set(CMAKE_HOST_SYSTEM "Linux-4.4.0-78-generic")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-78-generic")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")

set(CMAKE_SYSTEM "Linux-4.4.0-78-generic")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "4.4.0-78-generic")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")

set(CMAKE_CROSSCOMPILING "FALSE")

set(CMAKE_SYSTEM_LOADED 1)

{'repo_name': 'EricLYang/courseRepo', 'stars': '129', 'repo_language': 'C++', 'file_name': '_setup_util.py.stamp', 'mime_type': 'text/x-python', 'hash': 74588934202919856, 'source_dataset': 'data'}


 KafkaServer {
        com.sun.security.auth.module.Krb5LoginModule required
        useKeyTab=true
        storeKey=true
        keyTab="/vagrant/vagrant/keytabs/broker2.keytab"
        principal="kafka/broker2.kafkafast@KAFKAFAST";
    };

{'repo_name': 'gerritjvv/kafka-fast', 'stars': '170', 'repo_language': 'Clojure', 'file_name': 'zookeeper.sh', 'mime_type': 'text/x-shellscript', 'hash': -2406472703954802304, 'source_dataset': 'data'}


/**
 * Copyright (c) 2012, Ben Fortuna
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  o Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *
 *  o 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.
 *
 *  o Neither the name of Ben Fortuna nor the names of any other 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.
 */
package net.fortuna.ical4j.model.property;

import java.text.ParseException;

import net.fortuna.ical4j.model.DateTime;
import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.PropertyFactoryImpl;

/**
 * $Id$
 *
 * Created: [Apr 6, 2004]
 *
 * Defines a DTSTAMP iCalendar component property.
 *
 * <pre>
 *     4.8.7.2 Date/Time Stamp
 *
 *        Property Name: DTSTAMP
 *
 *        Purpose: The property indicates the date/time that the instance of
 *        the iCalendar object was created.
 *
 *        Value Type: DATE-TIME
 *
 *        Property Parameters: Non-standard property parameters can be
 *        specified on this property.
 *
 *        Conformance: This property MUST be included in the "VEVENT", "VTODO",
 *        "VJOURNAL" or "VFREEBUSY" calendar components.
 *
 *        Description: The value MUST be specified in the UTC time format.
 *
 *        This property is also useful to protocols such as [IMIP] that have
 *        inherent latency issues with the delivery of content. This property
 *        will assist in the proper sequencing of messages containing iCalendar
 *        objects.
 *
 *        This property is different than the "CREATED" and "LAST-MODIFIED"
 *        properties. These two properties are used to specify when the
 *        particular calendar data in the calendar store was created and last
 *        modified. This is different than when the iCalendar object
 *        representation of the calendar service information was created or
 *        last modified.
 *
 *        Format Definition: The property is defined by the following notation:
 *
 *          dtstamp    = "DTSTAMP" stmparam ":" date-time CRLF
 *
 *          stmparam   = *(";" xparam)
 * </pre>
 *
 * @author Ben Fortuna
 */
public class DtStamp extends UtcProperty {

    private static final long serialVersionUID = 7581197869433744070L;

    /**
     * Default constructor. Initialises the dateTime value to the time of instantiation.
     */
    public DtStamp() {
        super(DTSTAMP, PropertyFactoryImpl.getInstance());
    }

    /**
     * @param aValue a string representation of a DTSTAMP value
     * @throws ParseException if the specified value is not a valid representation
     */
    public DtStamp(final String aValue) throws ParseException {
    	this(new ParameterList(), aValue);
    }

    /**
     * @param aList a list of parameters for this component
     * @param aValue a value string for this component
     * @throws ParseException where the specified value string is not a valid date-time/date representation
     */
    public DtStamp(final ParameterList aList, final String aValue)
            throws ParseException {
        super(DTSTAMP, aList, PropertyFactoryImpl.getInstance());
        setValue(aValue);
    }

    /**
     * @param aDate a date representing a date-time
     */
    public DtStamp(final DateTime aDate) {
        super(DTSTAMP, PropertyFactoryImpl.getInstance());
        // time must be in UTC..
        aDate.setUtc(true);
        setDate(aDate);
    }

    /**
     * @param aList a list of parameters for this component
     * @param aDate a date representing a date-time
     */
    public DtStamp(final ParameterList aList, final DateTime aDate) {
        super(DTSTAMP, aList, PropertyFactoryImpl.getInstance());
        // time must be in UTC..
        aDate.setUtc(true);
        setDate(aDate);
    }
}

{'repo_name': 'gggard/AndroidCaldavSyncAdapater', 'stars': '242', 'repo_language': 'Java', 'file_name': 'org.eclipse.jdt.core.prefs', 'mime_type': 'text/plain', 'hash': -7205393514761875311, 'source_dataset': 'data'}


felixfbecker/advanced-json-rpc

A more advanced JSONRPC implementation

{'repo_name': 'felixfbecker/php-advanced-json-rpc', 'stars': '123', 'repo_language': 'PHP', 'file_name': 'MethodCall.php', 'mime_type': 'text/x-php', 'hash': -2990557096108146610, 'source_dataset': 'data'}


import { Component } from '@angular/core';

@Component({
  selector: 'mail-app',
  styleUrls: ['mail-app.component.scss'],
  template: `

      <router-outlet></router-outlet>

      <router-outlet name="pane"></router-outlet>

  `
})
export class MailAppComponent {}

{'repo_name': 'UltimateAngular/angular-pro-src', 'stars': '239', 'repo_language': 'TypeScript', 'file_name': 'stock-inventory.component.ts', 'mime_type': 'text/x-java', 'hash': -4647332069448861678, 'source_dataset': 'data'}


import { compile } from "../../src/lib/events/eventIfActorAtPosition";

test("Should be able to conditionally execute if actor is at a position", () => {
  const mockactorSetActive = jest.fn();
  const mockIfActorAtPosition = jest.fn();
  const truePath = [{ command: "EVENT_END", id: "abc" }];
  const falsePath = [{ command: "EVENT_END", id: "def" }];
  compile(
    {
      actorId: "player",
      x: 4,
      y: 8,
      true: truePath,
      false: falsePath
    },
    {
      actorSetActive: mockactorSetActive,
      ifActorAtPosition: mockIfActorAtPosition
    }
  );
  expect(mockactorSetActive).toBeCalledWith("player");
  expect(mockIfActorAtPosition).toBeCalledWith(4, 8, truePath, falsePath);
});

{'repo_name': 'chrismaltby/gb-studio', 'stars': '4863', 'repo_language': 'C', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -7800556367464688197, 'source_dataset': 'data'}


