<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cli.Fyi - A Potentially Useful Command Line Query Tool</title>
    <meta name="description" content="Quickly get information about emails, IP addresses, URLs and lots  more
    from the command line (or Browser)">

    <link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">
    <link rel="stylesheet" href="/assets/vendor/bulma.min.css">
    <link rel="stylesheet" href="/assets/vendor/highlightjs.theme.css">
    <link rel="stylesheet" href="/assets/styles.css">

    <link rel="apple-touch-icon" sizes="180x180" href="/assets/icons/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16x16.png">
    <link rel="manifest" href="/assets/icons/manifest.json">
    <link rel="mask-icon" href="/assets/icons/safari-pinned-tab.svg" color="#2a4c55">
    <link rel="shortcut icon" href="/assets/icons/favicon.ico">
    <meta name="msapplication-config" content="/assets/icons/browserconfig.xml">
    <meta name="theme-color" content="#2a4c55">

    <?php include __DIR__ . '/header-snippets.php'; ?>

                            Available Commands

                            About

                            GitHub

                        A Potentially Useful Command Line Query Tool

                        cli.fyi lets you to quickly retrieve information about emails, IP addresses, URLs and
                        lots
                        more
                        from the command line (or Browser)

                                Tweet

                        Available Commands

$ curl cli.fyi/btc
{
"type": "Bitcoin (BTC) Prices",
"data": {
    "USD ($)": 6973.74,
    "EUR (€)": 6087.48,
    "GBP (£)": 5416.63
    ...
    }
}

                        Toggle Menu

                        Available Commands

Crypto Currency Prices

Email Address Information

IP Address Information

Media/URL Information

Client Information

String Hash Values

Domain Name Information

Date/Time Information

Programming Language Links

Country Information

Popular Emojis

Help

                        General

FAQ

Credits

GitHub

Available Commands

Crypto Currency Prices

                            Returns the latest prices for 1000+ crypto currencies.

Example Request

$ curl cli.fyi/BTC

Example Response

{
    "type": "Bitcoin (BTC) Prices",
    "data": {
        "USD ($)": 7299.97,
        "EUR (€)": 6338.15,
        "GBP (£)": 5636.17,
        "AUD ($)": 9642.69,
        "CAD ($)": 9415.97,
        "BRL (R$)": 24559.16,
        "CHF (CHF)": 7528.65,
        "CLP ($)": 4675371.21,
        "CNY (¥)": 51398.69,
        "DKK (kr)": 51231.61,
        "HKD ($)": 57194.57,
        "INR (₹)": 490045.94,
        "ISK (kr)": 843540.55,
        "JPY (¥)": 833628.57,
        "KRW (₩)": 8250226.92,
        "NZD ($)": 12189.99,
        "PLN (zł)": 26717.84,
        "RUB (RUB)": 416001.11,
        "SEK (kr)": 60000.02,
        "SGD ($)": 10016.97,
        "THB (฿)": 230183.34,
        "TWD (NT$)": 219596.24
    }
}

                            BTC can be replaced with almost any crypto currency symbol.
                            Data is provided by
                            CryptoCompare.com.

Email Address Information

                            Returns information about an email address.

Example Request

$ curl cli.fyi/john.doe@10minutemail.com

Example Response

{
    "type": "Email Query",
    "data": {
        "validMxRecords": true,
        "freeProvider": false,
        "disposableEmail": true,
        "businessOrRoleEmail": false,
        "validHost": true
    }
}

IP Address Information

                            Returns geo-location and ASN/Organisation information related to an IP address.

Example Request

$ curl cli.fyi/8.8.8.8

Example Response

{
    "type": "IP Address",
    "data": {
        "organisation": "Google Inc.",
        "country": "United States",
        "countryCode": "US",
        "city": "Mountain View, California",
        "continent": "North America",
        "latitude": "37.751",
        "longitude": "-97.822"
    }
}

Media/URL Information

                            Returns detailed information about virtually any URL. Supports extracting data
                            from oEmbed, TwitterCards, OpenGraph, LinkPulse, Sailthru Meta-data, HTML and Dublin Core.

Example Request

$ curl cli.fyi/https://vimeo.com/231191863

Example Response

