package com.alibaba.druid.bvt.pool.exception;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.druid.mock.MockConnection;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidPooledConnection;
import com.alibaba.druid.pool.vendor.OracleExceptionSorter;
import com.alibaba.druid.stat.DruidDataSourceStatManager;
import com.alibaba.druid.stat.JdbcStatManager;
import com.alibaba.druid.test.util.OracleMockDriver;
import com.alibaba.druid.util.JdbcUtils;

public class OracleExceptionSorterTest_stmt_getFetchDirection extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());

        dataSource = new DruidDataSource();

        dataSource.setExceptionSorter(new OracleExceptionSorter());

        dataSource.setDriver(new OracleMockDriver());
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setPoolPreparedStatements(true);
        dataSource.setMaxOpenPreparedStatements(100);
    }

    @Override
    protected void tearDown() throws Exception {
        JdbcUtils.close(dataSource);
        Assert.assertEquals(0, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
    }

    public void test_connect() throws Exception {
        String sql = "SELECT 1";
        {
            DruidPooledConnection conn = dataSource.getConnection();

            PreparedStatement pstmt = conn.prepareStatement(sql);
            pstmt.execute();
            pstmt.close();
            conn.close();
        }

        DruidPooledConnection conn = dataSource.getConnection();
        MockConnection mockConn = conn.unwrap(MockConnection.class);
        Assert.assertNotNull(mockConn);

        Statement stmt = conn.createStatement();

        SQLException exception = new SQLException("xx", "xxx", 28);
        mockConn.setError(exception);

        SQLException stmtErrror = null;
        try {
            stmt.getFetchDirection();
        } catch (SQLException ex) {
            stmtErrror = ex;
        }
        Assert.assertNotNull(stmtErrror);
        Assert.assertSame(exception, stmtErrror);

        SQLException commitError = null;
        try {
            conn.commit();
        } catch (SQLException ex) {
            commitError = ex;
        }

        Assert.assertNotNull(commitError);
        Assert.assertSame(exception, commitError.getCause());

        conn.close();
    }

}

{'repo_name': 'alibaba/druid', 'stars': '21741', 'repo_language': 'Java', 'file_name': 'license.txt', 'mime_type': 'text/plain', 'hash': -4849873439677506546, 'source_dataset': 'data'}


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
  serializedVersion: 6
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInternal: {fileID: 0}
  m_Name: 079_01_Multi
  m_Shader: {fileID: 4800000, guid: 90230ba9d6fad124a90d5d56483f9b7c, type: 3}
  m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _NORMALMAP _OVERLAY_MULTIPLY _THE_GOOD
  m_LightmapFlags: 4
  m_EnableInstancingVariants: 0
  m_DoubleSidedGI: 0
  m_CustomRenderQueue: -1
  stringTagMap: {}
  disabledShaderPasses: []
  m_SavedProperties:
    serializedVersion: 3
    m_TexEnvs:
    - _BumpMap:
        m_Texture: {fileID: 2800000, guid: 4b8d081e9d114c7f1100f5ab44295342, type: 3}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailAlbedoMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailMask:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailNormalMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _EmissionMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MainTex:
        m_Texture: {fileID: 2800000, guid: aadb87c7d77078543b7e1ac2e60a9e39, type: 3}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MetallicGlossMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _Normal:
        m_Texture: {fileID: 2800000, guid: 5eacc7beca523d34db5f65d91a876e2f, type: 3}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _OcclusionMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _ParallaxMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _Prop3:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    m_Floats:
    - _Alpha: 125
    - _Alpha1: 0
    - _Alpha2: 0
    - _Alphabet: 0
    - _Amplitude: 0.09
    - _Blend2: 1
    - _BumpScale: 1
    - _Color: 0.25
    - _Cutoff: 0.5
    - _DetailNormalMapScale: 1
    - _DstBlend: 10
    - _Fancy: 0
    - _Frequency: 0.5
    - _GlossMapScale: 1
    - _Glossiness: 0.5
    - _GlossyReflections: 1
    - _Invert: 0
    - _Metallic: 0
    - _Mode: 3
    - _OcclusionStrength: 1
    - _Outline: 0.039
    - _Overlay: 2
    - _Parallax: 0.02
    - _Prop1: 0
    - _Prop2: 0
    - _Prop3: 0
    - _Prop4: 0
    - _Prop5: 0
    - _Shininess: 1
    - _SmoothnessTextureChannel: 0
    - _SpecularHighlights: 1
    - _Speed: 2.81
    - _SrcBlend: 1
    - _The: 0
    - _UVSec: 0
    - _Value: 1
    - _ZWrite: 0
    m_Colors:
    - _Color: {r: 1, g: 0, b: 0, a: 0}
    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
    - _OutlineColor: {r: 1, g: 0, b: 0.9761739, a: 1}

{'repo_name': 'knapeczadam/Unity-Shaders', 'stars': '175', 'repo_language': 'ShaderLab', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': -2193268282291960030, 'source_dataset': 'data'}


{**}
{strip}

{\App\Language::translate('LBL_SHOW_HIERARCHY', $MODULE)}

					<button type="button" class="close" data-dismiss="modal" title="{\App\Language::translate('LBL_CLOSE')}">
						×
					</button>

									{foreach item=HEADERNAME from=$HIERARCHY['header']}
										{\App\Language::translate($HEADERNAME, $MODULE)}
										{/foreach}

							{foreach item=ENTRIES from=$HIERARCHY['entries']}

										{foreach item=LISTFIELDS from=$ENTRIES}
											{$LISTFIELDS}
										{/foreach}

							{/foreach}

						<button class="btn btn-warning" type="reset" data-dismiss="modal">{\App\Language::translate('LBL_CLOSE', $MODULE)}</button>

{/strip}

{'repo_name': 'YetiForceCompany/YetiForceCRM', 'stars': '945', 'repo_language': 'PHP', 'file_name': 'cron.sh', 'mime_type': 'text/plain', 'hash': -7459122304736506730, 'source_dataset': 'data'}


package org.bouncycastle.pqc.crypto.lms;

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

import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
import org.bouncycastle.crypto.Digest;
import org.bouncycastle.crypto.Xof;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.bouncycastle.crypto.digests.SHA512Digest;
import org.bouncycastle.crypto.digests.SHAKEDigest;

/**
 * LMS digest utils provides oid mapping to provider digest name.
 */
class DigestUtil
{
    private static Map<String, ASN1ObjectIdentifier> nameToOid = new HashMap<String, ASN1ObjectIdentifier>();
    private static Map<ASN1ObjectIdentifier, String> oidToName = new HashMap<ASN1ObjectIdentifier, String>();

    static
    {
        nameToOid.put("SHA-256", NISTObjectIdentifiers.id_sha256);
        nameToOid.put("SHA-512", NISTObjectIdentifiers.id_sha512);
        nameToOid.put("SHAKE128", NISTObjectIdentifiers.id_shake128);
        nameToOid.put("SHAKE256", NISTObjectIdentifiers.id_shake256);

        oidToName.put(NISTObjectIdentifiers.id_sha256, "SHA-256");
        oidToName.put(NISTObjectIdentifiers.id_sha512, "SHA-512");
        oidToName.put(NISTObjectIdentifiers.id_shake128, "SHAKE128");
        oidToName.put(NISTObjectIdentifiers.id_shake256, "SHAKE256");
    }

    static Digest getDigest(ASN1ObjectIdentifier oid)
    {
        if (oid.equals(NISTObjectIdentifiers.id_sha256))
        {
            return new SHA256Digest();
        }
        if (oid.equals(NISTObjectIdentifiers.id_sha512))
        {
            return new SHA512Digest();
        }
        if (oid.equals(NISTObjectIdentifiers.id_shake128))
        {
            return new SHAKEDigest(128);
        }
        if (oid.equals(NISTObjectIdentifiers.id_shake256))
        {
            return new SHAKEDigest(256);
        }

        throw new IllegalArgumentException("unrecognized digest OID: " + oid);
    }

    static String getDigestName(ASN1ObjectIdentifier oid)
    {
        String name = oidToName.get(oid);
        if (name != null)
        {
            return name;
        }

        throw new IllegalArgumentException("unrecognized digest oid: " + oid);
    }

    static ASN1ObjectIdentifier getDigestOID(String name)
    {
        ASN1ObjectIdentifier oid = nameToOid.get(name);
        if (oid != null)
        {
            return oid;
        }

        throw new IllegalArgumentException("unrecognized digest name: " + name);
    }

    public static int getDigestSize(Digest digest)
    {
        if (digest instanceof Xof)
        {
            return digest.getDigestSize() * 2;
        }

        return digest.getDigestSize();
    }
}

{'repo_name': 'bcgit/bc-java', 'stars': '1204', 'repo_language': 'Java', 'file_name': 'ecrypt_HC-128.txt', 'mime_type': 'text/plain', 'hash': -8522222752160543192, 'source_dataset': 'data'}


/*
 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
 * Copyright (c) 1996-1999 by Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include "ares_setup.h"

#ifdef HAVE_NETINET_IN_H
#  include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#  include <arpa/inet.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include <arpa/nameser.h>
#else
#  include "nameser.h"
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
#  include <arpa/nameser_compat.h>
#endif

#include "ares.h"
#include "ares_ipv6.h"

#ifndef HAVE_INET_NTOP

/*
 * WARNING: Don't even consider trying to compile this on a system where
 * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
 */

static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size);
static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);

/* char *
 * inet_ntop(af, src, dst, size)
 *     convert a network format address to presentation format.
 * return:
 *     pointer to presentation format address (`dst'), or NULL (see errno).
 * note:
 *     On Windows we store the error in the thread errno, not
 *     in the winsock error code. This is to avoid loosing the
 *     actual last winsock error. So use macro ERRNO to fetch the
 *     errno this funtion sets when returning NULL, not SOCKERRNO.
 * author:
 *     Paul Vixie, 1996.
 */
const char *
ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
{
  switch (af) {
  case AF_INET:
    return (inet_ntop4(src, dst, (size_t)size));
  case AF_INET6:
    return (inet_ntop6(src, dst, (size_t)size));
  default:
    SET_ERRNO(EAFNOSUPPORT);
    return (NULL);
  }
  /* NOTREACHED */
}

/* const char *
 * inet_ntop4(src, dst, size)
 *     format an IPv4 address
 * return:
 *     `dst' (as a const)
 * notes:
 *     (1) uses no statics
 *     (2) takes a unsigned char* not an in_addr as input
 * author:
 *     Paul Vixie, 1996.
 */
static const char *
inet_ntop4(const unsigned char *src, char *dst, size_t size)
{
  static const char fmt[] = "%u.%u.%u.%u";
  char tmp[sizeof("255.255.255.255")];

  if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) {
    SET_ERRNO(ENOSPC);
    return (NULL);
  }
  strcpy(dst, tmp);
  return (dst);
}

