max_stars_count int64 301 224k | text stringlengths 6 1.05M | token_count int64 3 727k |
|---|---|---|
3,269 | // Time: O(n)
// Space: O(1)
class Solution {
public:
int minSwaps(string s) {
int result = 0, curr = 0;
for (const auto& c : s) {
if (c == ']') {
++curr;
result = max(result, curr);
} else {
--curr;
}
... | 231 |
506 | #!/usr/bin/env pypy3
# https://abc099.contest.atcoder.jp/tasks/abc099_c
n = int(input())
k = [0] * (n + 1)
for i in range(min(n + 1, 6)): k[i] = i
for i in range(6, n + 1):
m = k[i - 1] + 1
for j in range(1, 8):
l = pow(6, j)
if l > i: break
m = min(m, k[i - l] + 1)
for j in range(1,... | 252 |
708 | from aif360.metrics.mdss.MDSS import MDSS | 18 |
60,067 | <filename>test/typing/reveal/namedtuple.py
import torch
t = torch.tensor([[3.0, 1.5], [2.0, 1.5]])
t_sort = t.sort()
t_sort[0][0, 0] == 1.5 # noqa: B015
t_sort.indices[0, 0] == 1 # noqa: B015
t_sort.values[0, 0] == 1.5 # noqa: B015
reveal_type(t_sort) # E: Tuple[{Tensor}, {Tensor}, fallback=torch._C.namedtu... | 285 |
679 | /**************************************************************
*
* 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 y... | 1,053 |
848 | <gh_stars>100-1000
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
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 ... | 9,714 |
32,544 | <filename>core-java-modules/core-java-concurrency-basic/src/test/java/com/baeldung/concurrent/executorservice/Java8ExecutorServiceIntegrationTest.java
package com.baeldung.concurrent.executorservice;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert... | 2,079 |
429 | <filename>libc/wchar/wcscpy.c
#include <wchar.h>
wchar_t * wcscpy(wchar_t * restrict dest, const wchar_t * restrict src) {
wchar_t * out = dest;
for (; (*dest=*src); src++, dest++);
return out;
}
| 90 |
575 | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "base/run_loop.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
#include "chrome/browser/ui... | 4,079 |
653 | // RUN: %clangxx -fsycl-device-only -fsycl-unnamed-lambda -S -Xclang -emit-llvm %s -o - | FileCheck %s
#include <sycl/sycl.hpp>
int main() {
sycl::queue Q;
Q.single_task([] {
// CHECK: tail call spir_func void @_Z21__spirv_MemoryBarrierjj(i32 2, i32 896) #{{.*}}
sycl::atomic_fence(sycl::memory_order::rel... | 584 |
2,519 | <filename>be/src/storage/utils.cpp
// This file is made available under Elastic License 2.0.
// This file is based on code available under the Apache license here:
// https://github.com/apache/incubator-doris/blob/master/be/src/olap/utils.cpp
// Licensed to the Apache Software Foundation (ASF) under one
// or more c... | 7,271 |
4,262 | <filename>components/camel-azure/camel-azure-cosmosdb/src/main/java/org/apache/camel/component/azure/cosmosdb/operations/CosmosDbOperationsBuilder.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for addit... | 1,330 |
2,984 | /*
* 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 ... | 3,968 |
984 | <reponame>om-sharma/java-driver
/*
* Copyright DataStax, Inc.
*
* 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 ap... | 2,956 |
348 | {"nom":"Saint-Salvi-de-Carcavès","circ":"1ère circonscription","dpt":"Tarn","inscrits":89,"abs":40,"votants":49,"blancs":5,"nuls":4,"exp":40,"res":[{"nuance":"DVD","nom":"M. <NAME>","voix":32},{"nuance":"FN","nom":"M. <NAME>","voix":8}]} | 100 |
3,227 | <reponame>ffteja/cgal<gh_stars>1000+
// Copyright (c) 2006 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : <NAME> <<EMAIL>>
//
#ifndef CGAL_SURFACE_MESH_SIMPLIF... | 825 |
534 | package mekanism.common.recipe.lookup;
import java.util.function.Predicate;
import javax.annotation.Nullable;
import mekanism.api.chemical.Chemical;
import mekanism.api.chemical.ChemicalStack;
import mekanism.api.recipes.MekanismRecipe;
import mekanism.api.recipes.inputs.IInputHandler;
import mekanism.common.recipe.lo... | 1,282 |
839 | <reponame>AnEmortalKid/cxf
/**
* 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.... | 4,568 |
8,805 | //
// KBAppToolbar.h
// Keybase
//
// Created by Gabriel on 4/22/15.
// Copyright (c) 2015 <NAME>. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Tikppa/Tikppa.h>
#import "KBRPC.h"
#import "KBAppDefines.h"
@class KBAppToolbar;
@protocol KBAppToolbarDelegate
- (void)appToolbar:(KBAppToolbar *... | 216 |
628 | <filename>api/files/urls.py
from django.conf.urls import url
from api.files import views
app_name = 'osf'
urlpatterns = [
url(r'^(?P<file_id>\w+)/$', views.FileDetail.as_view(), name=views.FileDetail.view_name),
url(r'^(?P<file_id>\w+)/versions/$', views.FileVersionsList.as_view(), name=views.FileVersionsLis... | 389 |
483 | <filename>ranger.py
#!/usr/bin/env python
'''
Libraries
'''
import base64, sys, argparse, re, subprocess, os, time, logging, signal, urllib2, cmd, ntpath, string, random, ConfigParser, hashlib, traceback, tempfile, collections, ast, datetime, sets
import xml.etree.ElementTree as etree
from threading import Thread, Lock... | 118,877 |
892 | <gh_stars>100-1000
{
"schema_version": "1.2.0",
"id": "GHSA-9jrm-2jjr-9qf4",
"modified": "2022-05-13T01:15:34Z",
"published": "2022-05-13T01:15:34Z",
"aliases": [
"CVE-2011-2002"
],
"details": "win32k.sys in the kernel-mode drivers in Microsoft Windows Vista SP2, Windows Server 2008 SP2, R2, and R2 SP... | 576 |
4,071 | /*
* \file onnx_importer_test.cc
* \brief The onnx importer test unit
*/
#include "gtest/gtest.h"
#include <thread>
#include "blaze/model_importer/onnx_importer.h"
namespace blaze {
TEST(TestOnnxImporter, TestDNN) {
ONNXImporter onnx_importer;
onnx_importer.LoadModel("./utest_data/onnx/dnn.onnx");
auto re... | 481 |
377 | <reponame>aviv-julienjehannet/GenSON
from .base import (
SchemaStrategy,
TypedSchemaStrategy
)
from .scalar import (
Typeless,
Null,
Boolean,
Number,
String
)
from .array import List, Tuple
from .object import Object
BASIC_SCHEMA_STRATEGIES = (
Null,
Boolean,
Number,
String,... | 269 |
994 | <filename>Competitions/Codeforces/Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition)/Little Artem and Presents.cpp
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
long long int n, c;
int main()
{
cin>>n;
c=2*(n/3);
if(n%3!=0)
{
c++;
}
cout<<c<<endl;
return 0;
}
| 146 |
460 | #include "../../../src/declarative/qml/qdeclarativefastproperties_p.h"
| 28 |
384 | //
// Copyright (c) Microsoft Corporation. All rights reserved.
//
package com.microsoft.connecteddevices.nearshare;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import ... | 1,811 |
488 | <reponame>maurizioabba/rose
/******************************************************************************
*
* DOT3D - An OpenGL dot file viewer
* <NAME>, 2003
*
* graph info display widget
*
*****************************************************************************/
#include "graphinfo.h"
#include <FL/Fl_... | 8,411 |
369 | //
// StoryMakeFilterFooterView.h
// GetZSCStoryMaker
//
// Created by whbalzac on 11/08/2017.
// Copyright © 2017 make<EMAIL>. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol StoryMakeFilterFooterViewDelegate <NSObject>
@optional
- (void)storyMakeFilterFooterViewCloseBtnClicked;
- (void)storyMakeFilte... | 192 |
634 | <reponame>elishacloud/dxwrapper
#pragma once
#define VISIT_PROCS_SHAREDPROCS(visit) \
visit(DllCanUnloadNow, jmpaddr) \
visit(DllGetClassObject, jmpaddr) \
visit(DllRegisterServer, jmpaddr) \
visit(DllUnregisterServer, jmpaddr)
#ifdef PROC_CLASS
namespace ShardProcs
{
using namespace Wrapper;
VISIT_PROCS_SHARED... | 265 |
319 | <filename>demos/sandbox/src/main/java/org/openimaj/workinprogress/featlearn/cifarexps/CIFARExperimentFramework.java
/**
* Copyright (c) 2011, The University of Southampton and the individual contributors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* ... | 2,180 |
2,139 | package org.jruby.test;
import junit.framework.TestCase;
import org.jcodings.specific.SJISEncoding;
import org.jcodings.specific.UTF8Encoding;
import org.jruby.Ruby;
import org.jruby.RubyString;
import org.jruby.util.io.EncodingUtils;
public class TestEncodingAPI extends TestCase {
private Ruby runtime;
pub... | 387 |
6,304 | // Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
// Image Diff: Provides a metric for measuring the difference between two encoded images. Prints
// out a single floating-point number between 0.0 and 1.0; 0 means that the images are ... | 1,013 |
728 | <reponame>santoshkumarkannur/sirix<filename>bundles/sirix-core/src/test/java/org/sirix/service/xml/shredder/WikipediaImportTest.java<gh_stars>100-1000
/**
* Copyright (c) 2011, University of Konstanz, Distributed Systems Group All rights reserved.
*
* Redistribution and use in source and binary forms, with or withou... | 1,538 |
674 | <filename>env/lib/python2.7/site-packages/wheel/paths.py
"""
Installation paths.
Map the .data/ subdirectory names to install paths.
"""
import os.path
import sys
import distutils.dist as dist
import distutils.command.install as install
def get_install_command(name):
# late binding due to potential monkeypatchin... | 533 |
2,151 | <filename>opt/bitmap/src/com/android/bitmap/BitmapCache.java
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www... | 326 |
4,538 | <filename>components/linkkit/dev_model/dm_message_cache.h<gh_stars>1000+
/*
* Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#if !defined(DM_MESSAGE_CACHE_DISABLED)
#ifndef _DM_MESSAGE_CACHE_H_
#define _DM_MESSAGE_CACHE_H_
#include "iotx_dm_internal.h"
#define DM_MSG_CACHE_TIMEOUT_MS_DEFAULT (10000)
typ... | 439 |
1,337 | /*
* Copyright 2015 <NAME>
*
* 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 writin... | 10,831 |
1,021 | #include <pybind11/pybind11.h>
#include "otio_anyDictionary.h"
#include "otio_anyVector.h"
#include "otio_bindings.h"
#include "otio_utils.h"
#include "otio_errorStatusHandler.h"
#include "opentimelineio/serialization.h"
#include "opentimelineio/deserialization.h"
#include "opentimelineio/serializableObject.h"
#include... | 2,948 |
3,579 | #!/usr/bin/env python3
# encoding: utf-8
"""
tuya-discovery.py
Created by kueblc on 2019-11-13.
Discover Tuya devices on the LAN via UDP broadcast
"""
import asyncio
import json
from Cryptodome.Cipher import AES
pad = lambda s: s + (16 - len(s) % 16) * chr(16 - len(s) % 16)
unpad = lambda s: s[:-ord(s[len(s) - 1:])]
... | 719 |
891 | package com.scrollablelayout.simple.recyclerloadmore;
import android.view.View;
public interface OnLoadMoreListener {
void onLoadMore(View view);
}
| 48 |
6,156 | /*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#im... | 1,242 |
28,056 | <filename>src/main/java/com/alibaba/fastjson/serializer/ContextObjectSerializer.java
package com.alibaba.fastjson.serializer;
import java.io.IOException;
public interface ContextObjectSerializer extends ObjectSerializer {
void write(JSONSerializer serializer, //
Object object, //
Bea... | 121 |
387 | """
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : builder.py
# Abstract :
# Current Version: 1.0.0
# Date : 2020-05-31
####... | 5,574 |
14,668 | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// clang-format off
#include <hb.h>
#include <hb-aat.h>
// clang-format on
#include "third_party/blink/renderer/platform/fonts/opentype/open_type_caps_su... | 4,699 |
578 | /*
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available.
*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License.
*
* License for BK-JOB蓝鲸智云作业平台:
* ----------------------------------------------... | 1,030 |
466 | {
"extends": "./node_modules/mwts/",
"ignorePatterns": ["node_modules", "dist", "fixtures"],
"env": {
"mocha": true
}
}
| 59 |
320 | <reponame>2757571500/sdk<filename>jme3-scenecomposer/src/com/jme3/gde/scenecomposer/gizmo/NodeCallback.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.jme3.gde.scenec... | 1,976 |
388 | <reponame>OctaviantoVyan/jwswing
// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@
package example;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import javax.swing.*;
import javax.swing.text.DateFormatt... | 1,078 |
406 | package com.braintreepayments.api;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import androidx.annotation.VisibleForTesting;
import org.json.JSONExcept... | 1,779 |
1,125 | <reponame>peterjc123/XNNPACK
// Copyright 2019 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <gtest/gtest.h>
#include <xnnpack/common.h>
#include <xnnpack/isa-checks.h>
#include <xnnpack/conv.h>
#include "con... | 83,054 |
8,851 | <filename>wagtail/admin/rich_text/editors/draftail/__init__.py<gh_stars>1000+
import json
import warnings
from django.forms import Media, widgets
from django.utils.functional import cached_property
from wagtail.admin.edit_handlers import RichTextFieldPanel
from wagtail.admin.rich_text.converters.contentstate import C... | 1,413 |
6,059 | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include "IRInstruction.h"
#include "LinearScan.h"
#include "Liveness.h"
#include <unordered_map>
#include <utility>
... | 630 |
8,706 | #!/usr/bin/python3
# Runs SSLyze on the TLS endpoints of a box and outputs
# the results so we can inspect the settings and compare
# against a known good version in tls_results.txt.
#
# Make sure you have SSLyze available:
# wget https://github.com/nabla-c0d3/sslyze/releases/download/release-0.11/sslyze-0_11-linux64.... | 3,184 |
1,210 | {
"UIReplay": {
"UIFolder": "data/UIExploreResult/Graph",
"GraphFolder": "data/UIExploreResult/Graph",
"TestExampleFolder": "data/UIExploreResult/ExpandExample/0",
"WaitTime": 4
},
"Debug": {
"ShowButton": true,
"ShowCostTime": false,
"ShowImageRatio":... | 175 |
331 | //
// XMLNode.h
// Monal
//
// Created by <NAME> on 6/29/13.
//
//
#import <Foundation/Foundation.h>
#import "MLConstants.h"
NS_ASSUME_NONNULL_BEGIN
@interface MLXMLNode : NSObject <NSSecureCoding>
{
}
+(BOOL) supportsSecureCoding;
/**
Initilizes with an element type
*/
-(id) initWithElement:(NSString*) ... | 651 |
713 | <reponame>franz1981/infinispan
package org.infinispan.server.hotrod;
import java.time.temporal.Temporal;
import javax.security.auth.Subject;
import org.infinispan.security.Security;
public class AccessLoggingHeader extends HotRodHeader {
public final Object principalName;
public final Object key;
public fi... | 234 |
348 | {"nom":"Chéronnac","circ":"2ème circonscription","dpt":"Haute-Vienne","inscrits":229,"abs":96,"votants":133,"blancs":12,"nuls":8,"exp":113,"res":[{"nuance":"COM","nom":"<NAME>","voix":66},{"nuance":"REM","nom":"<NAME>","voix":47}]} | 93 |
3,402 | #!/usr/bin/python
#
# 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... | 511 |
416 | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* 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
... | 2,878 |
5,169 | {
"name": "UIPanGestureRecognizerDirection",
"version": "1.1.1",
"platforms": {
"ios": "11.0"
},
"source_files": "UIPanGestureRecognizerDirection/Classes/**/*",
"homepage": "https://github.com/iwheelbuy/UIPanGestureRecognizerDirection",
"license": "MIT",
"authors": {
"iwheelbuy": "<EMAIL>"
},
... | 266 |
649 | package net.serenitybdd.screenplay;
class EatsImmutableFruit implements Performable {
private final String fruit;
EatsImmutableFruit(String fruit) {
this.fruit = fruit;
}
public static EatsImmutableFruit ofType(String type) {
return Tasks.instrumented(EatsImmutableFruit.class, type);... | 150 |
5,169 | {
"name": "Hostess",
"version": "0.9.1",
"summary": "A Swift implementation of NSHost that builds for iOS, macOS and tvOS.",
"description": "A Swift implementation of NSHost (Host in Swift) that works on iOS, OS X and tvOS. Hostess.swift is safe to use in a framework because it does not require a bridging heade... | 496 |
2,419 | <filename>src/pyodbc.h
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, subli... | 1,863 |
930 | <reponame>zhenchai/pigeon<gh_stars>100-1000
/**
* Dianping.com Inc.
* Copyright (c) 2003-2013 All Rights Reserved.
*/
package com.dianping.pigeon.remoting.provider.service.method;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Concu... | 1,732 |
554 | <reponame>fxxf1111/X-APM<filename>third-party/tiles/src/main/java/dev/nick/tiles/tile/EditTextTileView.java
package dev.nick.tiles.tile;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.text.InputType;
import android.util.AttributeS... | 1,213 |
2,637 | <filename>vendors/infineon/XMCLib/2.1.20/drivers/src/xmc_i2c.c
/**
* @file xmc_i2c.c
* @date 2015-10-02
*
* @cond
*********************************************************************************************************************
* XMClib v2.1.20 - XMC Peripheral Driver Library
*
* Copyright (c) 2015-2018, I... | 6,494 |
357 | import java.util.*;
class RandomDemo
{
public static void main(String[] args)
{
Random r = new Random();
System.out.println( r.nextInt() ); //取得下一个随机整型数
System.out.println( r.nextInt() );
System.out.println( r.nextInt(10) );
System.out.println( r.nextInt(10) );
Sys... | 268 |
4,216 | /**
* @file methods/amf/amf.hpp
* @author <NAME>
* @author <NAME>
* @author <NAME>
*
* Alternating Matrix Factorization
*
* The AMF (alternating matrix factorization) class, from which more commonly
* known techniques such as incremental SVD, NMF, and batch-learning SVD can be
* derived.
*
* mlpack is free ... | 2,300 |
1,062 | //
// Generated by class-dump 3.5b1 (64 bit) (Debug version compiled Dec 3 2019 19:59:57).
//
// Copyright (C) 1997-2019 <NAME>.
//
#import <objc/NSObject.h>
#import <MailFW/MFMessageConsumer-Protocol.h>
#import <MailFW/MFSearchableIndexQueryResultProcessor-Protocol.h>
@class NSMutableDictionary, NSString;
@pr... | 728 |
349 | <reponame>zyjjfm/fanfouapp-opensource
/*******************************************************************************
* Copyright 2011, 2012, 2013 fanfou.com, <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obt... | 686 |
1,414 | #ifndef __MDFN_SURFACE_H
#define __MDFN_SURFACE_H
struct MDFN_Rect
{
int32 x, y, w, h;
};
enum
{
MDFN_COLORSPACE_RGB = 0,
//MDFN_COLORSPACE_LRGB = 1, // Linear RGB, 16-bit per component, TODO in the future?
//MDFN_COLORSPACE_YUV = 2, // TODO, maybe.
};
struct MDFN_PaletteEntry
{
uint8 r, g, b;
};
/*
template<t... | 4,132 |
2,073 | /**
* 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... | 783 |
4,253 | package com.mashibing.springboot.service;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mashibing.springboot.e... | 450 |
844 | <reponame>uQr/essentials
/*
* Copyright (C) 2014-2016 <NAME>, greenrobot (http://greenrobot.org)
*
* 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... | 3,101 |
558 | /*
* Licensed to <NAME> (the "Author") under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Author licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this ... | 3,449 |
1,056 | /*
* 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 ... | 1,792 |
312 | #include "wfrest/HttpServer.h"
using namespace wfrest;
int main()
{
HttpServer svr;
svr.PUT("/account", [](const HttpReq *req, HttpResp *resp)
{
fprintf(stderr, "put account\n");
resp->String("put verb");
});
svr.DELETE("/account", [](const HttpReq *req, HttpResp *resp)
{
... | 383 |
4,959 | <reponame>nipunbatra/pyro
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from typing import List, Union, ValuesView
from torch.optim import Optimizer
import pyro
from .optim import PyroOptim
class HorovodOptimizer(PyroOptim):
r"""
Distributed wrapper for a :class:`~pyr... | 829 |
3,401 | # -*- coding: UTF-8 -*-
"""
@author:xda
@file:fund_share_monitor.py
@time:2021/01/27
"""
# 份额监控,对上一天额度出现较大申购进行监控
import sys
sys.path.append('..')
from configure.settings import DBSelector
from common.BaseService import BaseService
from fund.fund_share_crawl import ShareModel,FundBaseInfoModel,Fund
from sqlalchemy impo... | 465 |
715 | import numpy as np
from pyray.shapes.twod.paraboloid import *
from pyray.shapes.twod.functional import *
from pyray.rotation import *
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib as mpl... | 3,887 |
552 | /*
Copyright 2017 Vector Creations Ltd
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... | 463 |
370 | #pragma once
#include <memory>
#include <vector>
#include <boost/noncopyable.hpp>
#include <petuum_ps/thread/context.hpp>
#include <petuum_ps_common/include/constants.hpp>
#include <petuum_ps_common/oplog/abstract_row_oplog.hpp>
#include <glog/logging.h>
namespace petuum {
struct SerializedOpLogBuffer : boost::nonco... | 2,043 |
852 | /*
* see file for a description of this class.
*
* $Date: 2012/02/07 18:35:00 $
* $Revision: 1.6.2.1 $
* \author <NAME> INFN Padova
*
*/
//-----------------------
// This Class' Header --
//-----------------------
#include "CondTools/DT/test/validate/DTT0ValidateHandler.h"
//-------------------------------... | 1,753 |
1,040 | <reponame>Ybalrid/orbiter
/*
**----------------------------------------------------------------------------
**
** File: input.h
** Purpose: DirectInput.
** Notes:
**
** Copyright (C) 1995-1999 Microsoft Corporation. All Rights Reserved.
**---------------------------------------------------------------------... | 177 |
360 | /* -------------------------------------------------------------------------
*
* fe-secure.cpp
* functions related to setting up a secure connection to the backend.
* Secure connections are expected to provide confidentiality,
* message integrity and endpoint authentication.
*
*
* Portions Copyright (c... | 32,848 |
7,086 | import datetime
from datetime import datetime
from executor.executor import dispatch_web_vuln, dispatch_service_vuln, dispatch_statistics
from model.vuln import Statistics, WebVuln, WebParam, WebParamPosition, WebRequest, WebResponse, ServiceVuln
def process_web_vuln(instance, data):
"""将 web 漏洞 json 转换为相关 model... | 1,323 |
1,091 | <gh_stars>1000+
import os
from PIL import Image
def create_thumbnail(infile: str, include_in_path: str = "thumbnail", size: tuple = (256, 256)):
infile_name, infile_extension = os.path.splitext(infile)
outfile = f"{infile_name}.{include_in_path}{infile_extension}" # .png, jpeg etc
if infile.find(include_in... | 782 |
444 | from datetime import timedelta
from django.utils import timezone
def first_day_of_the_week(relative_to_date=None):
if relative_to_date is None:
relative_to_date = timezone.now()
return (relative_to_date -
timedelta(days=relative_to_date.weekday())).date()
| 110 |
575 | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/global_error/global_error_waiter.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
namespace test {... | 243 |
1,290 | <reponame>dfirpaul/Active-Directory-Exploitation-Cheat-Sheet-1
# -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
... | 1,935 |
2,151 | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_PAYMENTS_CONTENT_SERVICE_WORKER_PAYMENT_INSTRUMENT_H_
#define COMPONENTS_PAYMENTS_CONTENT_SERVICE_WORKER_PAYMENT_INSTRUMENT_H_
#includ... | 1,590 |
467 | <reponame>orion434/Arduino<gh_stars>100-1000
/*-----------------------------------------
//Update History:
//2016/06/13 V1.1 by Lee add support for burst mode
--------------------------------------*/
#include <string.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
... | 7,196 |
701 | import sys
if "sphinx" not in sys.modules:
from . import cv2
from . import data
from .data import *
from Foundation import NSString
# wildcard import above does not import "private" variables like __version__
# this makes them available
globals().update(cv2.__dict__)
def autorotate(fram... | 449 |
844 | <gh_stars>100-1000
from __future__ import absolute_import, division, print_function
from datashape import dshape
from odo.chunks import *
from toolz import first
CL = chunks(list)
def test_chunks_basics():
assert isinstance(CL, type)
assert issubclass(CL, Chunks)
def test_chunks_isnt_consumable():
cl... | 408 |
468 | <filename>OpenGLDLL/GLFunctions/NV/NV_gpu_program5_Include.h
#define GLI_INCLUDE_GL_NV_GPU_PROGRAM5
enum Main {
//GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A,
//GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B,
//GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C,... | 461 |
349 | <filename>tests/test_point.py
import os
import rasterio
from rasterstats.point import point_window_unitxy, bilinear, geom_xys
from rasterstats import point_query
raster = os.path.join(os.path.dirname(__file__), 'data/slope.tif')
raster_nodata = os.path.join(os.path.dirname(__file__), 'data/slope_nodata.tif')
with ras... | 1,993 |
1,444 | <reponame>J-VOL/mage<filename>Mage.Sets/src/mage/cards/n/NineRingedBo.java<gh_stars>1000+
package mage.cards.n;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abil... | 512 |
539 | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
namespace bond
{
namespace python
{
// Indexing suite equivalent to boost::... | 1,558 |
8,747 | # This example code is in the Public Domain (or CC0 licensed, at your option.)
# Unless required by applicable law or agreed to in writing, this
# software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied.
# -*- coding: utf-8 -*-
from __future__ import pri... | 308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.