/* LZ78 compression */

#include <string.h>
#include "lz78.h"

extern void *malloc(int);

/* Dictionary size */
#define HTSIZE 16384

/* Dictionary */
int *larray;
int *carray;
int *codearray;

/* Initialize compressor/uncompressor */

int izcmp(void)
 {
 if(!(larray=malloc(sizeof(int)*HTSIZE))) return -1;
 if(!(carray=malloc(sizeof(int)*HTSIZE))) return -1;
 if(!(codearray=malloc(sizeof(int)*HTSIZE))) return -1;
 return 0;
 }

/* Compress block 'src' or size 'len' to output buffer 'dst'.  Returns
 * compressed size of block. */

int cmp(unsigned char *dst,unsigned char *src,int len)
 {
 int x;
 int l, c;
 int count=0;
 int ln=len;
 unsigned char *s=src;
 unsigned char *d=dst;
 unsigned assm=0;		/* Bit assembler */
 int nbits=0;			/* No. bits in bit assembler */
 int code=256;			/* Current code */
 int end=512;			/* Add another bit when code reaches here */
 int bits=9;			/* No. bits needed for current code */
 int tmp;

 /* Current and previous character */

 if(!len)       /* Empty block */
  return 0;

 /* Quick check for run-length compression */
 c=s[0];
 for(x=0;x!=len;++x) if(s[x]!=c) break;
 if(x==len)
  { /* Run length coding for constant blocks */
  *d++=0;
  *d++=c;
  *d++=len;
  *d++=(len>>8);
  return d-dst;
  }

 /* Initalize dictionary */
 memset(carray,255,sizeof(int)*HTSIZE);
 memset(larray,255,sizeof(int)*HTSIZE);
 memset(codearray,255,sizeof(int)*HTSIZE);

 /* Compress */

 /* Get first character */
 l= *s++; --ln;

 /* Output compression type */
 *d++=2;

 while(ln)
  {
  int hv;
  c= *s++; --ln;

  /* Find string l+c in hash table */
  for(hv=((l<<8)^(c)^(l>>6))&(HTSIZE-1);larray[hv]!= -1;hv=(hv+1)&(HTSIZE-1))
   if(larray[hv]==l && carray[hv]==c) break;

  if(larray[hv]!= -1)
   { /* We found the entry */
   l=codearray[hv];
   }
  else
   {
   /* String l+c is not in hash table: add an entry */
   larray[hv]=l;
   carray[hv]=c;
   codearray[hv]=code++;
   if(code==end) count=3;
   if(count>0) if(!--count) (end<<=1), ++bits;

   /* Output 'l' */
   tmp=bits;
   while(tmp)
    {
    assm|=(l<<nbits);
    if(tmp+nbits<=16) nbits+=tmp, tmp=0;
    else tmp-=(16-nbits), l>>=(16-nbits), nbits=16;
    while(nbits>=8)
     {
     *d++=assm; assm>>=8; nbits-=8;
     if(d-dst==len) goto none;
     }
    }
   /* Begin new string */
   l=c;
   }
  }

 /* Output last code */
 tmp=bits;
 while(tmp)
  {
  assm|=(l<<nbits);
  if(tmp+nbits<=16) nbits+=tmp, tmp=0;
  else tmp-=(16-nbits), l>>=(16-nbits), nbits=16;
  while(nbits>=8)
   {
   *d++=assm; assm>>=8; nbits-=8;
   if(d-dst==len) goto none;
   }
  }
 while(nbits>0)
  {
  *d++=assm; assm>>=8; nbits-=8;
  if(d-dst==len) goto none;
  }

 return d-dst;

 /* No compression */
 none:
 dst[0]=1;			/* Code for no compression */
 memcpy(dst+1,src,len);		/* Just copy the block */
 return len+1;
 }

/* Uncompress.  'src' contains compressed data, 'len' is compressed
 * size of data.  'dst' gets the uncompressed data, and ucmp returns
 * the original size of the data.
 */