/* const char *
 * inet_ntop6(src, dst, size)
 *     convert IPv6 binary address into presentation (printable) format
 * author:
 *     Paul Vixie, 1996.
 */
static const char *
inet_ntop6(const unsigned char *src, char *dst, size_t size)
{
  /*
   * Note that int32_t and int16_t need only be "at least" large enough
   * to contain a value of the specified size.  On some systems, like
   * Crays, there is no such thing as an integer variable with 16 bits.
   * Keep this in mind if you think this function should have been coded
   * to use pointer overlays.  All the world's not a VAX.
   */
  char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
  char *tp;
  struct { int base, len; } best, cur;
  unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
  int i;

  /*
   * Preprocess:
   *  Copy the input (bytewise) array into a wordwise array.
   *  Find the longest run of 0x00's in src[] for :: shorthanding.
   */
  memset(words, '\0', sizeof(words));
  for (i = 0; i < NS_IN6ADDRSZ; i++)
    words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
  best.base = -1;
  best.len = 0;
  cur.base = -1;
  cur.len = 0;
  for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
    if (words[i] == 0) {
      if (cur.base == -1)
        cur.base = i, cur.len = 1;
      else
        cur.len++;
    } else {
      if (cur.base != -1) {
        if (best.base == -1 || cur.len > best.len)
          best = cur;
        cur.base = -1;
      }
    }
  }
  if (cur.base != -1) {
    if (best.base == -1 || cur.len > best.len)
      best = cur;
  }
  if (best.base != -1 && best.len < 2)
    best.base = -1;

  /*
   * Format the result.
   */
  tp = tmp;
  for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
    /* Are we inside the best run of 0x00's? */
    if (best.base != -1 && i >= best.base &&
        i < (best.base + best.len)) {
      if (i == best.base)
        *tp++ = ':';
      continue;
    }
    /* Are we following an initial run of 0x00s or any real hex? */
    if (i != 0)
      *tp++ = ':';
    /* Is this address an encapsulated IPv4? */
    if (i == 6 && best.base == 0 && (best.len == 6 ||
        (best.len == 7 && words[7] != 0x0001) ||
        (best.len == 5 && words[5] == 0xffff))) {
      if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp)))
        return (NULL);
      tp += strlen(tp);
      break;
    }
    tp += sprintf(tp, "%x", words[i]);
  }
  /* Was it a trailing run of 0x00's? */
  if (best.base != -1 && (best.base + best.len) ==
      (NS_IN6ADDRSZ / NS_INT16SZ))
    *tp++ = ':';
  *tp++ = '\0';

  /*
   * Check for overflow, copy, and we're done.
   */
  if ((size_t)(tp - tmp) > size) {
    SET_ERRNO(ENOSPC);
    return (NULL);
  }
  strcpy(dst, tmp);
  return (dst);
}

#else /* HAVE_INET_NTOP */

const char *
ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
{
  /* just relay this to the underlying function */
  return inet_ntop(af, src, dst, size);
}

#endif /* HAVE_INET_NTOP */

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


---
title: generalLedgerEntries resource type
description: A general ledger entry in Dynamics 365 Business Central.
services: project-madeira
documentationcenter: ''
author: SusanneWindfeldPedersen
localization_priority: Normal
ms.prod: "dynamics-365-business-central"
doc_type: resourcePageType
---

# generalLedgerEntries resource type

Namespace: microsoft.graph

[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]

Represents a generalLedgerEntry object in Dynamics 365 Business Central.

## Methods

| Method       | Return Type  |Description|
|:-------------|:-------------|:----------|
|[Get generalLedgerEntries](../api/dynamics-generalledgerentries-get.md)|generalLedgerEntries|Get a G/L entry object.|

## Properties
| Property	         | Type	                 |Description                                  |
|:-------------------|:----------------------|:--------------------------------------------|
|id                  |numeric                |The unique ID of the G/L Entry.              |
|postingDate         |date                   |Specifies the posting date of the G/L Entry. |
|documentNumber      |string, maximum size 20|Specifies the document number of the G/L Entry.|
|documentType        |string                 |Specifies the document type of the G/L Entry.|
|accountId           |GUID                   |Specifies the accountId of the G/L Entry.    |
|accountNumber       |string, maximum size 20|Specifies the accountNumber of the G/L Entry.|
|description         |string, maximum size 50|Specifies the description of the G/L Entry.  |
|debitAmount         |numeric                |Specifies the debitAmount of the G/L Entry.  |
|creditAmount        |numeric                |Specifies the creditAmount of the G/L Entry. |
|lastModifiedDateTime|datetime               |The last datetime the G/L Entry was modified.|

## Relationships
None

## JSON representation

Here is a JSON representation of the resource.

```json
{
  "id": "int",
  "postingDate": "Date",
  "documentNumber": "string",
  "documentType": "string",
  "accountId": "GUID",
  "accountNumber": "string",
  "description": "string",
  "debitAmount": "decimal",
  "creditAmount": "decimal",
  "lastModifiedDateTime": "datetime"
}

```

{'repo_name': 'microsoftgraph/microsoft-graph-docs', 'stars': '615', 'repo_language': 'PowerShell', 'file_name': 'snippets-sdk-documentation-link.md', 'mime_type': 'text/plain', 'hash': 6604356542705018443, 'source_dataset': 'data'}


package null

