blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
8c8e5a856cc2afa938ff0687f2ee7c8db740089e | 0fae59689093c3e9b4260110ea35c081c857ad2f | firewood/topcoder | /atcoder/abc_246/c.cpp | C++ | cpp | 671 | no_license | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;
int64_t solve(int64_t N, int64_t K, int64_t X, std::vector<int64_t> A) {
for (int i = 0; i < N; ++... |
b423d240c62c49ea9729ecac9e0a351e39eda6ea | 02e28b712b3960df75d059fb8f5bf0abdd28859b | alanfx/cpp-client | /src/hotrod/impl/operations/OperationsFactory.cpp | C++ | cpp | 5,178 | permissive |
#include "hotrod/sys/types.h"
#include "hotrod/impl/operations/OperationsFactory.h"
#include "hotrod/impl/protocol/CodecFactory.h"
#include "hotrod/impl/transport/Transport.h"
#include "hotrod/impl/operations/GetOperation.h"
#include "hotrod/impl/operations/PutOperation.h"
#include "hotrod/impl/operations/PutIfAbsent... |
08ee3e6b517c4b60e722d7251d62a16377968182 | 09c28c1f6eaeac2b622f7f1b37e0be6bb23680d3 | Sebermic/akai | /4.4 pizza.cpp | C++ | cpp | 391 | no_license | /*在披萨饼程序中使用已定义的常量*/
#include <stdio.h>
#define PI 3.14159
int main(void)
{
float area,circum,radius;
printf("What is the radius of your pizza?\n");
scanf("%f",&radius);
area = PI*radius*radius;
circum = 2.0 *PI*radius;
printf("Your basic pizza parameters are as follows:\n");
printf("circumference = %1.2f,area ... |
d42b681e08b66a6d46e56989b858aa80a42bc54b | c97105c9ebe1096d203d546e529a1b6d2730936e | hbdlyao/HVDC | /Code/HvdcProject/CHvdcPRJ_RwMvc.cpp | C++ | cpp | 2,344 | no_license | ///////////////////////////////////////////////////////////
// CProjectRwMDB.cpp
// Implementation of the Class CHvdcPRJ_RwMvc
// Created on: 18-4月-2017 22:23:47
// Original author: open2
///////////////////////////////////////////////////////////
#include "CHvdcPRJ_RwMvc.h"
#include "CmcParams.h"
#include "C... |
8f42c858b882773073e2a04a47bf9bcd2afac049 | e943bd7388104a8d40bbe4c4c1edd230fab2b4b8 | ankityadav107/Solutions-in-Place | /Coding_blocks/GreedyAlgorithm/chopsticks.cpp | C++ | cpp | 533 | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, d;
cin >> n >> d;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int i = 0, j = 1;
int count = 0;
sort(a, a + n);
while (i < n && j < n)
{
if (a[j] - a[i] > d)
... |
44115bccdd8586d829be7212399252d2997e4d14 | c4fcea32e8613f40d2fb7a1fd62ee5cf80626120 | jpryan1/ie-solver | /ie_solver/boundaries/cubic_spline.cpp | C++ | cpp | 1,650 | no_license | // Copyright 2019 John Paul Ryan
#include <cmath>
#include <iostream>
#include <cassert>
#include <vector>
#include "ie_solver/boundaries/cubic_spline.h"
#include "ie_solver/log.h"
#define NUM_SPLINE_POINTS 20
namespace ie_solver {
void CubicSpline::get_spline_points(std::vector<double>* x0_spline_points,
... |
fe0fd4930abf83a8ac1a866df3b6908fb70c29a0 | db6e230ab2750cb10d6386f5491d26e692798fde | ffhan/garduino | /src/main/Menu.cpp | C++ | cpp | 673 | permissive | #include "Menu.h"
Menu::Menu(char *title) : Item(title){
type = MENU;
}
void Menu::addItem(Item *item){
childItems.add(item);
}
void Menu::addItems(){}
Item *Menu::enter(){
Item *temp = childItems.get(0);
if(temp) return temp;
Item::enter();
}
void Menu::processChildItem(int index, Printer func){
childItem... |
3726ed3d7d944154feb8e0a051a932ff74d54726 | ac95a07f1becff4434972359be8b04073c85b823 | yangyang-01-debug/res | /PVZ/MyPVZ0/basicpbs.cpp | C++ | cpp | 4,316 | no_license | #include "basicpbs.h"
#include <QDebug>
//int cout =0;
//int couttime = 100;
BasicPbs::BasicPbs(QWidget *parent) : BasicMovie(parent)
{
// this->m_label = new QLabel(parent);
// this->m_movie = nullptr;
// this->m_isBeBoomed = false;
// this->m_rect.setTopLeft(QPoint(0,0));
// this->m_label->setFixedSize... |
aec547fb2b41aa3d4fe97512e4206bdba5833094 | 2f278d2a19af81a3372d9a29dd716b586c5952c6 | cheerayhuang/Double-M | /src/thread.cc | C++ | cc | 2,525 | no_license | /**************************************************************************
*
* Copyright (c) 2015 Cheeray Huang. All Rights Reserved
*
* @file: thread.cc
* @author: Huang Qiyu
* @email: cheeray.huang@gmail.com
* @date: 03-12-2017 12:36:44
* @version $Revision$
*
**********************************************... |
fc2eaba070a9d69d0bf36049669914c6ae3a5591 | 2028369aa0a28ecc72d2185198616c49d580a01e | blopit/TinyBraveHeroes | /Classes/Combat/GridGraph.cpp | C++ | cpp | 2,422 | no_license | //
// GridTile.cpp
// TinyBraveHeroes
//
// Created by Shrenil Patel on 2017-09-06.
//
//
#include "GridGraph.hpp"
#include "GameManager.hpp"
using namespace std;
cocos2d::Vec2 GridTile::getCoordinate() {
return GridGraph::getCoordinate(location);
}
void GridGraph::addTile(Vec location, int weight) {
gr... |
9ec79f2cdd55b8b7b56acec6b0c9f1637c57812e | 20c117f2d88d31bd44b8c8121940e636b465ff02 | mogoweb/webkit_for_android5.1 | /skia_old/gm/poly2poly.cpp | C++ | cpp | 3,242 | permissive |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm.h"
namespace skiagm {
class Poly2PolyGM : public GM {
public:
Poly2PolyGM() {}
protected:
virtual SkString onShortName() {
return SkString("pol... |
004527b8c542877da6bb53b38cdd3865dc314c1e | 41ce6eecb315b15cdc6e079ed8ef912222f9c808 | SHS-GROUP/NEO-DFT | /libcchem/rysq/src/kernel/quadrature1.hpp | C++ | hpp | 6,122 | no_license | #ifndef RYSQ_KERNEL_QUADRATURE1_HPP
#define RYSQ_KERNEL_QUADRATURE1_HPP
#include "kernel/quadrature.hpp"
#include "kernel/quadrature1-impl.hpp"
#include <math.h>
#include "rysq-core.hpp"
#include "vector.hpp"
#include "roots/roots.hpp"
#include "kernel/transfer.hpp"
#include "kernel/recurrence.hpp"
namespace rysq ... |
f18a72fa7d8cf1741b6db0f69583534ffda1671b | 1834e7bc19acb8afe6d53a7178839c08e7eee09a | samuel1208/opencv | /modules/ocl/src/brute_force_matcher.cpp | C++ | cpp | 48,150 | no_license | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
e01c0379961824660afec10fb0a6598a682b1eed | 4c3b07affb1a1fd399b095de151f9823a9e3cf98 | amywieliczka/widgets | /Common/FooterWidget.cpp | C++ | cpp | 3,454 | no_license | /* *****************************************************************************
Copyright (c) 2016-2017, The Regents of the University of California (Regents).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions ar... |
f628bcc6ce88e190b5f8acacf3668f31315d7611 | d75dc96f9dbab1eddadb4cb7bc06d15423dd9d78 | arcatdmz/Halide | /apps/autoscheduler/AutoSchedule.cpp | C++ | cpp | 142,605 | permissive | /*
This file is the core of the autoscheduler. Most of the code here is
about navigating the search space and computing the
featurization. This also contains the top-level interface into the
autoscheduler.
The most interesting classes to look at are:
LoopNest Represents one node in our tree ... |
9e397ba27735845859e2b6ddbf34c62fb4162851 | 904f87a41f6b355d50feaef5fa2e66ed35bcebfe | Sigm0oid/Algorithms-DataStructures | /AdHoc/A. Ostap and Grasshopper/main.cpp | C++ | cpp | 590 | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
string s;
cin>>s;
int goss,insect,ngoss,ninsect;
for(int i=0;i<n;i++)
{if(s[i]=='G')
ngoss=i;
if (s[i]=='T')
ninsect=i;
}
goss=min(ngoss,ninsect);
insect=max(ngoss,ninsect);
bool ok=f... |
723fcc4b28f47196a576addaff4b52dbfeae7a79 | 5a3834d3df2b5c0958d5670623e7b757bd8f6778 | faxinwang/OJ_NowCoder | /剑指offer编程题/9.变态跳台阶.cpp | C++ | cpp | 1,059 | no_license | /*
一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。
求该青蛙跳上一个n级的台阶总共有多少种跳法。
*/
/*
解题思路:
设想青蛙在第i层,则青蛙有i种途径直接到达该层,分别是从第j层一次跳i-j层到达。
其中 0<= j < i, 设青蛙到达第i层的方法数有d[i]中,则 d[i] = sum( d[j] ), 0<=j<i.
又有:d[0] = 1, d[1] = 1
这样,通过递推即可计算出d[i]
简化:
f(n-1) = f(0) + f(1)+f(2)+f(3) + ... + f((n-1)-1) = f(0) + f(1) + f(2) + f(3) + ... + f(n-2)
... |
5a67e92ddadc5e6c800b1a16e3b9fcfc0248f47e | 31ada1b0e73cd1a752a63f1de4181aee454a5b6c | guillegalor/Practicas-IG | /practica3.hpp | C++ | hpp | 475 | no_license | // *********************************************************************
// **
// ** Informática Gráfica
// ** Práctica 3 (declaraciones públicas)
// **
// *********************************************************************
#ifndef IG_PRACTICA3_HPP
#define IG_PRACTICA3_HPP
#include "grafo-escena.hpp"
void P3_Inic... |
0e93d2c2a595bc5236a0e55116c7bcd90c498a4e | 460f5274f56dbf506c39948beefece3553039615 | hel4859/mixed_localization | /grid_localization_gl8/pointcloud_receive.cpp | C++ | cpp | 44,700 | no_license | #include "pointcloud_receive.h"
/*---------------------------------------------------------------------------
Initialization part
----------------------------------------------------------------------------*/
pointcloud_receive::pointcloud_receive()
{
//node handle
ros::NodeHandle nh;
r... |
e6c866ec85b9df4782af2d3a36ef9bc59560bde5 | b27ff7f9befe136941bc5b85cf803f6174c843ea | Mindjolt2406/Competitive-Programming | /ICPC Cookbook/Mo Algorithm.cpp | C++ | cpp | 1,517 | permissive | int block;
typedef struct node
{
int first,second,i;
}node;
bool sorter(const node &a, const node &b)
{
if(a.fi/block < b.fi/block) return true;
else if(a.fi/block> b.fi/block) return false;
else
{
if(a.se<b.se) return true;
return false;
}
}
int add(int*counter,int*l,int pos)
{
int count = ... |
eb0524674297b1fe96ffa42faf480d7155e60786 | 666b8ada1b38c8af8a52f2849d97d1c75d5ba243 | sudarshansunder/AI-Project | /ai.cpp | C++ | cpp | 3,629 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 1024
int depth = 0;
typedef struct Tree1
{
char str[10];
int hst, d;
struct Tree1 *left, *middle, *right;
} Tree;
typedef struct
{
Tree *arr[5000];
int f, r;
int count;
} Queue;
void init(Queue *q)
{
q->r = q->f = q->count = 0;
}
void a... |
0542994285f692f2a698436a631e320886864b5c | 65d877d5ec8f660820502d1f3d5b83feb2477460 | chromium/chromium | /chrome/updater/installer_mac.cc | C++ | cc | 1,609 | permissive | // Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/updater/installer.h"
#include "base/files/file_path.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#inclu... |
0b4f74fd62c1768bbdfbd50b027db8d15765c78f | 046adfdaaee547896b31a7679c322d47c294710a | darknebuli/darknebuli-RM | /clients/email_sender/vmime/libvmime-0.9.1/vmime/constants.hpp | C++ | hpp | 13,455 | no_license | U2FsdGVkX19hdzQ1S01qQhoPZfgXwSg1a7pooFbiVSGbyiSDhge9wSKz+ngmF0+9
+X1AeMAgrfzbqiNKUSy9BiaIaIyjk7KS4QcuJwMwfiie4sjfiBP8AznYx5vvDAQJ
zK6mXc45hoyd+OidcOWXFJxfoRW+IjTEve9Fy3UDfMkFINKKSZUomyPZMYs30hZp
oclPjcAT/n5wI1mmobfbvxe1S+uwbvDuETmE8vCXZyNZhLEC78OB13RR+2BPzSoY
gwqnVTsYIEcrb7PwdNwUvQuWc9jNqCoi+kZOCUC6Cetn0R8OJB7KlrUhuJT8... |
48aa6df33da6e80871c990d3b0c807f9d00a2158 | 9994717ff8e97d29961274d61215ccaa639a30a3 | Danielzhw/MEMS-oriented-image-testing-technology | /cpp-qt/circlefit.cpp | C++ | cpp | 12,873 | permissive | /**
** MIT License
**
** This file is part of the MEMS-oriented-image-testing-technology project.
** Copyright (c) 2018 Lu <miroox@outlook.com>.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
** ... |
eca43ab66adb8bf4531844e5c87982f158a3577c | fe7067fae32dfc334ad754e519205dd6c4c1af32 | SamDBrown/miind | /libs/MPILib/include/algorithm/RateFunctor.hpp | C++ | hpp | 3,921 | no_license | // Copyright (c) 2005 - 2009 Marc de Kamps
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this list of condition... |
03d77e1060945275485eb1649783d36aa4a47f9a | 8db47fca4791dd0ff3629ee0851e570e7bf0d5ae | Levi-Armstrong/tesseract_ros | /tesseract_ros/tesseract_examples/tesseract_ros_examples/src/freespace_ompl_example.cpp | C++ | cpp | 8,026 | permissive | /**
* @file freespace_ompl_example.cpp
* @brief An example of a feespace motion planning with OMPL.
*
* @author Levi Armstrong
* @date March 16, 2020
* @version TODO
* @bug No known bugs
*
* @copyright Copyright (c) 2020, Southwest Research Institute
*
* @par License
* Software License Agreement (Apache Lic... |
6a2b686e862cc533962a7b6ea9e7f849114d9071 | 7b647b33d4773a62aa14156b516a6c1873586fe1 | kthr/libEidomatica | /src/templates/boundingBox.hpp | C++ | hpp | 1,877 | permissive | /*
* boundingBox.hpp
*
* Created on: Jan 28, 2014
* Author: kthierbach
*/
#ifndef BOUNDINGBOX_HPP_
#define BOUNDINGBOX_HPP_
#include "glm/glm.hpp"
namespace elib
{
template <class Point>
class BoundingBox
{
public:
BoundingBox(const BoundingBox &other) : upper_left(other.upper_left), bottom_right(othe... |
20b6b02dafe30d94000ef77671bd93d7d6d4b861 | 4b1cc398e64d3b2c0a5c40bd4f7ff95de3a0bcb6 | bicimsiz/opentoonz | /toonz/sources/toonzlib/scriptbinding_rasterizer.cpp | C++ | cpp | 5,160 | permissive |
#include "toonz/scriptbinding_rasterizer.h"
#include "toonz/scriptbinding_image.h"
#include "toonz/scriptbinding_level.h"
#include "toonz/tcamera.h"
#include "toonz/stage.h"
#include "tofflinegl.h"
#include "tvectorrenderdata.h"
#include "ttoonzimage.h"
#include "toonz/toonzimageutils.h"
namespace TScriptBinding {
... |
a481dfbb39a7c1d24a8394959d1b494a2456e541 | 0674dcca8eab3875604c813759ff526339bab08c | funningboy/smtdv | /kernel/UVM_ML-1.5.1/ml/frameworks/uvm/sc/packages/boost/include/preprocessor/list/reverse.hpp | C++ | hpp | 1,635 | permissive | # /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost... |
4f79d21df62410f62e3a2f3a256838e2a015faac | ff251f5b2e9f5e557b0ba030ece3fa1c31828b63 | acetao/NOIP | /[提高训练]动态规划之区间DP/merge.cpp | C++ | cpp | 1,459 | no_license | #include<fstream>
using namespace std;
ifstream fin("merge.in");
ofstream fout("merge.out");
const int MAXN=200;
int stones[MAXN*2];
int totalStones[MAXN*2][MAXN];
int dp_min[MAXN*2][MAXN+1];//dp_min[i][j]表示以第i颗石子为起始,长度为j的区间(即[i,i+j-1])里的石子合并成一堆所能得到的最小得分
int dp_max[MAXN*2][MAXN+1];//同上类推
int n;
int main(){
... |
0d42b805e3d873c3f746ecf9b9367718ec70be6c | 806ecb6363c1224de879b64d61093db0f752c066 | mahmoud-10th/kernel_3.4.67_lenovo_s939_mtk6592 | /mediatek/custom/sofinatd/hal/camera/camera/flash_tuning_custom.cpp | C++ | cpp | 10,201 | no_license | /* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or ... |
3136971a0f52d615c5469ede6b879b49d1f305a1 | 9cb089bf0e8922d91d5c691134572e0977bc37eb | lan1412/naiveproxy | /src/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.cc | C++ | cc | 72,617 | permissive | // Copyright 2013 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 "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
#include <algorithm>
#include <cstdlib>
#include <memory>
#include <st... |
d28e8e87714b1d8f0b2dccbae535a0b983424cc3 | b8003e4d6442f06005959480b7aa7e06758a757c | FranciniSilva/curso-C-plus-plus | /arrays.cpp | C++ | cpp | 296 | no_license | #include <iostream>
using namespace std;
int main() {
int nums[10];
nums[0] = 100;
nums[1] = 99;
nums[2] = 50;
nums[3] = 25;
nums[4] = 4;
nums[5] = 5;
nums[6] = 60;
nums[7] = 0;
nums[8] = -1;
nums[9] = 9;
cout << nums[5] + nums[9] << endl;
cout << nums[0] << endl;
return 0;
} |
5f318f961df6fc12459258e2dcb6ed01bc723af9 | 1248975f45c46b8f8dcd4b0daeb9a59c0f9f3448 | nayanika0208/Linux-based-file-explorer | /2020201056/main.cpp | C++ | cpp | 34,803 | no_license | #include "headers.h"
int g_argc;
char** g_argv;
char root[4096];
char cur_directory[4096];
vector<string> directoryList;
stack<string> back_stack;
stack<string> forw_stack;
int totalFiles;
vector<char> command_string;
char homepath[4096];
unsigned int term_row_num;
unsigned int term_col_num;
unsig... |
37fb9f004bc48f16e20bd1890953305aa2ff3aed | a321cbeee3522544c4e762df174f7d45ab61de2c | iamgruuten/Data-Structure-and-Algorithm | /Full Revise/hashTable/hashTable/Main.cpp | C++ | cpp | 1,154 | no_license | #include <iostream>
#include "Dictionary.h"
using namespace std;
void addEntry(KeyType, ItemType, Dictionary*);
void replaceEntry(KeyType name, ItemType phone, Dictionary* dic);
int main() {
Dictionary dic;
//Adding entries of people
addEntry("bull", "64606722", &dic);
addEntry("llub", "64608687", &dic);
addEn... |
aa73934d4851014e2653bed75c17508f61fbe5c8 | 29c1888a3529a834fa859fc50f50879ca34df61c | MohamedElfeky/mscsim | /src/fdm_pw5/pw5_Mass.cpp | C++ | cpp | 1,758 | permissive | /****************************************************************************//*
* Copyright (C) 2020 Marek M. Cel
*
* 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, ... |
f09a8bf19f7e2c0294b6cfd17f976fc2dc967a0f | db8fed58cbba475b2735a5f5957d2b103c8d1e5d | DantheCodingGui/Turrets | /src/Psydb3AdvancedEnemyTank.cpp | C++ | cpp | 1,842 | no_license | #include "Psydb3AdvancedEnemyTank.h"
Psydb3AdvancedEnemyTank::Psydb3AdvancedEnemyTank(BaseEngine* pEngine, double x, double y, Psydb3CollisionHandler* collisionHandler,
Psydb3BulletManager* bulletManager, const char* name, Psydb3TileManager* map)
: Psydb3EnemyTank(pEngine, x, y, collisionHandler, bullet... |
6e10435150ec4ca7d0db17a1630d6b756494e9eb | c68647f59b0bec2ebdc320c663c60b99a5b1e513 | oturan-boga/Windows2000 | /private/inet/urlmon/notifctn/schhelp.cxx | C++ | cxx | 45,887 | no_license | //+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1995.
//
// File: schhelp.cxx
//
// Contents: helper APIs for the scheduling notifications
//
// Classes:
//
// Functions:
//
// History: 1... |
7f4ac8ff6c0b419de87793915f823e6d9388e9c6 | 1768a1a12938af83379e325f3725847b4a6ec681 | Jung-jaeho/network-programming | /class/Chapter04/TCPServer/TCPServer.cpp | C++ | cpp | 5,722 | no_license | #pragma comment(lib, "ws2_32")
#include <winsock2.h>
#include <stdlib.h>
#include <stdio.h>
#define SERVERPORT 9000
#define BUFSIZE 512
// 소켓 정보 저장을 위한 구조체와 변수
struct SOCKETINFO
{
SOCKET sock;
char buf[BUFSIZE+1];
int recvbytes;
int sendbytes;
};
int nTotalSockets = 0;
SOCKETINFO *SocketInfo... |
d7ba2d48193fe2682b060932432bf8e5b5b4db94 | 59e607c5d4d67846571283de411b2cd2e1449b33 | AhJo53589/leetcode-cn | /problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one/SOLUTION.cpp | C++ | cpp | 1,328 | no_license |
//////////////////////////////////////////////////////////////////////////
class Solution {
public:
int numSteps(string s)
{
int ans = 0;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == '0') continue;
s = s.substr(i, s.size() - i);
break;
}
... |
529d9837ab2ca8e172bea1de37f90646d65514bd | eded32ae9fd9f71bb216c945cbc756c7f74f2e69 | liang0/chromium | /chrome/browser/ui/views/autofill/payments/offer_notification_bubble_views_interactive_uitest.cc | C++ | cc | 11,693 | permissive | // Copyright 2021 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/views/autofill/payments/offer_notification_bubble_views_test_base.h"
#include "base/test/metrics/histogram_tester.h"
#include... |
b09daacd850a31e8e7407beebbc8aaa6bfeb8842 | 019e9f5c46e104f8c14aa4bcbf93347fabe01360 | AstroGroupCSM/SPB2Reconstruction | /SPB2showerRec/UserModule.cc | C++ | cc | 5,334 | no_license | #include "UserModule.h"
#include <utl/ErrorLogger.h>
#include <evt/Event.h>
#include <fevt/FEvent.h>
#include <fevt/Eye.h>
#include <fevt/TelescopeSimData.h>
#include <fevt/Telescope.h>
#include <evt/ShowerSimData.h>
#include <det/Detector.h>
#include <fdet/FDetector.h>
#include <fdet/Eye.h>
//Allows local definitions... |
59bb7d1047d719000ed27d7b10986632b8d61719 | d6e61d3b73ab1e9ad20a7da04c376ec83c859e58 | RMS21/MinDFA | /src/MinDFA.cpp | C++ | cpp | 10,591 | no_license | #include "MinDFA.h"
#include <string>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <sstream>
using namespace std;
MinDFA::MinDFA(string initial, vector<string> finals, vector<vector<string> > transitions){
_initialState = initial;
_finalStates = finals;
_transitionFunctions = transitions;
... |
b3a0036a6b905bfb61982d923c2cb967351b177f | 9c522692bbdb155f2084bc98f74eb4ae0587b2ae | f20500909/study_note | /cpp/online_judge/leetcode/editor/cn/返回倒数第 k 个节点.cpp | C++ | cpp | 1,050 | no_license | //实现一种算法,找出单向链表中倒数第 k 个节点。返回该节点的值。
//
// 注意:本题相对原题稍作改动
//
// 示例:
//
// 输入: 1->2->3->4->5 和 k = 2
//输出: 4
//
// 说明:
//
// 给定的 k 保证是有效的。
// Related Topics 链表 双指针
//leetcode submit region begin(Prohibit modification and deletion)
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ... |
1dcc3c6ce7283b598dc4474cb7b4b8050b51beec | 24e902d37680e1167a762c90dc79a8bc4db74ffc | rishabh-malik/Algorithms | /Lecture 3/upper_lower_bound.cpp | C++ | cpp | 720 | no_license | //upper and lower bound of a sorted array
#include<bits/stdc++.h>
using namespace std;
int upperBound(int *a,int n,int key){
int s=0;
int e=n-1;
int ans=-1;
while(s<=e){
int mid=(s+e)/2;
if(a[mid]==key){
ans=mid;
s=mid+1;
}else if(a[mid]>key){
e=mid-1;
}else {
s=mid+1;
}
}
return a... |
05bbcc724dd26cbc2b57ca1925558277c970d15e | 8cfe46c9fba410bfe4752a50f1f0cd49a27253ec | cprice404/j2c-ts-config | /src/com/typesafe/config/impl/PathBuilder.cpp | C++ | cpp | 2,654 | no_license | // Generated from /config/src/main/java/com/typesafe/config/impl/PathBuilder.java
#include <com/typesafe/config/impl/PathBuilder.hpp>
#include <com/typesafe/config/ConfigException_BugOrBroken.hpp>
#include <com/typesafe/config/impl/Path.hpp>
#include <java/lang/ClassCastException.hpp>
#include <java/lang/NullPointerEx... |
20d45333c705d794c9a08c01dc6f6459c518c8ab | 16d7e4ae548854357ca98cc77043b446b8d74b8d | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE121_Stack_Based_Buffer_Overflow/s01/CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_74b.cpp | C++ | cpp | 2,894 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE129_fscanf_74b.cpp
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE129.label.xml
Template File: sources-sinks-74b.tmpl.cpp
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: fscanf Read da... |
aa4d356dd73fdce5b958430f14df998a2a7f8876 | 1c6eab13c7f0b1d401ca1f88a60ca29721192443 | oiloiloil/QTProject | /QTProject/QTProject_UnitTesting/nodeOperationTest.cpp | C++ | cpp | 6,743 | no_license | #include <gtest/gtest.h>
#include <list>
#include "Component.h"
#include "Node.h"
#include "Root.h"
#include "NodeOperation.h"
using namespace std;
void testDisplay(Component *node, string space)
{
list <Component *> tempList = node->getNodeList();
list <Component *>::iterator i;
node->display();
if (!tempList.e... |
6f0f3f507e7d852d7d857bc616831b70db186e74 | 3a8722bb7ae6fe679dcdd753c410b6f091f61fd2 | ahmad37/OOP---C-programs- | /5- Nested Classes/nested classes/main.cpp | C++ | cpp | 734 | no_license | #include <iostream>
using namespace std;
/// Normal Class //////////////////////////////////
class A
{
protected:
int a1;
public:
void pp()
{
cout<<"father"<<endl;
}
};
/// class B -
class B
{
public:
///Nested Class A inside Class B
class A
{
protected:
... |
05de4cb69ec5cad79d838d4672808ae258d07e2a | 60ec89a7c1a928c8fb553ee813018783513c882d | songjihu/C_PTA | /B1068AAAAA.cpp | C++ | cpp | 1,451 | no_license | /*#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string.h>
#include <map>
using namespace std;
//²Î¿¼£ºhttps://blog.csdn.net/qq_38263123/article/details/81161052
int main() {
map<int, int >t_m;
int m, n, t, i, j, flag = 0, out_x = 0, out_y = 0;
int input[1004][10... |
4fa7bb58ed194f1e9d213eaaa2a00ec6605fe302 | 01466e4b8a195e4c2970f813037e81dc20209c99 | mimseong/CodeforcePractice | /Practice21_200604/D_Anu_Has_a_Function.cpp | C++ | cpp | 1,290 | no_license | #include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <bitset>
#include <map>
#include <set>
#include <tuple>
#include <string.h>
#include <math.h>
#include <random>
#include <functional>
#include <assert.h>
#include <math.h>
#define all(x) (x).begin()... |
500f234d86628d58b263a1eae0466a5272b235d6 | b5cae99c25a1418e649f5cecc47eecb4b8d7101a | grabthar/HysteriaCore | /src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp | C++ | cpp | 23,073 | no_license | /*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will b... |
e8b9a530e47124f5ce9700242834210bceed6557 | 9cfaba7e8d5d5fee333ed46ec78a452c3ffad4a4 | foss-for-synopsys-dwc-arc-processors/tensorflow | /tensorflow/lite/micro/kernels/xtensa/depthwise_conv.cc | C++ | cc | 23,218 | permissive | /* 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 applicable law or a... |
daf97485d15a1426bcb7ebe557b17df0c7d2464c | 77eccdf915863c803a598089248bd33d8e769bdf | KyrneDev/LibMemcacheD-windows | /libmemcached/poll.cc | C++ | cc | 1,888 | permissive | /* LibMemcached
* Copyright (C) 2013 Data Differential, http://datadifferential.com/
* Copyright (C) 2010 Brian Aker, Trond Norbye
* All rights reserved.
*
* Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text.
*
* Summary: Implementation of poll by... |
015dc358c26ee7fb24fa8d9c9b94459f25f676c7 | a5e3094439229a1c6222c260d881b3258b124c8d | SARPAINe/Codeforces | /322B.cpp | C++ | cpp | 703 | no_license | #include<cstdio>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<vector>
#include<list>
#include<set>
#include<utility>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include <iterator> //iterators
#include<stdio.h>
#include<limits.h>... |
1fce224e426b9d7594ad2a639349a05a6ab65338 | 48bd94f4940e203b2f97f6738ae37ae7404c0e27 | JasurN/SelfDrivingCar | /src/test/hardware/motorSpeedControl.cpp | C++ | cpp | 2,399 | permissive | #include <cstdio>
#include <wiringPi.h>
#include <softPwm.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#define IN1_PIN 1
#define IN2_PIN 4
#define IN3_PIN 5
#define IN4_PIN 6
#define NORMAL_SPEED 40
#define MIN_SPEED 0
void initSensorsDCMotor();
void go();
void stop();
void m... |
ed3ec9b2d58196baceff5138d0529e9e686d6060 | 5390bc2b8bcaafdb7281a0b8f19ee311c07eae67 | teach-me-tech/project | /src/gkp2.cpp | C++ | cpp | 1,360 | no_license | #include <bits/stdc++.h>
using namespace std;
long long int p=0, ctr=0, sum = 0;
int v(long long int x)
{
int counter = 0;
if(x==0)return 0;
while(x%p==0)
{
counter++;
x= x/p;
}return counter;
}
void fnc(int n, int q, long long int a[], int qq[][4])
{
cout << "Case #"<<ctr<<": ";... |
067c86a2d034def94c4ea0cd12e62e8c176d841f | e4a0f2c49539dd78231b553d5e994a60c48699b8 | islands04/smallk | /hierclust/include/postprocess.hpp | C++ | hpp | 1,120 | permissive | // Copyright 2014 Georgia Institute of Technology
//
// 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 ... |
46acd712b56ddd212edea1f6c6092ae5dce0ee7f | 8df334722487eeccd1cbacf80c22c8e61ee7e163 | YashMangroliya/Web-Projector | /single/app1/myapp1.cpp | C++ | cpp | 8,078 | no_license | #include<tmwp>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<fstream>
using namespace std;
using namespace tmwp;
class Student
{
private:
int rollNumber;
char name[36];
public:
Student()
{
printf("empty constructor got called\n");
this->rollNumber=0;
this->name[0]='\0';
}
Student(const Student &o... |
2d1771b42b415b44295954f5d2df804954b6876f | 2bb68ea92859de8ab97b3c128f630506edbbebba | jariasf/Online-Judges-Solutions | /UVA/Volume 8 (800-899)/836 - Largest Submatrix.cpp | C++ | cpp | 1,975 | no_license | /*****************************************
***Problema: Largest Submatrix
***ID: 836
***Juez: UVA
***Tipo: DP, Maximum 2D sum
***Autor: Jhosimar George Arias Figueroa
******************************************/
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <stdlib.h>
#include <cctype>
#incl... |
9fd7f2b9fc442279f81f641cfe6a07dbef60d80f | 0dcb86066e18e9079ec7cd6989af700af43d1e5c | AfaqNabi/algorithms | /c++/structs/graph_t.cpp | C++ | cpp | 1,520 | permissive | // regular graph representation as a array of pairs (source and desinations) and the weight
// https://gist.github.com/MagallanesFito/791f736a0d21708794aafa11a0416201
#include <iostream>
#include <vector>
#include <utility>
template<class T>
class Graph {
protected:
// have no uses for now
int V, E... |
e33eb3e55734980768bc0d537c301329e83dd709 | 1a24698b7e221e9b7c3e2a821c58c7091d8f1e9c | PriyankaGunjal/StarFighter-Game | /world.cpp | C++ | cpp | 703 | no_license | #include"world.h"
#include<iostream>
void world::initializeworld()
{
int i = 0;
for (int j = 0;j < 25;j++)
{
worldmatrix[i][j].d1 = 178;worldmatrix[i][j].d2 = 178;worldmatrix[i][j].d3 = 178;
worldmatrix[j][i].d1 = 178;worldmatrix[j][i].d2 = 178;worldmatrix[j][i].d3 = 178;
}
int i = 25;
for (int j = 0;j... |
bf359aadf9012d577241264a6c0cd07ce11e652f | 6c671926df9be1b025ae43708da89213581d509b | marciopocebon/LimeSuite | /src/examples/basicRX.cpp | C++ | cpp | 3,735 | permissive | /**
@file basicRX.cpp
@author Lime Microsystems (www.limemicro.com)
@brief minimal RX example
*/
#include <cstdlib>
#include "lime/LimeSuite.h"
#include <iostream>
#include "math.h"
#include <thread>
#include <chrono>
#ifdef USE_GNU_PLOT
#include "gnuPlotPipe.h"
#endif
using namespace std;
//Device ... |
dbc79d52ba263f26a622aa7e070e460b88e3548b | 16bcf275c4c89b291ecb933d862de273418022b3 | depromeet/algorithm-meet | /025_BINARY_SEARCH_TREE/haeseong.cpp | C++ | cpp | 2,266 | no_license | /**************************************
30 Nov. 2016
Haeseong Jeon
5639. Binary Search Tree
https://www.acmicpc.net/problem/5639
***************************************/
#include <iostream> // std::cin, cout
using namespace std;
typedef class Node {
private:
int _data;
class Node* _leftChild;
class Node* _r... |
1d7296175bddbf5a86b7e96ca8f1b942ca415058 | 4b170c7752cb767a3558978df7fcb7e754ccef2f | mapbox/mapnik-vector-tile | /src/vector_tile_compression.hpp | C++ | hpp | 2,582 | permissive | #pragma once
// mapnik-vector-tile
#include "vector_tile_config.hpp"
// zlib
#include <zlib.h>
// std
#include <string>
namespace mapnik
{
namespace vector_tile_impl
{
inline bool is_zlib_compressed(const char * data, std::size_t size)
{
return size > 2 &&
static_cast<uint8_t>(data[0]) == 0x78 ... |
24d5209cde5ff59bf89dcaa5c45d579dba2ef722 | 0de88bee1ee91c3da9b29f3e99a33d71facf06d2 | MagnusPoppe/polymap-backend | /src/polygon_operations/conversion.hpp | C++ | hpp | 380 | no_license | //
// Created by Magnus Poppe Wang on 11/12/2018.
//
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <streambuf>
#include <sstream>
#include <nlohmann/json.hpp>
// GeoJson conversion to and from boost:
std::vector<std::string> geoJsonToWkt(std::string filepath);
void wktToGeoJsonFil... |
30ae292b8e91c9893c87a54bd72b9a045f6db52a | 5ed0e1fc1a1c152175e6774dcfa7c1a01116e6e5 | yashton/compiler | /tests/cc_given/187.txt.cc | C++ | cc | 9,428 | no_license | (program
(define-env $env_t43 (e20 i19 k28))
(define-env $env_t44 (e20))
(define-env $env_t45 (k14))
(define-env $env_t46 (k14 t14))
(define-env $env_t41 (e18 i17 k22))
(define-env $env_t42 (e18))
(define-env $env_t38 (e16 i15 k16))
(define-env $env_t39 (e16))
(define-env $env_t40 ())
(define break (void))
(... |
5087467a7bf4a9808c29d4ed75cc74b03411c924 | a7633c7800fb267e94bd886acd7d2bc4b03f134d | Sourabh-Semalty/Cpp-questions | /objectsoriented/ArrayCodingTest/nevgationArray.cpp | C++ | cpp | 384 | no_license | #include<iostream>
using namespace std;
class NegativeArray {
int arr[5] = {-3,-32,-6,-2,6};
public:
int size = sizeof(arr)/sizeof(arr[0]);
void displayNegativeElement() {
cout << "Negative elements are"<<endl;
for(int i =0;i<size;i++) {
if(arr[i] < 0) cout << arr[i] << endl;
}
}
};
i... |
7cac9f04ad10ae84fb1ade60c2cc7826b2703094 | bd40763fdd99b4a4aaeddffd43a07fceac725c86 | gmeisinger/Bandcamp-mirror | /src/utils.cpp | C++ | cpp | 2,238 | no_license | /* Team Bandcamp
* Class function: contains utility functions
*
*/
#include "include/utils.h"
//loads image at specified path as a texture
//fname = relative path to image
SDL_Texture* utils::loadTexture(SDL_Renderer* renderer, std::string fname) {
//the final texture
SDL_Texture* newTexture = nullptr;
... |
11f2cb4fb346488354e1c6226bf0ad17c63b1e26 | e8205153493e9cd8a3e9c4e1a868693bed781472 | hangzhangac/Algorithm-Problem | /Google Contest/Google kickstart 2020/E/b.cpp | C++ | cpp | 1,605 | no_license | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <queue>
#include <cmath>
#include <map>
#include <set>
#define mem(a,x) memset(a,x,sizeof(a))
#define gi(x) scanf("%d",&x)
#define gi2(x,y) scanf("%d%d",&x,&y)
#define gll(x) scanf("%lld",&x)
#def... |
c07d059203d5a5b81085262bf5a1745c5c99b5ec | 5aee647628c7526c84c34883868aa75d4514aeae | HannuSa/GameComponent | /Windows_window - Copy/Windows_window/SystemManager.cpp | C++ | cpp | 605 | no_license | #include "SystemManager.h"
SystemManager::SystemManager()
{
VertexData = NULL;
}
SystemManager::~SystemManager()
{
for (unsigned int i = 0; i < objects.size(); i++)
{
delete(objects[i]);
}
objects.clear();
}
void SystemManager::AddObject(GameObject* _object)
{
objects.push_back(_object);
}
void SystemMana... |
91f97277c78938b572ff49a88de147e3779bbddf | 4e185c094e3871ac0414ac486c7dbc0fed4f0e4a | ishikabansal04/Ds-Algo | /dp/lds-lis.cpp | C++ | cpp | 3,324 | no_license | /*
tabulation method =====================
#include<iostream>
#include<vector>
#include<string>
#include<climits>
using namespace std;
int LIS(vector<int>& input){
vector<int> lis(input.size(),0);
vector<string> plis(input.size(),"");
lis[0]=1;
plis[0]+=to_string(input[0])+" ";
int maxlength=INT_M... |
f014f50540aaef3cfdba62f22719e3e4e4995705 | 1235ae5f05efae3a07ece21206981098fd25b19c | byte4byte/cloudretro | /services/tracing/public/cpp/perfetto/track_event_thread_local_event_sink.cc | C++ | cc | 24,101 | permissive | // 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 "services/tracing/public/cpp/perfetto/track_event_thread_local_event_sink.h"
#include "base/stl_util.h"
#include "base/strings/pattern.h"
#inclu... |
800958e1dc6c76a4fade2cc0c7389a5b4f542c55 | 5c4ef20d9d825bb43b84c17d4451a777938e8fb0 | yana87gt/procon | /codeforces/gym/101490/i.cpp | C++ | cpp | 395 | no_license | #include <bits/stdc++.h>
using namespace std;
bool solve(int q){
if(q==1) return false;
int rq = sqrt(q);
for(int p = 2; p <= rq; p++){
if(q%p==0){
while(q%p==0){
q /= p;
}
return q==1;
}
}
return true;
}
int main(void){
int q... |
685e8d2d34916d029dc490e463f7b08c45fc3a70 | 4b0684a3f435b4cb292dd454adc997bd52d7e6ae | Ahmedelkelb27031999/PROJECT2A | /sponsor.cpp | C++ | cpp | 1,771 | no_license | #include "sponsor.h"
#include <QSqlQuery>
sponsor::sponsor()
{
id=0;
name="";
location="";
products="";
}
sponsor::sponsor(int id,QString n,QString l ,QString p)
{
this->id=id;
this->name=n;
this->location=l;
this ->products=p;
}
QString sponsor ::getname(){return name;... |
13db8a4f409ce5d8173dab877facc04adbcc1be0 | 48a6bdcb07d2bb307faf45e3eaa921e192110a7e | pavel-zeman/CodeChef | /CodeChef/src/y2013/m12/cookoff/ChefAndGirlfriend.cpp | C++ | cpp | 1,317 | no_license | // Simple math
// http://www.codechef.com/COOK41/problems/GERALD04
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#define FOR(c, m) for(int c=0;c<(m);c++)
#define FORE(c, f, t) for(int c=(f);c<(t);c++)
int main(void) {
int t... |
8970c2700f9822968a8019457145651f2128640b | 59d0b86e52824d717efc49394067b2e1de2e14da | shrivastava12/C-programming | /c++program/stl_queue1.cpp | C++ | cpp | 573 | no_license | #include<iostream>
#include<queue>
using namespace std;
void showq(queue<int> gq)
{
queue<int> g = gq;
while(!g.empty())
{
cout<< '\t' <<g.front();
g.pop();
}
cout<< '\n';
}
int main()
{
queue<int> gquiz;
gquiz.push(10);
gquiz.push(20);
gquiz.push(30);
cout<<"Th... |
f92b55996e75de96beb7b2d3ea5304d1999ff0ee | b74f589e6bd712b14c1d4eca013112185bbd4a57 | VCrate/code-generator | /src/core/Block.cpp | C++ | cpp | 3,833 | permissive | #include <vcrate/code-generator/core/Block.hpp>
#include <vcrate/code-generator/core/Context.hpp>
namespace vcrate { namespace code_gen {
Block::Block(Context& context) : context(&context) {}
void Block::dump(std::ostream& os) const {
os << Dumper::bolder() << "Block <" << name << ">" << Dumper::clearer();
... |
a4073ef13b7d9659ca11d1d9bf09458ea60a7fbe | 1518328825e04c7b773d58b1fdb30634104c3aad | delta4d/AlgoSolution | /leetcode/permutation-sequence.cpp | C++ | cpp | 707 | no_license | // 8ms
// dp
class Solution {
public:
string getPermutation(int n, int k) {
int fac[11] = {1};
bool v[10] = {false};
for (int i=1; i<11; ++i) fac[i] = fac[i-1] * i;
fac[0] = 0;
string ret;
for (int i=0; i<n; ++i) {
int rem = n - i - 1;
for (int j=n-1; j... |
62980fdb6ab88f62f2fc70ec02df3e51edf9d770 | 02a9aedbc9d13aceff03f222be40065ac0ee16ea | pan2za/ctrl | /controller/src/vnsw/agent/uve/test/test_vrouter_uve.cc | C++ | cc | 36,166 | permissive | /*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#include "base/os.h"
#include <cfg/cfg_init.h>
#include <cfg/cfg_interface.h>
#include <oper/operdb_init.h>
#include <controller/controller_init.h>
#include <pkt/pkt_init.h>
#include <services/services_init.h>
#include <vrouter/ksync/ksync_init.h... |
c8ec29269433e0d8297522321e1d882fe5c15f3a | fc23df524dd20f8240d4799e789c4cea1e14225d | oalandgrave/swift | /lib/FrontendTool/FrontendTool.cpp | C++ | cpp | 76,340 | permissive | //===--- FrontendTool.cpp - Swift Compiler Frontend -----------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
a345d304ad6babecc09aecf64fb31747df75d66d | 1d4b1c9ad9c666e9a1471457c46cc3c524bbf023 | aswmtjdsj/oj-code | /poj/1321.cpp | C++ | cpp | 1,321 | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int ans,n,k;
#define maxn 10
char map[maxn][maxn];
struct node
{
int x,y;
node(){}
node(int a,int b):x(a),y(b){}
};
node sol[maxn];
void dfs(int x,int y,int step)
{
if(step == k)
ans++;
else
{
sol[step-... |
b27e0d127f3319ec987af6b4a2af9fc6509fa5ab | ea89826267820a2a3bb0968fc43fb633f5ed0f3b | lineCode/skland | /include/skland/gui/linear-layout.hpp | C++ | hpp | 1,439 | permissive | /*
* Copyright 2016 Freeman Zhang <zhanggyb@gmail.com>
*
* 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 applic... |
fb392af38f91e7dd36af4719c02fbcdca65b3734 | e77b3e7a50457fe60d2c5cc51dc91f98ccc18d2a | vellamike/TRTorch | /core/conversion/converters/impl/activation.cpp | C++ | cpp | 4,195 | permissive | #include "core/util/prelude.h"
#include "core/conversion/converters/converters.h"
namespace trtorch {
namespace core {
namespace conversion {
namespace converters {
namespace impl {
namespace {
#define convert(act, trt_type) \
bool act(ConversionCtx* ctx, const torch:... |
99aa6a3c1bcd9f2a258aaa862820f1d51cc7b4ae | 8722b9da2dc0a6c80591253c7cea6b01a227c731 | kdoggdev/cncn_m2 | /srcs/client_src/GameLib/RaceManager.cpp | C++ | cpp | 16,402 | permissive | #include "StdAfx.h"
#include "RaceManager.h"
#include "RaceMotionData.h"
#include "../EterPack/EterPackManager.h"
bool __IsGuildRace(unsigned race)
{
if (race >= 14000 && race < 15000)
return true;
if (20043 == race)
return true;
return false;
}
bool __IsNPCRace(unsigned race)
{
if (race > 9000)
return tr... |
2667ff65b64c9bd6c337c35cafe8488f2ef6e5cf | d1aed5a48811735697faf3c61aa622db86b1b696 | youngalx2/blockchain | /src/GetFilesListCommand.cpp | C++ | cpp | 1,028 | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include "../include/commands/GetFilesListCommand.h"
GetFilesListCommand::GetFilesListCommand()
: Command()
{}
void GetFilesListCommand::Execute(int socketId, const char * cmd)
{
int R, rece... |
d934463965cc6fdb53b88615ea65313dc56edcdf | 1b53e6f279672ba0f6523d6cbc527b3e4bab4ea6 | massbrowser/android | /ash/wm/workspace_controller_unittest.cc | C++ | cc | 60,614 | permissive | // Copyright 2013 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 "ash/wm/workspace_controller.h"
#include <map>
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/screen_util.h"
#include "ash/session/... |
79a377390dde19f9ee9d40e93d9d60c39833d785 | c1917a5d1013bc21b4c8c51737b7ef929f96a9b3 | diegocalero0/Maraton | /algorithms/factoresPrimos.cpp | C++ | cpp | 541 | no_license | #include<bits/stdc++.h>
using namespace std;
vector<int> factPrimos;
void factoresPrimos(int n){
int i;
while(n%2==0){
factPrimos.push_back(2);
n=n/2;
}
for(i=3;i<=sqrt(n);i+=2){
while(n%i==0){
factPrimos.push_back(i);
n=n/i;
}
... |
852a7e65beb6f332aa10b0526a3fb20cf980b210 | b97b21f9bd5c46f46c3b1a10a79729415e1472df | alemran042/StereoPipeline | /src/asp/Tools/point2las.cc | C++ | cc | 15,877 | permissive | // __BEGIN_LICENSE__
// Copyright (c) 2009-2013, United States Government as represented by the
// Administrator of the National Aeronautics and Space Administration. All
// rights reserved.
//
// The NGT platform is licensed under the Apache License, Version 2.0 (the
// "License"); you may not use this file excep... |
c459047bf7f684d0f04c6a1a60ce0107e400737f | b27d524e6cf5190185745ab04037371b12d84015 | SaiSiddarth/Codeforces-problems | /LuckyDivision.cpp | C++ | cpp | 593 | no_license | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int c=0;
int sum=0;
vector<int> a;
a.push_back(4);
a.push_back(7);
a.push_back(44);
a.push_back(47);
a.push_back(74);
a.push_back(77);a.push_back(447);a.push_back(477);a.push_back(474);a.push_back(747)... |
43e1503f66b8e12b71779014fe7b351b1331b5a1 | 51daf747dc77d382423ea54f9502732ac8993820 | tsam3000/UE4-CPP-Shooter-Series | /Code Per Lesson/63 Refactor Trace Under Crosshairs/ShooterCharacter.cpp | C++ | cpp | 13,951 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "ShooterCharacter.h"
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Kismet/GameplayStatics.h"
#include "Sound/SoundCue.h"
... |
1e01e5df6184914850ef4290b69863861e78d415 | cb0b3e582dfa781e6c4ab6ce1a17cea9d937f93a | QPC-database/aws-sdk-cpp | /aws-cpp-sdk-budgets/source/model/DescribeBudgetActionResult.cpp | C++ | cpp | 1,192 | permissive | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/budgets/model/DescribeBudgetActionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include ... |
ff52edcf0c7179a2ed6aa7bf747634222fe4c7f1 | 32d5a8a5d23e20cafa84eb595b27eacf9834127c | samnewga/LinkedList2 | /LinkedList/LinkedList/Source.cpp | C++ | cpp | 9,664 | no_license | #include <iostream>
#include "LinkedList.h"
// Bool that will run all our link list tests
bool test_linklist();
int main()
{
// Creates a linked list and insters 5 integers from 1-5
LinkedList<int> LinkedList_A;
LinkedList_A.insert(1);
LinkedList_A.insert(2);
LinkedList_A.insert(3);
LinkedList_A.in... |
645f5e38d2beb9770fb4be6e1d24396c62e87a6e | 1fa3b797feaec70d638549556d94a0129ade3a34 | VirajDeshwal/C_plus-code- | /competitive/Maps/HashMap.cpp | C++ | cpp | 693 | no_license | #include<iostream>
#include<map>
using namespace std;
int main()
{
map<int, char> cc;
pair<map<int,char>::iterator, bool> ret;
cc.insert(pair<int, char>(1,'a'));
cc.insert(pair<int, char>(2, 'b'));
cc.insert(pair<int, char>(3, 'c'));
cc.insert(pair<int, char>(4,'d'));
map<int, char>:: iterator itr... |
ac60ef060f349efb839d41b16ec8bf8ce53692e3 | 71ce075576f243f080dc228a1784022dbb356f11 | wahello/chromium | /components/media_router/browser/media_router_debugger_unittest.cc | C++ | cc | 1,244 | permissive | // Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/media_router/browser/media_router_debugger.h"
#include "base/test/scoped_feature_list.h"
#include "content/public/test/browser_task_environment.h"
#includ... |
7ccb4a10cd6d42c7dba74ded1b8b6f7bd2f6a271 | fe5495b8a47ee0654e00030122e68c01f1cab7eb | DistinctWind/OI | /old/NumSetRangeMax.cpp | C++ | cpp | 912 | permissive | #include <cstdio>
using namespace std;
const int MAXN=1e5+1;
const int LOGN=17;
int n,m;
int num[MAXN],log[MAXN],f[MAXN][LOGN];
int max(int a,int b)
{
return a>b?a:b;
}
inline void setup()
{
log[0]=-1;
for (int i=1;i<=n;i++)
f[i][0]=num[i],log[i]=log[i>>1]+1;
}
inline void dp()
{
for (int j=1;j<=LOGN;j++)
{
fo... |
fc5391bb451ab3665130583f9ff6cee2f8b84a69 | c57f534aa7ecc404119aef0dbfc28c8e1a633bc2 | Narthill/Signal | /单摄Final/main.cpp | C++ | cpp | 4,009 | no_license | #include <opencv2\opencv.hpp>
#include <iostream>
#include <string>
#include <math.h>
#include <sstream>
#include <limits>
using namespace cv;
using namespace std;
typedef struct {
double x_angle;
double y_angle;
double deltaZ;
}State; // get the current state of the initial image including u, v and z
State getSta... |
6409e034b5f114f192af54156df201a91a930653 | 55e72c77165276397d8776ca805a1ec8d5a625bf | ACLB/ACM | /HDU/2016CCPC网络赛/1011/main.cpp | C++ | cpp | 565 | no_license | #include <bits/stdc++.h>
using namespace std;
const int Max = 1e5+100;
bool vis[30];
char s[Max];
int main()
{
int T;
scanf("%d",&T);
for(int z = 1;z<=T;z++)
{
scanf("%s",s);
int len = strlen(s);
memset(vis,false,sizeof(vis));
int ans = 0;
for(int i = 0... |
3fcf31606a127f59dfda4c42b01083fa39002eb4 | 5d0a788317b5775766900062974026dd2fc3b87d | ilafaf/kori | /src/core_write.cpp | C++ | cpp | 8,611 | permissive | // Copyright (c) 2009-2016 The Kori Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <core_io.h>
#include <base58.h>
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <script/sc... |
8b7e5233c6b6da4afe6c6a5517d060614428cb30 | 351e247d44372e669c8cbfed038f4375b177693e | ccdxc/logSurvey | /data/crawl/tar/hunk_453.cpp | C++ | cpp | 459 | no_license | (data_block->buffer + written - 1));
if (check != written)
{
- ERROR ((0, errno, _("Only wrote %ld of %ld bytes to file %s"),
- check, written, current_file_name));
- skip_file ((long) (size - written));
+ ERROR ((0, errno, _("Only wrote %lu of %lu bytes to file %s"),
+ (u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.