int ucmp(unsigned char *dst, unsigned char *src, int len)
 {
 if(!len)       /* No data */
  return 0;

 if(*src==0)    /* Zeroed block */
  {
  int x;
  int c=src[1];
  len=src[2]+(src[3]<<8);
  for(x=0;x!=len;++x) dst[x]=c;
  return len;
  }

 if(*src==1)    /* No compression */
  {
  if(len-1) memcpy(dst,src+1,len-1);
  return len-1;
  }

 if(*src==2)    /* lz78 */
  {
  int x, q, cnt;

  /* Word assembler */
  unsigned long assm=0;
  int nbits=0;

  /* Code manager */
  int bits=9;
  int end=512;

  /* Current string */
  int l, c;
  int code;
  unsigned char *d=dst;
  code=256;

  /* Uncompress */

  ++src; --len;

  /* Get first character */
  while(nbits<bits)
   {
   assm|=((unsigned long)*src++<<nbits);
   --len;
   nbits+=8;
   }
  l=(assm&(end-1));
  assm>>=bits; nbits-=bits;
  *d++=l;

  while(len)
   {
   /* Get */
   while(nbits<bits)
    {
    assm|=((unsigned long)*src++<<nbits);
    --len;
    nbits+=8;
    }
   c=(assm&(end-1));
   assm>>=bits; nbits-=bits;

   if(c<256)
    {
    /* Got a character */
    /* Must have generated a new code at this point */
    larray[code]=l;
    carray[code]=c;
    ++code;

    /* Output */
    *d++=c;

    /* Start a new string */
    l=c;
    }
   else
    {
    /* Got a code */

    /* Must have generated a new code at this point */
    larray[code]=l;
    for(q=larray[c];q>=256;q=larray[q]);
    carray[code]=q;
    ++code;

    /* Start a new string */
    l=c;

    /* Output */
    cnt=0;
    while(larray[c]>=256)
     {
     ++cnt;
     *d++=carray[c];
     c=larray[c];
     }
    *d++=carray[c]; ++cnt;
    *d++=larray[c]; ++cnt;
    for(x=0;x!=cnt/2;++x)
     {
     q=d[-1-x];
     d[-1-x]=d[-cnt+x];
     d[-cnt+x]=q;
     }
    }
   if(code==end) end*=2, bits+=1;
   }
  return d-dst;
  }

 return -1;     /* Don't know how to uncompress this */
 }