{# USES_VARIABLES { _queue } #}
{% extends 'common_group.py_' %}

{% block maincode %}
_spiking_synapses = _queue.peek()

if len(_spiking_synapses):
    # scalar code
    {# Note that we don't write to scalar variables conditionally. The scalar code
       should therefore only include the calculation of scalar expressions
       that are used below for writing to a vector variable #}
    {{scalar_code|autoindent}}

    # vector code
    _idx = _spiking_synapses
    _vectorisation_idx = _idx
    {{vector_code|autoindent}}

# Advance the spike queue
_queue.advance()
{% endblock %}

{'repo_name': 'brian-team/brian2', 'stars': '447', 'repo_language': 'Python', 'file_name': 'computation.rst', 'mime_type': 'text/plain', 'hash': -315547097802678315, 'source_dataset': 'data'}


package openblocks.common.recipe;

import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import java.util.Iterator;
import javax.annotation.Nonnull;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import openblocks.OpenBlocks;
import openblocks.OpenBlocks.Blocks;
import openblocks.common.item.ItemImaginary;
import openblocks.common.item.ItemImaginary.PlacementMode;
import openmods.utils.CustomRecipeBase;

public class CrayonMixingRecipe extends CustomRecipeBase {

	public CrayonMixingRecipe() {
		super(OpenBlocks.location("crayons"));
	}

	@Override
	public boolean matches(InventoryCrafting inv, World world) {
		int count = 0;
		for (int i = 0; i < inv.getSizeInventory(); i++) {
			ItemStack stack = inv.getStackInSlot(i);
			if (stack.isEmpty()) continue;
			if (!ItemImaginary.isCrayon(stack))
				return false;
			if (ItemImaginary.getUses(stack) < ItemImaginary.CRAFTING_COST) continue;
			count++;
		}
		return count > 1;
	}

	@Override
	@Nonnull
	public ItemStack getCraftingResult(InventoryCrafting inv) {
		int count = 0;
		float r = 0, g = 0, b = 0;
		Multiset<ItemImaginary.PlacementMode> modes = HashMultiset.create();
		for (int i = 0; i < inv.getSizeInventory(); i++) {
			ItemStack stack = inv.getStackInSlot(i);
			if (stack.isEmpty() || (ItemImaginary.getUses(stack) < ItemImaginary.CRAFTING_COST)) continue;

			final NBTTagCompound tag = stack.getTagCompound();
			if (tag != null) {
				final Integer color = ItemImaginary.getColor(tag);
				if (color == null) return ItemStack.EMPTY;

				count++;

				r += ((color >> 16) & 0xFF);
				g += ((color >> 8) & 0xFF);
				b += ((color >> 0) & 0xFF);

				modes.add(ItemImaginary.getMode(tag));
			}
		}

		if (count < 2) return ItemStack.EMPTY;

		int color = (int)(r / count);
		color = (color << 8) + (int)(g / count);
		color = (color << 8) + (int)(b / count);

		final Iterator<Multiset.Entry<PlacementMode>> iterator = modes.entrySet().iterator();
		Multiset.Entry<PlacementMode> max = iterator.next();
		while (iterator.hasNext()) {
			Multiset.Entry<PlacementMode> tmp = iterator.next();
			if (tmp.getCount() > max.getCount()) max = tmp;
		}

		return ItemImaginary.setupValues(new ItemStack(Blocks.imaginary), color, max.getElement(), count * 0.9f);
	}

	@Override
	public boolean canFit(int width, int height) {
		return width * height > 1;
	}
}

{'repo_name': 'OpenMods/OpenBlocks', 'stars': '277', 'repo_language': 'Java', 'file_name': 'gradle-wrapper.properties', 'mime_type': 'text/plain', 'hash': -5121969977686234102, 'source_dataset': 'data'}


/*
 * avenir: Predictive analytic based on Hadoop Map Reduce
 * Author: Pranab Ghosh
 *
 * 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 org.avenir.regress;

/**
 * @author pranab
 *
 */
public class LogisticRegressor {
	 private double[] coefficients;
	 private double[] aggregates;
	 private double[] coeffDiff;
	 private double convergeThreshold;
	 private String posClassVal;

	 public LogisticRegressor() {
	 }

	public LogisticRegressor(double[] coefficients) {
			super();
			this.coefficients = coefficients;
			aggregates = new double[coefficients.length];
			for ( int i = 0; i < aggregates.length;  ++i) {
				aggregates[i] = 0;
			}
		}

	/**
	 * @param coefficients
	 * @param posClassVal
	 */
	public LogisticRegressor(double[] coefficients, String posClassVal) {
		super();
		this.coefficients = coefficients;
		this.posClassVal = posClassVal;
		aggregates = new double[coefficients.length];
		for ( int i = 0; i < aggregates.length;  ++i) {
			aggregates[i] = 0;
		}
	}

	/**
	 * @param values
	 * @param classValue
	 */
	public void aggregate(int[] values, String classValue) {
		double sum = 0;
		for (int i = 0; i < values.length; ++i) {
			sum += values[i] * coefficients[i];
		}
		double classProbEst =  1.0 / (1.0 + Math.exp(-sum));
		double classProbActual = classValue.equals(posClassVal) ? 1.0 :  0;
		double classProbDiff = classProbActual - classProbEst;

		for (int i = 0; i < values.length; ++i) {
			aggregates[i] += values[i] * classProbDiff;
		}
	}

	/**
	 * @return
	 */
	public double[] getAggregates() {
		return aggregates;
	}

	/**
	 * @param aggregates
	 */
	public void setAggregates(double[] aggregates) {
		this.aggregates = aggregates;
	}

	public void addAggregates(double[] aggregates) {
		if (null == this.aggregates) {
			this.aggregates = new double[aggregates.length];
			for (int i = 0; i < this.aggregates.length; ++i) {
				this.aggregates[i] = 0;
			}
		}

		for (int i = 0; i < aggregates.length;  ++i ) {
			this.aggregates[i]  += aggregates[i];
		}
	}

	/**
	 *
	 */
	public void setCoefficientDiff() {
		for (int i = 0; i < coefficients.length; ++i) {
			coeffDiff[i] =  ((aggregates[i] - coefficients[i]) * 100.0) / coefficients[i];
			if (coeffDiff[i] < 0) {
				coeffDiff[i]  =  - coeffDiff[i];
			}
		}
	}

	public double[] getCoefficients() {
		return coefficients;
	}

	public void setCoefficients(double[] coefficients) {
		this.coefficients = coefficients;
	}

	/**
	 * @param convergeThreshold
	 */
	public void setConvergeThreshold(double convergeThreshold) {
		this.convergeThreshold = convergeThreshold;
	}

	/**
	 * @return
	 */
	public boolean isAllConverged() {
		boolean converged = true;
		if (null == coeffDiff) {
			coeffDiff = new double[coefficients.length];
			setCoefficientDiff();
		}
		for (int i = 0; i <  coeffDiff.length; ++i) {
			if (coeffDiff[i] > convergeThreshold) {
				converged = false;
				break;
			}
		}
		return converged;
	}

	/**
	 * @return
	 */
	public boolean isAverageConverged() {
		boolean converged = true;
		if (null == coeffDiff) {
			coeffDiff = new double[coefficients.length];
			setCoefficientDiff();
		}
		double sum = 0;
		for (int i = 0; i <  coeffDiff.length; ++i) {
			sum += coeffDiff[i];
		}
		sum /= coeffDiff.length;
		converged = sum < convergeThreshold;
		return converged;
	}

}

{'repo_name': 'pranab/avenir', 'stars': '139', 'repo_language': 'Java', 'file_name': 'plugins.sbt', 'mime_type': 'text/plain', 'hash': 1883931889730751679, 'source_dataset': 'data'}


(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  define(['Behavioral/Visitor/AbstractTitleInfo'], function(AbstractTitleInfo) {
    var GameInfo;
    return GameInfo = (function(_super) {
      __extends(GameInfo, _super);

      function GameInfo(titleName) {
        this.titleName = titleName;
      }

      GameInfo.prototype.accept = function(titleBlurbVisitor) {
        return titleBlurbVisitor.visit(this);
      };

      return GameInfo;

    })(AbstractTitleInfo);
  });

}).call(this);

{'repo_name': 'markmontymark/patterns', 'stars': '112', 'repo_language': 'Shell', 'file_name': 'Singleton.coffee', 'mime_type': 'text/plain', 'hash': -7673152863484241845, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, The Android Open Source Project
**
** 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.
*/
-->

<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds. -->
<resources>
    <!-- The maximum number of rows in the QuickSettings -->
    <integer name="quick_settings_max_rows">2</integer>

    <!-- The number of columns that the top level tiles span in the QuickSettings -->
    <integer name="quick_settings_user_time_settings_tile_span">2</integer>

    <!-- We have only space for one notification on phone landscape layouts. -->
    <integer name="keyguard_max_notification_count">1</integer>

    <!-- orientation of the dead zone when touches have recently occurred elsewhere on screen -->
    <integer name="navigation_bar_deadzone_orientation">1</integer>

    <!-- Max number of columns for quick controls area -->
    <integer name="controls_max_columns">4</integer>

    <!-- Max number of columns for power menu -->
    <integer name="power_menu_max_columns">4</integer>
</resources>

{'repo_name': 'aosp-mirror/platform_frameworks_base', 'stars': '9245', 'repo_language': 'Java', 'file_name': 'DatabaseCursorTest.java', 'mime_type': 'text/x-java', 'hash': 6059901872153064427, 'source_dataset': 'data'}


#pragma vx_copyright "2020"
#pragma vx_title_pos -100, -80
#pragma vx_title_size -8, 80
#pragma vx_title "HELLO WORLD"
#pragma vx_music vx_music_1

#include "vectrex.h"
#include "bios.h"

int main()
{
  while(1)
  {
    wait_retrace();
    intensity(0x7f);
    print_str_c( 0x10, -0x50, (char*)"HELLO WORLD!" );
    intensity(0x3f);
    print_str_c( -0x10, -0x50, (char*)"THIS IS CMOC" );
  }
  return 0;
}

{'repo_name': 'sehugg/8bitworkshop', 'stars': '252', 'repo_language': 'JavaScript', 'file_name': 'platforms.md', 'mime_type': 'text/plain', 'hash': -2256529859983267585, 'source_dataset': 'data'}


(* ::Package:: *)

(* :Title: ValidateModelQCDBGF												*)

(*
	This software is covered by the GNU General Public License 3.
	Copyright (C) 1990-2020 Rolf Mertig
	Copyright (C) 1997-2020 Frederik Orellana
	Copyright (C) 2014-2020 Vladyslav Shtabovenko
*)

(* :Summary:  Validates FeynArts model for QCD in background field
				formalism                                                   *)

(* ------------------------------------------------------------------------ *)

(* ::Section:: *)
(*Load FeynCalc and FeynArts*)

If[ $FrontEnd === Null,
		$FeynCalcStartupMessages = False;
		Print["Validation of the FeynArts model for QCD in background field formalism"];
];
If[$Notebooks === False, $FeynCalcStartupMessages = False];
$LoadAddOns={"FeynArts"};
<<FeynCalc`
$FAVerbose = 0;

FCCheckVersion[9,3,1];

(* ::Section:: *)
(*Patch the generated models to work with FeynCalc*)

FAPatch[PatchModelsOnly->True];

(* ::Section:: *)
(*Compare vertices to FeynArts*)

top1To2 = CreateTopologies[0,1 -> 2];
top2To2 = CreateTopologies[0,2 -> 2];

compFu1To2[x_]:=FCFAConvert[CreateFeynAmp[x, Truncated -> True,PreFactor->1],
IncomingMomenta->{p1},OutgoingMomenta->{p2,p3},UndoChiralSplittings->True,
DropSumOver->True,List->False,SMP->True]//Contract;

compFu2To2[x_]:=FCFAConvert[CreateFeynAmp[x, Truncated -> True,PreFactor->1],
IncomingMomenta->{p1,p2},OutgoingMomenta->{p3,p4},UndoChiralSplittings->True,
DropSumOver->True,List->False,SMP->True]//Contract;

diagsFR[top_,in_,out_]:=InsertFields[top, in ->out,
InsertionLevel -> {Classes},Model -> FileNameJoin[{"QCDBGF","QCDBGF"}],
GenericModel->FileNameJoin[{"QCDBGF","QCDBGF"}]];

diagsFA[top_,in_,out_]:=InsertFields[top, in ->out,
InsertionLevel -> {Classes}, Model -> "SMQCD", GenericModel->Lorentz];

(* ::Subsection:: *)
(*QQG-coupling*)

particles={{F[3, {1}]},{F[3, {1}],V[5]}};
diff1=compFu1To2[diagsFR[top1To2,Sequence@@particles]]-compFu1To2[diagsFA[top1To2,Sequence@@particles]]

(* ::Subsection:: *)
(*GhGhG-coupling*)

particles={{U[5]},{U[5],V[5]}};
diff2=compFu1To2[diagsFR[top1To2,Sequence@@particles]]-compFu1To2[diagsFA[top1To2,Sequence@@particles]]

(* ::Subsection:: *)
(*GGG-coupling*)

particles={{V[5]},{V[5],V[5]}};
diff3=ExpandScalarProduct[compFu1To2[diagsFR[top1To2,Sequence@@particles]]-compFu1To2[diagsFA[top1To2,Sequence@@particles]]]//Simplify

(* ::Subsection:: *)
(*GGGG-coupling*)

particles={{V[5],V[5]},{V[5],V[5]}};
diff4=ExpandScalarProduct[compFu2To2[DiagramExtract[diagsFR[top2To2,Sequence@@particles],1]]-
compFu2To2[DiagramExtract[diagsFA[top2To2,Sequence@@particles],1]]]//FCCanonicalizeDummyIndices//Simplify

(* ::Subsection:: *)
(*GGGB-coupling*)

diff5=ExpandScalarProduct[compFu2To2[DiagramExtract[diagsFR[top2To2,{V[50],V[5]},{V[5],V[5]}],1]]-
compFu2To2[DiagramExtract[diagsFA[top2To2,{V[5],V[5]},{V[5],V[5]}],1]]]//FCCanonicalizeDummyIndices//Simplify

(* ::Subsection:: *)
(*GGB-Coupling*)

ggbDiag=InsertFields[top1To2, {V[50,{a}]} ->{V[5,{b}],V[5,{c}]},
InsertionLevel -> {Classes},Model -> FileNameJoin[{"QCDBGF","QCDBGF"}],
GenericModel->FileNameJoin[{"QCDBGF","QCDBGF"}]];
ggbAbbott=-(((FV[q, nu] + FV[-p + r, nu]*GaugeXi[G])*MT[la, mu]*SMP["g_s"]*SUNF[a, b, c])/GaugeXi[G]) + FV[-q + r, mu]*MT[la, nu]*SMP["g_s"]*SUNF[a, b, c] +
((FV[r, la] + FV[-p + q, la]*GaugeXi[G])*MT[mu, nu]*SMP["g_s"]*SUNF[a, b, c])/GaugeXi[G];
ggbVertexFR=FCFAConvert[CreateFeynAmp[ggbDiag, Truncated -> True,PreFactor->-1,GaugeRules->{}],
IncomingMomenta->{-p},OutgoingMomenta->{q,r},UndoChiralSplittings->True,
DropSumOver->True,List->False,SMP->True,LorentzIndexNames->{mu,nu,la}]//FCE//Collect2[#,MT,Factoring->FullSimplify]&//MomentumCombine
diff6=FCI[(ggbAbbott-ggbVertexFR)]

(* ::Subsection:: *)
(*GhGhB-coupling*)

ghghbDiag=InsertFields[top1To2, {U[5,{a}]} ->{U[5,{b}],V[50,{c}]},
InsertionLevel -> {Classes},Model -> FileNameJoin[{"QCDBGF","QCDBGF"}],
GenericModel->FileNameJoin[{"QCDBGF","QCDBGF"}]];
ghghbFR=FCFAConvert[CreateFeynAmp[ghghbDiag, Truncated -> True,PreFactor->-1,GaugeRules->{}],
IncomingMomenta->{-p},OutgoingMomenta->{-q,r},UndoChiralSplittings->True,
DropSumOver->True,List->False,SMP->True,LorentzIndexNames->{mu,nu,la}]//FCE//FCI//MomentumCombine
ghghbAbbott=FV[p + q, mu]*SMP["g_s"]*SUNF[a, b, c];
diff7=FCI[(ghghbAbbott-ghghbFR)]

(* ::Subsection:: *)
(*GGBB-Coupling*)

ggbbDiag=InsertFields[top2To2, {V[50,{a}],V[5,{d}]} ->{V[5,{b}],V[50,{c}]},
InsertionLevel -> {Classes},Model -> FileNameJoin[{"QCDBGF","QCDBGF"}],
GenericModel->FileNameJoin[{"QCDBGF","QCDBGF"}]];
ggbbAbbott=((-I)*(MT[la, rho]*MT[mu, nu] + GaugeXi[G]*(-(MT[la, nu]*MT[mu, rho]) + MT[la, mu]*MT[nu, rho]))*SMP["g_s"]^2*SUNF[a, d, x]*SUNF[b, c, x])/GaugeXi[G] +
I*(-(MT[la, rho]*MT[mu, nu]) + MT[la, nu]*MT[mu, rho])*SMP["g_s"]^2*SUNF[a, c, x]*SUNF[b, d, x] +
(I*(MT[la, nu]*MT[mu, rho] + GaugeXi[G]*(-(MT[la, rho]*MT[mu, nu]) + MT[la, mu]*MT[nu, rho]))*SMP["g_s"]^2*SUNF[a, b, x]*SUNF[c, d, x])/GaugeXi[G];
ggbbVertexFR=FCFAConvert[CreateFeynAmp[DiagramExtract[ggbbDiag,{1}], Truncated -> True,PreFactor->-1,GaugeRules->{}],
IncomingMomenta->{-p},OutgoingMomenta->{q,r},UndoChiralSplittings->True,
DropSumOver->True,List->False,SMP->True,LorentzIndexNames->{mu,nu,rho,la}]//FCE//FCCanonicalizeDummyIndices[#,SUNIndexNames->{x}]&//
Collect2[#,SUNF,Factoring->FullSimplify]&
diff8=FCI[(ggbbAbbott-ggbbVertexFR)]//FCCanonicalizeDummyIndices

(* ::Subsection:: *)
(*GhGhBG-Coupling*)

ghghbgDiag=InsertFields[top2To2, {U[5,{b}],V[50,{c}]} ->{U[5,{a}],V[5,{d}]},
InsertionLevel -> {Classes},Model -> FileNameJoin[{"QCDBGF","QCDBGF"}],
GenericModel->FileNameJoin[{"QCDBGF","QCDBGF"}]];
ghghbgAbbott=(-I)*MT[mu, nu]*SMP["g_s"]^2*SUNF[a, c, x]*SUNF[b, d, x];
ghghbgVertexFR=FCFAConvert[CreateFeynAmp[DiagramExtract[ghghbgDiag,{1}], Truncated -> True,PreFactor->-1,GaugeRules->{}],
IncomingMomenta->{-p},OutgoingMomenta->{q,r},UndoChiralSplittings->True,
DropSumOver->True,List->False,SMP->True,LorentzIndexNames->{mu,nu,rho,la}]//FCE//FCCanonicalizeDummyIndices[#,SUNIndexNames->{x}]&//
Collect2[#,SUNF,Factoring->FullSimplify]&
diff9=FCI[(ghghbgAbbott-ghghbgVertexFR)]

(* ::Subsection:: *)
(*GhGhBB-Coupling*)

ghghbbDiag=InsertFields[top2To2, {U[5,{b}],V[50,{c}]} ->{U[5,{a}],V[50,{d}]},
InsertionLevel -> {Classes},Model -> FileNameJoin[{"QCDBGF","QCDBGF"}],
GenericModel->FileNameJoin[{"QCDBGF","QCDBGF"}]];
ghghbbAbbott=(-I)*MT[mu, nu]*SMP["g_s"]^2*SUNF[a, d, x]*SUNF[b, c, x] - I*MT[mu, nu]*SMP["g_s"]^2*SUNF[a, c, x]*SUNF[b, d, x];
ghghbbVertexFR=FCFAConvert[CreateFeynAmp[DiagramExtract[ghghbbDiag,{1}], Truncated -> True,PreFactor->-1,GaugeRules->{}],
IncomingMomenta->{-p},OutgoingMomenta->{q,r},UndoChiralSplittings->True,
DropSumOver->True,List->False,SMP->True,LorentzIndexNames->{mu,nu,rho,la}]//FCE//FCCanonicalizeDummyIndices[#,SUNIndexNames->{x}]&//
Collect2[#,SUNF,Factoring->FullSimplify]&
diff10=FCI[(ghghbbAbbott-ghghbbVertexFR)]

(* ::Subsection:: *)
(*Check*)

Print["Check signs in the QCDBGF model: ",
			If[{diff1,diff2,diff3,diff4,diff5,diff6,diff7,diff8,diff9,diff10}===Table[0,10], "CORRECT.", "!!! WRONG !!!"]];

{'repo_name': 'FeynCalc/feyncalc', 'stars': '156', 'repo_language': 'Mathematica', 'file_name': 'CheckToTFI.m', 'mime_type': 'text/plain', 'hash': -6687218616850998486, 'source_dataset': 'data'}


/*
 * linux/arch/arm/mach-omap2/board-omap3logic.c
 *
 * Copyright (C) 2010 Li-Pro.Net
 * Stephan Linz <linz@li-pro.net>
 *
 * Copyright (C) 2010 Logic Product Development, Inc.
 * Peter Barada <peter.barada@logicpd.com>
 *
 * Modified from Beagle, EVM, and RX51
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/gpio.h>

#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>

#include <linux/i2c/twl.h>
#include <linux/mmc/host.h>

#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>

#include "mux.h"
#include "hsmmc.h"
#include "control.h"
#include "common-board-devices.h"

#include <plat/mux.h>
#include <plat/board.h>
#include "common.h"
#include <plat/gpmc-smsc911x.h>
#include <plat/gpmc.h>
#include <plat/sdrc.h>

#define OMAP3LOGIC_SMSC911X_CS			1

#define OMAP3530_LV_SOM_MMC_GPIO_CD		110
#define OMAP3530_LV_SOM_MMC_GPIO_WP		126
#define OMAP3530_LV_SOM_SMSC911X_GPIO_IRQ	152

#define OMAP3_TORPEDO_MMC_GPIO_CD		127
#define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ		129

static struct regulator_consumer_supply omap3logic_vmmc1_supply[] = {
	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
};

/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
static struct regulator_init_data omap3logic_vmmc1 = {
	.constraints = {
		.name			= "VMMC1",
		.min_uV			= 1850000,
		.max_uV			= 3150000,
		.valid_modes_mask	= REGULATOR_MODE_NORMAL
					| REGULATOR_MODE_STANDBY,
		.valid_ops_mask		= REGULATOR_CHANGE_VOLTAGE
					| REGULATOR_CHANGE_MODE
					| REGULATOR_CHANGE_STATUS,
	},
	.num_consumer_supplies  = ARRAY_SIZE(omap3logic_vmmc1_supply),
	.consumer_supplies      = omap3logic_vmmc1_supply,
};

static struct twl4030_gpio_platform_data omap3logic_gpio_data = {
	.gpio_base	= OMAP_MAX_GPIO_LINES,
	.irq_base	= TWL4030_GPIO_IRQ_BASE,
	.irq_end	= TWL4030_GPIO_IRQ_END,
	.use_leds	= true,
	.pullups	= BIT(1),
	.pulldowns	= BIT(2)  | BIT(6)  | BIT(7)  | BIT(8)
			| BIT(13) | BIT(15) | BIT(16) | BIT(17),
};

static struct twl4030_platform_data omap3logic_twldata = {
	.irq_base	= TWL4030_IRQ_BASE,
	.irq_end	= TWL4030_IRQ_END,

	/* platform_data for children goes here */
	.gpio		= &omap3logic_gpio_data,
	.vmmc1		= &omap3logic_vmmc1,
};

static int __init omap3logic_i2c_init(void)
{
	omap3_pmic_init("twl4030", &omap3logic_twldata);
	return 0;
}

static struct omap2_hsmmc_info __initdata board_mmc_info[] = {
	{
		.name		= "external",
		.mmc		= 1,
		.caps		= MMC_CAP_4_BIT_DATA,
		.gpio_cd	= -EINVAL,
		.gpio_wp	= -EINVAL,
	},
	{}      /* Terminator */
};

static void __init board_mmc_init(void)
{
	if (machine_is_omap3530_lv_som()) {
		/* OMAP3530 LV SOM board */
		board_mmc_info[0].gpio_cd = OMAP3530_LV_SOM_MMC_GPIO_CD;
		board_mmc_info[0].gpio_wp = OMAP3530_LV_SOM_MMC_GPIO_WP;
		omap_mux_init_signal("gpio_110", OMAP_PIN_OUTPUT);
		omap_mux_init_signal("gpio_126", OMAP_PIN_OUTPUT);
	} else if (machine_is_omap3_torpedo()) {
		/* OMAP3 Torpedo board */
		board_mmc_info[0].gpio_cd = OMAP3_TORPEDO_MMC_GPIO_CD;
		omap_mux_init_signal("gpio_127", OMAP_PIN_OUTPUT);
	} else {
		/* unsupported board */
		printk(KERN_ERR "%s(): unknown machine type\n", __func__);
		return;
	}

	omap_hsmmc_init(board_mmc_info);
}

static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = {
	.cs             = OMAP3LOGIC_SMSC911X_CS,
	.gpio_irq       = -EINVAL,
	.gpio_reset     = -EINVAL,
};

/* TODO/FIXME (comment by Peter Barada, LogicPD):
 * Fix the PBIAS voltage for Torpedo MMC1 pins that
 * are used for other needs (IRQs, etc).            */
static void omap3torpedo_fix_pbias_voltage(void)
{
	u16 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
	u32 reg;

	if (machine_is_omap3_torpedo())
	{
		/* Set the bias for the pin */
		reg = omap_ctrl_readl(control_pbias_offset);

		reg &= ~OMAP343X_PBIASLITEPWRDNZ1;
		omap_ctrl_writel(reg, control_pbias_offset);

		/* 100ms delay required for PBIAS configuration */
		msleep(100);

		reg |= OMAP343X_PBIASLITEVMODE1;
		reg |= OMAP343X_PBIASLITEPWRDNZ1;
		omap_ctrl_writel(reg | 0x300, control_pbias_offset);
	}
}

static inline void __init board_smsc911x_init(void)
{
	if (machine_is_omap3530_lv_som()) {
		/* OMAP3530 LV SOM board */
		board_smsc911x_data.gpio_irq =
					OMAP3530_LV_SOM_SMSC911X_GPIO_IRQ;
		omap_mux_init_signal("gpio_152", OMAP_PIN_INPUT);
	} else if (machine_is_omap3_torpedo()) {
		/* OMAP3 Torpedo board */
		board_smsc911x_data.gpio_irq = OMAP3_TORPEDO_SMSC911X_GPIO_IRQ;
		omap_mux_init_signal("gpio_129", OMAP_PIN_INPUT);
	} else {
		/* unsupported board */
		printk(KERN_ERR "%s(): unknown machine type\n", __func__);
		return;
	}

	gpmc_smsc911x_init(&board_smsc911x_data);
}

#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
	{ .reg_offset = OMAP_MUX_TERMINATOR },
};
#endif

static struct regulator_consumer_supply dummy_supplies[] = {
	REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
};

static void __init omap3logic_init(void)
{
	regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
	omap3torpedo_fix_pbias_voltage();
	omap3logic_i2c_init();
	omap_serial_init();
	omap_sdrc_init(NULL, NULL);
	board_mmc_init();
	board_smsc911x_init();

	/* Ensure SDRC pins are mux'd for self-refresh */
	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
	omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
}

MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
	.atag_offset	= 0x100,
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.init_early	= omap35xx_init_early,
	.init_irq	= omap3_init_irq,
	.handle_irq	= omap3_intc_handle_irq,
	.init_machine	= omap3logic_init,
	.timer		= &omap3_timer,
	.restart	= omap_prcm_restart,
MACHINE_END

MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
	.atag_offset	= 0x100,
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.init_early	= omap35xx_init_early,
	.init_irq	= omap3_init_irq,
	.handle_irq	= omap3_intc_handle_irq,
	.init_machine	= omap3logic_init,
	.timer		= &omap3_timer,
	.restart	= omap_prcm_restart,
MACHINE_END

{'repo_name': 'SmartisanTech/SmartisanOS_Kernel_Source', 'stars': '411', 'repo_language': 'C', 'file_name': 'spear310.h', 'mime_type': 'text/x-c', 'hash': 4879065538386799319, 'source_dataset': 'data'}


struct ftpds
/* struct for ftp_start() function */
{
	int tnum;
	unsigned short port;
	bool gotinfo;
	SOCKET sock;
};

bool ftp_connect(const char *ip, unsigned short port);

bool ftp_transfer();

unsigned int __stdcall ftp_start(void *param);

{'repo_name': 'Chiggins/malware_sources', 'stars': '187', 'repo_language': 'Pascal', 'file_name': 'entries', 'mime_type': 'text/xml', 'hash': 2713328116728181436, 'source_dataset': 'data'}


#if defined(Hiro_Window)

@implementation CocoaWindow : NSWindow

-(id) initWith:(hiro::mWindow&)windowReference {
  window = &windowReference;

  NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask;
  if(window->state.resizable) style |= NSResizableWindowMask;

  if(self = [super initWithContentRect:NSMakeRect(0, 0, 640, 480) styleMask:style backing:NSBackingStoreBuffered defer:YES]) {
    [self setDelegate:self];
    [self setReleasedWhenClosed:NO];
    [self setAcceptsMouseMovedEvents:YES];
    [self setTitle:@""];

    NSBundle* bundle = [NSBundle mainBundle];
    NSDictionary* dictionary = [bundle infoDictionary];
    NSString* applicationName = [dictionary objectForKey:@"CFBundleDisplayName"];
    string hiroName = hiro::Application::state().name ? hiro::Application::state().name : string{"hiro"};
    if(applicationName == nil) applicationName = [NSString stringWithUTF8String:hiroName];

    menuBar = [[NSMenu alloc] init];

    NSMenuItem* item;
    string text;

    rootMenu = [[NSMenu alloc] init];
    item = [[[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""] autorelease];
    [item setSubmenu:rootMenu];
    [menuBar addItem:item];

    item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"About %@ ...", applicationName] action:@selector(menuAbout) keyEquivalent:@""] autorelease];
    [item setTarget:self];
    [rootMenu addItem:item];
    [rootMenu addItem:[NSMenuItem separatorItem]];

    item = [[[NSMenuItem alloc] initWithTitle:@"Preferences ..." action:@selector(menuPreferences) keyEquivalent:@""] autorelease];
    [item setTarget:self];
    [rootMenu addItem:item];

    string result = nall::execute("spctl", "--status").output.strip();
    if(result != "assessments disabled") {
      disableGatekeeper = [[[NSMenuItem alloc] initWithTitle:@"Disable Gatekeeper" action:@selector(menuDisableGatekeeper) keyEquivalent:@""] autorelease];
      [disableGatekeeper setTarget:self];
      [rootMenu addItem:disableGatekeeper];
    }

    [rootMenu addItem:[NSMenuItem separatorItem]];

    NSMenu* servicesMenu = [[[NSMenu alloc] initWithTitle:@"Services"] autorelease];
    item = [[[NSMenuItem alloc] initWithTitle:@"Services" action:nil keyEquivalent:@""] autorelease];
    [item setTarget:self];
    [item setSubmenu:servicesMenu];
    [rootMenu addItem:item];
    [rootMenu addItem:[NSMenuItem separatorItem]];
    [NSApp setServicesMenu:servicesMenu];

    item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Hide %@", applicationName] action:@selector(hide:) keyEquivalent:@""] autorelease];
    [item setTarget:NSApp];
    [rootMenu addItem:item];

    item = [[[NSMenuItem alloc] initWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@""] autorelease];
    [item setTarget:NSApp];
    [rootMenu addItem:item];

    item = [[[NSMenuItem alloc] initWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""] autorelease];
    [item setTarget:NSApp];
    [rootMenu addItem:item];

    [rootMenu addItem:[NSMenuItem separatorItem]];

    item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Quit %@", applicationName] action:@selector(menuQuit) keyEquivalent:@""] autorelease];
    [item setTarget:self];
    [rootMenu addItem:item];

    statusBar = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)];
    [statusBar setAlignment:NSLeftTextAlignment];
    [statusBar setBordered:YES];
    [statusBar setBezeled:YES];
    [statusBar setBezelStyle:NSTextFieldSquareBezel];
    [statusBar setEditable:NO];
    [statusBar setHidden:YES];

    [[self contentView] addSubview:statusBar positioned:NSWindowBelow relativeTo:nil];
  }

  return self;
}

-(BOOL) canBecomeKeyWindow {
  return YES;
}

-(BOOL) canBecomeMainWindow {
  return YES;
}

-(void) windowDidBecomeMain:(NSNotification*)notification {
  if(window->state.menuBar) {
    [NSApp setMainMenu:menuBar];
  }
}

-(void) windowDidMove:(NSNotification*)notification {
  if(auto p = window->self()) p->moveEvent();
}

-(void) windowDidResize:(NSNotification*)notification {
  if(auto p = window->self()) p->sizeEvent();
}

-(BOOL) windowShouldClose:(id)sender {
  if(window->state.onClose) window->doClose();
  else window->setVisible(false);
  if(window->state.modal && !window->visible()) window->setModal(false);
  return NO;
}

-(NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender {
  return DropPathsOperation(sender);
}

-(BOOL) performDragOperation:(id<NSDraggingInfo>)sender {
  auto paths = DropPaths(sender);
  if(!paths) return NO;
  window->doDrop(paths);
  return YES;
}

-(NSMenu*) menuBar {
  return menuBar;
}

-(void) menuAbout {
  hiro::Application::Cocoa::doAbout();
}

-(void) menuPreferences {
  hiro::Application::Cocoa::doPreferences();
}

//to hell with gatekeepers
-(void) menuDisableGatekeeper {
  NSAlert* alert = [[[NSAlert alloc] init] autorelease];
  [alert setMessageText:@"Disable Gatekeeper"];

  AuthorizationRef authorization;
  OSStatus status = AuthorizationCreate(nullptr, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorization);
  if(status == errAuthorizationSuccess) {
    AuthorizationItem items = {kAuthorizationRightExecute, 0, nullptr, 0};
    AuthorizationRights rights = {1, &items};
    status = AuthorizationCopyRights(authorization, &rights, nullptr,
      kAuthorizationFlagDefaults
    | kAuthorizationFlagInteractionAllowed
    | kAuthorizationFlagPreAuthorize
    | kAuthorizationFlagExtendRights, nullptr);
    if(status == errAuthorizationSuccess) {
      { char program[] = "/usr/sbin/spctl";
        char* arguments[] = {"--master-disable", nullptr};
        FILE* pipe = nullptr;
        AuthorizationExecuteWithPrivileges(authorization, program, kAuthorizationFlagDefaults, arguments, &pipe);
      }
      { char program[] = "/usr/bin/defaults";
        char* arguments[] = {"write /Library/Preferences/com.apple.security GKAutoRearm -bool NO"};
        FILE* pipe = nullptr;
        AuthorizationExecuteWithPrivileges(authorization, program, kAuthorizationFlagDefaults, arguments, &pipe);
      }
    }
    AuthorizationFree(authorization, kAuthorizationFlagDefaults);
  }

  string result = nall::execute("spctl", "--status").output.strip();
  if(result == "assessments disabled") {
    [alert setAlertStyle:NSInformationalAlertStyle];
    [alert setInformativeText:@"Gatekeeper has been successfully disabled."];
    [disableGatekeeper setHidden:YES];
  } else {
    [alert setAlertStyle:NSWarningAlertStyle];
    [alert setInformativeText:@"Error: failed to disable Gatekeeper."];
  }

  [alert addButtonWithTitle:@"Ok"];
  [alert runModal];
}

-(void) menuQuit {
  hiro::Application::Cocoa::doQuit();
}

-(NSTextField*) statusBar {
  return statusBar;
}

@end

namespace hiro {

auto pWindow::construct() -> void {
  @autoreleasepool {
    cocoaWindow = [[CocoaWindow alloc] initWith:self()];

    static bool once = true;
    if(once) {
      once = false;
      [NSApp setMainMenu:[cocoaWindow menuBar]];
    }
  }
}

auto pWindow::destruct() -> void {
  @autoreleasepool {
    [cocoaWindow release];
  }
}

auto pWindow::append(sMenuBar menuBar) -> void {
}

auto pWindow::append(sSizable sizable) -> void {
  sizable->setGeometry(self().geometry().setPosition());
  statusBarReposition();
}

auto pWindow::append(sStatusBar statusBar) -> void {
  statusBar->setEnabled(statusBar->enabled(true));
  statusBar->setFont(statusBar->font(true));
  statusBar->setText(statusBar->text());
  statusBar->setVisible(statusBar->visible(true));
}

auto pWindow::focused() const -> bool {
  @autoreleasepool {
    return [cocoaWindow isMainWindow] == YES;
  }
}

auto pWindow::frameMargin() const -> Geometry {
  @autoreleasepool {
    NSRect frame = [cocoaWindow frameRectForContentRect:NSMakeRect(0, 0, 640, 480)];
    return {abs(frame.origin.x), (int)(frame.size.height - 480), (int)(frame.size.width - 640), abs(frame.origin.y)};
  }
}

auto pWindow::handle() const -> uintptr_t {
  return (uintptr_t)cocoaWindow;
}

auto pWindow::monitor() const -> uint {
  //TODO
  return 0;
}

auto pWindow::remove(sMenuBar menuBar) -> void {
}

auto pWindow::remove(sSizable sizable) -> void {
  @autoreleasepool {
    [[cocoaWindow contentView] setNeedsDisplay:YES];
  }
}

auto pWindow::remove(sStatusBar statusBar) -> void {
  @autoreleasepool {
    [[cocoaWindow statusBar] setHidden:YES];
  }
}

auto pWindow::setBackgroundColor(Color color) -> void {
  @autoreleasepool {
    [cocoaWindow
      setBackgroundColor:[NSColor
        colorWithCalibratedRed:color.red() / 255.0
        green:color.green() / 255.0
        blue:color.blue() / 255.0
        alpha:color.alpha() / 255.0
      ]
    ];
  }
}

auto pWindow::setDismissable(bool dismissable) -> void {
  //todo: not implemented
}

auto pWindow::setDroppable(bool droppable) -> void {
  @autoreleasepool {
    if(droppable) {
      [cocoaWindow registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
    } else {
      [cocoaWindow unregisterDraggedTypes];
    }
  }
}

auto pWindow::setFocused() -> void {
  @autoreleasepool {
    [cocoaWindow makeKeyAndOrderFront:nil];
  }
}

auto pWindow::setFullScreen(bool fullScreen) -> void {
  @autoreleasepool {
    if(fullScreen) {
      windowedGeometry = state().geometry;
      [NSApp setPresentationOptions:NSApplicationPresentationFullScreen];
      [cocoaWindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
      [cocoaWindow toggleFullScreen:nil];
      state().geometry = _geometry();
    } else {
      [cocoaWindow toggleFullScreen:nil];
      [cocoaWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault];
      [NSApp setPresentationOptions:NSApplicationPresentationDefault];
      state().geometry = windowedGeometry;
    }
  }
}

auto pWindow::setGeometry(Geometry geometry) -> void {
  lock();

  @autoreleasepool {
    [cocoaWindow
      setFrame:[cocoaWindow
        frameRectForContentRect:NSMakeRect(
          geometry.x(), Desktop::size().height() - geometry.y() - geometry.height(),
          geometry.width(), geometry.height() + statusBarHeight()
        )
      ]
      display:YES
    ];

    if(auto& sizable = state().sizable) {
      sizable->setGeometry(self().geometry().setPosition());
    }

    statusBarReposition();
  }

  unlock();
}

auto pWindow::setMaximized(bool maximized) -> void {
  //todo
}

auto pWindow::setMaximumSize(Size size) -> void {
  //todo
}

auto pWindow::setMinimized(bool minimized) -> void {
  //todo
}

auto pWindow::setMinimumSize(Size size) -> void {
  //todo
}

auto pWindow::setModal(bool modal) -> void {
  @autoreleasepool {
    if(modal == true) {
      [NSApp runModalForWindow:cocoaWindow];
    } else {
      [NSApp stopModal];
      NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0.0 windowNumber:0 context:nil subtype:0 data1:0 data2:0];
      [NSApp postEvent:event atStart:true];
    }
  }
}

auto pWindow::setResizable(bool resizable) -> void {
  @autoreleasepool {
    NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask;
    if(resizable) style |= NSResizableWindowMask;
    [cocoaWindow setStyleMask:style];
  }
}

auto pWindow::setTitle(const string& text) -> void {
  @autoreleasepool {
    [cocoaWindow setTitle:[NSString stringWithUTF8String:text]];
  }
}

auto pWindow::setVisible(bool visible) -> void {
  @autoreleasepool {
    if(visible) [cocoaWindow makeKeyAndOrderFront:nil];
    else [cocoaWindow orderOut:nil];
  }
}

auto pWindow::moveEvent() -> void {
  if(!locked() && !self().fullScreen() && self().visible()) {
    @autoreleasepool {
      NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]];
      area.size.height -= statusBarHeight();
      state().geometry.setX(area.origin.x);
      state().geometry.setY(Desktop::size().height() - area.origin.y - area.size.height);
    }
  }

  if(!locked()) self().doMove();
}

auto pWindow::sizeEvent() -> void {
  if(!locked() && !self().fullScreen() && self().visible()) {
    @autoreleasepool {
      NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]];
      area.size.height -= statusBarHeight();
      state().geometry.setWidth(area.size.width);
      state().geometry.setHeight(area.size.height);
    }
  }

  if(auto& sizable = state().sizable) {
    sizable->setGeometry(self().geometry().setPosition());
  }

  statusBarReposition();

  if(!locked()) self().doSize();
}

auto pWindow::statusBarHeight() -> uint {
  if(auto& statusBar = state().statusBar) {
    if(statusBar->visible()) {
      return pFont::size(statusBar->font(true), " ").height() + 6;
    }
  }
  return 0;
}

auto pWindow::statusBarReposition() -> void {
  @autoreleasepool {
    NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]];
    [[cocoaWindow statusBar] setFrame:NSMakeRect(0, 0, area.size.width, statusBarHeight())];
    [[cocoaWindow contentView] setNeedsDisplay:YES];
  }
}

auto pWindow::_append(mWidget& widget) -> void {
  @autoreleasepool {
    if(auto pWidget = widget.self()) {
      [pWidget->cocoaView removeFromSuperview];
      [[cocoaWindow contentView] addSubview:pWidget->cocoaView positioned:NSWindowAbove relativeTo:nil];
      pWidget->setGeometry(widget.geometry());
      [[cocoaWindow contentView] setNeedsDisplay:YES];
    }
  }
}

auto pWindow::_geometry() -> Geometry {
  @autoreleasepool {
    NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]];
    area.size.height -= statusBarHeight();
    return {
      (int)area.origin.x, (int)(Monitor::geometry(Monitor::primary()).height() - area.origin.y - area.size.height),
      (int)area.size.width, (int)area.size.height
    };
  }
}

}

#endif

{'repo_name': 'higan-emu/higan', 'stars': '245', 'repo_language': 'C++', 'file_name': 'icarus.plist', 'mime_type': 'text/xml', 'hash': -8614862383071647038, 'source_dataset': 'data'}


===============
Support Library
===============

Abstract
========

This document provides some details on LLVM's Support Library, located in the
source at ``lib/Support`` and ``include/llvm/Support``. The library's purpose
is to shield LLVM from the differences between operating systems for the few
services LLVM needs from the operating system. Much of LLVM is written using
portability features of standard C++. However, in a few areas, system dependent
facilities are needed and the Support Library is the wrapper around those
system calls.

By centralizing LLVM's use of operating system interfaces, we make it possible
for the LLVM tool chain and runtime libraries to be more easily ported to new
platforms since (theoretically) only ``lib/Support`` needs to be ported.  This
library also unclutters the rest of LLVM from #ifdef use and special cases for
specific operating systems. Such uses are replaced with simple calls to the
interfaces provided in ``include/llvm/Support``.

Note that the Support Library is not intended to be a complete operating system
wrapper (such as the Adaptive Communications Environment (ACE) or Apache
Portable Runtime (APR)), but only provides the functionality necessary to
support LLVM.

The Support Library was originally referred to as the System Library, written
by Reid Spencer who formulated the design based on similar work originating
from the eXtensible Programming System (XPS). Several people helped with the
effort; especially, Jeff Cohen and Henrik Bach on the Win32 port.

Keeping LLVM Portable
=====================

In order to keep LLVM portable, LLVM developers should adhere to a set of
portability rules associated with the Support Library. Adherence to these rules
should help the Support Library achieve its goal of shielding LLVM from the
variations in operating system interfaces and doing so efficiently.  The
following sections define the rules needed to fulfill this objective.

Don't Include System Headers
----------------------------

Except in ``lib/Support``, no LLVM source code should directly ``#include`` a
system header. Care has been taken to remove all such ``#includes`` from LLVM
while ``lib/Support`` was being developed.  Specifically this means that header
files like "``unistd.h``", "``windows.h``", "``stdio.h``", and "``string.h``"
are forbidden to be included by LLVM source code outside the implementation of
``lib/Support``.

To obtain system-dependent functionality, existing interfaces to the system
found in ``include/llvm/Support`` should be used. If an appropriate interface is
not available, it should be added to ``include/llvm/Support`` and implemented in
``lib/Support`` for all supported platforms.

Don't Expose System Headers
---------------------------

The Support Library must shield LLVM from **all** system headers. To obtain
system level functionality, LLVM source must
``#include "llvm/Support/Thing.h"`` and nothing else. This means that
``Thing.h`` cannot expose any system header files. This protects LLVM from
accidentally using system specific functionality and only allows it via
the ``lib/Support`` interface.

Use Standard C Headers
----------------------

The **standard** C headers (the ones beginning with "c") are allowed to be
exposed through the ``lib/Support`` interface. These headers and the things they
declare are considered to be platform agnostic. LLVM source files may include
them directly or obtain their inclusion through ``lib/Support`` interfaces.

Use Standard C++ Headers
------------------------

The **standard** C++ headers from the standard C++ library and standard
template library may be exposed through the ``lib/Support`` interface. These
headers and the things they declare are considered to be platform agnostic.
LLVM source files may include them or obtain their inclusion through
``lib/Support`` interfaces.

High Level Interface
--------------------

The entry points specified in the interface of ``lib/Support`` must be aimed at
completing some reasonably high level task needed by LLVM. We do not want to
simply wrap each operating system call. It would be preferable to wrap several
operating system calls that are always used in conjunction with one another by
LLVM.

For example, consider what is needed to execute a program, wait for it to
complete, and return its result code. On Unix, this involves the following
operating system calls: ``getenv``, ``fork``, ``execve``, and ``wait``. The
correct thing for ``lib/Support`` to provide is a function, say
``ExecuteProgramAndWait``, that implements the functionality completely.  what
we don't want is wrappers for the operating system calls involved.

There must **not** be a one-to-one relationship between operating system
calls and the Support library's interface. Any such interface function will be
suspicious.

No Unused Functionality
-----------------------

There must be no functionality specified in the interface of ``lib/Support``
that isn't actually used by LLVM. We're not writing a general purpose operating
system wrapper here, just enough to satisfy LLVM's needs. And, LLVM doesn't
need much. This design goal aims to keep the ``lib/Support`` interface small and
understandable which should foster its actual use and adoption.

No Duplicate Implementations
----------------------------

The implementation of a function for a given platform must be written exactly
once. This implies that it must be possible to apply a function's
implementation to multiple operating systems if those operating systems can
share the same implementation. This rule applies to the set of operating
systems supported for a given class of operating system (e.g. Unix, Win32).

No Virtual Methods
------------------

The Support Library interfaces can be called quite frequently by LLVM. In order
to make those calls as efficient as possible, we discourage the use of virtual
methods. There is no need to use inheritance for implementation differences, it
just adds complexity. The ``#include`` mechanism works just fine.

No Exposed Functions
--------------------

Any functions defined by system libraries (i.e. not defined by ``lib/Support``)
must not be exposed through the ``lib/Support`` interface, even if the header
file for that function is not exposed. This prevents inadvertent use of system
specific functionality.

For example, the ``stat`` system call is notorious for having variations in the
data it provides. ``lib/Support`` must not declare ``stat`` nor allow it to be
declared. Instead it should provide its own interface to discovering
information about files and directories. Those interfaces may be implemented in
terms of ``stat`` but that is strictly an implementation detail. The interface
provided by the Support Library must be implemented on all platforms (even
those without ``stat``).

No Exposed Data
---------------

Any data defined by system libraries (i.e. not defined by ``lib/Support``) must
not be exposed through the ``lib/Support`` interface, even if the header file
for that function is not exposed. As with functions, this prevents inadvertent
use of data that might not exist on all platforms.

Minimize Soft Errors
--------------------

Operating system interfaces will generally provide error results for every
little thing that could go wrong. In almost all cases, you can divide these
error results into two groups: normal/good/soft and abnormal/bad/hard. That is,
some of the errors are simply information like "file not found", "insufficient
privileges", etc. while other errors are much harder like "out of space", "bad
disk sector", or "system call interrupted". We'll call the first group "*soft*"
errors and the second group "*hard*" errors.

``lib/Support`` must always attempt to minimize soft errors.  This is a design
requirement because the minimization of soft errors can affect the granularity
and the nature of the interface. In general, if you find that you're wanting to
throw soft errors, you must review the granularity of the interface because it
is likely you're trying to implement something that is too low level. The rule
of thumb is to provide interface functions that **can't** fail, except when
faced with hard errors.

For a trivial example, suppose we wanted to add an "``OpenFileForWriting``"
function. For many operating systems, if the file doesn't exist, attempting to
open the file will produce an error.  However, ``lib/Support`` should not simply
throw that error if it occurs because its a soft error. The problem is that the
interface function, ``OpenFileForWriting`` is too low level. It should be
``OpenOrCreateFileForWriting``. In the case of the soft "doesn't exist" error,
this function would just create it and then open it for writing.

This design principle needs to be maintained in ``lib/Support`` because it
avoids the propagation of soft error handling throughout the rest of LLVM.
Hard errors will generally just cause a termination for an LLVM tool so don't
be bashful about throwing them.

Rules of thumb:

#. Don't throw soft errors, only hard errors.

#. If you're tempted to throw a soft error, re-think the interface.

#. Handle internally the most common normal/good/soft error conditions
   so the rest of LLVM doesn't have to.

No throw Specifications
-----------------------

None of the ``lib/Support`` interface functions may be declared with C++
``throw()`` specifications on them. This requirement makes sure that the
compiler does not insert additional exception handling code into the interface
functions. This is a performance consideration: ``lib/Support`` functions are
at the bottom of many call chains and as such can be frequently called. We
need them to be as efficient as possible.  However, no routines in the system
library should actually throw exceptions.

Code Organization
-----------------

Implementations of the Support Library interface are separated by their general
class of operating system. Currently only Unix and Win32 classes are defined
but more could be added for other operating system classifications.  To
distinguish which implementation to compile, the code in ``lib/Support`` uses
the ``LLVM_ON_UNIX`` and ``_WIN32`` ``#defines``.  Each source file in
``lib/Support``, after implementing the generic (operating system independent)
functionality needs to include the correct implementation using a set of
``#if defined(LLVM_ON_XYZ)`` directives. For example, if we had
``lib/Support/Path.cpp``, we'd expect to see in that file:

.. code-block:: c++

  #if defined(LLVM_ON_UNIX)
  #include "Unix/Path.inc"
  #endif
  #if defined(_WIN32)
  #include "Windows/Path.inc"
  #endif

The implementation in ``lib/Support/Unix/Path.inc`` should handle all Unix
variants. The implementation in ``lib/Support/Windows/Path.inc`` should handle
all Windows variants.  What this does is quickly inc the basic class
of operating system that will provide the implementation. The specific details
for a given platform must still be determined through the use of ``#ifdef``.

Consistent Semantics
--------------------

The implementation of a ``lib/Support`` interface can vary drastically between
platforms. That's okay as long as the end result of the interface function is
the same. For example, a function to create a directory is pretty straight
forward on all operating system. System V IPC on the other hand isn't even
supported on all platforms. Instead of "supporting" System V IPC,
``lib/Support`` should provide an interface to the basic concept of
inter-process communications. The implementations might use System V IPC if
that was available or named pipes, or whatever gets the job done effectively
for a given operating system.  In all cases, the interface and the
implementation must be semantically consistent.

{'repo_name': 'google/llvm-propeller', 'stars': '202', 'repo_language': 'C++', 'file_name': 'dbg-value-move-clone.mir', 'mime_type': 'text/plain', 'hash': 8312654352565538642, 'source_dataset': 'data'}


/*
 * Display a MSDOS directory
 *
 * Emmet P. Gray			US Army, HQ III Corps & Fort Hood
 * ...!uunet!uiucuxc!fthood!egray	Attn: AFZF-DE-ENV
 * 					Directorate of Engineering & Housing
 * 					Environmental Management Office
 * 					Fort Hood, TX 76544-5057
 */

#include <stdio.h>
#include "msdos.h"

int fd;				/* the file descriptor for the floppy */
int dir_start;			/* starting sector for directory */
int dir_len;			/* length of directory (in sectors) */
int dir_entries;		/* number of directory entries */
int dir_chain[25];		/* chain of sectors in directory */
int clus_size;			/* cluster size (in sectors) */
int fat_len;			/* length of FAT table (in sectors) */
int num_clus;			/* number of available clusters */
unsigned char *fatbuf;		/* the File Allocation Table */
char *mcwd;			/* the current working directory */

main(argc, argv)
int argc;
char *argv[];
{
	int i, entry, files, blocks, fargn, wide, faked;
	long size;
	char name[9], ext[4], *date, *time, *convdate(), *convtime();
	char *strncpy(), newpath[MAX_PATH], *getname(), *getpath(), *pathname;
	char *newfile, *filename, *unixname(), volume[12], *sep;
	char *strcpy(), *strcat(), newname[MAX_PATH], *strncat();
	void exit(), reset_dir(), free();
	struct directory *dir, *search();

	if (init(0)) {
		fprintf(stderr, "mdir: Cannot initialize diskette\n");
		exit(1);
	}
					/* find the volume label */
	reset_dir();
	volume[0] = '\0';
	for (entry=0; entry<dir_entries; entry++) {
		dir = search(entry);
					/* if empty */
		if (dir->name[0] == 0x0)
			break;
					/* if not volume label */
		if (!(dir->attr & 0x08))
			continue;

		strncpy(volume, (char *) dir->name, 8);
		volume[8] = '\0';
		strncat(volume, (char *) dir->ext, 3);
		volume[11] = '\0';
		break;
	}
	if (volume[0] == '\0')
		printf(" Volume in drive has no label\n");
	else
		printf(" Volume in drive is %s\n", volume);
	fargn = 1;
	wide = 0;
					/* first argument number */
	if (argc > 1) {
		if (!strcmp(argv[1], "-w")) {
			wide = 1;
			fargn = 2;
		}
	}
					/* fake an argument */
	faked = 0;
	if (argc == fargn) {
		faked++;
		argc++;
	}
	files = 0;
	for (i=fargn; i<argc; i++) {
		if (faked) {
			filename = getname(".");
			pathname = getpath(".");
		}
		else {
			filename = getname(argv[i]);
			pathname = getpath(argv[i]);
		}
					/* move to first guess subdirectory */
					/* required by isdir() */
		if (subdir(pathname)) {
			free(filename);
			free(pathname);
			continue;
		}
					/* is filename really a subdirectory? */
		if (isdir(filename)) {
			strcpy(newpath, pathname);
			if (strcmp(pathname,"/") && strcmp(pathname, "\\")) {
				if (*pathname != '\0')
					strcat(newpath, "/");
			}
			strcat(newpath, filename);
					/* move to real subdirectory */
			if (subdir(newpath)) {
				free(filename);
				free(pathname);
				continue;
			}
			strcpy(newname, "*");
		}
		else {
			strcpy(newpath, pathname);
			strcpy(newname, filename);
		}

		if (*filename == '\0')
			strcpy(newname, "*");

		if (*newpath == '/' || *newpath == '\\')
			printf(" Directory for %s\n\n", newpath);
		else if (!strcmp(newpath, "."))
			printf(" Directory for %s\n\n", mcwd);
		else {
			if (strlen(mcwd) == 1 || !strlen(newpath))
				sep = "";
			else
				sep = "/";
			printf(" Directory for %s%s%s\n\n", mcwd, sep, newpath);
		}
		for (entry=0; entry<dir_entries; entry++) {
			dir = search(entry);
					/* if empty */
			if (dir->name[0] == 0x0)
				break;
					/* if erased */
			if (dir->name[0] == 0xe5)
				continue;
					/* if a volume label */
			if (dir->attr & 0x08)
				continue;

			strncpy(name, (char *) dir->name, 8);
			strncpy(ext, (char *) dir->ext, 3);
			name[8] = '\0';
			ext[3] = '\0';

			newfile = unixname(name, ext);
			if (!match(newfile, newname)) {
				free(newfile);
				continue;
			}
			free(newfile);

			files++;
			if (wide && files != 1) {
				if (!((files-1) % 5))
					putchar('\n');
			}
			date = convdate(dir->date[1], dir->date[0]);
			time = convtime(dir->time[1], dir->time[0]);
			size = dir->size[2]*0x10000L + dir->size[1]*0x100 + dir->size[0];
					/* is a subdirectory */
			if (dir->attr & 0x10) {
				if (wide)
					printf("%-9.9s%-6.6s", name, ext);
				else
					printf("%8s %3s  <DIR>     %s  %s\n", name, ext, date, time);
				continue;
			}
			if (wide)
				printf("%-9.9s%-6.6s", name, ext);
			else
				printf("%8s %3s %8d   %s  %s\n", name, ext, size, date, time);
		}
		if (argc > 2)
			putchar('\n');

		free(filename);
		free(pathname);
	}

	blocks = getfree() * MSECSIZ;
	if (!files)
		printf("File \"%s\" not found\n", newname);
	else
		printf("     %3d File(s)     %6ld bytes free\n", files, blocks);
	close(fd);
	exit(0);
}

/*
 * Get the amount of free space on the diskette
 */

int
getfree()
{
	register int i, total;

	total = 0;
	for (i=2; i<num_clus+2; i++) {
					/* if getfat returns zero */
		if (!getfat(i))
			total += clus_size;
	}
	return(total);
}

{'repo_name': 'jbruchon/elks', 'stars': '295', 'repo_language': 'C', 'file_name': 'boot_sect.S', 'mime_type': 'text/x-python', 'hash': 5241881463860328939, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>$(DEVELOPMENT_LANGUAGE)</string>
	<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>gltf</string>
			</array>
			<key>CFBundleTypeIconFile</key>
			<string></string>
			<key>CFBundleTypeName</key>
			<string>glTF</string>
			<key>CFBundleTypeOSTypes</key>
			<array>
				<string>????</string>
			</array>
			<key>CFBundleTypeRole</key>
			<string>Viewer</string>
			<key>NSDocumentClass</key>
			<string>GLTFSCNDocument</string>
		</dict>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>glb</string>
			</array>
			<key>CFBundleTypeName</key>
			<string>glTF (Binary)</string>
			<key>CFBundleTypeRole</key>
			<string>Viewer</string>
			<key>NSDocumentClass</key>
			<string>GLTFSCNDocument</string>
		</dict>
	</array>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIconFile</key>
	<string></string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>LSMinimumSystemVersion</key>
	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
	<key>NSHumanReadableCopyright</key>
	<string>Copyright © 2018 Warren Moore. All rights reserved. glTF and the glTF logo are trademarks of the Khronos Group Inc.</string>
	<key>NSMainStoryboardFile</key>
	<string>Main</string>
	<key>NSPrincipalClass</key>
	<string>NSApplication</string>
	<key>UTImportedTypeDeclarations</key>
	<array>
		<dict>
			<key>UTTypeDescription</key>
			<string>glTF</string>
			<key>UTTypeIdentifier</key>
			<string>org.khronos.gltf</string>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<array>
					<string>gltf</string>
				</array>
				<key>public.mime-type</key>
				<array>
					<string>model/gltf+json</string>
				</array>
			</dict>
		</dict>
		<dict>
			<key>UTTypeDescription</key>
			<string>glTF (Binary)</string>
			<key>UTTypeIdentifier</key>
			<string>org.khronos.gltf</string>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<array>
					<string>glb</string>
				</array>
				<key>public.mime-type</key>
				<array>
					<string>model/gltf-binary</string>
				</array>
			</dict>
		</dict>
	</array>
</dict>
</plist>

{'repo_name': 'warrenm/GLTFKit', 'stars': '122', 'repo_language': 'Objective-C', 'file_name': 'IDEWorkspaceChecks.plist', 'mime_type': 'text/xml', 'hash': -4495493377916750545, 'source_dataset': 'data'}


<navbar></navbar>
<heading></heading>

{'repo_name': 'DaoCloud/daochain', 'stars': '115', 'repo_language': 'JavaScript', 'file_name': '2_deploy_contracts.js', 'mime_type': 'text/plain', 'hash': -9050154167671397854, 'source_dataset': 'data'}


		__name_box__

			<select class="form_input_select bx-def-font-inputs" name="__name_targets_box__" onchange="oCustomizer.reloadCustomizeBlock(this.value);">
				<bx_repeat:targets><option value="__value__" __select__>__name__</option></bx_repeat:targets>
			</select>

{'repo_name': 'boonex/dolphin.pro', 'stars': '118', 'repo_language': 'PHP', 'file_name': 'Compressor.php', 'mime_type': 'text/x-php', 'hash': 1273478331283876589, 'source_dataset': 'data'}


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

import java.util.concurrent.atomic.AtomicReference;

import com.google.common.util.concurrent.Atomics;

/**
 * Means to access the current {@link FunctionLoader} instance;
 */
public class CurrentFunctionLoader {

   private static final AtomicReference<FunctionLoader> ref = Atomics.<FunctionLoader>newReference(
            BasicFunctionLoader.INSTANCE);

   public static FunctionLoader get() {
      return ref.get();
   }

   public static FunctionLoader set(FunctionLoader loader) {
      return ref.getAndSet(loader);
   }

   public static FunctionLoader reset() {
      return ref.getAndSet(BasicFunctionLoader.INSTANCE);
   }

}

{'repo_name': 'jclouds/legacy-jclouds', 'stars': '477', 'repo_language': 'Java', 'file_name': 'archetype-metadata.xml', 'mime_type': 'text/xml', 'hash': 1338280399342905988, 'source_dataset': 'data'}


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

//+-----------------------------------------------------------------------------
//

//
//  $TAG ENGR

//      $Module:    win_mil_graphics_meta
//      $Keywords:
//
//  $Description:
//          Contains class definition for the render target iterator used in the
//      implementation of the meta render target primitive drawing functions.
//
//  $ENDTAG
//
//------------------------------------------------------------------------------

#include "precomp.hpp"

//+-----------------------------------------------------------------------------
//
//  Member:
//      CMetaIterator::CMetaIterator
//
//  Synopsis:
//      ctor
//
//------------------------------------------------------------------------------
CMetaIterator::CMetaIterator(
    __in_ecount(cRT) MetaData *prgMetaData,
    UINT cRT,
    UINT idxFirstEnabledRT,
    bool fUseRTOffset,
    __in_ecount_opt(1) CDisplaySet const *pDisplaySet,
    __in_ecount_opt(1) CAliasedClip *pAliasedClip,
    __deref_opt_inout_ecount(1) CMilRectF const **ppBoundsToAdjust,
    __in_ecount_opt(1) CMultiOutSpaceMatrix<CoordinateSpace::LocalRendering> *pTransform,
    __in_ecount_opt(1) CContextState *pContextState,
    __in_ecount_opt(1) IWGXBitmapSource **ppIBitmapSource
    ) :
        m_firstTransformAdjustor(
            !fUseRTOffset           ? NULL :
            (pTransform != NULL)    ? &static_cast<CMultiOutSpaceMatrix<CoordinateSpace::Variant> &>(*pTransform) :
            (pContextState == NULL) ? NULL :
            pContextState->In3D     ? &static_cast<CMultiOutSpaceMatrix<CoordinateSpace::Variant> &>(pContextState->ViewportProjectionModifier3D) :
                                      &static_cast<CMultiOutSpaceMatrix<CoordinateSpace::Variant> &>(pContextState->WorldToDevice)
            ),
        m_boundsAdjustor(ppBoundsToAdjust),
        m_aliasedClipAdjustor(
            !fUseRTOffset           ? NULL :
            pContextState           ? &pContextState->AliasedClip :
                                      pAliasedClip
            ),
        m_bitmapSourceAdjustor(ppIBitmapSource)
#if DBG_ANALYSIS
        ,
        // If transform adjust is not needed only because of fUseRTOffset being
        // false, then just change the Out space while iterating.
        m_pDbgToPageOrDeviceTransform(
            fUseRTOffset            ? NULL :
            (pTransform != NULL)    ? &static_cast<CMultiOutSpaceMatrix<CoordinateSpace::Variant> &>(*pTransform) :
            (pContextState == NULL) ? NULL :
            pContextState->In3D     ? &static_cast<CMultiOutSpaceMatrix<CoordinateSpace::Variant> &>(pContextState->ViewportProjectionModifier3D) :
                                      &static_cast<CMultiOutSpaceMatrix<CoordinateSpace::Variant> &>(pContextState->WorldToDevice)
            )
#endif
{
    Assert(prgMetaData[idxFirstEnabledRT].fEnable);
    Assert(idxFirstEnabledRT < cRT);
    // Don't expect both a transform and context state
    Assert(!pTransform || !pContextState);

    // Don't expect both an aliased clip and context state
    Assert(!pContextState || !pAliasedClip);

    m_prgMetaData = prgMetaData;
    m_cRT = cRT;
    m_idxCurrent = idxFirstEnabledRT;
    m_pContextState = pContextState;
    m_pDisplaySet = pDisplaySet;
    AssertMsg(m_pDisplaySet || !m_pContextState, "Must have display set when there is a ContextState");

    m_pFirstTransformAdjustor = &m_firstTransformAdjustor;
    m_pAliasedClipAdjustor = &m_aliasedClipAdjustor;
    m_pBitmapSourceAdjustor = &m_bitmapSourceAdjustor;

#if DBG_ANALYSIS
    if (m_pDbgToPageOrDeviceTransform)
    {
        m_pDbgToPageOrDeviceTransform->DbgChangeToSpace<CoordinateSpace::PageInPixels,CoordinateSpace::Device>();
    }
#endif
}

//+-----------------------------------------------------------------------------
//
//  Member:
//      CMetaIterator::~CMetaIterator
//
//  Synopsis:
//      dtor
//
//------------------------------------------------------------------------------

CMetaIterator::~CMetaIterator()
{
#if DBG_ANALYSIS
    if (m_pDbgToPageOrDeviceTransform)
    {
        m_pDbgToPageOrDeviceTransform->DbgChangeToSpace<CoordinateSpace::Device,CoordinateSpace::PageInPixels>();
    }
#endif
}

//+-----------------------------------------------------------------------------
//
//  Member:
//      CMetaIterator::PrepareForIteration
//
//  Synopsis:
//      Calls BeginPrimitiveAdjust on all adjustors, gathering pointers to the
//      objects that require adjustment
//
//------------------------------------------------------------------------------
HRESULT CMetaIterator::PrepareForIteration()
{
    HRESULT hr = S_OK;

    {
        bool fRequiresAdjustment;

        IFC(m_firstTransformAdjustor.BeginPrimitiveAdjust(
            &fRequiresAdjustment
            ));
        if (!fRequiresAdjustment)
        {
            m_pFirstTransformAdjustor = NULL;
        }
    }

    m_fAdjustBounds = m_boundsAdjustor.BeginPrimitiveAdjust();

    {
        bool fRequiresAdjustment;

        IFC(m_aliasedClipAdjustor.BeginPrimitiveAdjust(
            &fRequiresAdjustment
            ));
        if (!fRequiresAdjustment)
        {
            m_pAliasedClipAdjustor = NULL;
        }
    }

    {
        bool fRequiresAdjustment;

        IFC(m_pBitmapSourceAdjustor->BeginPrimitiveAdjust(
            &fRequiresAdjustment
            ));
        if (!fRequiresAdjustment)
        {
            m_pBitmapSourceAdjustor = NULL;
        }
    }

Cleanup:
    RRETURN(hr);
}

//+-----------------------------------------------------------------------------
//
//  Member:
//      CMetaIterator::SetupForNextInternalRT
//
//  Synopsis:
//      retrieves the next internal render target, performing any setup work
//      necessary to draw to this render target
//
//------------------------------------------------------------------------------
HRESULT CMetaIterator::SetupForNextInternalRT(
    __deref_out_ecount(1) IRenderTargetInternal **ppRTInternalNoAddRef
    )
{
    HRESULT hr = S_OK;

    Assert(m_idxCurrent < m_cRT);
    Assert(m_prgMetaData[m_idxCurrent].fEnable);

    // Active internal render target found.
    // Perform BeginDeviceAdjustment and remember this index
    // such that post adjustment will occur
    IFC(BeginDeviceAdjust(
        m_idxCurrent
        ));

    *ppRTInternalNoAddRef = m_prgMetaData[m_idxCurrent].pInternalRT;

Cleanup:
    RRETURN(hr);
}

//+-----------------------------------------------------------------------------
//
//  Member:
//      CMetaIterator::BeginDeviceAdjust
//
//  Synopsis:
//      Performs the adjustment. Any data that is changed here should be
//      restored in EndPrimitiveAdjust
//
//------------------------------------------------------------------------------
HRESULT CMetaIterator::BeginDeviceAdjust(
    UINT idx
    )
{
    HRESULT hr = S_OK;

    if (m_pFirstTransformAdjustor)
    {
        IFC(m_pFirstTransformAdjustor->BeginDeviceAdjust(
            m_prgMetaData,
            idx
            ));
    }

    if (m_fAdjustBounds)
    {
        m_boundsAdjustor.BeginDeviceAdjust(
            m_prgMetaData,
            idx
            );
    }

    if (m_pAliasedClipAdjustor)
    {
        IFC(m_pAliasedClipAdjustor->BeginDeviceAdjust(
            m_prgMetaData,
            idx
            ));
    }

    if (m_pBitmapSourceAdjustor)
    {
        IFC(m_pBitmapSourceAdjustor->BeginDeviceAdjust(
            m_prgMetaData,
            idx
            ));
    }

    if (m_pContextState)
    {
        // let rendering objects to know which display is served
        m_pContextState->GetDisplaySettingsFromDisplaySet(m_pDisplaySet, idx);
    }

Cleanup:
    RRETURN(hr);
}

{'repo_name': 'dotnet/wpf', 'stars': '4556', 'repo_language': 'C#', 'file_name': 'Targets.h', 'mime_type': 'text/x-c', 'hash': -7837273135727366195, 'source_dataset': 'data'}


/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 *
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 *
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _PTHREAD_MUTEXATTR_T
#define _PTHREAD_MUTEXATTR_T
typedef __darwin_pthread_mutexattr_t pthread_mutexattr_t;
#endif /* _PTHREAD_MUTEXATTR_T */

{'repo_name': 'theos/sdks', 'stars': '275', 'repo_language': 'Objective-C', 'file_name': 'TextInput_cs.tbd', 'mime_type': 'text/plain', 'hash': 4056137844923397370, 'source_dataset': 'data'}


/*! normalize.css v2.1.3 | MIT License | git.io/normalize */

// ==========================================================================
// HTML5 display definitions
// ==========================================================================

//
// Correct `block` display not defined in IE 8/9.
//

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
  display: block;
}

//
// Correct `inline-block` display not defined in IE 8/9.
//

audio,
canvas,
video {
  display: inline-block;
}

//
// Prevent modern browsers from displaying `audio` without controls.
// Remove excess height in iOS 5 devices.
//

audio:not([controls]) {
  display: none;
  height: 0;
}

//
// Address `[hidden]` styling not present in IE 8/9.
// Hide the `template` element in IE, Safari, and Firefox < 22.
//

[hidden],
template {
  display: none;
}

// ==========================================================================
// Base
// ==========================================================================

//
// 1. Set default font family to sans-serif.
// 2. Prevent iOS text size adjust after orientation change, without disabling
//    user zoom.
//

html {
  font-family: sans-serif; // 1
  -ms-text-size-adjust: 100%; // 2
  -webkit-text-size-adjust: 100%; // 2
}

//
// Remove default margin.
//

body {
  margin: 0;
}

// ==========================================================================
// Links
// ==========================================================================

//
// Remove the gray background color from active links in IE 10.
//

a {
  background: transparent;
}

//
// Address `outline` inconsistency between Chrome and other browsers.
//

a:focus {
  outline: thin dotted;
}

//
// Improve readability when focused and also mouse hovered in all browsers.
//

a:active,
a:hover {
  outline: 0;
}

// ==========================================================================
// Typography
// ==========================================================================

//
// Address variable `h1` font-size and margin within `section` and `article`
// contexts in Firefox 4+, Safari 5, and Chrome.
//

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

//
// Address styling not present in IE 8/9, Safari 5, and Chrome.
//

abbr[title] {
  border-bottom: 1px dotted;
}

//
// Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
//

b,
strong {
  font-weight: bold;
}

//
// Address styling not present in Safari 5 and Chrome.
//

dfn {
  font-style: italic;
}

//
// Address differences between Firefox and other browsers.
//

hr {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  height: 0;
}

//
// Address styling not present in IE 8/9.
//

mark {
  background: #ff0;
  color: #000;
}

//
// Correct font family set oddly in Safari 5 and Chrome.
//

code,
kbd,
pre,
samp {
  font-family: monospace, serif;
  font-size: 1em;
}

//
// Improve readability of pre-formatted text in all browsers.
//

pre {
  white-space: pre-wrap;
}

//
// Set consistent quote types.
//

q {
  quotes: "\201C" "\201D" "\2018" "\2019";
}

//
// Address inconsistent and variable font size in all browsers.
//

small {
  font-size: 80%;
}

//
// Prevent `sub` and `sup` affecting `line-height` in all browsers.
//

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

// ==========================================================================
// Embedded content
// ==========================================================================

//
// Remove border when inside `a` element in IE 8/9.
//

img {
  border: 0;
}

//
// Correct overflow displayed oddly in IE 9.
//

svg:not(:root) {
  overflow: hidden;
}

// ==========================================================================
// Figures
// ==========================================================================

//
// Address margin not present in IE 8/9 and Safari 5.
//

figure {
  margin: 0;
}

// ==========================================================================
// Forms
// ==========================================================================

//
// Define consistent border, margin, and padding.
//

fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}

//
// 1. Correct `color` not being inherited in IE 8/9.
// 2. Remove padding so people aren't caught out if they zero out fieldsets.
//

legend {
  border: 0; // 1
  padding: 0; // 2
}

//
// 1. Correct font family not being inherited in all browsers.
// 2. Correct font size not being inherited in all browsers.
// 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
//

button,
input,
select,
textarea {
  font-family: inherit; // 1
  font-size: 100%; // 2
  margin: 0; // 3
}

//
// Address Firefox 4+ setting `line-height` on `input` using `!important` in
// the UA stylesheet.
//

button,
input {
  line-height: normal;
}

//
// Address inconsistent `text-transform` inheritance for `button` and `select`.
// All other form control elements do not inherit `text-transform` values.
// Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
// Correct `select` style inheritance in Firefox 4+ and Opera.
//

button,
select {
  text-transform: none;
}

//
// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
//    and `video` controls.
// 2. Correct inability to style clickable `input` types in iOS.
// 3. Improve usability and consistency of cursor style between image-type
//    `input` and others.
//

button,
html input[type="button"], // 1
input[type="reset"],
input[type="submit"] {
  -webkit-appearance: button; // 2
  cursor: pointer; // 3
}

//
// Re-set default cursor for disabled elements.
//

button[disabled],
html input[disabled] {
  cursor: default;
}

//
// 1. Address box sizing set to `content-box` in IE 8/9/10.
// 2. Remove excess padding in IE 8/9/10.
//

input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box; // 1
  padding: 0; // 2
}

//
// 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
// 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
//    (include `-moz` to future-proof).
//

input[type="search"] {
  -webkit-appearance: textfield; // 1
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box; // 2
  box-sizing: content-box;
}

//
// Remove inner padding and search cancel button in Safari 5 and Chrome
// on OS X.
//

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

//
// Remove inner padding and border in Firefox 4+.
//

button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}

//
// 1. Remove default vertical scrollbar in IE 8/9.
// 2. Improve readability and alignment in all browsers.
//

textarea {
  overflow: auto; // 1
  vertical-align: top; // 2
}

// ==========================================================================
// Tables
// ==========================================================================

//
// Remove most spacing between table cells.
//

table {
  border-collapse: collapse;
  border-spacing: 0;
}

{'repo_name': 'ironbane/IronbaneServerLegacy', 'stars': '172', 'repo_language': 'JavaScript', 'file_name': 'tests.js', 'mime_type': 'text/plain', 'hash': 8459004796081784366, 'source_dataset': 'data'}


package goworker

import (
	"fmt"
	"math/rand"
	"os"
	"strings"
	"time"
)

type process struct {
	Hostname string
	Pid      int
	ID       string
	Queues   []string
}

func newProcess(id string, queues []string) (*process, error) {
	hostname, err := os.Hostname()
	if err != nil {
		return nil, err
	}

	return &process{
		Hostname: hostname,
		Pid:      os.Getpid(),
		ID:       id,
		Queues:   queues,
	}, nil
}

func (p *process) String() string {
	return fmt.Sprintf("%s:%d-%s:%s", p.Hostname, p.Pid, p.ID, strings.Join(p.Queues, ","))
}

func (p *process) open(conn *RedisConn) error {
	conn.Send("SADD", fmt.Sprintf("%sworkers", workerSettings.Namespace), p)
	conn.Send("SET", fmt.Sprintf("%sstat:processed:%v", workerSettings.Namespace, p), "0")
	conn.Send("SET", fmt.Sprintf("%sstat:failed:%v", workerSettings.Namespace, p), "0")
	conn.Flush()

	return nil
}

func (p *process) close(conn *RedisConn) error {
	logger.Infof("%v shutdown", p)
	conn.Send("SREM", fmt.Sprintf("%sworkers", workerSettings.Namespace), p)
	conn.Send("DEL", fmt.Sprintf("%sstat:processed:%s", workerSettings.Namespace, p))
	conn.Send("DEL", fmt.Sprintf("%sstat:failed:%s", workerSettings.Namespace, p))
	conn.Flush()

	return nil
}

func (p *process) start(conn *RedisConn) error {
	conn.Send("SET", fmt.Sprintf("%sworker:%s:started", workerSettings.Namespace, p), time.Now().String())
	conn.Flush()

	return nil
}

func (p *process) finish(conn *RedisConn) error {
	conn.Send("DEL", fmt.Sprintf("%sworker:%s", workerSettings.Namespace, p))
	conn.Send("DEL", fmt.Sprintf("%sworker:%s:started", workerSettings.Namespace, p))
	conn.Flush()

	return nil
}

func (p *process) fail(conn *RedisConn) error {
	conn.Send("INCR", fmt.Sprintf("%sstat:failed", workerSettings.Namespace))
	conn.Send("INCR", fmt.Sprintf("%sstat:failed:%s", workerSettings.Namespace, p))
	conn.Flush()

	return nil
}

func (p *process) queues(strict bool) []string {
	// If the queues order is strict then just return them.
	if strict {
		return p.Queues
	}

	// If not then we want to to shuffle the queues before returning them.
	queues := make([]string, len(p.Queues))
	for i, v := range rand.Perm(len(p.Queues)) {
		queues[i] = p.Queues[v]
	}
	return queues
}

{'repo_name': 'benmanns/goworker', 'stars': '2425', 'repo_language': 'Go', 'file_name': 'go.yml', 'mime_type': 'text/plain', 'hash': -873627425819689684, 'source_dataset': 'data'}


###  TEMPLATE.txt.tpl; coding: utf-8 ---

#  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
#       Date: 2020-01-20
#
#  Copyright (C) 2013-2020 Feel++ Consortium
#
# Distributed under the GPL(GNU Public License):
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
##
## Archive generation using cpack
##
if (UNIX)
  execute_process(
    COMMAND uname -m
    OUTPUT_VARIABLE FEELPP_SYSTEM_MACHINE
    OUTPUT_STRIP_TRAILING_WHITESPACE
    ERROR_VARIABLE FEELPP_SYSTEM_MACHINE_error
    RESULT_VARIABLE FEELPP_SYSTEM_MACHINE_result)
endif()
SET(CPACK_PACKAGE_NAME "feelpp-toolboxes")
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Feel++ Toolboxes")
SET(CPACK_PACKAGE_VENDOR "Christophe Prud'homme")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.adoc")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.adoc")
SET(CPACK_PACKAGE_VERSION_MAJOR "${FEELPP_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${FEELPP_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${FEELPP_VERSION_MICRO}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "feelpp-toolboxes")
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "CPackSourceConfig.cmake")
SET(CPACK_SYSTEM_NAME "${FEELPP_OS}-${FEELPP_SYSTEM_MACHINE}")

SET(CPACK_PACKAGE_NAME "feelpp-toolboxes")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Feel++ Toolboxes")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${FEELPP_VERSION_MAJOR}.${FEELPP_VERSION_MINOR}.${FEELPP_VERSION_MICRO}${FEELPP_VERSION_PRERELEASE}${FEELPP_VERSION_METADATA}")

SET(CPACK_SOURCE_STRIP_FILES "")
# The following components are regex's to match anywhere (unless anchored)
# in absolute path + filename to find files or directories to be excluded
# from source tarball.
set(CPACK_SOURCE_IGNORE_FILES
  "/\\\\.git/;\\\\.gitignore;/\\\\.svn;"
  "/.git;"
  "/admin/;/Templates/;"
  "/auto/;/ltxpng/;"
  "/TAGS;/#.*;/.*~$;/*.log$;/.cvsignore;/.bzrignore;/work/;/autom4te.cache/"
  )

include( CPack )

{'repo_name': 'feelpp/feelpp', 'stars': '203', 'repo_language': 'C++', 'file_name': 'aneurysm.geo', 'mime_type': 'text/plain', 'hash': 2021732163507463082, 'source_dataset': 'data'}


<template>
    video[controls]
    <video data-focus="video" width="1" height="1"></video>
    <video data-focus="videoControls" controls width="1" height="1"></video>
</template>

{'repo_name': 'salesforce/lwc', 'stars': '809', 'repo_language': 'JavaScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -3519010752090783507, 'source_dataset': 'data'}


<?php

/* vim: set shiftwidth=2 expandtab softtabstop=2: */

namespace Boris;

/**
 * The Readline client is what the user spends their time entering text into.
 *
 * Input is collected and sent to {@link \Boris\EvalWorker} for processing.
 */
class ReadlineClient {
  private $_socket;
  private $_prompt;
  private $_historyFile;
  private $_clear = false;

  /**
   * Create a new ReadlineClient using $socket for communication.
   *
   * @param resource $socket
   */
  public function __construct($socket) {
    $this->_socket = $socket;
  }

  /**
   * Start the client with an prompt and readline history path.
   *
   * This method never returns.
   *
   * @param string $prompt
   * @param string $historyFile
   */
  public function start($prompt, $historyFile) {
    readline_read_history($historyFile);

    declare(ticks = 1);
    pcntl_signal(SIGCHLD, SIG_IGN);
    pcntl_signal(SIGINT, array($this, 'clear'), true);

    // wait for the worker to finish executing hooks
    if (fread($this->_socket, 1) != EvalWorker::READY) {
      throw new \RuntimeException('EvalWorker failed to start');
    }

    $parser = new ShallowParser();
    $buf    = '';
    $lineno = 1;

    for (;;) {
      $this->_clear = false;
      $line = readline(
        sprintf(
          '[%d] %s',
          $lineno,
          ($buf == ''
            ? $prompt
            : str_pad('*> ', strlen($prompt), ' ', STR_PAD_LEFT))
        )
      );

      if ($this->_clear) {
        $buf = '';
        continue;
      }

      if (false === $line) {
        $buf = 'exit(0);'; // ctrl-d acts like exit
      }

      if (strlen($line) > 0) {
        readline_add_history($line);
      }

      $buf .= sprintf("%s\n", $line);

      if ($statements = $parser->statements($buf)) {
        ++$lineno;

        $buf = '';
        foreach ($statements as $stmt) {
          if (false === $written = fwrite($this->_socket, $stmt)) {
            throw new \RuntimeException('Socket error: failed to write data');
          }

          if ($written > 0) {
            $status = fread($this->_socket, 1);
            if ($status == EvalWorker::EXITED) {
              readline_write_history($historyFile);
              echo "\n";
              exit(0);
            } elseif ($status == EvalWorker::FAILED) {
              break;
            }
          }
        }
      }
    }
  }

  /**
   * Clear the input buffer.
   */
  public function clear() {
    // FIXME: I'd love to have this send \r to readline so it puts the user on a blank line
    $this->_clear = true;
  }
}

{'repo_name': '5-say/laravel-4.1-quick-start-cn', 'stars': '144', 'repo_language': 'PHP', 'file_name': 'github.css', 'mime_type': 'text/plain', 'hash': 7954457642401566209, 'source_dataset': 'data'}


/*
 * Copyright (C) 2017 Apple 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:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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.
 */

#include "config.h"
#include "JSMarkingConstraintPrivate.h"

#include "APICast.h"
#include "JSCInlines.h"
#include "SimpleMarkingConstraint.h"

using namespace JSC;

namespace {

Atomic<unsigned> constraintCounter;

struct Marker : JSMarker {
    SlotVisitor* visitor;
};

bool isMarked(JSMarkerRef markerRef, JSObjectRef objectRef)
{
    if (!objectRef)
        return true; // Null is an immortal object.

    return static_cast<Marker*>(markerRef)->visitor->vm().heap.isMarked(toJS(objectRef));
}

void mark(JSMarkerRef markerRef, JSObjectRef objectRef)
{
    if (!objectRef)
        return;

    static_cast<Marker*>(markerRef)->visitor->appendHiddenUnbarriered(toJS(objectRef));
}

} // anonymous namespace

void JSContextGroupAddMarkingConstraint(JSContextGroupRef group, JSMarkingConstraint constraintCallback, void *userData)
{
    VM& vm = *toJS(group);
    JSLockHolder locker(vm);

    unsigned constraintIndex = constraintCounter.exchangeAdd(1);

    // This is a guess. The algorithm should be correct no matter what we pick. This means
    // that we expect this constraint to mark things even during a stop-the-world full GC, but
    // we don't expect it to be able to mark anything at the very start of a GC before anything
    // else gets marked.
    ConstraintVolatility volatility = ConstraintVolatility::GreyedByMarking;

    auto constraint = std::make_unique<SimpleMarkingConstraint>(
        toCString("Amc", constraintIndex, "(", RawPointer(bitwise_cast<void*>(constraintCallback)), ")"),
        toCString("API Marking Constraint #", constraintIndex, " (", RawPointer(bitwise_cast<void*>(constraintCallback)), ", ", RawPointer(userData), ")"),
        [constraintCallback, userData]
        (SlotVisitor& slotVisitor) {
            Marker marker;
            marker.IsMarked = isMarked;
            marker.Mark = mark;
            marker.visitor = &slotVisitor;

            constraintCallback(&marker, userData);
        },
        volatility,
        ConstraintConcurrency::Sequential);

    vm.heap.addMarkingConstraint(WTFMove(constraint));
}

{'repo_name': 'mbbill/JSC.js', 'stars': '279', 'repo_language': 'C++', 'file_name': 'updateGN.md', 'mime_type': 'text/plain', 'hash': 3802004939018551231, 'source_dataset': 'data'}


<?php

/*
 * This file is part of the Monolog package.
 *
 * (c) Jonathan A. Schweder <jonathanschweder@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Monolog\Processor;

use Monolog\TestCase;

class MercurialProcessorTest extends TestCase
{
    /**
     * @covers Monolog\Processor\MercurialProcessor::__invoke
     */
    public function testProcessor()
    {
        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
            exec("where hg 2>NUL", $output, $result);
        } else {
            exec("which hg 2>/dev/null >/dev/null", $output, $result);
        }
        if ($result != 0) {
            $this->markTestSkipped('hg is missing');
            return;
        }

        `hg init`;
        $processor = new MercurialProcessor();
        $record = $processor($this->getRecord());

        $this->assertArrayHasKey('hg', $record['extra']);
        $this->assertTrue(!is_array($record['extra']['hg']['branch']));
        $this->assertTrue(!is_array($record['extra']['hg']['revision']));
    }
}

{'repo_name': 'woann/chat', 'stars': '208', 'repo_language': 'PHP', 'file_name': 'demo-1.js', 'mime_type': 'text/plain', 'hash': 2804170736226767632, 'source_dataset': 'data'}