/**
 * Panther is a Cloud-Native SIEM for the Modern Security Team.
 * Copyright (C) 2020 Panther Labs Inc
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestUint64Codec(t *testing.T) {
	type A struct {
		Foo Uint64 `json:"foo,omitempty"`
	}
	runTestsUnmarshal(t, typUint64, []unmarshalTest{
		{"", `"42"`, Uint64{Value: 42, Exists: true}, false},
		{"", `"-42"`, Uint64{}, true},
		{"", `""`, Uint64{}, false},
		{"", `null`, Uint64{}, false},
		{"number positive", `42`, Uint64{Value: 42, Exists: true}, false},
		{"number negative", `-42`, Uint64{}, true},
		{"", `"abc"`, Uint64{}, true},
		{"", `[]`, Uint64{}, true},
		{"", `{}`, Uint64{}, true},
		{"", `{"foo":"42"}`, A{Foo: Uint64{Value: 42, Exists: true}}, false},
		{"", `{"foo":""}`, A{}, false},
		{"", `{"foo":null}`, A{}, false},
		{"", `{"foo":"abc"}`, A{}, true},
		{"", `{"foo":[]}`, A{}, true},
		{"", `{"foo":{}}`, A{}, true},
		{"", `{"foo":42}`, A{Foo: Uint64{Value: 42, Exists: true}}, false},
		{"", `{"foo":-42}`, A{}, true},
	})
	runTestsMarshal(t, typUint64, []marshalTest{
		{"", Uint64{Value: 42, Exists: true}, `42`, `42`},
		{"", Uint64{Value: 0, Exists: true}, `0`, `0`},
		{"", Uint64{}, `null`, `null`},
		{"", A{Foo: Uint64{Value: 42, Exists: true}}, `{"foo":42}`, `{"foo":42}`},
		{"", A{}, `{}`, `{"foo":null}`},
		{"", A{Foo: Uint64{Value: 0, Exists: true}}, `{"foo":0}`, `{"foo":0}`},
	})
}

func TestUint64IsNull(t *testing.T) {
	n := Uint64{
		Exists: true,
	}
	require.False(t, n.IsNull())
	n = Uint64{
		Value:  42,
		Exists: true,
	}
	require.False(t, n.IsNull())
	n = Uint64{}
	require.True(t, n.IsNull())
	n = Uint64{
		Value: 12,
	}
	require.True(t, n.IsNull())
}

{'repo_name': 'panther-labs/panther', 'stars': '646', 'repo_language': 'Go', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': 3591048903520267581, 'source_dataset': 'data'}


#ifndef ALLOC_H
#define ALLOC_H

#include "common.h"
#include "process.h"

void initializeKernelHeap();
void *ksbrkPage(int n);
void *kmalloc(uint32 size);
void kfree(void *v_addr);

void initializeProcessHeap(Process* process);
void *sbrk(Process* process, int nBytes);

uint32 getKernelHeapUsed();

struct MallocHeader {
    unsigned long size:31;
    unsigned long used:1;
} __attribute__ ((packed));

typedef struct MallocHeader MallocHeader;

#endif // ALLOC_H

{'repo_name': 'akkartik/mu', 'stars': '699', 'repo_language': 'C++', 'file_name': 'racket.css', 'mime_type': 'text/plain', 'hash': 2541253077733800823, 'source_dataset': 'data'}


---
layout: default
title: Setting up a Google Cloud Project
parent: Running an experiment on your Cloud project
nav_order: 1
permalink: /running-a-cloud-experiment/setting-up-a-google-cloud-project/
---

# Setting up a Google Cloud Project

**NOTE**: Most users of FuzzBench should simply [add a fuzzer]({{ site.baseurl
}}/getting-started/adding-a-new-fuzzer/) and use the FuzzBench service. This
page isn't needed for using the FuzzBench service. This page explains
how to set up a Google Cloud project for running an [experiment]({{ site.baseurl
}}/reference/glossary/#Experiment) for the first time. We don't recommend
running experiments on your own for most users. Validating results from the
FuzzBench service is a good reason to run an experiment on your own.

Currently, FuzzBench requires Google Cloud to run experiments (though this may
change, see
[FAQ]({{ site.baseurl }}/faq/#how-can-i-reproduce-the-results-or-run-fuzzbench-myself)).

The rest of this page will assume all commands are run from the root of
FuzzBench.

## Create the Project

* [Create a new Google Cloud Project](https://console.cloud.google.com/projectcreate).

* Enable billing when prompted on the Google Cloud website.

* Set `$PROJECT_NAME` in the environment:

```bash
export PROJECT_NAME=<your-project-name>
```

For the rest of this page, replace `$PROJECT_NAME` with the name of the
project you created.

* [Install Google Cloud SDK](https://cloud.google.com/sdk/install).

* Set your default project using gcloud:

```bash
gcloud config set project $PROJECT_NAME
```

## Set up the database

* [Enable the Compute Engine API](https://console.cloud.google.com/apis/library/compute.googleapis.com?q=compute%20engine)

* Create a PostgreSQL (we use PostgreSQL 11) instance using
[Google Cloud SQL](https://console.cloud.google.com/sql/create-instance-postgres).
This will take a few minutes.
We recommend using "us-central1" as the region and "us-central1-a" as the zone.
Certain links provided in this page assume "us-central1".
Note that the region you choose should be the region you use later for running
experiments.

* For the rest of this page, we will use `$PROJECT_REGION`, `$PROJECT_ZONE`,
`$POSTGRES_INSTANCE`, and `$POSTGRES_PASSWORD` to refer to the region of the
PostgreSQL instance you created, its name, and its password. Set them in your
environment:

```bash
export PROJECT_REGION=<your-postgres-region>
export PROJECT_ZONE=<your-postgres-zone>
export POSTGRES_INSTANCE=<your-postgres-instance-name>
export POSTGRES_PASSWORD=<your-postgres-password>
```

* [Download and install cloud_sql_proxy](https://cloud.google.com/sql/docs/postgres/sql-proxy)

```bash
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
```

* Connect to your postgres instance using cloud_sql_proxy:

```bash
./cloud_sql_proxy -instances=$PROJECT_NAME:$PROJECT_REGION:$POSTGRES_INSTANCE=tcp:5432
```

* (optional, but recommended) Connect to your instance to ensure you
   have all of the details right:

```bash
psql "host=127.0.0.1 sslmode=disable user=postgres"
```

Use `$POSTGRES_PASSWORD` when prompted.

* Initialize the postgres database:

```bash
PYTHONPATH=. alembic upgrade head
```

If this command fails, double check you set `POSTGRES_PASSWORD` correctly.
At this point you can kill the `cloud_sql_proxy` process.

## Google Cloud Storage buckets

* Set up Google Cloud Storage Buckets by running the commands below:

```bash
# Bucket for storing experiment artifacts such as corpora, coverage binaries,
# crashes etc.
gsutil mb gs://$DATA_BUCKET_NAME

# Bucket for storing HTML reports.
gsutil mb gs://$REPORT_BUCKET_NAME
```

You can pick any (globally unique) names you'd like for `$DATA_BUCKET_NAME` and
`$REPORT_BUCKET_NAME`.

* Make the report bucket public so it can be viewed from your browser:

```bash
gsutil iam ch allUsers:objectViewer gs://$REPORT_BUCKET_NAME
```

## Dispatcher image and container registry setup

* Build the dispatcher image:

```bash
docker build -f docker/dispatcher-image/Dockerfile \
    -t gcr.io/$PROJECT_NAME/dispatcher-image docker/dispatcher-image/
```

FuzzBench uses an instance running this image to manage most of the experiment.

* [Enable Google Container Registry API](https://console.cloud.google.com/apis/api/containerregistry.googleapis.com/overview)
to use the container registry.

* Push `dispatcher-image` to the docker registry:

```bash
docker push gcr.io/$PROJECT_NAME/dispatcher-image
```

* [Switch the registry's visibility to public](https://console.cloud.google.com/gcr/settings).

## Enable required APIs

* [Enable the IAM API](https://console.cloud.google.com/apis/api/iam.googleapis.com/landing)
so that FuzzBench can authenticate to Google Cloud APIs and services.

* [Enable the error reporting API](https://console.cloud.google.com/apis/library/clouderrorreporting.googleapis.com)
so that FuzzBench can report errors to the
[Google Cloud error reporting dashboard](https://console.cloud.google.com/errors)

* [Enable Cloud Build API](https://console.cloud.google.com/apis/library/cloudbuild.googleapis.com)
so that FuzzBench can build docker images using Google Cloud Build, a platform
optimized for doing so.

* [Enable Cloud SQL Admin API](https://console.cloud.google.com/apis/library/sqladmin.googleapis.com)
so that FuzzBench can connect to the database.

## Configure networking

* Go to the networking page for the network you want to run your experiment in.
[This](https://console.cloud.google.com/networking/subnetworks/details/us-central1/default)
is the networking page for the default network in "us-central1". It is best if
you use `$POSTGRES_REGION` for this.

* Click the edit icon. Turn "Private Google access" to "On". Press "Save".

* This allows the trial runner instances to use Google Cloud APIs since they do
  not have external IP addresses.

## Request CPU quota increase

* FuzzBench uses a 96 core Google Compute Engine instance for measuring trials
and single core instances for each trial in your experiment.

* Go to the quotas page for the region you will use for experiments.
[This](https://console.cloud.google.com/iam-admin/quotas?location=us-central1)
is the quotas page for the "us-central1" region.

* Select the "Compute Engine API" "CPUs" quota, fill out contact details and
request a quota increase. We recommend requesting a quota limit of "1000" as
will probably be approved and is large enough for running experiments in a
reasonable amount of time.

* Wait until you receive an email confirming the quota increase.

## Run an experiment

* Follow the [guide on running an experiment]({{ site.baseurl }}/running-your-own-experiment/running-an-experiment/)

{'repo_name': 'google/fuzzbench', 'stars': '486', 'repo_language': 'Jupyter Notebook', 'file_name': 'sancov.py', 'mime_type': 'text/x-python', 'hash': 3539657646917730409, 'source_dataset': 'data'}


#!/bin/sh

# Starts the JSR289 TCK Tests which include Signature test,API tests and SPEC tests.
# Setup the environments before run JSR289 TCK.

. ${TCK_DIRECTORY}/bin/setupENV.sh

# Start JSR289 Signatre Test.
java -cp "${TCK_LIB}/servlet-2_5-api.jar:${REFERENCE_JAR}:${SIGTEST_LIB}" com.sun.tdk.signaturetest.SignatureTest -FileName ${SIGNATURE_FILE_NAME} -apiVersion 2.0 -out ${SIGNATURE_REPORT_NAME} -package javax.servlet.sip -debug -verbose

# Copy the Signature test report to signature report directory.
if [ ! -d "$SIGREPORT_HOME" ]; then
	mkdir -p ${SIGREPORT_HOME}
fi

cp ${SIGNATURE_REPORT_NAME} ${SIGREPORT_HOME}
rm ${SIGNATURE_REPORT_NAME}

cd ${TCK_HOME}
echo ant home ${ANT_HOME}
#${ANT_HOME}/bin/ant -no_config run-tck
export ANT_LIB=${ANT_HOME}/lib
export LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
export LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
echo LOCALCLASSPATH $LOCALCLASSPATH
export CLASSPATH=$ANT_LIB/ant-launcher.jar:$CLASSPATH
echo CLASSPATH $CLASSPATH

java $ANT_OPTS -classpath $LOCALCLASSPATH -Dant.home=$ANT_HOME -Dant.library.dir=$ANT_LIB $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp $CLASSPATH run-tck
cd ./bin

{'repo_name': 'RestComm/sip-servlets', 'stars': '192', 'repo_language': 'Java', 'file_name': 'web.xml', 'mime_type': 'text/plain', 'hash': 1741537071775959590, 'source_dataset': 'data'}


# Beats Powerbeats Pro
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.

### Parametric EQs
In case of using parametric equalizer, apply preamp of **-7.8dB** and build filters manually
with these parameters. The first 5 filters can be used independently.
When using independent subset of filters, apply preamp of **-7.3dB**.

| Type    | Fc       |    Q | Gain    |
|:--------|:---------|:-----|:--------|
| Peaking | 46 Hz    | 0.31 | -3.0 dB |
| Peaking | 1305 Hz  | 1.94 | -2.3 dB |
| Peaking | 2722 Hz  | 2.68 | -3.4 dB |
| Peaking | 3622 Hz  | 4.32 | 5.1 dB  |
| Peaking | 6783 Hz  | 2.06 | 6.7 dB  |
| Peaking | 4683 Hz  | 2.09 | 0.9 dB  |
| Peaking | 4715 Hz  | 5.04 | -2.4 dB |
| Peaking | 4727 Hz  | 4    | -0.5 dB |
| Peaking | 9749 Hz  | 2.79 | -3.4 dB |
| Peaking | 18816 Hz | 0.23 | 3.5 dB  |

### Fixed Band EQs
In case of using fixed band (also called graphic) equalizer, apply preamp of **-4.9dB**
(if available) and set gains manually with these parameters.

| Type    | Fc       |    Q | Gain    |
|:--------|:---------|:-----|:--------|
| Peaking | 31 Hz    | 1.41 | -2.7 dB |
| Peaking | 62 Hz    | 1.41 | -2.4 dB |
| Peaking | 125 Hz   | 1.41 | -1.9 dB |
| Peaking | 250 Hz   | 1.41 | -0.1 dB |
| Peaking | 500 Hz   | 1.41 | 0.3 dB  |
| Peaking | 1000 Hz  | 1.41 | -1.1 dB |
| Peaking | 2000 Hz  | 1.41 | -2.7 dB |
| Peaking | 4000 Hz  | 1.41 | 2.8 dB  |
| Peaking | 8000 Hz  | 1.41 | 3.9 dB  |
| Peaking | 16000 Hz | 1.41 | 3.8 dB  |

### Graphs
![](./Beats%20Powerbeats%20Pro.png)

{'repo_name': 'jaakkopasanen/AutoEq', 'stars': '1868', 'repo_language': 'Jupyter Notebook', 'file_name': 'Yinyoo Ash ParametricEQ.txt', 'mime_type': 'text/plain', 'hash': 4887194307840215551, 'source_dataset': 'data'}


<?php

/*
 * This file is part of PHPExifTool.
 *
 * (c) 2012 Romain Neutron <imprec@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace PHPExiftool\Driver\Tag\DICOM;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class OverlaysGray extends AbstractTag
{

    protected $Id = '60xx,1200';

    protected $Name = 'OverlaysGray';

    protected $FullName = 'DICOM::Main';

    protected $GroupName = 'DICOM';

    protected $g0 = 'DICOM';

    protected $g1 = 'DICOM';

    protected $g2 = 'Image';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Overlays Gray';
}

{'repo_name': 'romainneutron/PHPExiftool', 'stars': '112', 'repo_language': 'PHP', 'file_name': 'MetadataBagTest.php', 'mime_type': 'text/x-php', 'hash': 3755028377029130961, 'source_dataset': 'data'}


/* src/libjasper/include/jasper/jas_config.h.  Generated by configure.  */
/* src/libjasper/include/jasper/jas_config.h.in.  Generated from configure.ac by autoheader.  */

/* Avoid problems due to multiple inclusion. */
#ifndef JAS_CONFIG_H
#define JAS_CONFIG_H

/* This preprocessor symbol identifies the version of JasPer. */
#define	JAS_VERSION "1.900.1"
/* If configure is being used, this symbol will be defined automatically
  at this point in the configuration header file. */

/* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
  unless the JasPer software is being built under Microsoft Windows
  using Microsoft Visual C. */
#if !defined(JAS_WIN_MSVC_BUILD)
/* A configure-based build is being used. */

/* Extra debugging support */
/* #undef DEBUG */

/* Debugging memory allocator */
/* #undef DEBUG_MEMALLOC */

/* Debugging overflow detection */
/* #undef DEBUG_OVERFLOW */

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */

/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1

/* Define to 1 if you have the `getrusage' function. */
#define HAVE_GETRUSAGE 1

/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */

/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the <stdbool.h> header file. */
#define HAVE_STDBOOL_H 1

/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Have variable length arrays */
#define HAVE_VLA 1

/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1

/* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */

/* JasPer configure */
#define JAS_CONFIGURE 1

/* JasPer version */
#define JAS_VERSION "1.900.1"