{
    "type": "Vimeo Url",
    "data": {
        "title": "Low Earth Orbit",
        "description": "Orbital drone movements are theorbits...",
        "url": "https://vimeo.com/231191863",
        "type": "video",
        "tags": "Drone",
        "image": "https://i.vimeocdn.com/video/651947838_640.jpg",
        "imageWidth": 640,
        "imageHeight": 360,
        "code": "[embed code...]",
        "width": 640,
        "height": 360,
        "authorName": "Visual Suspect",
        "authorUrl": "https://vimeo.com/vsuspect",
        "providerName": "Vimeo",
        "providerUrl": "https://vimeo.com/",
        .......
}

Client Information

                            Returns information about the person/machine making the request.

Example Request

$ curl cli.fyi/me

Example Response

{
    "type": "Client Query",
    "data": {
        "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36",
        "iPAddress": "109.255.10.10",
        "browser": "Chrome Dev 62.0.3202.75",
        "operatingSystem": "Linux",
        "iPAddressInformation": {
            "organisation": "Liberty Global Operations B.V.",
            "country": "Ireland",
            "countryCode": "IE",
            "city": "Dublin",
            "continent": "Europe",
            "latitude": "53.3472",
            "longitude": "-6.2439"
        }
    }
}

Domain Whois / DNS information

                            Returns whois and DNS information for a given domain.

Example Request

$ curl cli.fyi/github.com

Example Response

{
    "type": "Domain Name",
    "data": {
        "dns": [
            "github.com.  3600 IN MX 5 ALT2.ASPMX.L.GOOGLE.com.",
            "github.com.  3600 IN MX 5 ALT1.ASPMX.L.GOOGLE.com.",
            "github.com.  40 IN A 192.30.253.113",
            "github.com.  40 IN A 192.30.253.112",
            "github.com.  651 IN NS ns-520.awsdns-01.net.",
            "github.com.  651 IN NS ns-421.awsdns-52.com.",
            "github.com.  651 IN NS ns-1283.awsdns-32.org.",
            "github.com.  900 IN SOA ns-1707.awsdns-21.co.uk. awsdns-hostmaster.amazon.com. (",
            "    1          ; serial",
            "    7200       ; refresh (2 hours)",
            "    900        ; retry (15 minutes)",
            "    1209600    ; expire (2 weeks)",
            "    86400      ; minimum (1 day)",
            "    )",
            "github.com.  2350 IN TXT \"docusign=087098e3-3d46-47b7-9b4e-8a23028154cd\"",
            "github.com.  2350 IN TXT \"v=spf1 ip4:192.30.252.0/22 ip4:208.74.204.0/22 ip4:46.19.168.0/23 include:_spf.google.com include:esp.github.com include:_spf.createsend.com include:mail.zendesk.com include:servers.mcsv.net ~all\""
        ],
        "whois": [
            "Domain Name: GITHUB.COM",
            "Registry Domain ID: 1264983250_DOMAIN_COM-VRSN",
            "Registrar WHOIS Server: whois.markmonitor.com",
            "Registrar URL: http://www.markmonitor.com",
          	....
        ]
    }
}

String Hash Values

                            Returns various hash values for a given string.

Example Request

$ curl cli.fyi/hash/HelloWorld

Example Response

{
    "type": "String Hash Values",
    "data": {
        "md2": "74655651e01700a25fff9c0127382098",
        "md4": "f4e0ffdf5d6d530edb234b381805efc1",
        "md5": "292e4a0acc0fb7179dcf58ef02cc2f76",
        "sha1": "65cc79bfae2cf9f63475727ee35fd5b4fedeed38",
        "sha224": "6a89b325fe53d631a92a75ba43ee8829d686cf135f129af24f9de0ba",
        "sha256": "ddec6733cd3fd3fe0ffd13bb477cc28220e8fdbafb217eb16b586af2ea9baa8f",
        "sha384": "c83fcbc94b784da0f3223e2c6c69dbc610de24697f7fe26597705af3b946a1dc8d8dcc7aca349579fbea8abab7ecd148",
        "sha512/224": "5177294c0c14d3fd34672bb4cad4de3a82454247fcdb1b4b6800c4e6",
        "sha512/256": "e373b3e9a3600b5bd7b9609fd0c0fd3cc47e192c0525cff7b197b683bc2b04f0",
        .................
    }
}

                            Available Hashes:
                            <?= implode(', ',
                                    hash_algos()) ?>

Date/Time Information

                            Returns information about the current UTC date and time.

Example Request

$ curl cli.fyi/time

Example Response

{
    "type": "Date/Time Information (UTC)",
    "data": {
        "day": "03",
        "month": "11",
        "year": "2017",
        "hour": "16",
        "minutes": "11",
        "seconds": "22",
        "dayName": "Friday",
        "MonthName": "November",
        "amOrPm": "pm",
        "unixEpoch": 1509728122,
        "formattedDate": "Fri, 03 Nov 2017 16:55:22 +0000"
    }
}

Programming Language Links

                            Returns useful and up-to-date links for programming languages.

                            PHP, Javascript &
                            Java currently supported.

Example Request

$ curl cli.fyi/PHP

Example Response

{
    "type": "PHP Query",
    "data": {
        "documentation": "http://php.net/docs.php",
        "links": {
            "Awesome PHP": "https://github.com/ziadoz/awesome-php",
            "PHP The Right Way": "http://www.phptherightway.com",
            "Docker Repository": "https://hub.docker.com/_/php/",
            "PHP Fig": "http://www.php-fig.org/",
            "PHP Security": "http://phpsecurity.readthedocs.io/en/latest/index.html"
        }
    }
}

Country Information

                            Returns useful information about a given country.

Example Request

$ curl cli.fyi/united-states

Example Response

{
    "type": "Country Query",
    "data": {
        "commonName": "United States",
        "officialName": "United States of America",
        "topLevelDomain": ".us",
        "currency": "USD",
        "callingCode": "+1",
        "capitalCity": "Washington D.C.",
        "region": "Americas",
        "subRegion": "Northern America",
        "latitude": 38,
        "longitude": -97,
        "demonym": "American",
        "isLandlocked": "No",
        "areaKm": 9372610,
        "officialLanguages": "English"
    }
}

Popular Emojis

                            Returns a selection of popular unicode emojis.

Example Request

$ curl cli.fyi/emojis

Example Response

{
    "type": "Emoji",
    "data": {
        "huggingFace": "🤗",
        "tearsOfJoy": "😂",
        "grinningFace": "😀",
        "rofl": "🤣",
        "smiling": "😊",
        "tongueOut": "😋",
        "kissingFace": "😘",
        "thinking": "🤔",
        "neutralFace": "😐"
    }
}

Help

                            Returns all possible query types and example queries.

Example Request

$ curl cli.fyi/help

Example Response

{
    "type": "Help",
    "data": {
        "IP Address Query": {
            "example": "https://cli.fyi/8.8.8.8"
        },
        "Media/Url Query": {
            "example": "https://cli.fyi/https://google.com"
        },
        "Email Address Query": {
            "example": "https://cli.fyi/test@10minutemail.com"
        },
        "Client (you) Query": {
            "example": "https://cli.fyi/me"
        },
        ...
    }
}

General Information

FAQ

Why?

                            cli.fyi's goal is to create a quick an easy way to fetch information
                            about IPs, emails, domains etc. directly from the command line.

Colourised Output?

                            Unfortunately Curl currently doesn't support colourised output1.
                            HTTPie
                            is a good alternative which does support colour output.

The JSON-Formatter
                            Chrome extension is a good solution for in-browser JSON formatting.

Rate Limits?

                            There are no rate limits, however we will block any IP which is abusing the service. If you
                            need to make a significant number of requests you can always
                            host your own version.

Who?

                            cli.fyi is developed by Dave Earley

                            1 To the best of my knowledge, please
                            correct me if I'm wrong.

Credits

Data

                            Cli.fyi relies on the following services & projects for its data:

                                Country Data

                                IP Data

                                Media/URL Data

                                Crypto Currency Data

Hosting

                            Cli.fyi is hosted by

                                Linode
                            .

Terms of Service

                            Cli.fyi is provided as-is. Cli.fyi makes no guarantees about the quality of the service or
                            the accuracy of data provided by the service.

    ^ Back To Top

{'repo_name': 'daveearley/cli.fyi', 'stars': '115', 'repo_language': 'PHP', 'file_name': 'programming_language_data.php', 'mime_type': 'text/x-php', 'hash': -3051668728963892630, 'source_dataset': 'data'}


package mediathek.gui.actions;

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

/**
 * Generic action for disposing dialogs.
 */
@SuppressWarnings("serial")
public class DisposeDialogAction extends AbstractAction {

    private final JDialog dlg;

    public DisposeDialogAction(JDialog dlg, String description, String shortDescription) {
        super();
        putValue(NAME, description);
        putValue(SHORT_DESCRIPTION, shortDescription);
        this.dlg = dlg;
    }

    public void actionPerformed(ActionEvent e) {
        dlg.dispose();
    }
}

{'repo_name': 'mediathekview/MediathekView', 'stars': '569', 'repo_language': 'Java', 'file_name': 'MavenWrapperDownloader.java', 'mime_type': 'text/x-c', 'hash': 1603050566835068129, 'source_dataset': 'data'}


/*
===========================================================================

Return to Castle Wolfenstein multiplayer GPL Source Code
Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company.

This file is part of the Return to Castle Wolfenstein multiplayer GPL Source Code (RTCW MP Source Code).

RTCW MP Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

RTCW MP Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with RTCW MP Source Code.  If not, see <http://www.gnu.org/licenses/>.

In addition, the RTCW MP Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the RTCW MP Source Code.  If not, please request a copy in writing from id Software at the address below.

If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.

===========================================================================
*/

/*****************************************************************************
 * name:		be_aas_move.h
 *
 * desc:		AAS
 *
 *
 *****************************************************************************/

#ifdef AASINTERN
extern aas_settings_t aassettings;
#endif //AASINTERN

//movement prediction
int AAS_PredictClientMovement( struct aas_clientmove_s *move,
							   int entnum, vec3_t origin,
							   int presencetype, int onground,
							   vec3_t velocity, vec3_t cmdmove,
							   int cmdframes,
							   int maxframes, float frametime,
							   int stopevent, int stopareanum, int visualize );
//returns true if on the ground at the given origin
int AAS_OnGround( vec3_t origin, int presencetype, int passent );
//returns true if swimming at the given origin
int AAS_Swimming( vec3_t origin );
//returns the jump reachability run start point
void AAS_JumpReachRunStart( struct aas_reachability_s *reach, vec3_t runstart );
//returns true if against a ladder at the given origin
int AAS_AgainstLadder( vec3_t origin, int ms_areanum );
//rocket jump Z velocity when rocket-jumping at origin
float AAS_RocketJumpZVelocity( vec3_t origin );
//bfg jump Z velocity when bfg-jumping at origin
float AAS_BFGJumpZVelocity( vec3_t origin );
//calculates the horizontal velocity needed for a jump and returns true this velocity could be calculated
int AAS_HorizontalVelocityForJump( float zvel, vec3_t start, vec3_t end, float *velocity );
//
void AAS_SetMovedir( vec3_t angles, vec3_t movedir );
//
int AAS_DropToFloor( vec3_t origin, vec3_t mins, vec3_t maxs );
//
void AAS_InitSettings( void );

{'repo_name': 'iortcw/iortcw', 'stars': '270', 'repo_language': 'C', 'file_name': 'sv_snapshot.c', 'mime_type': 'text/x-c', 'hash': 6322361128187803765, '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 <objc/NSObject.h>

#import <NeutrinoCore/NUImageStorage-Protocol.h>

@class NSString, NUMutableRegion, NUPixelFormat, NURegion;

@interface _NUAbstractStorage : NSObject <NUImageStorage>
{
    NUMutableRegion *_validRegion;
    long long _sizeInBytes;
    NUPixelFormat *_format;
    CDStruct_d58201db _size;
}

- (void).cxx_destruct;
@property(retain) NUPixelFormat *format; // @synthesize format=_format;
@property long long sizeInBytes; // @synthesize sizeInBytes=_sizeInBytes;
@property CDStruct_912cb5d2 size; // @synthesize size=_size;
- (void)provideMutableBuffer:(CDUnknownBlockType)arg1;
- (void)provideBuffer:(CDUnknownBlockType)arg1;
- (long long)useAsCIRenderDestinationWithRenderer:(id)arg1 block:(CDUnknownBlockType)arg2;
- (long long)useAsCIImageWithOptions:(id)arg1 renderer:(id)arg2 block:(CDUnknownBlockType)arg3;
- (long long)fillBufferWithPattern4:(unsigned int)arg1;
- (long long)writeBufferInRegion:(id)arg1 block:(CDUnknownBlockType)arg2;
- (long long)readBufferInRegion:(id)arg1 block:(CDUnknownBlockType)arg2;
- (long long)copyFromStorage:(id)arg1 region:(id)arg2;
- (void)assertIsValidInRegion:(id)arg1;
- (void)assertIsValidInRect:(CDStruct_996ac03c)arg1;
- (BOOL)isValidInRegion:(id)arg1;
- (BOOL)isValidInRect:(CDStruct_996ac03c)arg1;
- (void)invalidate;
@property(readonly) NURegion *validRegion;
- (void)validateRegion:(id)arg1;
- (void)validateRect:(CDStruct_996ac03c)arg1;
- (void)_resetSize:(CDStruct_912cb5d2)arg1 format:(id)arg2;
- (id)init;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end

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


.class public interface abstract Landroid/support/v7/app/ActionBarDrawerToggle$DelegateProvider;
.super Ljava/lang/Object;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/support/v7/app/ActionBarDrawerToggle;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x609
    name = "DelegateProvider"
.end annotation

# virtual methods
.method public abstract getDrawerToggleDelegate()Landroid/support/v7/app/ActionBarDrawerToggle$Delegate;
    .annotation build Landroid/support/annotation/Nullable;
    .end annotation
.end method

{'repo_name': 'smlbiobot/cr', 'stars': '119', 'repo_language': 'None', 'file_name': 'ab.smali', 'mime_type': 'text/plain', 'hash': 3875045875105788088, 'source_dataset': 'data'}


import { CustomSanitizer } from '../base';
import * as Options from '../options';

export interface Sanitizers<Return> {
  customSanitizer(sanitizer: CustomSanitizer): Return;

  blacklist(chars: string): Return;
  escape(): Return;
  unescape(): Return;
  ltrim(chars?: string): Return;
  normalizeEmail(options?: Options.NormalizeEmailOptions): Return;
  rtrim(chars?: string): Return;
  stripLow(keep_new_lines?: boolean): Return;
  toArray(): Return;
  toBoolean(strict?: boolean): Return;
  toDate(): Return;
  toFloat(): Return;
  toInt(radix?: number): Return;
  toLowerCase(): Return;
  toUpperCase(): Return;
  trim(chars?: string): Return;
  whitelist(chars: string): Return;
}

{'repo_name': 'express-validator/express-validator', 'stars': '4505', 'repo_language': 'TypeScript', 'file_name': 'index.ts', 'mime_type': 'text/plain', 'hash': -6202458232938846727, 'source_dataset': 'data'}


/*jslint nomen: true */
var helper = require('../helper'),
    code,
    verifier;

/*jshint maxlen: 500 */
module.exports = {
    "with a simple do-while": {
        setUp: function (cb) {
            code = [
                'var x = args[0], i=0;',
                'do { i++; } while (i < x);',
                'output = i;'
            ];
            verifier = helper.verifier(__filename, code);
            cb();
        },

        "should provide correct line coverage": function (test) {
            verifier.verify(test, [ 10 ], 10, { lines: { 1: 1, 2: 10, 3: 1 }, branches: {}, functions: {}, statements: { '1': 1, '2': 1, '3': 10, '4': 1 } });
            test.done();
        },

        "should cover single-entry into while": function (test) {
            verifier.verify(test, [ -1 ], 1, { lines: { 1: 1, 2: 1, 3: 1 }, branches: {}, functions: {}, statements: { '1': 1, '2': 1, '3': 1, '4': 1 } });
            test.done();
        }
    },
    "with a block do-while on separate line": {
        setUp: function (cb) {
            code = [
                'var x = args[0], i=0;',
                'do { ',
                '   i++; ',
                '} while (i < x);',
                'output = i;'
            ];
            verifier = helper.verifier(__filename, code);
            cb();
        },

        "should provide correct line coverage": function (test) {
            verifier.verify(test, [ 10 ], 10, { lines: { 1: 1, 2: 1, 3: 10, 5: 1 }, branches: {}, functions: {}, statements: { '1': 1, '2': 1, '3': 10, '4': 1 } });
            test.done();
        },

        "should cover single-entry into while": function (test) {
            verifier.verify(test, [ -1 ], 1, { lines: { 1: 1, 2: 1, 3: 1, 5: 1 }, branches: {}, functions: {}, statements:  { '1': 1, '2': 1, '3': 1, '4': 1 } });
            test.done();
        }
    },
    "with an ignore inside a do-while": {
        setUp: function (cb) {
            code = [
                'do { ',
                '   /* istanbul ignore next */ ',
                '   console.log("hi");',
                '} while (false);',
                'output = 10'
            ];
            verifier = helper.verifier(__filename, code);
            cb();
        },

        "should mark statement as skipped": function (test) {
            verifier.verify(test, [], 10, { lines: { '1': 1, '3': 1, '5': 1 }, branches: {}, functions: {}, statements: { '1': 1, '2': 1, '3': 1 } });
            var cov = verifier.getFileCoverage();
            test.equal(true, cov.statementMap[2].skip);
            test.done();
        }
    }
};

{'repo_name': 'zenozeng/p5.js-svg', 'stars': '216', 'repo_language': 'JavaScript', 'file_name': 'Apache-License-2.0.txt', 'mime_type': 'text/plain', 'hash': -309721790276750984, 'source_dataset': 'data'}


/*------------------------------------------------------------------------------
* convkml.c : google earth kml converter
*
*          Copyright (C) 2007-2010 by T.TAKASU, All rights reserved.
*
* references :
*     [1] Open Geospatial Consortium Inc., OGC 07-147r2, OGC(R) KML, 2008-04-14
*
* version : $Revision: 1.1 $ $Date: 2008/07/17 21:48:06 $
* history : 2007/01/20  1.0  new
*           2007/03/15  1.1  modify color sequence
*           2007/04/03  1.2  add geodetic height option
*                            support input of NMEA GGA sentence
*                            delete altitude info for track
*                            add time stamp option
*                            separate readsol.c file
*           2009/01/19  1.3  fix bug on display mark with by-q-flag option
*           2010/05/10  1.4  support api readsolt() change
*           2010/08/14  1.5  fix bug on readsolt() (2.4.0_p3)
*-----------------------------------------------------------------------------*/
#include "rtklib.h"

static const char rcsid[]="$Id: convkml.c,v 1.1 2008/07/17 21:48:06 ttaka Exp $";

/* constants -----------------------------------------------------------------*/

#define SIZP     0.2            /* mark size of rover positions */
#define SIZR     0.3            /* mark size of reference position */
#define TINT     30.0           /* time label interval (sec) */
#define HEADKML1 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
#define HEADKML2 "<kml xmlns=\"http://earth.google.com/kml/2.1\">"
#define MARKICON "http://maps.google.com/mapfiles/kml/pal2/icon18.png"

/* output track --------------------------------------------------------------*/
static void outtrack(FILE *f, const solbuf_t *solbuf, const char *color,
                     int outalt, int outtime)
{
    double pos[3];
    int i;

    fprintf(f,"<Placemark>\n");
    fprintf(f,"<name>Rover Track</name>\n");
    fprintf(f,"<Style>\n");
    fprintf(f,"<LineStyle>\n");
    fprintf(f,"<color>%s</color>\n",color);
    fprintf(f,"</LineStyle>\n");
    fprintf(f,"</Style>\n");
    fprintf(f,"<LineString>\n");
    if (outalt) fprintf(f,"<altitudeMode>absolute</altitudeMode>\n");
    fprintf(f,"<coordinates>\n");
    for (i=0;i<solbuf->n;i++) {
        ecef2pos(solbuf->data[i].rr,pos);
        if      (outalt==0) pos[2]=0.0;
        else if (outalt==2) pos[2]-=geoidh(pos);
        fprintf(f,"%13.9f,%12.9f,%5.3f\n",pos[1]*R2D,pos[0]*R2D,pos[2]);
    }
    fprintf(f,"</coordinates>\n");
    fprintf(f,"</LineString>\n");
    fprintf(f,"</Placemark>\n");
}
/* output point --------------------------------------------------------------*/
static void outpoint(FILE *fp, gtime_t time, const double *pos,
                     const char *label, int style, int outalt, int outtime)
{
    double ep[6],alt=0.0;
    char str[256]="";

    fprintf(fp,"<Placemark>\n");
    if (*label) fprintf(fp,"<name>%s</name>\n",label);
    fprintf(fp,"<styleUrl>#P%d</styleUrl>\n",style);
    if (outtime) {
        if      (outtime==2) time=gpst2utc(time);
        else if (outtime==3) time=timeadd(gpst2utc(time),9*3600.0);
        time2epoch(time,ep);
        if (!*label&&fmod(ep[5]+0.005,TINT)<0.01) {
            sprintf(str,"%02.0f:%02.0f:%02.0f",ep[3],ep[4],ep[5]);
            fprintf(fp,"<name>%s</name>\n",str);
        }
        sprintf(str,"%04.0f-%02.0f-%02.0fT%02.0f:%02.0f:%05.2fZ",
                ep[0],ep[1],ep[2],ep[3],ep[4],ep[5]);
        fprintf(fp,"<TimeStamp><when>%s</when></TimeStamp>\n",str);
    }
    fprintf(fp,"<Point>\n");
    if (outalt) {
        fprintf(fp,"<extrude>1</extrude>\n");
        fprintf(fp,"<altitudeMode>absolute</altitudeMode>\n");
        alt=pos[2]-(outalt==2?geoidh(pos):0.0);
    }
    fprintf(fp,"<coordinates>%13.9f,%12.9f,%5.3f</coordinates>\n",pos[1]*R2D,
            pos[0]*R2D,alt);
    fprintf(fp,"</Point>\n");
    fprintf(fp,"</Placemark>\n");
}
/* save kml file -------------------------------------------------------------*/
static int savekml(const char *file, const solbuf_t *solbuf, int tcolor,
                   int pcolor, int outalt, int outtime)
{
    FILE *fp;
    double pos[3];
    int i,qcolor[]={0,1,2,5,4,3,0};
    char *color[]={
        "ffffffff","ff008800","ff00aaff","ff0000ff","ff00ffff","ffff00ff"
    };
    if (!(fp=fopen(file,"w"))) {
        fprintf(stderr,"file open error : %s\n",file);
        return 0;
    }
    fprintf(fp,"%s\n%s\n",HEADKML1,HEADKML2);
    fprintf(fp,"<Document>\n");
    for (i=0;i<6;i++) {
        fprintf(fp,"<Style id=\"P%d\">\n",i);
        fprintf(fp,"  <IconStyle>\n");
        fprintf(fp,"    <color>%s</color>\n",color[i]);
        fprintf(fp,"    <scale>%.1f</scale>\n",i==0?SIZR:SIZP);
        fprintf(fp,"    <Icon><href>%s</href></Icon>\n",MARKICON);
        fprintf(fp,"  </IconStyle>\n");
        fprintf(fp,"</Style>\n");
    }
    if (tcolor>0) {
        outtrack(fp,solbuf,color[tcolor-1],outalt,outtime);
    }
    if (pcolor>0) {
        fprintf(fp,"<Folder>\n");
        fprintf(fp,"  <name>Rover Position</name>\n");
        for (i=0;i<solbuf->n;i++) {
            ecef2pos(solbuf->data[i].rr,pos);
            outpoint(fp,solbuf->data[i].time,pos,"",
                     pcolor==5?qcolor[solbuf->data[i].stat]:pcolor-1,outalt,outtime);
        }
        fprintf(fp,"</Folder>\n");
    }
    if (norm(solbuf->rb,3)>0.0) {
        ecef2pos(solbuf->rb,pos);
        outpoint(fp,solbuf->data[0].time,pos,"Reference Position",0,outalt,0);
    }
    fprintf(fp,"</Document>\n");
    fprintf(fp,"</kml>\n");
    fclose(fp);
    return 1;
}
/* convert to google earth kml file --------------------------------------------
* convert solutions to google earth kml file
* args   : char   *infile   I   input solutions file
*          char   *outfile  I   output google earth kml file ("":<infile>.kml)
*          gtime_t ts,te    I   start/end time (gpst)
*          int    tint      I   time interval (s) (0.0:all)
*          int    qflg      I   quality flag (0:all)
*          double *offset   I   add offset {east,north,up} (m)
*          int    tcolor    I   track color
*                               (0:none,1:white,2:green,3:orange,4:red,5:yellow)
*          int    pcolor    I   point color
*                               (0:none,1:white,2:green,3:orange,4:red,5:by qflag)
*          int    outalt    I   output altitude (0:off,1:elipsoidal,2:geodetic)
*          int    outtime   I   output time (0:off,1:gpst,2:utc,3:jst)
* return : status (0:ok,-1:file read,-2:file format,-3:no data,-4:file write)
* notes  : see ref [1] for google earth kml file format
*-----------------------------------------------------------------------------*/
extern int convkml(const char *infile, const char *outfile, gtime_t ts,
                   gtime_t te, double tint, int qflg, double *offset,
                   int tcolor, int pcolor, int outalt, int outtime)
{
    solbuf_t solbuf={0};
    double rr[3]={0},pos[3],dr[3];
    int i,j;
    char *p,file[1024];

    trace(3,"convkml : infile=%s outfile=%s\n",infile,outfile);

    if (!*outfile) {
        if ((p=strrchr(infile,'.'))) {
            strncpy(file,infile,p-infile);
            strcpy(file+(p-infile),".kml");
        }
        else sprintf(file,"%s.kml",infile);
    }
    else strcpy(file,outfile);

    /* read solution file */
    if (!readsolt((char **)&infile,1,ts,te,tint,qflg,&solbuf)) return -1;

    /* mean position */
    for (i=0;i<3;i++) {
        for (j=0;j<solbuf.n;j++) rr[i]+=solbuf.data[j].rr[i];
        rr[i]/=solbuf.n;
    }
    /* add offset */
    ecef2pos(rr,pos);
    enu2ecef(pos,offset,dr);
    for (i=0;i<solbuf.n;i++) {
        for (j=0;j<3;j++) solbuf.data[i].rr[j]+=dr[j];
    }
    if (norm(solbuf.rb,3)>0.0) {
        for (i=0;i<3;i++) solbuf.rb[i]+=dr[i];
    }
    /* save kml file */
    return savekml(file,&solbuf,tcolor,pcolor,outalt,outtime)?0:-4;
}

{'repo_name': 'tomojitakasu/RTKLIB', 'stars': '1270', 'repo_language': 'C', 'file_name': 'STA_IGS.txt', 'mime_type': 'text/plain', 'hash': -7389966285447908189, 'source_dataset': 'data'}


# A quick little extension to use this lib with with rails 2.3.X
# To use it, in your environment.rb or some_environment.rb you simply set
#
# config.after_initialize do
#  ActionMailer::Base.delivery_method = :amazon_ses
#  ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new(:secret_access_key => S3_CONFIG[:secret_access_key], :access_key_id => S3_CONFIG[:access_key_id])
# end

module ActionMailer
  class Base
    cattr_accessor :custom_amazon_ses_mailer

    def perform_delivery_amazon_ses(mail)
      raise 'AWS::SES::Base has not been intitialized.' unless @@custom_amazon_ses_mailer
      @@custom_amazon_ses_mailer.deliver!(mail)
    end

  end
end

{'repo_name': 'drewblas/aws-ses', 'stars': '532', 'repo_language': 'Ruby', 'file_name': 'fake_response.rb', 'mime_type': 'text/x-ruby', 'hash': -9111101399821903641, 'source_dataset': 'data'}


package org.evomaster.client.java.instrumentation.coverage.methodreplacement.classes;

import org.evomaster.client.java.instrumentation.coverage.methodreplacement.DateTimeParsingUtils;
import org.evomaster.client.java.instrumentation.coverage.methodreplacement.DistanceHelper;
import org.evomaster.client.java.instrumentation.coverage.methodreplacement.MethodReplacementClass;
import org.evomaster.client.java.instrumentation.coverage.methodreplacement.Replacement;
import org.evomaster.client.java.instrumentation.heuristic.Truthness;
import org.evomaster.client.java.instrumentation.heuristic.TruthnessUtils;
import org.evomaster.client.java.instrumentation.shared.ReplacementType;
import org.evomaster.client.java.instrumentation.shared.StringSpecialization;
import org.evomaster.client.java.instrumentation.shared.StringSpecializationInfo;
import org.evomaster.client.java.instrumentation.staticstate.ExecutionTracer;

import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.chrono.ChronoLocalDateTime;
import java.time.format.DateTimeParseException;
import java.util.Objects;

public class LocalDateTimeClassReplacement implements MethodReplacementClass {

    private static long getMillis(ChronoLocalDateTime<?> chronoLocalDateTime) {
        return chronoLocalDateTime.atZone(ZoneOffset.UTC).toInstant().toEpochMilli();
    }

    private static Truthness getIsBeforeTruthness(ChronoLocalDateTime<?> caller, ChronoLocalDateTime<?> when) {
        Objects.requireNonNull(caller);
        Objects.requireNonNull(when);

        final long a = getMillis(caller);
        final long b = getMillis(when);

        /**
         * We use the same gradient that HeuristicsForJumps.getForValueComparison()
         * used for IF_ICMPLT, ie, a < b
         */
        return TruthnessUtils.getLessThanTruthness(a, b);
    }

    @Override
    public Class<?> getTargetClass() {
        return LocalDateTime.class;
    }

    /**
     * Obtains an instance of LocalDateTime from a text string such as 2007-12-03T10:15:30.
     * The string must represent a valid date-time and is parsed using DateTimeFormatter.ISO_LOCAL_DATE_TIME.
     *
     * @param text
     * @param idTemplate
     * @return
     */
    @Replacement(type = ReplacementType.EXCEPTION, replacingStatic = true)
    public static LocalDateTime parse(CharSequence text, String idTemplate) {

        if (text != null && ExecutionTracer.isTaintInput(text.toString())) {
            ExecutionTracer.addStringSpecialization(text.toString(),
                    new StringSpecializationInfo(StringSpecialization.ISO_LOCAL_DATE_TIME, null));
        }

        if (idTemplate == null) {
            return LocalDateTime.parse(text);
        }

        try {
            LocalDateTime res = LocalDateTime.parse(text);
            ExecutionTracer.executedReplacedMethod(idTemplate, ReplacementType.EXCEPTION, new Truthness(1, 0));
            return res;
        } catch (DateTimeParseException | NullPointerException ex) {
            double h = DateTimeParsingUtils.getHeuristicToISOLocalDateTimeParsing(text);
            ExecutionTracer.executedReplacedMethod(idTemplate, ReplacementType.EXCEPTION, new Truthness(h, 1));
            throw ex;
        }
    }

    @Replacement(type = ReplacementType.BOOLEAN)
    public static boolean equals(LocalDateTime caller, Object anObject, String idTemplate) {
        Objects.requireNonNull(caller);

        if (idTemplate == null) {
            return caller.equals(anObject);
        }

        final Truthness t;
        if (anObject == null || !(anObject instanceof LocalDateTime)) {
            t = new Truthness(DistanceHelper.H_REACHED_BUT_NULL, 1d);
        } else {
            LocalDateTime anotherLocalDateTime = (LocalDateTime) anObject;
            if (caller.equals(anotherLocalDateTime)) {
                t = new Truthness(1d, 0d);
            } else {
                double base = DistanceHelper.H_NOT_NULL;
                double distance = DistanceHelper.getDistanceToEquality(caller, anotherLocalDateTime);
                double h = base + (1 - base) / (1 + distance);
                t = new Truthness(h, 1d);
            }
        }
        ExecutionTracer.executedReplacedMethod(idTemplate, ReplacementType.BOOLEAN, t);
        return caller.equals(anObject);
    }

    @Replacement(type = ReplacementType.BOOLEAN)
    public static boolean isBefore(LocalDateTime caller, ChronoLocalDateTime<?> other, String idTemplate) {
        Objects.requireNonNull(caller);

        // might throw NPE if when is null
        if (idTemplate == null) {
            return caller.isBefore(other);
        }

        final Truthness t;
        if (other == null) {
            t = new Truthness(DistanceHelper.H_REACHED_BUT_NULL, 1d);
        } else {
            t = getIsBeforeTruthness(caller, other);
        }
        ExecutionTracer.executedReplacedMethod(idTemplate, ReplacementType.BOOLEAN, t);
        return caller.isBefore(other);
    }

    @Replacement(type = ReplacementType.BOOLEAN)
    public static boolean isAfter(LocalDateTime caller, ChronoLocalDateTime<?> other, String idTemplate) {
        Objects.requireNonNull(caller);

        // might throw NPE if when is null
        if (idTemplate == null) {
            return caller.isAfter(other);
        }
        final Truthness t;
        if (other == null) {
            t = new Truthness(DistanceHelper.H_REACHED_BUT_NULL, 1d);
        } else {
            t = getIsBeforeTruthness(other, caller);
        }

        ExecutionTracer.executedReplacedMethod(idTemplate, ReplacementType.BOOLEAN, t);
        return caller.isAfter(other);
    }

    @Replacement(type = ReplacementType.BOOLEAN)
    public static boolean isEqual(LocalDateTime caller, ChronoLocalDateTime<?> other, String idTemplate) {
        Objects.requireNonNull(caller);

        if (idTemplate == null) {
            return caller.isEqual(other);
        }
        final Truthness t;
        if (other == null) {
            t = new Truthness(DistanceHelper.H_REACHED_BUT_NULL, 1d);
        } else {
            if (caller.isEqual(other)) {
                t = new Truthness(1d, 0d);
            } else {
                double base = DistanceHelper.H_NOT_NULL;
                double distance = DistanceHelper.getDistanceToEquality(caller, other);
                double h = base + (1 - base) / (1 + distance);
                t = new Truthness(h, 1d);
            }
        }
        ExecutionTracer.executedReplacedMethod(idTemplate, ReplacementType.BOOLEAN, t);
        return caller.isEqual(other);
    }

}

{'repo_name': 'EMResearch/EvoMaster', 'stars': '116', 'repo_language': 'Kotlin', 'file_name': 'JUnitTestRunner.java', 'mime_type': 'text/x-java', 'hash': 3580272308950920413, 'source_dataset': 'data'}


<map id="CTextEdit" name="CTextEdit">
<area shape="rect" id="node2" href="$class_v_s_t_g_u_i_1_1_c_text_label.html" title="a text label " alt="" coords="113,304,193,330"/>
<area shape="rect" id="node4" href="$class_v_s_t_g_u_i_1_1_c_param_display.html" title="a parameter display " alt="" coords="101,230,205,256"/>
<area shape="rect" id="node6" href="$class_v_s_t_g_u_i_1_1_c_control.html" title="base class of all VSTGUI controls " alt="" coords="119,155,187,181"/>
<area shape="rect" id="node8" href="$class_v_s_t_g_u_i_1_1_c_view.html" title="Base Class of all view objects. " alt="" coords="23,80,77,106"/>
<area shape="rect" id="node10" href="$class_v_s_t_g_u_i_1_1_c_base_object.html" title="Base Object with reference counter. " alt="" coords="5,6,96,32"/>
<area shape="rect" id="node12" href="$class_v_s_t_g_u_i_1_1_i_focus_drawing.html" title="Custom focus drawing interface. " alt="" coords="103,80,204,106"/>
<area shape="rect" id="node14" href="$class_v_s_t_g_u_i_1_1_i_dependency.html" title="simple dependency between objects. " alt="" coords="229,80,320,106"/>
</map>

{'repo_name': 'creativeintent/temper', 'stars': '112', 'repo_language': 'HTML', 'file_name': 'all_1.html', 'mime_type': 'text/html', 'hash': -7838779509176125398, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topology SYSTEM "hwloc2.dtd">
<topology version="2.0">
  <object type="Machine" os_index="0" cpuset="0x000000ff" complete_cpuset="0x000000ff" allowed_cpuset="0x000000ff" nodeset="0x00000001" complete_nodeset="0x00000001" allowed_nodeset="0x00000001">
    <info name="Backend" value="x86"/>
    <object type="NUMANode" os_index="0" cpuset="0x000000ff" complete_cpuset="0x000000ff" nodeset="0x00000001" complete_nodeset="0x00000001"/>
    <object type="Package" os_index="0" cpuset="0x00000055" complete_cpuset="0x00000055" nodeset="0x00000001" complete_nodeset="0x00000001">
      <info name="CPUVendor" value="GenuineIntel"/>
      <info name="CPUFamilyNumber" value="6"/>
      <info name="CPUModelNumber" value="15"/>
      <info name="CPUModel" value="Intel(R) Xeon(R) CPU           E5345  @ 2.33GHz"/>
      <info name="CPUStepping" value="7"/>
      <object type="L2Cache" cpuset="0x00000011" complete_cpuset="0x00000011" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="4194304" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
        <info name="Inclusive" value="0"/>
        <object type="L1Cache" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="0" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="0" cpuset="0x00000001" complete_cpuset="0x00000001" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
        <object type="L1Cache" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="1" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="4" cpuset="0x00000010" complete_cpuset="0x00000010" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
      </object>
      <object type="L2Cache" cpuset="0x00000044" complete_cpuset="0x00000044" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="4194304" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
        <info name="Inclusive" value="0"/>
        <object type="L1Cache" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="2" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="2" cpuset="0x00000004" complete_cpuset="0x00000004" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
        <object type="L1Cache" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="3" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="6" cpuset="0x00000040" complete_cpuset="0x00000040" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
      </object>
    </object>
    <object type="Package" os_index="1" cpuset="0x000000aa" complete_cpuset="0x000000aa" nodeset="0x00000001" complete_nodeset="0x00000001">
      <info name="CPUVendor" value="GenuineIntel"/>
      <info name="CPUFamilyNumber" value="6"/>
      <info name="CPUModelNumber" value="15"/>
      <info name="CPUModel" value="Intel(R) Xeon(R) CPU           E5345  @ 2.33GHz"/>
      <info name="CPUStepping" value="7"/>
      <object type="L2Cache" cpuset="0x00000022" complete_cpuset="0x00000022" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="4194304" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
        <info name="Inclusive" value="0"/>
        <object type="L1Cache" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="0" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="1" cpuset="0x00000002" complete_cpuset="0x00000002" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
        <object type="L1Cache" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="1" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="5" cpuset="0x00000020" complete_cpuset="0x00000020" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
      </object>
      <object type="L2Cache" cpuset="0x00000088" complete_cpuset="0x00000088" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="4194304" depth="2" cache_linesize="64" cache_associativity="16" cache_type="0">
        <info name="Inclusive" value="0"/>
        <object type="L1Cache" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="2" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="3" cpuset="0x00000008" complete_cpuset="0x00000008" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
        <object type="L1Cache" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="1">
          <info name="Inclusive" value="0"/>
          <object type="L1iCache" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000001" complete_nodeset="0x00000001" cache_size="32768" depth="1" cache_linesize="64" cache_associativity="8" cache_type="2">
            <info name="Inclusive" value="0"/>
            <object type="Core" os_index="3" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000001" complete_nodeset="0x00000001">
              <object type="PU" os_index="7" cpuset="0x00000080" complete_cpuset="0x00000080" nodeset="0x00000001" complete_nodeset="0x00000001"/>
            </object>
          </object>
        </object>
      </object>
    </object>
  </object>
</topology>

{'repo_name': 'open-mpi/hwloc', 'stars': '239', 'repo_language': 'C', 'file_name': 'get-knl-modes.c', 'mime_type': 'text/x-c', 'hash': -7538045680326492466, 'source_dataset': 'data'}


// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: not %run %t 2>&1 | FileCheck %s
// REQUIRES: asan-32-bits

#include <malloc.h>

int main() {
  while (true) {
    void *ptr = malloc(200 * 1024 * 1024);  // 200MB
  }
// CHECK: SUMMARY: AddressSanitizer: out-of-memory
}

{'repo_name': 'llvm-mirror/compiler-rt', 'stars': '264', 'repo_language': 'C', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': -5487971740094166376, 'source_dataset': 'data'}


/**
 * Copyright 2011-2013 FoundationDB, LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* The original from which this derives bore the following: */

/*

   Derby - Class org.apache.derby.impl.sql.compile.DeleteNode

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to you under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

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

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

 */

package com.bj58.sql.parser;

/**
 * A DeleteNode represents a DELETE statement. It is the top-level node
 * for the statement.
 *
 * For positioned delete, there may be no from table specified.
 * The from table will be derived from the cursor specification of
 * the named cursor.
 *
 */

public class DeleteNode extends DMLModStatementNode
{
    /**
     * Initializer for a DeleteNode.
     *
     * @param targetTableName The name of the table to delete from
     * @param queryExpression The query expression that will generate
     *                                              the rows to delete from the given table
     */

    public void init(Object targetTableName,
                     Object queryExpression,
                     Object returningList) {
        super.init(queryExpression);
        this.targetTableName = (TableName)targetTableName;
        this.returningColumnList = (ResultColumnList)returningList;
    }

    public String statementToString() {
        return "DELETE";
    }

    /**
     * Return the type of statement, something from
     * StatementType.
     *
     * @return the type of statement
     */
    protected final int getStatementType() {
        return StatementType.DELETE;
    }
}

{'repo_name': '58code/Oceanus', 'stars': '532', 'repo_language': 'Java', 'file_name': 'User.java', 'mime_type': 'text/x-java', 'hash': 4880944195629800758, 'source_dataset': 'data'}


<map id="TMC2660Stepper::DRVCTRL" name="TMC2660Stepper::DRVCTRL">
<area shape="rect" id="node1" title=" " alt="" coords="5,31,195,57"/>
<area shape="rect" id="node2" href="$class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275" title=" " alt="" coords="243,5,400,32"/>
<area shape="rect" id="node3" href="$class_t_m_c2660_stepper.html#a4ab9b5cf6da0c345ecc50e877b54ada2" title=" " alt="" coords="243,56,400,83"/>
<area shape="rect" id="node4" href="$class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd" title=" " alt="" coords="448,31,651,57"/>
<area shape="rect" id="node5" href="$class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3" title=" " alt="" coords="471,81,627,108"/>
</map>

{'repo_name': 'teemuatlut/TMCStepper', 'stars': '150', 'repo_language': 'C++', 'file_name': 'files_7.js', 'mime_type': 'text/plain', 'hash': 2894729511350900015, 'source_dataset': 'data'}


# This directory contains estimators to train and run inference on
# gradient boosted trees on top of TensorFlow.
licenses(["notice"])  # Apache 2.0

exports_files(["LICENSE"])

package(
    default_visibility = ["//visibility:public"],
)

load("//tensorflow:tensorflow.bzl", "py_test")

filegroup(
    name = "all_files",
    srcs = glob(
        ["**/*"],
        exclude = [
            "**/OWNERS",
        ],
    ),
    visibility = ["//tensorflow:__subpackages__"],
)

py_library(
    name = "init_py",
    srcs = [
        "__init__.py",
    ],
    srcs_version = "PY2AND3",
)

py_library(
    name = "model",
    srcs = ["model.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":trainer_hooks",
        "//tensorflow/contrib/boosted_trees:gbdt_batch",
        "//tensorflow/contrib/boosted_trees:model_ops_py",
        "//tensorflow/python:framework_ops",
        "//tensorflow/python:state_ops",
        "//tensorflow/python:training",
    ],
)

py_library(
    name = "trainer_hooks",
    srcs = ["trainer_hooks.py"],
    srcs_version = "PY2AND3",
    deps = [
        "//tensorflow/contrib/learn",
        "//tensorflow/core:protos_all_py",
        "//tensorflow/python:control_flow_ops",
        "//tensorflow/python:framework_ops",
        "//tensorflow/python:platform",
        "//tensorflow/python:training",
    ],
)

py_test(
    name = "trainer_hooks_test",
    size = "small",
    srcs = ["trainer_hooks_test.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":trainer_hooks",
        "//tensorflow/contrib/framework:framework_py",
        "//tensorflow/python:constant_op",
        "//tensorflow/python:framework_ops",
        "//tensorflow/python:framework_test_lib",
        "//tensorflow/python:platform_test",
        "//tensorflow/python:session",
        "//tensorflow/python:state_ops",
        "//tensorflow/python:training",
        "//tensorflow/python:variables",
    ],
)

py_library(
    name = "custom_loss_head",
    srcs = ["custom_loss_head.py"],
    srcs_version = "PY2AND3",
    deps = [
        "//tensorflow/contrib/learn",
        "//tensorflow/python:array_ops",
        "//tensorflow/python:dtypes",
        "//tensorflow/python:math_ops",
    ],
)

py_library(
    name = "custom_export_strategy",
    srcs = ["custom_export_strategy.py"],
    srcs_version = "PY2AND3",
    deps = [
        "//tensorflow/contrib/boosted_trees:gbdt_batch",
        "//tensorflow/contrib/boosted_trees/proto:tree_config_proto_py",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_extensions_py",
        "//tensorflow/contrib/decision_trees/proto:generic_tree_model_py",
        "//tensorflow/contrib/learn",
        "//tensorflow/python:framework_ops",
        "//tensorflow/python:platform",
        "//tensorflow/python:session",
        "//tensorflow/python/saved_model:loader",
        "//tensorflow/python/saved_model:tag_constants",
    ],
)

py_test(
    name = "custom_export_strategy_test",
    size = "small",
    srcs = ["custom_export_strategy_test.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":custom_export_strategy",
        "//tensorflow/contrib/boosted_trees/proto:tree_config_proto_py",
        "//tensorflow/python:framework_test_lib",
        "//tensorflow/python:platform_test",
    ],
)

py_library(
    name = "estimator",
    srcs = ["estimator.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":model",
        "//tensorflow/contrib/boosted_trees:losses",
        "//tensorflow/contrib/learn",
        "//tensorflow/python:math_ops",
    ],
)

py_library(
    name = "dnn_tree_combined_estimator",
    srcs = ["dnn_tree_combined_estimator.py"],
    srcs_version = "PY2AND3",
    deps = [
        ":trainer_hooks",
        "//tensorflow/contrib/boosted_trees:gbdt_batch",
        "//tensorflow/contrib/boosted_trees:model_ops_py",
        "//tensorflow/contrib/learn",
        "//tensorflow/python:control_flow_ops",
        "//tensorflow/python:framework_ops",
        "//tensorflow/python:state_ops",
        "//tensorflow/python:training",
    ],
)

py_test(
    name = "dnn_tree_combined_estimator_test",
    size = "small",
    srcs = ["dnn_tree_combined_estimator_test.py"],
    srcs_version = "PY2AND3",
    tags = ["notsan"],
    deps = [
        ":dnn_tree_combined_estimator",
        "//tensorflow/contrib/boosted_trees:gbdt_batch",
        "//tensorflow/contrib/layers:layers_py",
        "//tensorflow/python:array_ops",
        "//tensorflow/python:framework_for_generated_wrappers",
    ],
)

{'repo_name': 'JenifferWuUCLA/pulmonary-nodules-MaskRCNN', 'stars': '158', 'repo_language': 'Jupyter Notebook', 'file_name': 'restful_client.py', 'mime_type': 'text/x-python', 'hash': -4394701231950642921, 'source_dataset': 'data'}


/**
 * Created by shuding on 6/9/15.
 * <ds303077135@gmail.com>
 */

module.exports = {

    REGISTERS: [
        'R_EAX',
        'R_ECX',
        'R_EDX',
        'R_EBX',
        'R_ESP',
        'R_EBP',
        'R_ESI',
        'R_EDI'
    ],

    P_LOAD:   0,
    P_STALL:  1,
    P_BUBBLE: 2,
    P_ERROR:  3,

    I_NOP:    0,
    I_HALT:   1,
    I_RRMOVL: 2,
    I_IRMOVL: 3,
    I_RMMOVL: 4,
    I_MRMOVL: 5,
    I_OPL:    6,
    I_JXX:    7,
    I_CALL:   8,
    I_RET:    9,
    I_PUSHL:  0xa,
    I_POPL:   0xb,
    I_IADDL:  0xc,
    I_LEAVE:  0xd,

    A_ADD:  0,
    A_SUB:  1,
    A_AND:  2,
    A_XOR:  3,
    A_NONE: 4,

    F_OF: 1, // OF at bit 0
    F_SF: 2, // SF at bit 1
    F_ZF: 4, // ZF at bit 2

    C_TRUE: 0,
    C_LE:   1,
    C_L:    2,
    C_E:    3,
    C_NE:   4,
    C_GE:   5,
    C_G:    6,

    STAT_BUB: 0,
    STAT_AOK: 1,
    STAT_HLT: 2,
    STAT_ADR: 3,
    STAT_INS: 4,
    STAT_PIP: 5,

    R_EAX:  0,
    R_ECX:  1,
    R_EDX:  2,
    R_EBX:  3,
    R_ESP:  4,
    R_EBP:  5,
    R_ESI:  6,
    R_EDI:  7,
    R_NONE: 0xf,

    DEF_CC: 4
};

{'repo_name': 'shuding/y86', 'stars': '380', 'repo_language': 'JavaScript', 'file_name': 'alu.js', 'mime_type': 'text/plain', 'hash': -3125088018918081739, 'source_dataset': 'data'}


var assert = require('assert');
var expect = require('chai').expect;
var rds = require('./rdsMinorVersionUpgrade.js');

const createCache = (data) => {
    return {
        rds: {
            describeDBInstances: {
                'us-east-1': {
                    data: data
                }
            }
        }
    }
};

describe('rdsMinorVersionUpgrade', function () {
    describe('run', function () {
        it('should give passing result if AutoMinorVersionUpgrade is enabled', function (done) {
            const callback = (err, results) => {
                expect(results[0].status).to.equal(0)
                expect(results.length).to.equal(1)
                done()
            };

            const cache = createCache(
                [{
                    "AutoMinorVersionUpgrade": true,
                    "DBInstanceIdentifier": "test_id",
                }]
            );

            rds.run(cache, {}, callback);
        })

        it('should give failing result if AutoMinorVersionUpgrade is not enabled', function(done) {
            const callback = (err, results) => {
                expect(results[0].status).to.equal(2)
                expect(results.length).to.equal(1)
                done()
            };

            const cache = createCache(
                [{
                    "AutoMinorVersionUpgrade": false,
                    "DBInstanceIdentifier": "test_id",
                }]
            );

            rds.run(cache, {}, callback);
        })

        it('should give failing result if AutoMinorVersionUpgrade is not included on the object', function(done) {
            const callback = (err, results) => {
                expect(results[0].status).to.equal(2)
                expect(results.length).to.equal(1)
                done()
            };

            const cache = createCache(
                [{
                    "DBInstanceIdentifier": "test_id",
                }]
            );

            rds.run(cache, {}, callback);
        })

        it('should give passing result if DB descriptors are not passed', function(done) {
            const callback = (err, results) => {
                expect(results[0].status).to.equal(0)
                expect(results.length).to.equal(1)
                done()
            };

            const cache = createCache(
                []
            );

            rds.run(cache, {}, callback);
        })
    })
})

{'repo_name': 'cloudsploit/scans', 'stars': '1018', 'repo_language': 'JavaScript', 'file_name': 'usersMfaEnabled.js', 'mime_type': 'text/plain', 'hash': 7558402255992254778, 'source_dataset': 'data'}


/*
 * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
 * at the root of this project for more details.
 */
package io.github.nucleuspowered.nucleus.modules.world.listeners;

import io.github.nucleuspowered.nucleus.modules.world.WorldKeys;
import io.github.nucleuspowered.nucleus.modules.world.services.WorldHelper;
import io.github.nucleuspowered.nucleus.scaffold.listener.ListenerBase;
import io.github.nucleuspowered.nucleus.services.INucleusServiceCollection;
import io.github.nucleuspowered.nucleus.services.impl.storage.dataobjects.modular.IWorldDataObject;
import org.spongepowered.api.GameState;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.game.state.GameStartedServerEvent;
import org.spongepowered.api.event.world.LoadWorldEvent;
import org.spongepowered.api.scheduler.Task;
import org.spongepowered.api.world.World;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

import javax.inject.Inject;

public class WorldGenListener implements ListenerBase {

    private final INucleusServiceCollection serviceCollection;

    @Inject
    public WorldGenListener(INucleusServiceCollection serviceCollection) {
        this.serviceCollection = serviceCollection;
    }

    @Listener
    public void onStart(GameStartedServerEvent event) {
        Task.builder().execute(() -> Sponge.getServer().getWorlds().forEach(this::onWorldLoad)).delay(1, TimeUnit.SECONDS).submit(this.serviceCollection.pluginContainer());
    }

    @Listener
    public void onWorldLoad(LoadWorldEvent event) {
        if (Sponge.getGame().getState() == GameState.SERVER_STARTED) {
            Task.builder().execute(() -> onWorldLoad(event.getTargetWorld())).delay(1, TimeUnit.SECONDS).submit(this.serviceCollection.pluginContainer());
        }
    }

    private void onWorldLoad(final World world) {
        WorldHelper worldHelper = this.serviceCollection.getServiceUnchecked(WorldHelper.class);
        final CompletableFuture<Optional<IWorldDataObject>> cfo =
                this.serviceCollection.storageManager().getWorldService().get(world.getUniqueId());

        // avoiding main thread loading
        Task.builder()
                .delay(500, TimeUnit.MILLISECONDS)
                .interval(500, TimeUnit.MILLISECONDS)
                .execute(task -> {
                    try {
                        if (cfo.isDone()) {
                            task.cancel();
                            if (!cfo.isCompletedExceptionally()) {
                                // We know there isn't an exception.
                                Optional<IWorldDataObject> optionalWorldDataObject = cfo.join();
                                if (optionalWorldDataObject.isPresent()) {
                                    IWorldDataObject worldDataObject = optionalWorldDataObject.get();
                                    boolean act = worldDataObject.get(WorldKeys.WORLD_PREGEN_START).orElse(false);
                                    if (act && worldHelper.startPregenningForWorld(
                                            world,
                                            worldDataObject.getOrDefault(WorldKeys.WORLD_PREGEN_AGGRESSIVE),
                                            worldDataObject.getOrDefault(WorldKeys.WORLD_PREGEN_SAVE_FREQUENCY),
                                            worldDataObject.getOrDefault(WorldKeys.WORLD_PREGEN_TICK_PERCENT),
                                            worldDataObject.getOrDefault(WorldKeys.WORLD_PREGEN_TICK_FREQUENCY),
                                            true
                                    )) {
                                        this.serviceCollection.messageProvider()
                                                .sendMessageTo(Sponge.getServer().getConsole(), "command.world.gen.started", world.getName());
                                    }
                                }
                            }
                        }
                    } catch (IllegalStateException e) {
                        this.serviceCollection.logger().error(
                                "Could not determine World Generation restart status for world {}, WorldProperties could not be loaded from the Sponge "
                                        + "World Manager (Sponge.getServer().getWorldProperties({}) returned empty.)", world.getName(), world.getUniqueId());
                        e.printStackTrace();
                    }
                }).submit(this.serviceCollection.pluginContainer());
    }
}

{'repo_name': 'NucleusPowered/Nucleus', 'stars': '129', 'repo_language': 'Java', 'file_name': 'core.js', 'mime_type': 'text/plain', 'hash': 7477285461326602609, 'source_dataset': 'data'}


{{currentVideo.title}} - {{currentVideo.author}}

{'repo_name': 'OasisDigital/angular-enterprise-example', 'stars': '118', 'repo_language': 'TypeScript', 'file_name': 'age-range.module.ts', 'mime_type': 'text/x-java', 'hash': -8050048868186105111, 'source_dataset': 'data'}


# Within V2

## 2.0.12
 - Translations:
   - New Crowdin translations (https://github.com/coreshop/CoreShop/pull/1165)
 - Tests
   - [Tests] add conflict for monolog (https://github.com/coreshop/CoreShop/pull/1178)
 - Bug
   - [TRACKING] use single item price in order item extractor (https://github.com/coreshop/CoreShop/pull/1231)

## 2.0.11
 - Bugs:
   - [IndexBundle] use doctrine schema-config to create index-table schema (https://github.com/coreshop/CoreShop/pull/1142)

## 2.0.10
 - Bugs:
   - [PayumBundle]: add sandbox to PayPal Configuration (https://github.com/coreshop/CoreShop/pull/1112)

## 2.0.9
 - Bugs:
   - [Pimcore] fix stan tests on 2.0 (https://github.com/coreshop/CoreShop/pull/998)
   - [CurrencyBundle] fix for money-currency editable when data comes from pimcore editmode (https://github.com/coreshop/CoreShop/pull/1023)
   - [PimcoreBundle] use reflection to get class methods (https://github.com/coreshop/CoreShop/pull/1038)
   - [CoreExtensions] don't allow any diff until properly implemented (https://github.com/coreshop/CoreShop/pull/1050)
   - [ProductBundle] specific price rules: keep id on save (https://github.com/coreshop/CoreShop/pull/1045)
   - [TrackingBundle] fix total tax in tag manager tracker (https://github.com/coreshop/CoreShop/pull/1053) @solverat
   - [IndexBundle] fix iterator and nested interpreter (https://github.com/coreshop/CoreShop/pull/1054)
   - [IndexBundle] fix index iterator interpreter (https://github.com/coreshop/CoreShop/pull/1076)
   - [ResourceBundle] fix resource-select options (https://github.com/coreshop/CoreShop/pull/1077)
   - [Tests] fix stan and travis tests (https://github.com/coreshop/CoreShop/pull/1078)
   - [Docs] Fix extend docs (https://github.com/coreshop/CoreShop/pull/1082)
   - [PimcoreBundle] embedd CoreExtension - Protected members are available only via getters (https://github.com/coreshop/CoreShop/pull/1089) @rishadomar
   - [IndexBundle] fix order-direction now serialized properly (https://github.com/coreshop/CoreShop/pull/1097)
   - [All] Fixing Configuration Keys (https://github.com/coreshop/CoreShop/pull/1100) @khusseini
   - [FrontendBundle] CategoryController perPage Configuration fix (https://github.com/coreshop/CoreShop/pull/1105)

 - Features:
   - [All] make CoreShop stores more async, don't load them initially (https://github.com/coreshop/CoreShop/pull/1025)
   - [Order] introduce checkout events (https://github.com/coreshop/CoreShop/pull/1043)
   - [CoreShop] Update CI (https://github.com/coreshop/CoreShop/pull/1056)
   - [CoreShop] Smaller CI changes (https://github.com/coreshop/CoreShop/pull/1060)

## 2.0.8
 - Bug:
   - [Pimcore] Make CoreShop compatible with Pimcore 5.8.0 (https://github.com/coreshop/CoreShop/pull/977)
   - [Order] remove wrong type hints (https://github.com/coreshop/CoreShop/pull/978)
   - [Core] fix setting customer and persisting cart on user login (https://github.com/coreshop/CoreShop/pull/980)

## 2.0.7
 - Bug:
   - [Taxation] Wrong Tax Calculation when using Store Gross Values (https://github.com/coreshop/CoreShop/issues/971)
   - [Core] remove unused Helper Classes (https://github.com/coreshop/CoreShop/pull/966)
   - [Core] add index to StorePrice Table for better performance (https://github.com/coreshop/CoreShop/pull/962)
   - [Core] remove result cache for Store Price due to issues with inheritance (https://github.com/coreshop/CoreShop/pull/961)
   - [Core] strip_tags for meta description in Category (https://github.com/coreshop/CoreShop/pull/959)
   - [Currency] MoneyCurrency fixes and improvements (https://github.com/coreshop/CoreShop/pull/958)
   - [Purchasable] When using custom purchasable, CoreShop always assumed that your class has a weight, even though it didn't had to. That's why we moved all weight related fields to the Core Component and CoreBundle.
   - [Core] prevent empty carts from being persisted (https://github.com/coreshop/CoreShop/issues/920)
   - [Core] move weight/total weight to Core Component (https://github.com/coreshop/CoreShop/pull/938)
   - [Address] use isoCode as fallback if no language value is set (https://github.com/coreshop/CoreShop/pull/939)

 - Features
   - [JMS Serializer] Updated JMS Serializer to 2.0 (https://github.com/coreshop/CoreShop/pull/955)

## 2.0.6:
 - Bug:
   - [Adjustments] in the classes "CoreShopOrderItem", "CoreShopQuoteItem", was a typo `basePdjustmentItems` instead of `baseAdjustmentItems`. Please manually rename them to `baseAdjustmentItems`
   - [ProductBundle] Fix extjs layout crash price rule is inactive (https://github.com/coreshop/CoreShop/pull/908)
   - [FrontendBundle] fix address creation redirect (https://github.com/coreshop/CoreShop/pull/910)
   - [StorageList] Storage List and Storage List Item is not a Pimcore Object (https://github.com/coreshop/CoreShop/pull/907)
   - [Order] fix typo in OrderItem and QuoteItem (https://github.com/coreshop/CoreShop/pull/906)
   - [NotificationBundle] fix typo in serializer namespace declaration (https://github.com/coreshop/CoreShop/pull/901)
   - [CoreBundle] fix notification rule setting for order mail action (https://github.com/coreshop/CoreShop/pull/886)
   - [Core] use PriceCalculatorInterface in product tracking extractor (https://github.com/coreshop/CoreShop/pull/892)
   - [Core] fix not passing full configuration in store based email (https://github.com/coreshop/CoreShop/pull/917)
   - [Core] fix copying object brick data from cart to sale (https://github.com/coreshop/CoreShop/pull/918)
   - [CoreBundle/OrderBundle] KernelResponse Event should ignore Profile Toolbar (https://github.com/coreshop/CoreShop/pull/919)
   - [Pimcore] Make CoreShop compatible with Pimcore 5.7.2 (https://github.com/coreshop/CoreShop/pull/914)

 - Features:
   - [FrontendBundle] make private method protected (https://github.com/coreshop/CoreShop/pull/890)
   - [AddressBundle] introduce address-identifiers (https://github.com/coreshop/CoreShop/issues/830 & https://github.com/coreshop/CoreShop/pull/913)

## 2.0.5:
 - Deprecations:
   - [WorkflowBundle] refactor state change logging (https://github.com/coreshop/CoreShop/pull/835)
     - `CoreShop\Bundle\OrderBundle\Workflow\OrderHistoryLogger` has been deprecated, use `CoreShop\Bundle\WorkflowBundle\History\HistoryLoggerInterface` instead
     - `CoreShop\Bundle\OrderBundle\Workflow\OrderStateHistoryLogger` has been deprecated, use `CoreShop\Bundle\WorkflowBundle\History\StateHistoryLoggerInterface` instead
     - `CoreShop\Bundle\OrderBundle\Workflow\WorkflowStateManager` has been deprecated, use `CoreShop\Bundle\WorkflowBundle\StateManager\WorkflowStateInfoManagerInterface` instead
 - Bugs
   - [PimcoreBundle] Make embedded classes work for Pimcore 5.6 (https://github.com/coreshop/CoreShop/pull/867)
   - [All] Make CoreShop 2.0.x compatible with Pimcore 5.7 (https://github.com/coreshop/CoreShop/pull/869)
   - [All] fix PHP5 sort issues by removing them (https://github.com/coreshop/CoreShop/issues/840)
   - [Shipping] if cart has no shippables, don't force carriage calculation (https://github.com/coreshop/CoreShop/pull/863)
   - [Checkout] validate cart before submitting the order (https://github.com/coreshop/CoreShop/pull/858)
   - [Frontend] remove unused property in templates (https://github.com/coreshop/CoreShop/pull/859)
   - [Permissions] prefix permission labels (https://github.com/coreshop/CoreShop/pull/855)
   - [Order] refactor creation of invoices/shipments (https://github.com/coreshop/CoreShop/pull/852 + https://github.com/coreshop/CoreShop/pull/849)
   - [Order] introduce options for order-document-items (https://github.com/coreshop/CoreShop/pull/848)
   - [Autoloading] fix paths (https://github.com/coreshop/CoreShop/pull/846)
   - [ResourceBundle] Introduce more basic resource-types (https://github.com/coreshop/CoreShop/pull/838 + https://github.com/coreshop/CoreShop/pull/845)
   - [AddressBundle] add missing translations (https://github.com/coreshop/CoreShop/pull/836)

- Features
   - [Index] Introduce advanced sorting for indexes (https://github.com/coreshop/CoreShop/pull/856)

## 2.0.4
 - Features:
   - [Reports] Reports Grid Sorting (https://github.com/coreshop/CoreShop/pull/828)
   - [Reports] Add Paginator To All Reports (https://github.com/coreshop/CoreShop/pull/826)
   - [Pimcore] introduce twig placeholder (https://github.com/coreshop/CoreShop/pull/827)
   - [Resource] add serialization for pimcore types (https://github.com/coreshop/CoreShop/pull/818)
   - [Resource] add more doctrine-pimcore-types (https://github.com/coreshop/CoreShop/pull/816)

 - Bugs:
   - [Order] fix code-generator length (https://github.com/coreshop/CoreShop/pull/833)
   - [JS] Split JS Helpers into several regions of usability (https://github.com/coreshop/CoreShop/pull/829)
   - [Core] fix for cart-item digital product never set (https://github.com/coreshop/CoreShop/pull/821)
   - [Docs] Fix dead link (https://github.com/coreshop/CoreShop/pull/822)
   - [Resource] move settings icon to resource-bundle (https://github.com/coreshop/CoreShop/pull/815)
   - [Tracker] Update CompositeTracker::trackCheckoutStep (https://github.com/coreshop/CoreShop/pull/810)

## 2.0.3
 - Features:
   - [All] Replace intval with int cast (https://github.com/coreshop/CoreShop/pull/805)
   - [Core] Store Price Dirty Detection if installed Pimcore Version >= 5.5 (https://github.com/coreshop/CoreShop/pull/807)
   - [Core] Allow Variants in Product Rule Conditions (https://github.com/coreshop/CoreShop/pull/794)
   - [Core] Add Event for Settings (https://github.com/coreshop/CoreShop/pull/785)
   - [Core] Extract CartItem Processor (https://github.com/coreshop/CoreShop/pull/784)
   - [Core] Decouple Shipping Calculator from Cart (https://github.com/coreshop/CoreShop/pull/783)
   - [Order] extract DataLoader into Pimcore Component (https://github.com/coreshop/CoreShop/pull/782)
   - [Order] rename Pimcore Grid Operators to be more CoreShop specific (https://github.com/coreshop/CoreShop/pull/787)
   - [Order] Check also for CurrencyAwareInterface in PriceFormatter Gird Operator (https://github.com/coreshop/CoreShop/pull/788)
   - [Index] Introduce Iterator Interpreter (https://github.com/coreshop/CoreShop/pull/802)
   - [Index] Introduce new Abstract function in AbstractWorker to allow handling of array data (https://github.com/coreshop/CoreShop/pull/803)
   - [Pimcore] add object_method twig function (https://github.com/coreshop/CoreShop/pull/809)
 - Bugs:
   - [Core] Fix Gift Cart Price Rule Action (https://github.com/coreshop/CoreShop/pull/796)
   - [Core] Fix Invoice WKHTML Settings (https://github.com/coreshop/CoreShop/pull/786)
   - [Core] Rule Conditions: Check on type (https://github.com/coreshop/CoreShop/pull/779)
   - [Core] Add Translation for Adjustments (https://github.com/coreshop/CoreShop/pull/774)
   - [Pimcore] allow spaces in DynamicDropdown (https://github.com/coreshop/CoreShop/pull/781)

# 2.0.2
 - Pimcore:
   - This release makes CoreShop compatible with Pimcore 5.6.0 (https://github.com/coreshop/CoreShop/pull/762)
 - Features:
   - [Core] Adds a new CoreShop JS Event to add custom Menu Items to the CoreShop Menu (https://github.com/coreshop/CoreShop/pull/765)
   - [Resource] [ResourceBundle] add JMS Serializer Handler for Pimcore Objects (https://github.com/coreshop/CoreShop/pull/766)
 - Bugs:
  - [Tracking] Fixes a Bug in the Tracking Manager when a Product does not have any categories applied (https://github.com/coreshop/CoreShop/pull/767)

# 2.0.1
 - Features:
    - [Core] Remove login customer after successfully registration (https://github.com/coreshop/CoreShop/pull/735)
 - Bugs:
    - [Core] Countries are removed when removing Store (https://github.com/coreshop/CoreShop/pull/746)
    - [Core] order Document State Resolver when a Document is cancelled (https://github.com/coreshop/CoreShop/pull/738)
    - [Core] safe path for folders (https://github.com/coreshop/CoreShop/pull/742)
    - [Core] Fix for StoreMailActionProcessor exception in Notification Rule (https://github.com/coreshop/CoreShop/pull/740)
    - [Shipping] is invalid when no Shipping Rules are given (https://github.com/coreshop/CoreShop/pull/741)
    - [Frontend] Inaccurate Store Filter Query in Category Controller (https://github.com/coreshop/CoreShop/pull/744)

## 2.0.0
 - CoreShop\Component\Index\Condition\RendererInterface has been deprecated in favor of CoreShop\Component\Index\Condition\DynamicRendererInterface to allow dynamic registration of condition renderers

## 2.0.0-RC.1
 - Flash Messages are translated in the Controllers now, not in views anymore. If you have custom Flash Messages, translate them in your Controller instead of the view.

## 2.0.0-beta.4
 - Completely remove FOSRestBundle, you still can use it, but you need to install it yourself. CoreShop only used the BodyListener to decode POST/PUT Requests, this Listener is now added by CoreShop if FOSRestBundle is not installed.

## 2.0.0-beta.3 to 2.0.0-beta.4
 - **BC break**: All occurrences of parameters `coreshop.all.stack.pimcore_class_ids`, `"application".model."class".pimcore_class_id`, `coreshop.all.pimcore_classes.ids` have been removed. Inject the corresponding Repository and use `classId` function instead
 - **Pimcore**: CoreShop now requires at least Pimcore 5.4.0. You need to update Pimcore to the at least 5.4.0 in order to use/update CoreShop.

### Product Price Calculation
In order to allow custom price calculation on API Level, we changed the way CoreShop calculates product prices by introducing a new parameter to every PriceCalculation Interface. Price Calculator Conditions are not anymore using a Live context, instead it gets passed via API.

Following interfaces have changed:

 - ```CoreShop\Component\Core\Product\TaxedProductPriceCalculatorInterface```
 - ```CoreShop\Component\Order\Calculator\PurchasableDiscountCalculatorInterface```
 - ```CoreShop\Component\Order\Calculator\PurchasableDiscountPriceCalculatorInterface```
 - ```CoreShop\Component\Order\Calculator\PurchasablePriceCalculatorInterface```
 - ```CoreShop\Component\Order\Calculator\PurchasableRetailPriceCalculatorInterface```
 - ```CoreShop\Component\Product\Calculator\ProductDiscountCalculatorInterface```
 - ```CoreShop\Component\Product\Calculator\ProductDiscountPriceCalculatorInterface```
 - ```CoreShop\Component\Product\Calculator\ProductPriceCalculatorInterface```
 - ```CoreShop\Component\Product\Calculator\ProductRetailPriceCalculatorInterface```
 - ```CoreShop\Component\Product\Rule\Action\ProductDiscountActionProcessorInterface```
 - ```CoreShop\Component\Product\Rule\Action\ProductDiscountPriceActionProcessorInterface```
 - ```CoreShop\Component\Product\Rule\Action\ProductDiscountPriceActionProcessorInterface```
 - ```CoreShop\Component\Product\Rule\Action\ProductPriceActionProcessorInterface```
 - ```CoreShop\Component\Product\Rule\Fetcher\ValidRulesFetcherInterface```

If you have anything customized with those classes, please change them accordingly.

If you use the PriceCalculator Service directly, you also need to change the call from

```
$this->priceCalculator->getPrice($object, true)
```

to

```
$this->priceCalculator->getPrice($object, [
    'store' => $store,
    'country' => $country,
    'customer' => $customer,
    'currency' $currency,
    'cart' => $cart
], true)
```

The new second argument, is the Context for which you want to get the Price. This is highly depends on your
need. On a default CoreShop setup, the context can be fetched form the `ShopperContext` Service like this:

```
return  [
    'store' => $this->shopperContext->getStore(),
    'customer' => $this->shopperContext->hasCustomer() ? $this->shopperContext->getCustomer() : null,
    'currency' => $this->shopperContext->getCurrency(),
    'country' => $this->shopperContext->getCountry(),
    'cart' => $this->shopperContext->getCart()
];
```

CoreShop makes that easier for you, you can just use ```$this->shoppperContext->getContext()```. But be aware, the Shopper Context is only in a Web Request available.
When you work on a CLI Level, you have to define the context yourself.

If you already have a cart and want to calculate the price for the cart, the context is a bit different, cause it resolves from the cart

```
$context = [
    'store' => $cart->getStore(),
    'customer' => $cart->getCustomer() ?: null,
    'currency' => $cart->getCurrency(),
    'country' => $cart->getStore()->getBaseCountry(),
    'cart' => $cart
];
```

### Taxation
Tax Rule Store relation has been removed as it makes currently no sense.

### Tracking
Tracking bundle has completely been refactored in order to support more use-cases than just ecommerce. If you have any customizations made, please check the current implementation to adapt your changes.

### Order Invoice
Due to changes in adjustments, we also need to change OrderInvoice/OrderInvoiceItem.

After you have migrated to the latest version you also have to remove some fields:

#### CoreShopOrderInvoice
- totalTax
- baseTotalTax
- subtotalTax
- baseSubtotalTax
- shippingTax
- baseShippingTax
- taxes
- baseTaxes
- discountTax
- baseDiscountTax
- discountNet
- discountGross
- baseDiscountNet
- baseDiscountGross
- shippingNet
- shippingGross
- baseShippingNet
- baseShippingGross
- shippingTaxRate

#### CoreShopOrderInvoiceItem
- totalTax
- baseTotalTax
- taxes
- baseTaxes

### Adjustments
> **BC break / New Feature**

There are several deprecated class fields.
After you have migrated to the latest version you also have to remove them:

#### CoreShopOrder / CoreShopQuote
- shippingGross
- shippingNet
- shippingTax
- discountGross
- discountNet
- discountTax
- baseShippingNet
- baseShippingGross
- baseShippingTax
- baseDiscountNet
- baseDiscountGross
- totalTax
- baseTotalTax
- subTotalTax
- baseSubtotalTax

#### CoreShopOrderItem / CoreShopQuoteItem
- totalTax
- baseTotalTax

#### CoreShopCart
- shippingGross
- shippingNet
- discountGross
- discountNet

## 2.0.0-beta.2 to 2.0.0-beta.3
 - **BC break** Signature of following interfaces changed:
    - `CoreShop\Component\Index\Interpreter\InterpreterInterface`: public function interpret($value, IndexableInterface $object, IndexColumnInterface $config, $interpreterConfig = []);
    - `CoreShop\Component\Index\Interpreter\LocalizedInterpreterInterface`: public function interpretForLanguage($language, $value, IndexableInterface $object, IndexColumnInterface $config, $interpreterConfig = []);
    - `CoreShop\Component\Index\Interpreter\RelationInterpreterInterface`: public function interpretRelational($value, IndexableInterface $indexable, IndexColumnInterface $config, $interpreterConfig = []);
    - `CoreShop\Component\Customer\Model\UserInterface::ROLE_DEFAULT` renamed `CoreShop\Component\Customer\Model\UserInterface::CORESHOP_ROLE_DEFAULT`
    - `CoreShop\Component\Customer\Model\UserInterface::ROLE_SUPER_ADMIN` renamed `CoreShop\Component\Customer\Model\UserInterface::CORESHOP_ROLE_SUPER_ADMIN`

 - **BC break** Shipment / Invoice Creation via API changed
    - Before adding a new Shipment / Invoice you need to dispatch a request state to your order. Read more about it [here](./docs/03_Development/06_Order/05_Invoice/01_Invoice_Creation.md) and [here](./docs/03_Development/06_Order/06_Shipment/01_Shipment_Creation.md).
 - **BC break** getName in `CoreShop\Component\Index\Model\IndexableInterface` has been changed to `getIndexableName` as `getName` could eventually conflict with a non localized Pimcore Field
 - **BC break** getEnabled in `CoreShop\Component\Index\Model\IndexableInterface` has been changed to `getIndexableEnabled` as `getEnabled` could eventually conflict with a localized Pimcore Field

## 2.0.0-beta.1 to 2.0.0-beta.2
 - Link Generator implemented. If you want to use nice urls, you need to add the link generator service:
    - CoreShopProduct: add `@coreshop.object.link_generator.product` as Link Provider
    - CoreShopCategory: add `@coreshop.object.link_generator.category` as Link Provider
    - Change `{{ path('') }}` to `{{ coreshop_path('') }}`. You may want to checkout the FrontendBundle to get a deeper insight.
 - Deprecated Field Names in - CoreShop\Component\Payment\Model\PaymentInterface`:
    - getName is now getTitle
    - getOrderId is now getOrder and directly returns a OrderInterface
 - Deprecated Field Names in - `CoreShop\Component\Shipping\Model\CarrierInterface`:
    - getLabel is not getTitle
    - getName is now getIdentifier

## 2.0.0-alpha.4 to 2.0.0-beta.1
 - **BC break** Signature of following interfaces changed:
    - `CoreShop\Component\Index\Interpreter\InterpreterInterface`: public function interpret($value, IndexableInterface $object, IndexColumnInterface $config);
    - `CoreShop\Component\Index\Interpreter\LocalizedInterpreterInterface`: public function interpretForLanguage($language, $value, IndexableInterface $object, IndexColumnInterface $config);
    - `CoreShop\Component\Index\Interpreter\RelationInterpreterInterface`: public function interpretRelational($value, IndexableInterface $indexable, IndexColumnInterface $config);

 - **BC break** CoreShop now takes advantage of the dependent bundle feature introduced in Pimcore 5.1.2. Therefore,
 all bundles are now automatically loaded. This is a BC break, as when updating, you might run into issues.
 To solve the issues, check following things:
    - remove `RegisterBundles` entry from `app/AppKernel.php`
    - remove loading CoreShopCoreBundle Configuration in `app/config.yml`
    - enable CoreShopCoreBundle via CLI or manually in `var/config/extensions.php`: `"CoreShop\\Bundle\\CoreBundle\\CoreShopCoreBundle" => TRUE`
 - **BC break** Upgraded Default Layout to Bootstrap 4. This will most certainly cause issues when you just override certain templates. Best would be to copy all templates from before the Bootstrap 4 Upgrade.

## 2.0.0-alpha.4 to 2.0.0-alpha.5
 - **BC break** added Component\Core\Model\OrderItem and Component\Core\Model\QuoteItem. If you already customized them, inherit them from the Core Models.
 - **BC break** changed the way CoreShop processes Cart-Rules. If you implemented a custom-condition, inherit from `CoreShop\Component\Order\Cart\Rule\Condition\AbstractConditionChecker` and implement `isCartRuleValid` instead of `isValid`
- Deprecated: remove `cart/add-price-rule/` static route.

## 2.0.0-alpha.3 to 2.0.0-alpha.4
 - **BC break** decoupled MoneyBundle from CurrencyBundle, therefore the Twig Extension for Money Conversion went to the CurrencyBundle. Therefore the name of that extension was renamed from
   **coreshop_convert_money** to **coreshop_convert_currency**. If you use it directly in your code, please rename all of them.
 - Deprecated CoreShopAdminBundle which responsability was only handling installation and deliviering pimcore resources like JS and CSS files.
    * Installation has been moved to CoreShopCoreBundle
    * Delivering of resources is now handled by CoreShopResourceBundle, this also makes it easier to use CoreShop Bundles without handling resources yourself.

## 2.0.0-alpha.2 to 2.0.0-alpha.3
 - **BC break** getPrice in PurchasableInterface and ProductInterface has been removed. In favor of this a new coreShopStorePrice editable has been introduced, which stores prices for each store. This makes handling of multiple currencies way more elegant.

   If you still want to use the old getPrice, create a new Subclass of \CoreShop\Component\Core\Model\Product, implement \CoreShop\Component\Order\Model\PriceAwarePurchasableInterface and set your class to CoreShopProduct parents.

# V1 to V2
 - CoreShop 2 is not backward compatible. Due to the framework change, we decided to re-make CoreShop from scratch. If you still have instances running and want to migrate, there is a basic migration way which gets you data from V1 to V2.
 - [Export from CoreShop1](https://github.com/coreshop/CoreShopExport)
 - [Import into CoreShop2](https://github.com/coreshop/ImportBundle)

# Within V1
 - Nothing available

{'repo_name': 'coreshop/CoreShop', 'stars': '175', 'repo_language': 'PHP', 'file_name': 'GeoIP.conf', 'mime_type': 'text/plain', 'hash': -7082707537354685493, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.guerwan.transitionsample"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.guerwan.transitionsample.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

{'repo_name': 'guerwan/TransitionsBackport', 'stars': '589', 'repo_language': 'Java', 'file_name': 'ids.xml', 'mime_type': 'text/xml', 'hash': 8678511071455004712, 'source_dataset': 'data'}


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

package rng

import (
	"errors"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"time"

	"github.com/u-root/u-root/pkg/recovery"
)

// The concept
//
// Most systems in real world application do not provide enough entropy at boot
// time. Therefore we will seed /dev/random with /dev/hwrng if a HW random
// number generator is available. Entropy is important for cryptographic
// protocols running in network stacks. Also disk encryption can be a problem
// if bad or no entropy is available. It can either block provisioning or makes
// a symmetric key easy to re-calculate.

var (
	// HwRandomCurrentFile shows/sets the current
	// HW random number generator
	HwRandomCurrentFile = "/sys/class/misc/hw_random/rng_current"
	// HwRandomAvailableFile shows the current available
	// HW random number generator
	HwRandomAvailableFile = "/sys/class/misc/hw_random/rng_available"
	// RandomEntropyAvailableFile shows how much of the entropy poolsize is used
	RandomEntropyAvailableFile = "/proc/sys/kernel/random/entropy_avail"
	// EntropyFeedTime sets the loop time for seeding /dev/random by /dev/hwrng
	// in seconds
	EntropyFeedTime = 2 * time.Second
	// EntropyBlockSize sets the bytes to read per Read function call
	EntropyBlockSize = 128
	// EntropyThreshold is used to stop seeding at specific entropy level
	EntropyThreshold uint64 = 3000
	// RandomDevice is the linux random device
	RandomDevice = "/dev/random"
	// HwRandomDevice is the linux hw random device
	HwRandomDevice = "/dev/hwrng"
)

// trngList is a list of hw random number generator
// names used by the Linux kernel.
// Can be extended but keep in mind to priorize
// more secure random sources like hw random over
// timer, jitter based mechanisms. At the top of the array
// is the highest priority.
// <rng-name>
var trngList = []string{
	"tpm-rng",
	"intel-rng",
	"amd-rng",
	"timeriomem-rng",
}

// setAvailableTRNG searches for available True Random Number Generator
// inside the kernel api and sets the most secure on if
// available which seeds /dev/hwrng
func setAvailableTRNG() error {
	var (
		currentRNG    string
		availableRNGs []string
		selectedRNG   string
	)

	availableFileData, err := ioutil.ReadFile(HwRandomAvailableFile)
	if err != nil {
		return err
	}
	availableRNGs = strings.Split(string(availableFileData), " ")

	for _, trng := range trngList {
		for _, rng := range availableRNGs {
			if trng == rng {
				selectedRNG = trng
				break
			}
		}
	}

	if selectedRNG == "" {
		return errors.New("no TRNG found on platform")
	}

	if err = ioutil.WriteFile(HwRandomCurrentFile, []byte(selectedRNG), 0644); err != nil {
		return err
	}

	// Check if the correct TRNG was successful written
	currentFileData, err := ioutil.ReadFile(HwRandomCurrentFile)
	if err != nil {
		return err
	}
	currentRNG = string(currentFileData)

	if currentRNG != selectedRNG {
		return errors.New("Couldn't select TRNG: " + currentRNG)
	}

	return nil
}

// UpdateLinuxRandomness seeds random data from
// /dev/hwrng into /dev/random based on a timer and
// the entropy pool size
func UpdateLinuxRandomness(recoverer recovery.Recoverer) error {
	if err := setAvailableTRNG(); err != nil {
		return err
	}

	hwRng, err := os.OpenFile(HwRandomDevice, os.O_RDONLY, os.ModeDevice)
	if err != nil {
		return err
	}

	rng, err := os.OpenFile(RandomDevice, os.O_APPEND|os.O_WRONLY, os.ModeDevice)
	if err != nil {
		return err
	}

	go func() {
		defer hwRng.Close()
		defer rng.Close()

		for {
			time.Sleep(EntropyFeedTime)

			randomEntropyAvailableData, err := ioutil.ReadFile(RandomEntropyAvailableFile)
			if err != nil {
				recoverer.Recover("Can't read entropy pool size")
			}

			formatted := strings.TrimSuffix(string(randomEntropyAvailableData), "\n")
			randomEntropyAvailable, err := strconv.ParseUint(formatted, 10, 32)
			if err != nil {
				recoverer.Recover("Can't parse entropy pool size")
			}

			if randomEntropyAvailable >= EntropyThreshold {
				continue
			}

			var random = make([]byte, EntropyBlockSize)
			length, err := hwRng.Read(random)
			if err != nil {
				recoverer.Recover("Can't open the hardware random device")
			}
			_, err = rng.Write(random[:length])
			if err != nil {
				recoverer.Recover("Can't open the random device")
			}
		}
	}()

	return nil
}

{'repo_name': 'u-root/u-root', 'stars': '1291', 'repo_language': 'Go', 'file_name': 'config_linux5.2.0_arm.txt', 'mime_type': 'text/plain', 'hash': -2570149189945312983, 'source_dataset': 'data'}


            Entity Framework Effort

		<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#site-header-nav-site-menu"
				aria-controls="site-header-nav-site-menu" aria-expanded="false" aria-label="Toggle navigation">

		</button>

						Tutorials

                        GitHub

                        Donate

						Contact

						Download

{'repo_name': 'zzzprojects/EntityFramework-Effort', 'stars': '387', 'repo_language': 'C#', 'file_name': '_sidebar.md', 'mime_type': 'text/plain', 'hash': 8419576249621019346, 'source_dataset': 'data'}