{'repo_name': 'jhallen/joes-sandbox', 'stars': '596', 'repo_language': 'C', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': 3225543753464738803, 'source_dataset': 'data'}


import itertools

K, M = map(int, input().split())
l = []
for i in range(K):
	ts = input().split()[1 : ]
	xs = [int(x) ** 2 for x in ts]
	l.append(xs)
ps = map(sum, itertools.product(*l))
mps = max(map(lambda p: p % M, ps))
print(mps)

{'repo_name': 'kerry-perret/Python.HackerRank', 'stars': '103', 'repo_language': 'Python', 'file_name': '5 - Sparse Arrays.py', 'mime_type': 'text/plain', 'hash': 8605921993957822729, 'source_dataset': 'data'}


'\" t
.\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License version 2 only, as
.\" published by the Free Software Foundation.
.\"
.\" This 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
.\" version 2 for more details (a copy is included in the LICENSE file that
.\" accompanied this code).
.\"
.\" You should have received a copy of the GNU General Public License version
.\" 2 along with this work; if not, write to the Free Software Foundation,
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
.\"
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\"     Arch: generic
.\"     Software: JDK 8
.\"     Date: 21 November 2013
.\"     SectDesc: Troubleshooting Tools
.\"     Title: jmap.1
.\"
.if n .pl 99999
.TH jmap 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------

.SH NAME
jmap \- Prints shared object memory maps or heap memory details for a process, core file, or remote debug server\&. This command is experimental and unsupported\&.
.SH SYNOPSIS
.sp
.nf

\fBjmap\fR [ \fIoptions\fR ] \fIpid\fR
.fi
.nf

\fBjmap\fR [ \fIoptions\fR ] \fIexecutable\fR \fIcore\fR
.fi
.nf

\fBjmap\fR [ \fIoptions\fR ] [ \fIpid\fR ] \fIserver\-id\fR@ ] \fIremote\-hostname\-or\-IP\fR
.fi
.sp
.TP
\fIoptions\fR
The command-line options\&. See Options\&.
.TP
\fIpid\fR
The process ID for which the memory map is to be printed\&. The process must be a Java process\&. To get a list of Java processes running on a machine, use the jps(1) command\&.
.TP
\fIexecutable\fR
The Java executable from which the core dump was produced\&.
.TP
\fIcore\fR
The core file for which the memory map is to be printed\&.
.TP
\fIremote-hostname-or-IP\fR
The remote debug server \f3hostname\fR or \f3IP\fR address\&. See jsadebugd(1)\&.
.TP
\fIserver-id\fR
An optional unique ID to use when multiple debug servers are running on the same remote host\&.
.SH DESCRIPTION
The \f3jmap\fR command prints shared object memory maps or heap memory details of a specified process, core file, or remote debug server\&. If the specified process is running on a 64-bit Java Virtual Machine (JVM), then you might need to specify the \f3-J-d64\fR option, for example: \f3jmap\fR\f3-J-d64 -heap pid\fR\&.
.PP
\fINote:\fR This utility is unsupported and might not be available in future releases of the JDK\&. On Windows Systems where the \f3dbgeng\&.dll\fR file is not present, Debugging Tools For Windows must be installed to make these tools work\&. The \f3PATH\fR environment variable should contain the location of the \f3jvm\&.dll\fR file that is used by the target process or the location from which the crash dump file was produced, for example: \f3set PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR\&.
.SH OPTIONS
.TP
<no option>
When no option is used, the \f3jmap\fR command prints shared object mappings\&. For each shared object loaded in the target JVM, the start address, size of the mapping, and the full path of the shared object file are printed\&. This behavior is similar to the Oracle Solaris \f3pmap\fR utility\&.
.TP
-dump:[live,] format=b, file=\fIfilename\fR
.br
Dumps the Java heap in \f3hprof\fR binary format to \f3filename\fR\&. The \f3live\fR suboption is optional, but when specified, only the active objects in the heap are dumped\&. To browse the heap dump, you can use the jhat(1) command to read the generated file\&.
.TP
-finalizerinfo
.br
Prints information about objects that are awaiting finalization\&.
.TP
-heap
.br
Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage\&. In addition, the number and size of interned Strings are printed\&.
.TP
-histo[:live]
.br
Prints a histogram of the heap\&. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed\&. The JVM internal class names are printed with an asterisk (*) prefix\&. If the \f3live\fR suboption is specified, then only active objects are counted\&.
.TP
-clstats
.br
Prints class loader wise statistics of Java heap\&. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed\&.
.TP
-F
.br
Force\&. Use this option with the \f3jmap -dump\fR or \f3jmap -histo\fR option when the pid does not respond\&. The \f3live\fR suboption is not supported in this mode\&.
.TP
-h
.br
Prints a help message\&.
.TP
-help
.br
Prints a help message\&.
.TP
-J\fIflag\fR
.br
Passes \f3flag\fR to the Java Virtual Machine where the \f3jmap\fR command is running\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
jhat(1)
.TP 0.2i
\(bu
jps(1)
.TP 0.2i
\(bu
jsadebugd(1)
.RE
.br
'pl 8.5i
'bp

{'repo_name': 'AdoptOpenJDK/openjdk-jdk8u', 'stars': '142', 'repo_language': 'Java', 'file_name': 'jar.1', 'mime_type': 'text/troff', 'hash': -1418168481643376041, 'source_dataset': 'data'}


/*
 * Copyright (C) 2013 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "config.h"
#include "WKBundlePageBannerMac.h"

#if !PLATFORM(IOS)

#include "APIClient.h"
#include "PageBanner.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"

using namespace WebCore;
using namespace WebKit;

namespace API {
template<> struct ClientTraits<WKBundlePageBannerClientBase> {
    typedef std::tuple<WKBundlePageBannerClientV0> Versions;
};
}

class PageBannerClientImpl : API::Client<WKBundlePageBannerClientBase>, public PageBanner::Client {
public:
    explicit PageBannerClientImpl(WKBundlePageBannerClientBase* client)
    {
        initialize(client);
    }

    virtual ~PageBannerClientImpl()
    {
    }

private:
    // PageBanner::Client.
    void pageBannerDestroyed(PageBanner*) override
    {
        delete this;
    }

    bool mouseEvent(PageBanner* pageBanner, WebEvent::Type type, WebMouseEvent::Button button, const IntPoint& position) override
    {
        switch (type) {
        case WebEvent::MouseDown: {
            if (!m_client.mouseDown)
                return false;

            return m_client.mouseDown(toAPI(pageBanner), toAPI(position), toAPI(button), m_client.base.clientInfo);
        }
        case WebEvent::MouseUp: {
            if (!m_client.mouseUp)
                return false;

            return m_client.mouseUp(toAPI(pageBanner), toAPI(position), toAPI(button), m_client.base.clientInfo);
        }
        case WebEvent::MouseMove: {
            if (button == WebMouseEvent::NoButton) {
                if (!m_client.mouseMoved)
                    return false;

                return m_client.mouseMoved(toAPI(pageBanner), toAPI(position), m_client.base.clientInfo);
            }

            // This is a MouseMove event with a mouse button pressed. Call mouseDragged.
            if (!m_client.mouseDragged)
                return false;

            return m_client.mouseDragged(toAPI(pageBanner), toAPI(position), toAPI(button), m_client.base.clientInfo);
        }

        default:
            return false;
        }
    }
};

WKBundlePageBannerRef WKBundlePageBannerCreateBannerWithCALayer(CALayer *layer, int height, WKBundlePageBannerClientBase* wkClient)
{
    if (wkClient && wkClient->version)
        return 0;

    auto clientImpl = std::make_unique<PageBannerClientImpl>(wkClient);
    return toAPI(&PageBanner::create(layer, height, clientImpl.release()).leakRef());
}

CALayer * WKBundlePageBannerGetLayer(WKBundlePageBannerRef pageBanner)
{
    return toImpl(pageBanner)->layer();
}

#endif // !PLATFORM(IOS)

{'repo_name': 'naver/sling', 'stars': '115', 'repo_language': 'C++', 'file_name': 'configure-clang-linux.sh', 'mime_type': 'text/x-shellscript', 'hash': -107080103097640001, 'source_dataset': 'data'}


/* The MIT License */
.dropzone,
.dropzone *,
.dropzone-previews,
.dropzone-previews * {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.dropzone {
  position: relative;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  padding: 1em;
}
.dropzone.dz-clickable {
  cursor: pointer;
}
.dropzone.dz-clickable .dz-message,
.dropzone.dz-clickable .dz-message span {
  cursor: pointer;
}
.dropzone.dz-clickable * {
  cursor: default;
}
.dropzone .dz-message {
  opacity: 1;
  -ms-filter: none;
  filter: none;
}
.dropzone.dz-drag-hover {
  border-color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.04);
}
.dropzone.dz-started .dz-message {
  display: none;
}
.dropzone .dz-preview,
.dropzone-previews .dz-preview {
  background: rgba(255,255,255,0.8);
  position: relative;
  display: inline-block;
  margin: 17px;
  vertical-align: top;
  border: 1px solid #acacac;
  padding: 6px 6px 6px 6px;
}
.dropzone .dz-preview.dz-file-preview [data-dz-thumbnail],
.dropzone-previews .dz-preview.dz-file-preview [data-dz-thumbnail] {
  display: none;
}
.dropzone .dz-preview .dz-details,
.dropzone-previews .dz-preview .dz-details {
  width: 100px;
  height: 100px;
  position: relative;
  background: #ebebeb;
  padding: 5px;
  margin-bottom: 22px;
}
.dropzone .dz-preview .dz-details .dz-filename,
.dropzone-previews .dz-preview .dz-details .dz-filename {
  overflow: hidden;
  height: 100%;
}
.dropzone .dz-preview .dz-details img,
.dropzone-previews .dz-preview .dz-details img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
}
.dropzone .dz-preview .dz-details .dz-size,
.dropzone-previews .dz-preview .dz-details .dz-size {
  position: absolute;
  bottom: -28px;
  left: 3px;
  height: 28px;
  line-height: 28px;
}
.dropzone .dz-preview.dz-error .dz-error-mark,
.dropzone-previews .dz-preview.dz-error .dz-error-mark {
  display: block;
}
.dropzone .dz-preview.dz-success .dz-success-mark,
.dropzone-previews .dz-preview.dz-success .dz-success-mark {
  display: block;
}
.dropzone .dz-preview:hover .dz-details img,
.dropzone-previews .dz-preview:hover .dz-details img {
  display: none;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
  display: none;
  position: absolute;
  width: 40px;
  height: 40px;
  font-size: 30px;
  text-align: center;
  right: -10px;
  top: -10px;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone-previews .dz-preview .dz-success-mark {
  color: #8cc657;
}
.dropzone .dz-preview .dz-error-mark,
.dropzone-previews .dz-preview .dz-error-mark {
  color: #ee162d;
}
.dropzone .dz-preview .dz-progress,
.dropzone-previews .dz-preview .dz-progress {
  position: absolute;
  top: 100px;
  left: 6px;
  right: 6px;
  height: 6px;
  background: #d7d7d7;
  display: none;
}
.dropzone .dz-preview .dz-progress .dz-upload,
.dropzone-previews .dz-preview .dz-progress .dz-upload {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background-color: #8cc657;
}
.dropzone .dz-preview.dz-processing .dz-progress,
.dropzone-previews .dz-preview.dz-processing .dz-progress {
  display: block;
}
.dropzone .dz-preview .dz-error-message,
.dropzone-previews .dz-preview .dz-error-message {
  display: none;
  position: absolute;
  top: -5px;
  left: -20px;
  background: rgba(245,245,245,0.8);
  padding: 8px 10px;
  color: #800;
  min-width: 140px;
  max-width: 500px;
  z-index: 500;
}
.dropzone .dz-preview:hover.dz-error .dz-error-message,
.dropzone-previews .dz-preview:hover.dz-error .dz-error-message {
  display: block;
}

{'repo_name': '201206030/novel-plus', 'stars': '297', 'repo_language': 'Java', 'file_name': 'ResultBean.java', 'mime_type': 'text/x-java', 'hash': 2849290617620928802, 'source_dataset': 'data'}


'use strict';
var path = require('path');
var fs = require('graceful-fs');
var stripBom = require('strip-bom');
var parseJson = require('parse-json');
var Promise = require('pinkie-promise');
var pify = require('pify');

function parse(x, fp) {
	return parseJson(stripBom(x), path.relative(process.cwd(), fp));
}

module.exports = function (fp) {
	return pify(fs.readFile, Promise)(fp, 'utf8').then(function (data) {
		return parse(data, fp);
	});
};

module.exports.sync = function (fp) {
	return parse(fs.readFileSync(fp, 'utf8'), fp);
};

{'repo_name': 'codesandbox/codesandbox-client', 'stars': '9600', 'repo_language': 'JavaScript', 'file_name': 'tsc', 'mime_type': 'text/plain', 'hash': -4552988718514574859, 'source_dataset': 'data'}


# SLPA
## Original Authors' Link
- [GANXiS (aka SLPA)](https://sites.google.com/site/communitydetectionslpa/)

## Python Source Link
- [slpa by romain-fontugne](https://github.com/romain-fontugne/slpa_nx)
- [slpa by YipingNUS](https://github.com/YipingNUS/slpa-py)

{'repo_name': 'RapidsAtHKUST/CommunityDetectionCodes', 'stars': '115', 'repo_language': 'C++', 'file_name': 'network_seeded.cl', 'mime_type': 'text/plain', 'hash': 8019101571686109854, 'source_dataset': 'data'}


---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

## Description
<!-- A clear and concise description of what the bug is. -->

## How To Reproduce
1.
2.
3.

## Your Environment
 - OS: [e.g. MacOS]
 - Whalebird Version: [e.g. 1.0.0]
 - Instance: [e.g. mastodon.social]

{'repo_name': 'h3poteto/whalebird-desktop', 'stars': '459', 'repo_language': 'TypeScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 8395782602151376954, 'source_dataset': 'data'}


# Provision a Ubuntu/Centos VM and  bootstrapping the Chef Agent.

![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/chef-json-parameters-linux-vm/PublicLastTestDate.svg)
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/chef-json-parameters-linux-vm/PublicDeployment.svg)

![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/chef-json-parameters-linux-vm/FairfaxLastTestDate.svg)
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/chef-json-parameters-linux-vm/FairfaxDeployment.svg)

![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/chef-json-parameters-linux-vm/BestPracticeResult.svg)
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/chef-json-parameters-linux-vm/CredScanResult.svg)

[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fchef-json-parameters-linux-vm%2Fazuredeploy.json)  [![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fchef-json-parameters-linux-vm%2Fazuredeploy.json)

 This template provisions a Linux Ubuntu/Centos VM on Azure and bootstraps it with Chef client version 1201.12.

Useful Links for learning about Chef:

Get Started with Chef

Chef Pricing and Licensing

Chef Training

Using Chef Server in the Azure Marketplace

Chef Documentation

 For deploying the Chef agent on a VM, you can create a hosted Chef account or spin off Chef Server in Azure using the Marketplace image which is free upto 20 nodes. More on Marketplace image : Using Chef Server in the Azure Marketplace

{'repo_name': 'Azure/azure-quickstart-templates', 'stars': '7645', 'repo_language': 'PowerShell', 'file_name': 'azuredeploy.json', 'mime_type': 'text/plain', 'hash': 7465113147393338863, 'source_dataset': 'data'}


//
// Wire
// Copyright (C) 2018 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//

import UIKit

protocol ViewControllerDismisser: class {
    func dismiss(viewController: UIViewController, completion: Completion?)
}

{'repo_name': 'wireapp/wire-ios', 'stars': '2896', 'repo_language': 'Swift', 'file_name': 'CAF23EA4-A3BD-44BC-8CE5-F35CDF5AC07A.plist', 'mime_type': 'text/xml', 'hash': 7563028653399081900, 'source_dataset': 'data'}


# 📂 File metadata

## fs.stat()

The [`blksize`](https://nodejs.org/api/fs.html#fs_stats_blksize) and
[`blocks`](https://nodejs.org/api/fs.html#fs_stats_blocks) values of
[`fs.stat()`](https://nodejs.org/api/fs.html#fs_fs_stat_path_options_callback)
are `undefined` on Windows.

The timestamps have inconsistent behavior across OS:

- [`birthtime`](https://nodejs.org/api/fs.html#fs_stats_birthtime) and
  [`birthtimeMs`](https://nodejs.org/api/fs.html#fs_stats_birthtimems) can be
  `1970-01-01` or the
  [same as `ctime`](https://nodejs.org/api/fs.html#fs_stat_time_values) on some
  platforms
- [`atime`](https://nodejs.org/api/fs.html#fs_stats_atime) and
  [`atimeMs`](https://nodejs.org/api/fs.html#fs_stats_atimems) can be disabled
  at the partition-level, especially on
  [Unix](https://wiki.archlinux.org/index.php/fstab#atime_options) but on
  [Windows](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-behavior)
  as well
- Windows handles [`ctime`](https://nodejs.org/api/fs.html#fs_stats_ctime) and
  [`ctimeMs`](https://nodejs.org/api/fs.html#fs_stats_ctimems) differently than
  Unix
- [`mtime`](https://nodejs.org/api/fs.html#fs_stats_mtime) and
  [`mtimeMs`](https://nodejs.org/api/fs.html#fs_stats_mtimems) are also not
  completely [reliable](https://apenwarr.ca/log/20181113)

## fs.open()

The [`O_NOATIME`](https://nodejs.org/api/fs.html#fs_file_open_constants) flag of
[`fs.open()`](https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback)
only works on Linux. Access times can also be disabled on Windows but through
[the registry](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-behavior#remarks).

The [`UV_FS_O_FILEMAP`](https://nodejs.org/api/fs.html#fs_file_open_constants)
flag only works on Windows.

## fs.watch()

[`fs.watch()`](https://nodejs.org/api/fs.html#fs_caveats) is not very
cross-platform. For example the option `recursive` does not work on Linux.
[`chokidar`](https://github.com/paulmillr/chokidar) can be used instead.

<hr>

[**Next** _(💻 Terminal)_](../4_terminal/README.md)\
[**Previous** _(📂 Symlinks)_](symlinks.md)\
[**Top**](README.md)

{'repo_name': 'ehmicky/cross-platform-node-guide', 'stars': '1080', 'repo_language': 'JavaScript', 'file_name': 'eof_bom.md', 'mime_type': 'text/plain', 'hash': -2441954874631411991, 'source_dataset': 'data'}


import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import TileLayer from '../src/ol/layer/Tile.js';
import View from '../src/ol/View.js';
import XYZ from '../src/ol/source/XYZ.js';
import {getRenderPixel} from '../src/ol/render.js';

const osm = new TileLayer({
  source: new OSM(),
});

const key = 'get_your_own_D6rA4zTHduk6KOKTXzGB';
const attributions =
  '© MapTiler ' +
  '© OpenStreetMap contributors';

const aerial = new TileLayer({
  source: new XYZ({
    attributions: attributions,
    url: 'https://api.maptiler.com/tiles/satellite/{z}/{x}/{y}.jpg?key=' + key,
    maxZoom: 20,
  }),
});

const map = new Map({
  layers: [osm, aerial],
  target: 'map',
  view: new View({
    center: [0, 0],
    zoom: 2,
  }),
});

const swipe = document.getElementById('swipe');

aerial.on('prerender', function (event) {
  const ctx = event.context;
  const mapSize = map.getSize();
  const width = mapSize[0] * (swipe.value / 100);
  const tl = getRenderPixel(event, [width, 0]);
  const tr = getRenderPixel(event, [mapSize[0], 0]);
  const bl = getRenderPixel(event, [width, mapSize[1]]);
  const br = getRenderPixel(event, mapSize);

  ctx.save();
  ctx.beginPath();
  ctx.moveTo(tl[0], tl[1]);
  ctx.lineTo(bl[0], bl[1]);
  ctx.lineTo(br[0], br[1]);
  ctx.lineTo(tr[0], tr[1]);
  ctx.closePath();
  ctx.clip();
});

aerial.on('postrender', function (event) {
  const ctx = event.context;
  ctx.restore();
});

swipe.addEventListener(
  'input',
  function () {
    map.render();
  },
  false
);

{'repo_name': 'openlayers/openlayers', 'stars': '7201', 'repo_language': 'JavaScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -1378895893372616506, 'source_dataset': 'data'}


import React, { useContext } from 'react';
import { ColorPickerContext } from '../context';
import { StyledPreview } from './styled';
import { recomposeColor } from '../../../styles/helpers/color';

export default function Preview() {
    const { rgba } = useContext(ColorPickerContext);
    const style = { backgroundColor: recomposeColor({ type: 'rgba', values: rgba }) };

    return <StyledPreview style={style} />;
}

{'repo_name': 'nexxtway/react-rainbow', 'stars': '1352', 'repo_language': 'JavaScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': 6623597290478991471, 'source_dataset': 'data'}


//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by AsyncGenerator.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH776
{
	using System.Threading.Tasks;
	[TestFixture]
	public class FixtureAsync : BugTestCase
	{
		[Test]
		public async Task ProxiedOneToOneTestAsync()
		{
			//Instantiate and setup associations (all needed to generate the error);
			A a = new A(1, "aaa");

			try
			{
				using (ISession session = Sfi.OpenSession())
				{
					await (session.SaveAsync(a));

					await (session.FlushAsync());
				}

				using (ISession session = Sfi.OpenSession())
				{
					A loadedA = (A) await (session.LoadAsync(typeof(A), 1));
					Assert.IsNull(loadedA.NotProxied);
					Assert.IsNull(loadedA.Proxied,
					              "one-to-one to proxied types not handling missing associated classes correctly (as null)");
				}
			}
			finally
			{
				using (ISession session = OpenSession())
				{
					await (session.DeleteAsync(a));
					await (session.FlushAsync());
				}
			}
		}
	}
}

{'repo_name': 'nhibernate/nhibernate-core', 'stars': '1783', 'repo_language': 'C#', 'file_name': 'NhibernateCollection_NamedURL.HxK', 'mime_type': 'text/xml', 'hash': 425608167368160232, 'source_dataset': 'data'}


// Sort Colors
// 双指针，时间复杂度O(n)，空间复杂度O(1)
public class Solution {
    public void sortColors(int[] A) {
        // 一个是red的index，一个是blue的index，两边往中间走
        int red = 0, blue = A.length - 1;

        for (int i = 0; i < blue + 1;) {
            if (A[i] == 0)
                swap (A, i++, red++);
            else if (A[i] == 2)
                swap(A, i, blue--);
            else
                i++;
        }
    }
    private static void swap(int[] A, int i, int j) {
        int tmp = A[i];
        A[i] = A[j];
        A[j] = tmp;
    }
}

{'repo_name': 'soulmachine/algorithm-essentials', 'stars': '535', 'repo_language': 'Java', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': -3214095324275468926, 'source_dataset': 'data'}


<?php

$expected     = array('class WithFoo1 { /**/ } ',
                      'class WithStaticFoo2 { /**/ } ',
                     );

$expected_not = array('class WithFoo2 { /**/ } ',
                      'class WithStaticFoo1 { /**/ } ',
                     );

?>

{'repo_name': 'exakat/exakat', 'stars': '328', 'repo_language': 'PHP', 'file_name': 'gremlin-server.sh', 'mime_type': 'text/x-shellscript', 'hash': -631116781475525281, 'source_dataset': 'data'}


attribute.availability has unrecognized substring. test should fail.

{'repo_name': 'vz-risk/veris', 'stars': '331', 'repo_language': 'HTML', 'file_name': 'action.physical_unrecognized.json', 'mime_type': 'text/plain', 'hash': -8364010079525967728, 'source_dataset': 'data'}


/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   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 .
 */

#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_RTFSDREXPORT_HXX
#define INCLUDED_SW_SOURCE_FILTER_WW8_RTFSDREXPORT_HXX

#include <filter/msfilter/escherex.hxx>
#include <editeng/outlobj.hxx>
#include <rtl/strbuf.hxx>

#include <map>
#include <memory>

#include "wrtww8.hxx"

class RtfExport;
class RtfAttributeOutput;
class SwFrameFormat;

/// Handles export of drawings using RTF markup
class RtfSdrExport final : public EscherEx
{
    RtfExport& m_rExport;

    RtfAttributeOutput& m_rAttrOutput;

    const SdrObject* m_pSdrObject;

    /// Remember the shape type.
    sal_uInt32 m_nShapeType;

    /// Remember the shape flags.
    ShapeFlag m_nShapeFlags;

    /// Remember style, the most important shape attribute ;-)
    OStringBuffer m_aShapeStyle;

    std::map<OString, OString> m_aShapeProps;

    /// Remember which shape types we had already written.
    std::unique_ptr<bool[]> m_pShapeTypeWritten;

    bool m_bInGroup = false;

public:
    explicit RtfSdrExport(RtfExport& rExport);
    ~RtfSdrExport() override;

    /// Export the sdr object as Sdr.
    ///
    /// Call this when you need to export the object as Sdr in RTF.
    void AddSdrObject(const SdrObject& rObj);

    /// Is this a standalone TextFrame, or used as a TextBox of a shape?
    static bool isTextBox(const SwFrameFormat& rFrameFormat);
    /// Write editeng text, e.g. shape or comment.
    void WriteOutliner(const OutlinerParaObject& rParaObj, TextTypes eType);

private:
    /// Start the shape for which we just collected the information.
    ///
    /// Returns the element's tag number, -1 means we wrote nothing.
    using EscherEx::StartShape;
    sal_Int32 StartShape();

    /// End the shape.
    ///
    /// The parameter is just what we got from StartShape().
    using EscherEx::EndShape;
    void EndShape(sal_Int32 nShapeElement);

    void Commit(EscherPropertyContainer& rProps, const tools::Rectangle& rRect) override;

    void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance = 0) override;
    void CloseContainer() override;

    sal_uInt32 EnterGroup(const OUString& rShapeName, const tools::Rectangle* pBoundRect) override;
    void LeaveGroup() override;

    void AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId = 0) override;

    /// Add starting and ending point of a line to the m_pShapeAttrList.
    void AddLineDimensions(const tools::Rectangle& rRectangle);

    /// Add position and size to the OStringBuffer.
    void AddRectangleDimensions(OStringBuffer& rBuffer, const tools::Rectangle& rRectangle);

    /// Exports the pib property of the shape
    void impl_writeGraphic();
};

#endif // INCLUDED_SW_SOURCE_FILTER_WW8_RTFSDREXPORT_HXX

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

{'repo_name': 'LibreOffice/core', 'stars': '907', 'repo_language': 'None', 'file_name': 'README', 'mime_type': 'text/plain', 'hash': 5756171531532916447, 'source_dataset': 'data'}


/* Flot plugin for automatically redrawing plots as the placeholder resizes.

Copyright (c) 2007-2013 IOLA and Ole Laursen.
Licensed under the MIT license.

It works by listening for changes on the placeholder div (through the jQuery
resize event plugin) - if the size changes, it will redraw the plot.

There are no options. If you need to disable the plugin for some plots, you
can just fix the size of their placeholders.

*/

/* Inline dependency:
 * jQuery resize event - v1.1 - 3/14/2010
 * http://benalman.com/projects/jquery-resize-plugin/
 *
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */

(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);

(function ($) {
    var options = { }; // no options

    function init(plot) {
        function onResize() {
            var placeholder = plot.getPlaceholder();

            // somebody might have hidden us and we can't plot
            // when we don't have the dimensions
            if (placeholder.width() == 0 || placeholder.height() == 0)
                return;

            plot.resize();
            plot.setupGrid();
            plot.draw();
        }

        function bindEvents(plot, eventHolder) {
            plot.getPlaceholder().resize(onResize);
        }

        function shutdown(plot, eventHolder) {
            plot.getPlaceholder().unbind("resize", onResize);
        }

        plot.hooks.bindEvents.push(bindEvents);
        plot.hooks.shutdown.push(shutdown);
    }

    $.plot.plugins.push({
        init: init,
        options: options,
        name: 'resize',
        version: '1.0'
    });
})(jQuery);

{'repo_name': 'zhengyunfei/springboot-hadmin', 'stars': '212', 'repo_language': 'Java', 'file_name': 'UserController.java', 'mime_type': 'text/x-java', 'hash': 9000604265460391605, 'source_dataset': 'data'}


package zs.shopping.pojo;

public class Category {
	private int cid;
	private String ctype;
	private boolean chot;
	private Account account;

	public int getCid() {
		return cid;
	}

	public void setCid(int cid) {
		this.cid = cid;
	}

	public String getCtype() {
		return ctype;
	}

	public void setCtype(String ctype) {
		this.ctype = ctype;
	}

	public boolean isChot() {
		return chot;
	}

	public void setChot(boolean chot) {
		this.chot = chot;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
}

{'repo_name': 'calmound/web', 'stars': '186', 'repo_language': 'HTML', 'file_name': '自定义提示.html', 'mime_type': 'text/html', 'hash': -5502311847568710454, 'source_dataset': 'data'}


"""
So here's the special syntax for a decorator.

"""

def mydecorator(func):
    print "Decorator is go!"
    """ A decorator that simply passes through a function.
    """
    return func

# Using the decorator.
@mydecorator
def sample():
    print "instantiating sample function"
    return 'sample'

print sample()

{'repo_name': 'noisebridge/PythonClass', 'stars': '101', 'repo_language': 'HTML', 'file_name': 'call_graph_example.py', 'mime_type': 'text/x-python', 'hash': -633898653513804693, 'source_dataset': 'data'}


// @flow
import React, { Component } from 'react'

import Button from '../../Button'
import { ROUTES } from '../../../core/constants'
import styles from './EncryptQR.scss'
import FullHeightPanel from '../../Panel/FullHeightPanel'
import CloseButton from '../../CloseButton'
import BackButton from '../../BackButton'
import ConfirmIcon from '../../../assets/icons/confirm.svg'
import CopyIcon from '../../../assets/icons/copy.svg'
import CheckIcon from '../../../assets/icons/check.svg'
import AddIcon from '../../../assets/icons/add.svg'
import withCopyCanvasToClipboard from '../../../hocs/withCopyCanvasToClipboard'

type Props = {
  encryptedWIF: string,
  resetEncryptedWIF: Function,
  handleCopy: (?HTMLCanvasElement, string, ?boolean) => Promise<void>,
  handleCreateCanvas: (?HTMLCanvasElement, string) => any,
  copied: boolean,
}

class EncryptQR extends Component<Props> {
  encryptedCanvas: ?HTMLCanvasElement

  componentDidMount() {
    const { encryptedWIF } = this.props
    this.props.handleCreateCanvas(this.encryptedCanvas, encryptedWIF)
  }

  render() {
    const { resetEncryptedWIF } = this.props
    return (
      <FullHeightPanel
        headerText="Encrypted QR Code"
        renderInstructions={false}
        headerContainerClassName={styles.headerIconMargin}
        renderHeaderIcon={() => <CheckIcon />}
        renderCloseButton={() => (

            <CloseButton routeTo={ROUTES.SETTINGS} />

        )}
        renderBackButton={() => <BackButton routeTo={ROUTES.ENCRYPT} />}
        iconColor="#F7BC33"
      >

               encrypted key
              <canvas
                ref={node => {
                  this.encryptedCanvas = node
                }}
              />
              <Button
                className={styles.submitButton}
                renderIcon={() =>
                  this.props.copied ? <ConfirmIcon /> : <CopyIcon />
                }
                type="submit"
                onClick={() => {
                  this.props.handleCopy(this.encryptedCanvas, 'encrypted-wif')
                }}
              >
                Copy Code Image
              </Button>

          <Button renderIcon={AddIcon} primary onClick={this.handlePrint}>
            Print
          </Button>

      </FullHeightPanel>
    )
  }

  handlePrint = () => {
    window.print()
  }
}

export default withCopyCanvasToClipboard(EncryptQR)

{'repo_name': 'CityOfZion/neon-wallet', 'stars': '1017', 'repo_language': 'JavaScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -1504010640183263821, 'source_dataset': 'data'}