/* Name of package */
#define PACKAGE "jasper"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME "jasper"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "jasper 1.900.1"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "jasper"

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.900.1"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "1.900.1"

/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `__inline__' or `__inline' if that's what the C compiler
   calls it, or to nothing if 'inline' is not supported under any name.  */
#ifndef __cplusplus
/* #undef inline */
#endif

/* Define to `long long' if <sys/types.h> does not define. */
#define longlong long long

/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */

/* Define to `int' if <sys/types.h> does not define. */
/* #undef ssize_t */

/* Define to `unsigned char' if <sys/types.h> does not define. */
#define uchar unsigned char

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef uint */

/* Define to `unsigned long' if <sys/types.h> does not define. */
/* #undef ulong */

/* Define to `unsigned long long' if <sys/types.h> does not define. */
#define ulonglong unsigned long long

/* Define to `unsigned short' if <sys/types.h> does not define. */
/* #undef ushort */

#else
/* A configure-based build is not being used. */
#include <jasper/jas_config2.h>
#endif

#endif

{'repo_name': 'cmu-sei/SCALe', 'stars': '242', 'repo_language': 'C', 'file_name': '215846638.txt', 'mime_type': 'text/plain', 'hash': 7206710892949055528, 'source_dataset': 'data'}


using System;
using sw = System.Windows;
using swc = System.Windows.Controls;
using Eto.Forms;

namespace Eto.Wpf.Forms.Controls
{
	public class CheckBoxHandler : WpfControl<swc.CheckBox, CheckBox, CheckBox.ICallback>, CheckBox.IHandler
	{
		readonly swc.Border border;

		public override sw.FrameworkElement ContainerControl
		{
			get { return border; }
		}

		public CheckBoxHandler ()
		{
			Control = new swc.CheckBox {
				IsThreeState = false,
				VerticalAlignment = sw.VerticalAlignment.Center,
				VerticalContentAlignment = sw.VerticalAlignment.Center
			};
			Control.Checked += (sender, e) => Callback.OnCheckedChanged(Widget, EventArgs.Empty);
			Control.Unchecked += (sender, e) => Callback.OnCheckedChanged(Widget, EventArgs.Empty);
			Control.Indeterminate += (sender, e) => Callback.OnCheckedChanged(Widget, EventArgs.Empty);

			border = new EtoBorder { Handler = this, Child = Control };
		}

		public override Eto.Drawing.Color BackgroundColor
		{
			get { return border.Background.ToEtoColor(); }
			set { border.Background = value.ToWpfBrush(Control.Background); }
		}

		public override bool UseMousePreview { get { return true; } }

		public override bool UseKeyPreview { get { return true; } }

		public bool? Checked
		{
			get { return Control.IsChecked; }
			set { Control.IsChecked = value; }
		}

		public string Text
		{
			get { return (Control.Content as string).ToEtoMnemonic(); }
			set { Control.Content = value.ToPlatformMnemonic(); }
		}

		public bool ThreeState
		{
			get { return Control.IsThreeState; }
			set { Control.IsThreeState = value; }
		}
	}
}

{'repo_name': 'picoe/Eto', 'stars': '2541', 'repo_language': 'C#', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': 7610617040068650413, 'source_dataset': 'data'}


; Utilities for writing test ROMs

; In NVRAM so these can be used before initializing runtime,
; then runtime initialized without clearing them
nv_res test_code ; code of current test
nv_res test_name,2 ; address of name of current test, or 0 of none

; Sets current test code and optional name. Also resets
; checksum.
; Preserved: A, X, Y
.macro set_test code,name
	pha
	lda #code
	jsr set_test_
	.ifblank name
		setb test_name+1,0
	.else
		.local Addr
		setw test_name,Addr
		seg_data RODATA,{Addr: .byte name,0}
	.endif
	pla
.endmacro

set_test_:
	sta test_code
	jmp reset_crc

; Initializes testing module
init_testing = init_crc

; Reports that all tests passed
tests_passed:
	jsr print_filename
	print_str newline,"Passed"
	lda #0
	jmp exit

; Reports "Done" if set_test has never been used,
; "Passed" if set_test 0 was last used, or
; failure if set_test n was last used.
tests_done:
	ldx test_code
	jeq tests_passed
	inx
	bne test_failed
	jsr print_filename
	print_str newline,"Done"
	lda #0
	jmp exit

; Reports that the current test failed. Prints code and
; name last set with set_test, or just "Failed" if none
; have been set yet.
test_failed:
	ldx test_code

	; Treat $FF and 0 as 1, in case it wasn't ever set
	beq @unset
	inx
	bne :+
@unset: inx
	stx test_code
:
	; If code >= 2, print name
	cpx #2-1    ; -1 due to inx above
	blt :+
	lda test_name+1
	beq :+
	jsr print_newline
	sta addr+1
	lda test_name
	sta addr
	jsr print_str_addr
	jsr print_newline
:
	jsr print_filename

	; End program
	lda test_code
	jmp exit

; If checksum doesn't match expected, reports failed test.
; Clears checksum afterwards.
; Preserved: A, X, Y
.macro check_crc expected
	jsr_with_addr check_crc_,{.dword expected}
.endmacro

check_crc_:
	pha
	jsr is_crc_
	bne :+
	jsr reset_crc
	pla
	rts

:   jsr print_newline
	jsr print_crc
	jmp test_failed

{'repo_name': 'koute/pinky', 'stars': '591', 'repo_language': 'Rust', 'file_name': 'normalize.css', 'mime_type': 'text/plain', 'hash': 3938246712075615008, 'source_dataset': 'data'}


using DotLiquid.Exceptions;
using NUnit.Framework;

namespace DotLiquid.Tests
{
    [TestFixture]
    public class ParsingQuirksTests
    {
        [Test]
        public void TestErrorWithCss()
        {
            const string text = " div { font-weight: bold; } ";
            Template template = Template.Parse(text);
            Assert.AreEqual(text, template.Render());
            Assert.AreEqual(1, template.Root.NodeList.Count);
            Assert.IsInstanceOf<string>(template.Root.NodeList[0]);
        }

        [Test]
        public void TestRaiseOnSingleCloseBrace()
        {
            Assert.Throws<SyntaxException>(() => Template.Parse("text {{method} oh nos!"));
        }

        [Test]
        public void TestRaiseOnLabelAndNoCloseBrace()
        {
            Assert.Throws<SyntaxException>(() => Template.Parse("TEST {{ "));
        }

        [Test]
        public void TestRaiseOnLabelAndNoCloseBracePercent()
        {
            Assert.Throws<SyntaxException>(() => Template.Parse("TEST {% "));
        }

        [Test]
        public void TestErrorOnEmptyFilter()
        {
            Assert.DoesNotThrow(() =>
            {
                Template.Parse("{{test |a|b|}}");
                Template.Parse("{{test}}");
                Template.Parse("{{|test|}}");
            });
        }

        [Test]
        public void TestMeaninglessParens()
        {
            Hash assigns = Hash.FromAnonymousObject(new { b = "bar", c = "baz" });
            Helper.AssertTemplateResult(" YES ", "{% if a == 'foo' or (b == 'bar' and c == 'baz') or false %} YES {% endif %}", assigns);
        }

        [Test]
        public void TestUnexpectedCharactersSilentlyEatLogic()
        {
            Helper.AssertTemplateResult(" YES ", "{% if true && false %} YES {% endif %}");
            Helper.AssertTemplateResult("", "{% if false || true %} YES {% endif %}");
        }
    }
}

{'repo_name': 'dotliquid/dotliquid', 'stars': '719', 'repo_language': 'C#', 'file_name': 'LocalFileSystem.cs', 'mime_type': 'text/plain', 'hash': -7786827941750133134, 'source_dataset': 'data'}


// Bootstrap Grid only
//
// Includes relevant variables and mixins for the regular (non-flexbox) grid
// system, as well as the generated predefined classes (e.g., `.col-4-sm`).

//
// Variables
//

@import "custom";
@import "variables";

//
// Grid mixins
//

@import "mixins/clearfix";
@import "mixins/breakpoints";
@import "mixins/grid-framework";
@import "mixins/grid";

@import "grid";

{'repo_name': 'kzima/vuestrap', 'stars': '110', 'repo_language': 'JavaScript', 'file_name': '_size.scss', 'mime_type': 'text/plain', 'hash': 2881818825646981063, 'source_dataset': 'data'}


#! /usr/bin/env python
"""
This script adds a license file to a DMG. Requires Xcode and a plain ascii text
license file.
Obviously only runs on a Mac.

Copyright (C) 2011-2013 Jared Hobbs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
import os
import sys
import tempfile
import optparse

class Path(str):
    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        os.unlink(self)

def mktemp(dir=None, suffix=''):
    (fd, filename) = tempfile.mkstemp(dir=dir, suffix=suffix)
    os.close(fd)
    return Path(filename)

def main(options, args):
    dmgFile, license = args
    with mktemp('.') as tmpFile:
        with open(tmpFile, 'w') as f:
            f.write("""data 'TMPL' (128, "LPic") {
        $"1344 6566 6175 6C74 204C 616E 6775 6167"
        $"6520 4944 4457 5244 0543 6F75 6E74 4F43"
        $"4E54 042A 2A2A 2A4C 5354 430B 7379 7320"
        $"6C61 6E67 2049 4444 5752 441E 6C6F 6361"
        $"6C20 7265 7320 4944 2028 6F66 6673 6574"
        $"2066 726F 6D20 3530 3030 4457 5244 1032"
        $"2D62 7974 6520 6C61 6E67 7561 6765 3F44"
        $"5752 4404 2A2A 2A2A 4C53 5445"
};

data 'LPic' (5000) {
        $"0000 0002 0000 0000 0000 0000 0004 0000"
};

data 'STR#' (5000, "English buttons") {
        $"0006 0D45 6E67 6C69 7368 2074 6573 7431"
        $"0541 6772 6565 0844 6973 6167 7265 6505"
        $"5072 696E 7407 5361 7665 2E2E 2E7A 4966"
        $"2079 6F75 2061 6772 6565 2077 6974 6820"
        $"7468 6520 7465 726D 7320 6F66 2074 6869"
        $"7320 6C69 6365 6E73 652C 2063 6C69 636B"
        $"2022 4167 7265 6522 2074 6F20 6163 6365"
        $"7373 2074 6865 2073 6F66 7477 6172 652E"
        $"2020 4966 2079 6F75 2064 6F20 6E6F 7420"
        $"6167 7265 652C 2070 7265 7373 2022 4469"
        $"7361 6772 6565 2E22"
};

data 'STR#' (5002, "English") {
        $"0006 0745 6E67 6C69 7368 0541 6772 6565"
        $"0844 6973 6167 7265 6505 5072 696E 7407"
        $"5361 7665 2E2E 2E7B 4966 2079 6F75 2061"
        $"6772 6565 2077 6974 6820 7468 6520 7465"
        $"726D 7320 6F66 2074 6869 7320 6C69 6365"
        $"6E73 652C 2070 7265 7373 2022 4167 7265"
        $"6522 2074 6F20 696E 7374 616C 6C20 7468"
        $"6520 736F 6674 7761 7265 2E20 2049 6620"
        $"796F 7520 646F 206E 6F74 2061 6772 6565"
        $"2C20 7072 6573 7320 2244 6973 6167 7265"
        $"6522 2E"
};\n\n""")
            with open(license, 'r') as l:
                kind = 'RTF ' if license.lower().endswith('.rtf') else 'TEXT'
                f.write('data \'%s\' (5000, "English") {\n' % kind)
                def escape(s):
                    return s.strip().replace('\\', '\\\\').replace('"', '\\"')

                for line in l:
                    if len(line) < 1000:
                        f.write('    "' + escape(line) + '\\n"\n')
                    else:
                        for liner in line.split('.'):
                            f.write('    "' + escape(liner) + '. \\n"\n')
                f.write('};\n\n')
            f.write("""data 'styl' (5000, "English") {
        $"0003 0000 0000 000C 0009 0014 0000 0000"
        $"0000 0000 0000 0000 0027 000C 0009 0014"
        $"0100 0000 0000 0000 0000 0000 002A 000C"
        $"0009 0014 0000 0000 0000 0000 0000"
};\n""")
        os.system('hdiutil unflatten -quiet "%s"' % dmgFile)
        ret = os.system('%s -a %s -o "%s"' %
                        (options.rez, tmpFile, dmgFile))
        os.system('hdiutil flatten -quiet "%s"' % dmgFile)
        if options.compression is not None:
            os.system('cp %s %s.temp.dmg' % (dmgFile, dmgFile))
            os.remove(dmgFile)
            if options.compression == "bz2":
                os.system('hdiutil convert %s.temp.dmg -format UDBZ -o %s' %
                          (dmgFile, dmgFile))
            elif options.compression == "gz":
                os.system('hdiutil convert %s.temp.dmg -format ' % dmgFile +
                          'UDZO -imagekey zlib-devel=9 -o %s' % dmgFile)
            os.remove('%s.temp.dmg' % dmgFile)
    if ret == 0:
        print "Successfully added license to '%s'" % dmgFile
    else:
        print "Failed to add license to '%s'" % dmgFile

if __name__ == '__main__':
    parser = optparse.OptionParser()
    parser.set_usage("""%prog <dmgFile> <licenseFile> [OPTIONS]
  This program adds a software license agreement to a DMG file.
  It requires Xcode and either a plain ascii text <licenseFile>
  or a <licenseFile.rtf> with the RTF contents.

  See --help for more details.""")
    parser.add_option(
        '--rez',
        '-r',
        action='store',
        default='/Applications/Xcode.app/Contents/Developer/Tools/Rez',
        help='The path to the Rez tool. Defaults to %default'
    )
    parser.add_option(
        '--compression',
        '-c',
        action='store',
        choices=['bz2', 'gz'],
        default=None,
        help='Optionally compress dmg using specified compression type. '
             'Choices are bz2 and gz.'
    )
    options, args = parser.parse_args()
    cond = len(args) != 2
    if not os.path.exists(options.rez):
        print 'Failed to find Rez at "%s"!\n' % options.rez
        cond = True
    if cond:
        parser.print_usage()
        sys.exit(1)
    main(options, args)

{'repo_name': 'OpenCPN/OpenCPN', 'stars': '540', 'repo_language': 'C', 'file_name': 'PluginInstall.cmake', 'mime_type': 'text/plain', 'hash': -1246081245018135525, 'source_dataset': 'data'}


{
   "application": "{{ app }}",
   "description": "Upsert scaling policy {{ server_group }}",
   "job": [
      {
         "serverGroupName": "{{ server_group }}",
         "credentials": "{{ env }}",
         "region": "{{ region }}",
         "provider": "aws",
         "adjustmentType": "ChangeInCapacity",
         "alarm":{
            "region": "{{ region }}",
            "actionsEnabled": true,
            "comparisonOperator": "{{ scaling_policy.scaling_metric.comparison_operator }}",
            "dimensions": {{ scaling_policy.scaling_metric.dimensions|tojson|safe }},
            "evaluationPeriods": {{ scaling_policy.scaling_metric.evaluation_periods }},
            "period": {{ scaling_policy.scaling_metric.evaluation_period }},
            "threshold": {{ scaling_policy.scaling_metric.threshold }},
            "namespace": "{{ scaling_policy.scaling_metric.namespace }}",
            "metricName": "{{ scaling_policy.scaling_metric.metric_name }}",
            "statistic": "{{ scaling_policy.scaling_metric.statistic }}",
            "alarmActionArns":[],
            "insufficientDataActionArns":[]
         },
         "step": {
            "estimatedInstanceWarmup": {{ scaling_policy.instance_warmup | default(300) }},
            "metricAggregationType": "{{ scaling_policy.scaling_metric.statistic }}",
            "stepAdjustments": {{ scaling_policy.scaling_metric.steps|tojson|safe }}
         },
         "type": "upsertScalingPolicy",
         "user": "foremast"
      }
   ]
}

{'repo_name': 'foremast/foremast', 'stars': '252', 'repo_language': 'Python', 'file_name': 'test_api.py', 'mime_type': 'text/x-python', 'hash': 7706782621976387259, 'source_dataset': 'data'}


# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
  advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at conduct@sourced.tech. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

{'repo_name': 'graniet/operative-framework', 'stars': '452', 'repo_language': 'Go', 'file_name': 'cron.go', 'mime_type': 'text/plain', 'hash': -7414748894813059617, 'source_dataset': 'data'}


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

#ifndef _OSAPI_H_
#define _OSAPI_H_

//#include <string.h>
#include "os_type.h"
#include "user_config.h"

void ets_bzero(void *s, size_t n);
void ets_delay_us(uint32_t us);
void ets_install_putc1(void (*p)(char c));

#define os_bzero ets_bzero
#define os_delay_us ets_delay_us
#define os_install_putc1 ets_install_putc1

int ets_memcmp(const void *str1, const void *str2, unsigned int nbyte);
void *ets_memcpy(void *dest, const void *src, unsigned int nbyte);
void *ets_memmove(void *dest, const void *src, unsigned int nbyte);
void *ets_memset(void *dest, int val, unsigned int nbyte);

int ets_strcmp(const char *s1, const char *s2);
char *ets_strcpy(char *s1, const char *s2);
int ets_strlen(const char *s);
int ets_strncmp(const char *s1, const char *s2, unsigned int n);
char *ets_strncpy(char *s1, const char *s2, unsigned int n);
char *ets_strstr(const char *s1, const char *s2);

#define os_memcmp ets_memcmp
#define os_memcpy ets_memcpy
#define os_memmove ets_memmove
#define os_memset ets_memset
#define os_strcat strcat
#define os_strchr strchr
#define os_strcmp ets_strcmp
#define os_strcpy ets_strcpy
#define os_strlen ets_strlen
#define os_strncmp ets_strncmp
#define os_strncpy ets_strncpy
#define os_strstr ets_strstr

void ets_timer_arm_new(os_timer_t *ptimer, uint32_t time, bool repeat_flag, bool ms_flag);
void ets_timer_disarm(os_timer_t *ptimer);
void ets_timer_setfn(os_timer_t *ptimer, os_timer_func_t *pfunction, void *parg);

#ifdef USE_US_TIMER
#define os_timer_arm_us(a, b, c) ets_timer_arm_new(a, b, c, 0)
#endif
#define os_timer_arm(a, b, c) ets_timer_arm_new(a, b, c, 1)
#define os_timer_disarm ets_timer_disarm
#define os_timer_setfn ets_timer_setfn

int ets_sprintf(char *str, const char *format, ...)  __attribute__ ((format (printf, 2, 3)));
int os_printf_plus(const char *format, ...)  __attribute__ ((format (printf, 1, 2)));

#define os_sprintf  ets_sprintf

#ifdef USE_OPTIMIZE_PRINTF
#define os_printf(fmt, ...) do {	\
	static const char flash_str[] ICACHE_RODATA_ATTR STORE_ATTR = fmt;	\
	os_printf_plus(flash_str, ##__VA_ARGS__);	\
	} while(0)
#else
#define os_printf	os_printf_plus
#endif

unsigned long os_random(void);
int os_get_random(unsigned char *buf, size_t len);

#endif

{'repo_name': 'devicehive/esp8266-firmware', 'stars': '140', 'repo_language': 'C', 'file_name': 'json.h', 'mime_type': 'text/x-c', 'hash': -6276457503388914810, 'source_dataset': 'data'}


using System;

namespace Spark.Engine.Maintenance
{
    internal class MaintenanceLock : IDisposable
    {
        public MaintenanceLockMode Mode { get; private set; }

        public bool IsLocked => Mode > MaintenanceLockMode.None;

        public MaintenanceLock(MaintenanceLockMode mode)
        {
            Mode = mode;
        }

        public void Unlock()
        {
            Mode = MaintenanceLockMode.None;
        }

        public void Dispose()
        {
            Unlock();
        }
    }
}

{'repo_name': 'FirelyTeam/spark', 'stars': '157', 'repo_language': 'C#', 'file_name': 'CreateIndexes.js', 'mime_type': 'text/plain', 'hash': -5872145268857766880, 'source_dataset': 'data'}


// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2010 Manuel Yguel <manuel.yguel@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_POLYNOMIAL_SOLVER_H
#define EIGEN_POLYNOMIAL_SOLVER_H

namespace Eigen {

/** \ingroup Polynomials_Module
 *  \class PolynomialSolverBase.
 *
 * \brief Defined to be inherited by polynomial solvers: it provides
 * convenient methods such as
 *  - real roots,
 *  - greatest, smallest complex roots,
 *  - real roots with greatest, smallest absolute real value,
 *  - greatest, smallest real roots.
 *
 * It stores the set of roots as a vector of complexes.
 *
 */
template< typename _Scalar, int _Deg >
class PolynomialSolverBase
{
  public:
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Deg==Dynamic ? Dynamic : _Deg)

    typedef _Scalar                             Scalar;
    typedef typename NumTraits<Scalar>::Real    RealScalar;
    typedef std::complex<RealScalar>            RootType;
    typedef Matrix<RootType,_Deg,1>             RootsType;

    typedef DenseIndex Index;

  protected:
    template< typename OtherPolynomial >
    inline void setPolynomial( const OtherPolynomial& poly ){
      m_roots.resize(poly.size()); }

  public:
    template< typename OtherPolynomial >
    inline PolynomialSolverBase( const OtherPolynomial& poly ){
      setPolynomial( poly() ); }

    inline PolynomialSolverBase(){}

  public:
    /** \returns the complex roots of the polynomial */
    inline const RootsType& roots() const { return m_roots; }

  public:
    /** Clear and fills the back insertion sequence with the real roots of the polynomial
     * i.e. the real part of the complex roots that have an imaginary part which
     * absolute value is smaller than absImaginaryThreshold.
     * absImaginaryThreshold takes the dummy_precision associated
     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
     *
     * \param[out] bi_seq : the back insertion sequence (stl concept)
     * \param[in]  absImaginaryThreshold : the maximum bound of the imaginary part of a complex
     *  number that is considered as real.
     * */
    template<typename Stl_back_insertion_sequence>
    inline void realRoots( Stl_back_insertion_sequence& bi_seq,
        const RealScalar& absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() ) const
    {
      using std::abs;
      bi_seq.clear();
      for(Index i=0; i<m_roots.size(); ++i )
      {
        if( abs( m_roots[i].imag() ) < absImaginaryThreshold ){
          bi_seq.push_back( m_roots[i].real() ); }
      }
    }

  protected:
    template<typename squaredNormBinaryPredicate>
    inline const RootType& selectComplexRoot_withRespectToNorm( squaredNormBinaryPredicate& pred ) const
    {
      Index res=0;
      RealScalar norm2 = numext::abs2( m_roots[0] );
      for( Index i=1; i<m_roots.size(); ++i )
      {
        const RealScalar currNorm2 = numext::abs2( m_roots[i] );
        if( pred( currNorm2, norm2 ) ){
          res=i; norm2=currNorm2; }
      }
      return m_roots[res];
    }

  public:
    /**
     * \returns the complex root with greatest norm.
     */
    inline const RootType& greatestRoot() const
    {
      std::greater<Scalar> greater;
      return selectComplexRoot_withRespectToNorm( greater );
    }

    /**
     * \returns the complex root with smallest norm.
     */
    inline const RootType& smallestRoot() const
    {
      std::less<Scalar> less;
      return selectComplexRoot_withRespectToNorm( less );
    }

  protected:
    template<typename squaredRealPartBinaryPredicate>
    inline const RealScalar& selectRealRoot_withRespectToAbsRealPart(
        squaredRealPartBinaryPredicate& pred,
        bool& hasArealRoot,
        const RealScalar& absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() ) const
    {
      using std::abs;
      hasArealRoot = false;
      Index res=0;
      RealScalar abs2(0);

      for( Index i=0; i<m_roots.size(); ++i )
      {
        if( abs( m_roots[i].imag() ) < absImaginaryThreshold )
        {
          if( !hasArealRoot )
          {
            hasArealRoot = true;
            res = i;
            abs2 = m_roots[i].real() * m_roots[i].real();
          }
          else
          {
            const RealScalar currAbs2 = m_roots[i].real() * m_roots[i].real();
            if( pred( currAbs2, abs2 ) )
            {
              abs2 = currAbs2;
              res = i;
            }
          }
        }
        else
        {
          if( abs( m_roots[i].imag() ) < abs( m_roots[res].imag() ) ){
            res = i; }
        }
      }
      return numext::real_ref(m_roots[res]);
    }

    template<typename RealPartBinaryPredicate>
    inline const RealScalar& selectRealRoot_withRespectToRealPart(
        RealPartBinaryPredicate& pred,
        bool& hasArealRoot,
        const RealScalar& absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() ) const
    {
      using std::abs;
      hasArealRoot = false;
      Index res=0;
      RealScalar val(0);

      for( Index i=0; i<m_roots.size(); ++i )
      {
        if( abs( m_roots[i].imag() ) < absImaginaryThreshold )
        {
          if( !hasArealRoot )
          {
            hasArealRoot = true;
            res = i;
            val = m_roots[i].real();
          }
          else
          {
            const RealScalar curr = m_roots[i].real();
            if( pred( curr, val ) )
            {
              val = curr;
              res = i;
            }
          }
        }
        else
        {
          if( abs( m_roots[i].imag() ) < abs( m_roots[res].imag() ) ){
            res = i; }
        }
      }
      return numext::real_ref(m_roots[res]);
    }

  public:
    /**
     * \returns a real root with greatest absolute magnitude.
     * A real root is defined as the real part of a complex root with absolute imaginary
     * part smallest than absImaginaryThreshold.
     * absImaginaryThreshold takes the dummy_precision associated
     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
     * If no real root is found the boolean hasArealRoot is set to false and the real part of
     * the root with smallest absolute imaginary part is returned instead.
     *
     * \param[out] hasArealRoot : boolean true if a real root is found according to the
     *  absImaginaryThreshold criterion, false otherwise.
     * \param[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide
     *  whether or not a root is real.
     */
    inline const RealScalar& absGreatestRealRoot(
        bool& hasArealRoot,
        const RealScalar& absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() ) const
    {
      std::greater<Scalar> greater;
      return selectRealRoot_withRespectToAbsRealPart( greater, hasArealRoot, absImaginaryThreshold );
    }

    /**
     * \returns a real root with smallest absolute magnitude.
     * A real root is defined as the real part of a complex root with absolute imaginary
     * part smallest than absImaginaryThreshold.
     * absImaginaryThreshold takes the dummy_precision associated
     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
     * If no real root is found the boolean hasArealRoot is set to false and the real part of
     * the root with smallest absolute imaginary part is returned instead.
     *
     * \param[out] hasArealRoot : boolean true if a real root is found according to the
     *  absImaginaryThreshold criterion, false otherwise.
     * \param[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide
     *  whether or not a root is real.
     */
    inline const RealScalar& absSmallestRealRoot(
        bool& hasArealRoot,
        const RealScalar& absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() ) const
    {
      std::less<Scalar> less;
      return selectRealRoot_withRespectToAbsRealPart( less, hasArealRoot, absImaginaryThreshold );
    }

    /**
     * \returns the real root with greatest value.
     * A real root is defined as the real part of a complex root with absolute imaginary
     * part smallest than absImaginaryThreshold.
     * absImaginaryThreshold takes the dummy_precision associated
     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
     * If no real root is found the boolean hasArealRoot is set to false and the real part of
     * the root with smallest absolute imaginary part is returned instead.
     *
     * \param[out] hasArealRoot : boolean true if a real root is found according to the
     *  absImaginaryThreshold criterion, false otherwise.
     * \param[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide
     *  whether or not a root is real.
     */
    inline const RealScalar& greatestRealRoot(
        bool& hasArealRoot,
        const RealScalar& absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() ) const
    {
      std::greater<Scalar> greater;
      return selectRealRoot_withRespectToRealPart( greater, hasArealRoot, absImaginaryThreshold );
    }

    /**
     * \returns the real root with smallest value.
     * A real root is defined as the real part of a complex root with absolute imaginary
     * part smallest than absImaginaryThreshold.
     * absImaginaryThreshold takes the dummy_precision associated
     * with the _Scalar template parameter of the PolynomialSolver class as the default value.
     * If no real root is found the boolean hasArealRoot is set to false and the real part of
     * the root with smallest absolute imaginary part is returned instead.
     *
     * \param[out] hasArealRoot : boolean true if a real root is found according to the
     *  absImaginaryThreshold criterion, false otherwise.
     * \param[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide
     *  whether or not a root is real.
     */
    inline const RealScalar& smallestRealRoot(
        bool& hasArealRoot,
        const RealScalar& absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() ) const
    {
      std::less<Scalar> less;
      return selectRealRoot_withRespectToRealPart( less, hasArealRoot, absImaginaryThreshold );
    }

  protected:
    RootsType               m_roots;
};

#define EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( BASE )  \
  typedef typename BASE::Scalar                 Scalar;       \
  typedef typename BASE::RealScalar             RealScalar;   \
  typedef typename BASE::RootType               RootType;     \
  typedef typename BASE::RootsType              RootsType;

/** \ingroup Polynomials_Module
  *
  * \class PolynomialSolver
  *
  * \brief A polynomial solver
  *
  * Computes the complex roots of a real polynomial.
  *
  * \param _Scalar the scalar type, i.e., the type of the polynomial coefficients
  * \param _Deg the degree of the polynomial, can be a compile time value or Dynamic.
  *             Notice that the number of polynomial coefficients is _Deg+1.
  *
  * This class implements a polynomial solver and provides convenient methods such as
  * - real roots,
  * - greatest, smallest complex roots,
  * - real roots with greatest, smallest absolute real value.
  * - greatest, smallest real roots.
  *
  * WARNING: this polynomial solver is experimental, part of the unsuported Eigen modules.
  *
  *
  * Currently a QR algorithm is used to compute the eigenvalues of the companion matrix of
  * the polynomial to compute its roots.
  * This supposes that the complex moduli of the roots are all distinct: e.g. there should
  * be no multiple roots or conjugate roots for instance.
  * With 32bit (float) floating types this problem shows up frequently.
  * However, almost always, correct accuracy is reached even in these cases for 64bit
  * (double) floating types and small polynomial degree (<20).
  */
template< typename _Scalar, int _Deg >
class PolynomialSolver : public PolynomialSolverBase<_Scalar,_Deg>
{
  public:
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Deg==Dynamic ? Dynamic : _Deg)

    typedef PolynomialSolverBase<_Scalar,_Deg>    PS_Base;
    EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( PS_Base )

    typedef Matrix<Scalar,_Deg,_Deg>                 CompanionMatrixType;
    typedef EigenSolver<CompanionMatrixType>         EigenSolverType;

  public:
    /** Computes the complex roots of a new polynomial. */
    template< typename OtherPolynomial >
    void compute( const OtherPolynomial& poly )
    {
      eigen_assert( Scalar(0) != poly[poly.size()-1] );
      internal::companion<Scalar,_Deg> companion( poly );
      companion.balance();
      m_eigenSolver.compute( companion.denseMatrix() );
      m_roots = m_eigenSolver.eigenvalues();
    }

  public:
    template< typename OtherPolynomial >
    inline PolynomialSolver( const OtherPolynomial& poly ){
      compute( poly ); }

    inline PolynomialSolver(){}

  protected:
    using                   PS_Base::m_roots;
    EigenSolverType         m_eigenSolver;
};

template< typename _Scalar >
class PolynomialSolver<_Scalar,1> : public PolynomialSolverBase<_Scalar,1>
{
  public:
    typedef PolynomialSolverBase<_Scalar,1>    PS_Base;
    EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( PS_Base )

  public:
    /** Computes the complex roots of a new polynomial. */
    template< typename OtherPolynomial >
    void compute( const OtherPolynomial& poly )
    {
      eigen_assert( Scalar(0) != poly[poly.size()-1] );
      m_roots[0] = -poly[0]/poly[poly.size()-1];
    }

  protected:
    using                   PS_Base::m_roots;
};

} // end namespace Eigen

#endif // EIGEN_POLYNOMIAL_SOLVER_H

{'repo_name': 'RSIA-LIESMARS-WHU/LSHBOX', 'stars': '232', 'repo_language': 'C++', 'file_name': 'psdlsh.h', 'mime_type': 'text/x-c++', 'hash': -925219995362434819, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: 3b6f0eabe163b3041a08b124b6c59dee
timeCreated: 1486348460
licenseType: Pro
TextureImporter:
  fileIDToRecycleName: {}
  serializedVersion: 2
  mipmaps:
    mipMapMode: 0
    enableMipMap: 0
    linearTexture: 1
    correctGamma: 0
    fadeOut: 0
    borderMipMap: 0
    mipMapFadeDistanceStart: 1
    mipMapFadeDistanceEnd: 3
  bumpmap:
    convertToNormalMap: 0
    externalNormalMap: 0
    heightScale: 0.25
    normalMapFilter: 0
  isReadable: 1
  grayScaleToAlpha: 0
  generateCubemap: 0
  cubemapConvolution: 0
  cubemapConvolutionSteps: 7
  cubemapConvolutionExponent: 1.5
  seamlessCubemap: 0
  textureFormat: -3
  maxTextureSize: 1024
  textureSettings:
    filterMode: 0
    aniso: 1
    mipBias: -1
    wrapMode: 1
  nPOTScale: 0
  lightmap: 0
  rGBM: 0
  compressionQuality: 50
  allowsAlphaSplitting: 0
  spriteMode: 0
  spriteExtrude: 1
  spriteMeshType: 1
  alignment: 0
  spritePivot: {x: 0.5, y: 0.5}
  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
  spritePixelsToUnits: 100
  alphaIsTransparency: 0
  textureType: 2
  buildTargetSettings:
  - buildTarget: Android
    maxTextureSize: 1024
    textureFormat: -3
    compressionQuality: 50
    allowsAlphaSplitting: 0
  spriteSheet:
    sprites: []
    outline: []
  spritePackingTag:
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'Acgmart/ET-MultiplyDemos', 'stars': '110', 'repo_language': 'C#', 'file_name': 'ImmutableTypeClassMapConvention.cs.meta', 'mime_type': 'text/plain', 'hash': 3780714847257790594, 'source_dataset': 'data'}


//
//  AppDelegate.swift
//  FoodPin
//
//  Created by scott on 14-10-31.
//  Copyright (c) 2014年 scott. All rights reserved.
//

import UIKit
import CoreData

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        // Change navigation bar appearance
        UINavigationBar.appearance().barTintColor = UIColor(red: 231.0/255.0, green: 95.0/255.0, blue: 53.0/255.0, alpha: 0.3)

        UINavigationBar.appearance().tintColor = UIColor.whiteColor()

        UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:UIColor.whiteColor(), NSFontAttributeName:UIFont(name: "AvenirNextCondensed-DemiBold", size: 22.0)!]

        // Change status bar style
        UIApplication.sharedApplication().statusBarStyle = .LightContent

        // Change toolbar style
        // UIBarButtonItem.appearance().tintColor = UIColor(red: 235.0/255.0, green: 73.0/255.0, blue: 27.0/255.0, alpha: 1.0)
        UIToolbar.appearance().barTintColor = UIColor(red: 237.0/255.0, green: 240.0/255.0, blue: 243.0/255.0, alpha: 0.5)

        UITabBar.appearance().tintColor = UIColor(red: 235.0/255.0, green: 75.0/255.0, blue: 27.0/255.0, alpha: 1.0)
        UITabBar.appearance().barTintColor = UIColor.whiteColor()
        // UITabBar.appearance().selectionIndicatorImage = UIImage(named: "tabitem_selected")

        return true

    }

    func applicationWillResignActive(application: UIApplication) {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    }

    func applicationDidEnterBackground(application: UIApplication) {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    }

    func applicationWillEnterForeground(application: UIApplication) {
        // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    }

    func applicationDidBecomeActive(application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    func applicationWillTerminate(application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }

    // MARK: - Core Data stack

    lazy var applicationDocumentsDirectory: NSURL = {
        // The directory the application uses to store the Core Data store file. This code uses a directory named "net.aimeizi.CoreDataDemo" in the application's documents Application Support directory.
        let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
        return urls[urls.count-1] as NSURL
        }()

    lazy var managedObjectModel: NSManagedObjectModel = {
        // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
        let modelURL = NSBundle.mainBundle().URLForResource("FoodPin", withExtension: "momd")!
        return NSManagedObjectModel(contentsOfURL: modelURL)!
        }()

    lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator? = {
        // The persistent store coordinator for the application. This implementation creates and return a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail.
        // Create the coordinator and store
        var coordinator: NSPersistentStoreCoordinator? = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
        let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("FoodPin.sqlite")
        var error: NSError? = nil
        var failureReason = "There was an error creating or loading the application's saved data."
        if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil, error: &error) == nil {
            coordinator = nil
            // Report any error we got.
            let dict = NSMutableDictionary()
            dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
            dict[NSLocalizedFailureReasonErrorKey] = failureReason
            dict[NSUnderlyingErrorKey] = error
            error = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
            // Replace this with code to handle the error appropriately.
            // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
            NSLog("Unresolved error \(error), \(error!.userInfo)")
            abort()
        }

        return coordinator
        }()

    lazy var managedObjectContext: NSManagedObjectContext? = {
        // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail.
        let coordinator = self.persistentStoreCoordinator
        if coordinator == nil {
            return nil
        }
        var managedObjectContext = NSManagedObjectContext()
        managedObjectContext.persistentStoreCoordinator = coordinator
        return managedObjectContext
        }()

    // MARK: - Core Data Saving support

    func saveContext () {
        if let moc = self.managedObjectContext {
            var error: NSError? = nil
            if moc.hasChanges && !moc.save(&error) {
                // Replace this implementation with code to handle the error appropriately.
                // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
                NSLog("Unresolved error \(error), \(error!.userInfo)")
                abort()
            }
        }
    }
}

{'repo_name': 'ameizi/FoodPin', 'stars': '202', 'repo_language': 'Swift', 'file_name': 'Contents.json', 'mime_type': 'text/plain', 'hash': -5364144539735647315, 'source_dataset': 'data'}


/*
 * Gradient image (utility class for debugging GPU code)
 * gradient_image.cpp
 *
 * Copyright (c) 2019-2020 Balazs Nagy,
 * Robotics and Perception Group, University of Zurich
 * 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.
 *
 * 3. Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 <opencv2/highgui.hpp>
#include "test/groundtruth/gradient_image.h"

GradientImage::GradientImage(const std::size_t & width,
                             const std::size_t & height,
                             Type type) {
  image_ = cv::Mat(height,width,CV_8UC1);
  // initialize with a gradient pattern
  unsigned char * data_ptr = image_.data;
  unsigned char data = 0x00;
  for(std::size_t r=0;r<height;++r,data_ptr+=image_.step - width) {
    if(type == Type::HORIZONTAL) {
      data = 0x00;
    }
    for(std::size_t c=0;c<width;++c,++data_ptr) {
      *data_ptr = data;
      if(type == Type::HORIZONTAL) {
        ++data;
      }
    }
    if(type == Type::VERTICAL) {
      ++data;
    }
  }
}

void GradientImage::display(void) const {
  cv::imshow("Gradient test image", image_);
  cv::waitKey();
}

{'repo_name': 'uzh-rpg/vilib', 'stars': '104', 'repo_language': 'C++', 'file_name': 'subframe_pool.h', 'mime_type': 'text/x-c++', 'hash': 5578628024031181582, 'source_dataset': 'data'}


#include <agency/agency.hpp>
#include <agency/execution/executor/detail/utility.hpp>
#include <agency/cuda.hpp>
#include <iostream>

#include "../../test_executors.hpp"

template<class Executor>
void test(Executor exec)
{
  using shape_type = agency::executor_shape_t<Executor>;
  using index_type = agency::executor_index_t<Executor>;

  size_t shape = 10;

  auto result = agency::detail::blocking_bulk_twoway_execute_with_collected_result(exec,
    [](index_type idx, std::vector<int>& shared_arg)
    {
      return shared_arg[idx];
    },
    shape,
    [=]{ return std::vector<int>(shape); },    // results
    [=]{ return std::vector<int>(shape, 13); } // shared_arg
  );

  assert(std::vector<int>(shape, 13) == result);
}

template<class Executor>
void test2(Executor exec)
{
  using shape_type = agency::executor_shape_t<Executor>;
  using index_type = agency::executor_index_t<Executor>;

  shape_type shape{10,10};

  using container_type = agency::experimental::basic_ndarray<int, shape_type, agency::executor_allocator_t<Executor,int>>;

  auto result = agency::detail::blocking_bulk_twoway_execute_with_collected_result(exec,
    [] __host__ __device__ (index_type, int& outer_shared_arg, int& inner_shared_arg)
    {
      return outer_shared_arg + inner_shared_arg;
    },
    shape,
    [=] __host__ __device__ { return container_type(shape); }, // results
    [] __host__ __device__  { return 7; },                     // outer_shared_arg
    [] __host__ __device__  { return 13; }                     // inner_shared_arg
  );

  assert(container_type(shape, 7 + 13) == result);
}

int main()
{
  test(bulk_twoway_executor());
  test(bulk_then_executor());
  test(not_a_bulk_twoway_executor());
  test(not_a_bulk_then_executor());
  test(complete_bulk_executor());

  test2(agency::cuda::grid_executor());

  std::cout << "OK" << std::endl;

  return 0;
}

{'repo_name': 'agency-library/agency', 'stars': '124', 'repo_language': 'C++', 'file_name': 'invoke.hpp', 'mime_type': 'text/x-c++', 'hash': 7294623300854070003, 'source_dataset': 'data'}


$stocks-icon-width: 14px;
$stocks-icon-height: 10px;

.stocks__stocks-container {
    @include clearfix;

    clear: left;
    margin-top: $gs-baseline * 1.5;
    margin-bottom: 0;
    overflow-x: scroll;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;

    &::-webkit-scrollbar {
        display: none;
    }

    @include mq(tablet) {
        margin-bottom: $gs-baseline / 2;
    }
}

.stocks__divider {
    width: 50%;

    @include mq(leftCol) {
        border-top: 1px dotted $brightness-86;
    }

    @include mq(wide) {
        .has-page-skin & {
            border-top: 0;
        }
    }
}

.stocks__icon {
    display: none;
    width: $stocks-icon-width;
    height: $stocks-icon-height;
    margin-right: 3px;
}

@mixin stock($change, $colour, $icon) {
    .stocks__stock-value--#{$change} {
        .stocks__change {
            color: $colour;
        }

        .stocks__icon--#{$icon} {
            display: inline;
        }
    }
}

@include stock('positive', green-bold, up);
@include stock('negative', news-main, down);
@include stock('level', brightness-46, same);

.stocks__stock-value {
    display: inline-block;
    padding-left: 6px;
    padding-right: $gs-gutter;
    min-width: 60%;
    border-right: 1px dotted $brightness-86;

    @include mq(mobileLandscape) {
        min-width: 35%;
    }

    @include mq(tablet) {
        min-width: gs-span(2) + $gs-gutter;
    }

    @include mq(leftCol) {
        display: block;
        margin-bottom: $gs-baseline;
        padding-left: 0;
        padding-right: 0;
        border-right: 0;
    }

    @include mq(wide) {
        .has-page-skin & {
            display: table-cell;
            padding-left: 6px;
            padding-right: $gs-gutter;
            min-width: 150px;
            border-right: 1px dotted $brightness-86;
        }
    }

    &:first-of-type {
        padding-left: 0;
    }

    &:last-of-type {
        border-right: 0;
    }
}

.stocks__value {
    @include clearfix;
}

.stocks__price {
    margin-right: .25em;
}

.stocks__closed,
.stocks__closed--inline {
    color: $brightness-46;
}

.stocks__closed {
    display: none;

    @include mq(leftCol) {
        display: block;
    }

    @include mq(wide) {
        .has-page-skin & {
            display: none;
        }
    }
}

.stocks__closed--inline {
    font-weight: 400;
    margin-left: .5em;
    display: inline;

    @include mq(leftCol) {
        display: none;
    }

    @include mq(wide) {
        .has-page-skin & {
            display: inline;
        }
    }
}

.stocks__price,
.stocks__change,
.stocks__icon {
    float: left;

    @include mq(leftCol) {
        float: none;
    }

    @include mq(wide) {
        .has-page-skin & {
            float: left;
        }
    }
}

.stocks__icon {
    @include mq(leftCol) {
        float: left;
    }
}

.stocks__name {
    font-weight: 600;
}

.stocks__price,
.stocks__change,
.stocks__icon,
.stocks__closed {
    @include mq(leftCol) {
        margin-top: -4px;
    }

    @include mq(wide) {
        .has-page-skin & {
            margin-top: 0;
        }
    }
}

{'repo_name': 'guardian/frontend', 'stars': '5473', 'repo_language': 'HTML', 'file_name': 'logback.xml', 'mime_type': 'text/plain', 'hash': 5706774969186348687, 'source_dataset': 'data'}


;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL

(ns app.common.uuid
  (:refer-clojure :exclude [next uuid zero?])
  #?(:clj (:import java.util.UUID))
  #?(:clj
     (:require [clj-uuid :as impl]
               [clojure.core :as c])
     :cljs
     (:require [app.common.uuid-impl :as impl]
               [cljs.core :as c])))

(def zero #uuid "00000000-0000-0000-0000-000000000000")

(defn zero?
  [v]
  (= zero v))

(defn next
  []
  #?(:clj (impl/v1)
     :cljs (impl/v1)))

(defn random
  "Alias for clj-uuid/v4."
  []
  #?(:clj (impl/v4)
     :cljs (impl/v4)))

#?(:clj
   (defn namespaced
     [ns data]
     (impl/v5 ns data)))

(defn uuid
  "Parse string uuid representation into proper UUID instance."
  [s]
  #?(:clj (UUID/fromString s)
     :cljs (c/uuid s)))

#?(:clj
   (defn custom
     ([a] (UUID. 0 a))
     ([b a] (UUID. b a))))

{'repo_name': 'uxbox/uxbox', 'stars': '993', 'repo_language': 'Clojure', 'file_name': 'config.edn', 'mime_type': 'text/plain', 'hash': -6235964052817118399, 'source_dataset': 'data'}


<?php
declare(strict_types=1);
namespace PHPJava\Kernel\Mnemonics;

use PHPJava\Kernel\Types\Float_;

final class _fload_3 extends AbstractOperationCode implements OperationCodeInterface
{
    protected $isStackingOperation = true;

    public function getOperands(): ?Operands
    {
        parent::getOperands();
        if ($this->operands !== null) {
            return $this->operands;
        }
        return $this->operands = new Operands();
    }

    public function execute(): void
    {
        parent::execute();
        $this->pushToOperandStack(
            Float_::get(
                $this->getLocalStorage(3)
            )
        );
    }
}

{'repo_name': 'php-java/php-java', 'stars': '312', 'repo_language': 'PHP', 'file_name': 'AssertFields.php', 'mime_type': 'text/x-php', 'hash': 6103450988095905103, 'source_dataset': 'data'}


Crypt Component from ZF2
========================

This is the Crypt component for ZF2.

- File issues at https://github.com/zendframework/zf2/issues
- Create pull requests against https://github.com/zendframework/zf2
- Documentation is at http://framework.zend.com/docs

LICENSE
-------

The files in this archive are released under the [Zend Framework
license](http://framework.zend.com/license), which is a 3-clause BSD license.

{'repo_name': 'eryx/php-framework-benchmark', 'stars': '131', 'repo_language': 'PHP', 'file_name': 'base.html.twig', 'mime_type': 'text/html', 'hash': -6979503615001787149, 'source_dataset': 'data'}


/*
 * Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
 * Distributed under the terms of the MIT License.
 */
#ifndef _PACKAGE__INSTALLATION_LOCATION_INFO_H_
#define _PACKAGE__INSTALLATION_LOCATION_INFO_H_

#include <Node.h>
#include <String.h>

#include <package/PackageDefs.h>
#include <package/PackageInfoSet.h>

namespace BPackageKit {

class BInstallationLocationInfo {
public:
								BInstallationLocationInfo();
								~BInstallationLocationInfo();

			void				Unset();

			BPackageInstallationLocation Location() const;
			void				SetLocation(
									BPackageInstallationLocation location);

			const node_ref&		BaseDirectoryRef() const;
			status_t			SetBaseDirectoryRef(const node_ref& ref);

			const node_ref&		PackagesDirectoryRef() const;
			status_t			SetPackagesDirectoryRef(const node_ref& ref);

			const BPackageInfoSet& LatestActivePackageInfos() const;
			void				SetLatestActivePackageInfos(
									const BPackageInfoSet& infos);

			const BPackageInfoSet& LatestInactivePackageInfos() const;
			void				SetLatestInactivePackageInfos(
									const BPackageInfoSet& infos);

			const BPackageInfoSet& CurrentlyActivePackageInfos() const;
			void				SetCurrentlyActivePackageInfos(
									const BPackageInfoSet& infos);

			const BString&		OldStateName() const;
			void				SetOldStateName(const BString& name);

			int64				ChangeCount() const;
			void				SetChangeCount(int64 changeCount);

private:
			BPackageInstallationLocation fLocation;
			node_ref			fBaseDirectoryRef;
			node_ref			fPackageDirectoryRef;
			BPackageInfoSet		fLatestActivePackageInfos;
			BPackageInfoSet		fLatestInactivePackageInfos;
			BPackageInfoSet		fCurrentlyActivePackageInfos;
			BString				fOldStateName;
			int64				fChangeCount;
};

}	// namespace BPackageKit

#endif	// _PACKAGE__INSTALLATION_LOCATION_INFO_H_

{'repo_name': 'haiku/haiku', 'stars': '971', 'repo_language': 'C++', 'file_name': 'bootstrap', 'mime_type': 'text/plain', 'hash': -5834363120358209753, 'source_dataset': 'data'}


#ifndef UTENSOR_MATRIX_KERNELS
#define UTENSOR_MATRIX_KERNELS
#include "context.hpp"
#include "operatorBase.hpp"
#include "ActivationFncs.hpp"

namespace uTensor {
DECLARE_ERROR(InvalidMatrixMultIndicesError);

// Assume c is already allocated to the correct size
// Naive implementation
template <typename T>
void matrix_mult_kernel(Tensor& c, const Tensor& a, const Tensor& b) {
  // Decide on c shape
  TensorShape a_shape = a->get_shape();
  TensorShape b_shape = b->get_shape();
  TensorShape c_shape = c->get_shape();
  if (a_shape.num_dims() > 2 || b_shape.num_dims() > 2 ||
      c_shape.num_dims() > 2 || a_shape[1] != b_shape[0] ||
      a_shape[0] != c_shape[0] || b_shape[1] != c_shape[1]) {
    uTensor_printf("[Error] Invalid matrix multiple shape mismatch\n");
    Context::get_default_context()->throwError(
        new InvalidMatrixMultIndicesError);
  }

  for (uint32_t i = 0; i < a_shape[0]; i++) {
    for (uint32_t j = 0; j < b_shape[1]; j++) {
      // c(i, j) = static_cast<T>(0);
      T tmp = 0;
      for (uint32_t k = 0; k < a_shape[1]; k++) {
        tmp += static_cast<T>(a(i, k)) * static_cast<T>(b(k, j));
        // printf("i, j, k : %d %d %d %d %d\n", i, j, k, static_cast<T>(a(i, k))
        // , static_cast<T>(b(k, j)));
      }
      c(i, j) = tmp;
    }
  }
}

template <typename T, typename Bias>
void matrix_mult_kernel_v2(Tensor& output, const Tensor& input,
                                  const Tensor& filter, Bias bias,
                                  Fuseable::Activation<T> activation){
  const TensorShape& input_shape = input->get_shape();
  const TensorShape& filter_shape = filter->get_shape();
  TensorShape& output_shape = output->get_shape();

  const int filter_dim_count = filter_shape.num_dims();
  const int batches = output_shape[0];
  const int output_depth = output_shape[1];
  if (!(output_depth <= filter_shape[filter_dim_count - 1])) {
    uTensor_printf("[Error] Invalid matrix multiple shape mismatch\n");
    Context::get_default_context()->throwError(
        new InvalidMatrixMultIndicesError);
  }
  const int accum_depth = filter_shape[0];
  for (int b = 0; b < batches; ++b) {
    for (int out_c = 0; out_c < output_depth; ++out_c) {
      T acc = 0;
      for (int d = 0; d < accum_depth; ++d) {
        // TODO write this in tensor form
        T input_val = static_cast<T>(input(b, d, 0, 0));
        T filter_val = static_cast<T>(filter(d, out_c, 0, 0));
        acc += filter_val * input_val;
      }
      acc += static_cast<T>(bias(out_c));
      acc = activation(acc);
      output(b, out_c, 0, 0) = static_cast<T>(acc);
    }
  }
}

}
#endif

{'repo_name': 'uTensor/uTensor', 'stars': '1156', 'repo_language': 'C++', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -3550452789091910718, 'source_dataset': 'data'}


//
//     Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//

#import <HomeKitDaemon/NSObject-Protocol.h>

@class NSArray, NSString;

@protocol HMDAccessorySettingProtocol <NSObject>
@property(readonly, copy) id value;
@property(readonly, copy) NSArray *constraints;
@property(readonly, copy) NSString *name;
@property(readonly) long long type;
@end

{'repo_name': 'LeoNatan/Apple-Runtime-Headers', 'stars': '131', 'repo_language': 'None', 'file_name': 'CDStructures.h', 'mime_type': 'text/x-c', 'hash': -6615757220274370696, 'source_dataset': 'data'}