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 |
|---|---|---|---|---|---|---|---|---|
618c33353551038290811f8a6fca85e573453724 | a6f0ac8a0cee7a2394e4094d6d5bf946211e5f4d | s1Rishabh/Data-Structures-in-C-plus-plus | /Recursion/1Dqueen.cpp | C++ | cpp | 1,459 | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
void queen(vector<bool> &board, int cq, string asf, int tq, int tb)
{
if (cq > tq)
{
cout << asf << endl;
return;
}
for (int b = 0; b < board.size(); b++)
{
if (board[b] == false)
{
... |
8271abcb93b88ac6e51b1137a8cd980c1ef99d27 | f9343890ee02b8c9c6e877c8f3f0dd73e4579be6 | abhijeet65/geeks_for_geeks | /powerof2.cpp | C++ | cpp | 379 | no_license | #include<bits/stdc++.h>
using namespace std;
int powerof2(int x)
{
if(x&(x-1))
return 0;
else
return 1;
}
int main()
{
int n;
cin>>n;
int a[n];
int i,j,sum=0;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
int count=0;
for(i=1;i<=n;i++)
{
for(j=i+1;j<=n;j++)
{
sum=a[i]+a[j];
if(pow... |
1c9c357293590cd17abc28c9a05dc9d89fd2cdc0 | 81fd7c30d038a28d1f679a399a1a42420b5cc0f0 | MSuha/Hackkerrank_Cpp | /STL/LowerBoundSTL.cpp | C++ | cpp | 696 | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int size, input;
size_t target;
vector<int>::iterator low;
cin>>size;
vector<int>my_vector(size);
for(int i = 0; i < size; i++){
cin>>input;
my_vec... |
907d1115aaadda75b1422264a3e6b5679d50a0de | 4620b7257a741286f56abba7820e93ec37584126 | Dongd0825/swoole-src | /swoole_process_pool.cc | C++ | cc | 15,923 | permissive | /*
+----------------------------------------------------------------------+
| Swoole |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license, |
| that is bundl... |
b76b928ea3fc80592fd93779421478b0334c1306 | bca6209d9f278a54ecbe19fcb7930acc40eb1be7 | jstzwj/Catool | /example/rot90.cpp | C++ | cpp | 701 | permissive | #include<iostream>
#include<cassert>
#include"MainToolbox\Types.h"
#include"MainToolbox\Array.h"
#include"MainToolbox\Mathematics\ElementaryMath\Arithmetic.h"
#include"MainToolbox\Mathematics\LinearAlgebra\LinearEquations.h"
#include"MainToolbox\Mathematics\RandomNumber\Rand.h"
using namespace catool::main_toolbox;
u... |
f7b152b99c7949109704f8ff5ac6317853e2fbc7 | 060fac92ad36d9008babe88186c66a5410daeba2 | hphulara/bleeding_edge | /dart/runtime/vm/stub_code.cc | C++ | cc | 5,103 | permissive | // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/stub_code.h"
#include "platform/assert.h"
#include "platform/globals.h"
#include "vm/asse... |
c3a3b627836c5a6d7ba9cb3e8b7204cfdca20350 | f016098cc098b5b6dc59c7a619f1c133937c977f | NikolaPerica/Objektno-programiranje | /vjezba2/zadatak2/zadatak2.cpp | C++ | cpp | 911 | no_license | #include "pch.h"
#include <iostream>
void unesi(int* &niz, int size)
{
std::cout << "Unesi brojeve: \n";
for (int i = 0; i < size; i++)
{
std::cin >> niz[i];
}
}
void ispisi(int* &niz, int size)
{
for (int i = 0; i < size; i++)
{
std::cout << niz[i] << " ";
}
std::cout << "\n";
}
v... |
1da8e8afa240df333a12107829bb3a81d6541b92 | c9998cc854776fda871a8b70919c8257717fbe06 | mindspore-ai/mindspore | /mindspore/lite/tools/converter/config_parser/micro_param_parser.cc | C++ | cc | 6,558 | permissive | /**
* Copyright 2021 Huawei Technologies Co., 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... |
4a8d54f237c1cec34f7a36eb61b16e9d4c95b786 | 11fefc00f7953330c7a97b536ba2eeb11fd2f8b3 | mohmad011/Hard-Programming-Challenges | /7_LCS.cpp | C++ | cpp | 3,488 | no_license | // For this challenge you will be determining the longest common subsequence of two strings.
/*
have the function LCS(strArr) take the strArr parameter being passed which will be an array of two strings containing only the characters {a,b,c} and have your program return the length of the longest common subsequence comm... |
9c12ba6df01a41df2f8b5612f8e4a2f82d7f6cb5 | 6b9d1b081fc7ab4eb94dbd8bb3b523a30b68c858 | ahmad-mostafa1000/Problem-solving | /Bit++_282A.cpp | C++ | cpp | 287 | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n,x=0;
string operation;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> operation;
if (operation == "++X" || operation == "X++")
x++;
else x--;
}
cout << x;
system("pause");
return 0;
}
|
60912d5710177d074ace12bc128cc892de05d8d5 | 7aee38e5675b1d68d6168a9cc61d6d88f53556c0 | Ming-blue/mindspore | /mindspore/lite/tools/converter/parser/tf/tf_transpose_parser.cc | C++ | cc | 1,527 | permissive | /**
* Copyright 2020 Huawei Technologies Co., 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... |
a1a910c7baa1ff0e073f3a4c5c69b52be935ebb2 | 56e49ccf38175c5e8b9c104f0ea027ddf3e5db71 | raineyeh/axom | /src/axom/inlet/examples/fields.cpp | C++ | cpp | 3,866 | permissive | // Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and
// other Axom Project Developers. See the top-level LICENSE file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
#include <iostream>
#include <string>
#include "axom/inlet.hpp"
#include "axom/slic/core/SimpleLogger.hpp"
/... |
85678c9a638aaf10000807ba1e2c70b7c5cdcd80 | fbbe1489aaf229d344fc430088bda50a63094ea9 | BachelorDegree/AccessLogic | /accesslogic/MetaDataMaster/FileSystem.cpp | C++ | cpp | 83,259 | no_license | #include "FileSystem.hpp"
/**
初始化常量,文件系统名和命令集合
finish
*/
FileSystem::FileSystem(char* name)
:blockSize(BLOCK_SIZE),
blockNum(BLOCK_NUM),
blockBitmap(new unsigned char[BLOCK_NUM+1]),
inodeBitmap(new unsigned char[BLOCK_NUM+1]),
isAlive(0),
fp(NULL),
curLink(NULL)
{
userSize = sizeof(User);
superBlockSize = size... |
e4f1948b5620a6ac66fbb09429b4b94cab49bca6 | 71195db1a9462b1430ae29df41bd331e142fa7ef | kevinugly/Parallel-Fixed-Length-Code-Generator | /OS2020SUHW1/OS2020SUHW1/main.cpp | C++ | cpp | 5,006 | no_license | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <unordered_map>
#include <vector>
#include <pthread.h>
using namespace std;
unordered_map<int, int> m2;
struct c... |
92e1224b53fd5486c6dee9a3d51a1b57651298ca | 5d442adea23927aa8253ecbf87305510c6053160 | aakashshanbhag/Digital-Image-Processing-EE-569-Spring-2017 | /HW -1/HW#1/HW 1/Prob2b/linear3d/linear3d/linear3d.cpp | C++ | cpp | 4,784 | no_license | // Inclusion of headers
#include "stdafx.h"
#include <iostream>
#include "Header1.h"
#include<math.h>
#include <fstream>
using namespace std;
int main(int argc, char* argv[])
{
// Define file pointer and variables
FILE* file=NULL;
if (argc < 3)
{
cout << "Syntax Error - Incorrect parameter usage:"... |
2bab004e1d692137968abf0b853682db8dd9a439 | b32dcd26ea5774bfe1375def1cb620e3da177a7e | Vindows95/mesa | /src/tool/pps/pps_driver.cc | C++ | cc | 2,770 | no_license | /*
* Copyright © 2019-2020 Collabora, Ltd.
* Author: Antonio Caggiano <antonio.caggiano@collabora.com>
* Author: Rohan Garg <rohan.garg@collabora.com>
* Author: Robert Beckett <bob.beckett@collabora.com>
* Author: Corentin Noël <corentin.noel@collabora.com>
*
* SPDX-License-Identifier: MIT
*/
#include "pps_dri... |
78d4474e4d2c0beb5ded9f1557bed24e5fe3f6ef | e818ce5c54f93e6ab3689499ccf7ac19b3082f64 | mbkim95/Algorithm | /Baekjoon/15686.cpp | C++ | cpp | 1,223 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int n, m, ans;
vector<vector<int>> map;
vector<pair<int, int>> home, chicken, cand;
void dfs(int cnt, int idx) {
if (idx == chicken.size())
return;
if (cnt == m) {
int tmp = 0;
for (int i = 0; i < home.size(); i+... |
675e0b461aeb2ec7e0f25c210da8104a525b5b92 | 8507cc3e188750e101a1063310d5f6bf9d9b3499 | raghavaggarwal99/Competitive | /Hashing/Leetcode/firstuniquechar.cpp | C++ | cpp | 415 | no_license | class Solution {
public:
int firstUniqChar(string s) {
unordered_map<char, int> x ;
int n = s.length();
for (int i = 0; i < n; i++) {
x[s[i]]++;
}
// find the index
for (int i = 0; i < n; i++) {
if (x[s[i]]==... |
3a1986a237eeaa6e68f1a137765d2a8616a40e5c | 5c73f12c9049446753faf673103bf4556fa91ff8 | mvanotti/fuchsia-mirror | /src/developer/system_monitor/bin/harvester/gather_cpu.cc | C++ | cc | 1,083 | permissive | // Copyright 2019 The Fuchsia 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 "gather_cpu.h"
#include <lib/syslog/cpp/macros.h>
#include <zircon/status.h>
#include "harvester.h"
#include "sample_bundle.h"
namespace harves... |
92b6f7548dcb0b26d4e49d9ea93737d6bcc56038 | 34a11585f12403e83e8665d348b930ed7031d8fa | leostd/Competitive-Programming | /WorkInProgress/Codeforces - Educational Codeforces Round 131 (Rated for Div. 2)/C. Schedule Management/main.cpp | C++ | cpp | 4,587 | no_license | #pragma GCC diagnostic ignored "-Wunused-const-variable"
#ifdef MAC
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <chrono>
#include <complex>
#include <algorithm>
#include <utility>
#in... |
a5c370a17fd3a47293a2854101982b07e457c06b | 437d70ac12e5e3bbec455cf5fef2613ceaafa8e0 | oparace/MiscCode | /Programming Assignment/Game_Object.cpp | C++ | cpp | 913 | no_license |
#include <iostream>
#include "Game_Object.h"
using namespace std;
Game_Object::Game_Object(char in_code)
{
display_code = in_code;
id_num = 1;
state = 's';
std::cout << "Game_Object constructed"<<endl;
}
Game_Object::Game_Object(Cart_Point in_loc, int in_id, char in_code)
{
display_code = i... |
1e7dd7376a3d642a198b6ae4a643a81c8cc25c58 | 433317a0a28953ee72959b61656a5099a6207865 | danyfang/SourceCode | /cpp/other/linker.cpp | C++ | cpp | 287 | permissive | #ifndef LINKER_CPP
#define LINKER_CPP
#include<iostream>
using namespace std;
class node{
int* left;
int* right;
void getLeft(){
return *left;
}
void getRight(){
return *right;
}
}
class linker{
private:
node *nrr;
int size;
public:
linker(int size){
size = size;
nrr = new
}
}
|
bb0fd94bd0045ecafac8b00aee6c9901c5b61fbb | cf8844fb97de34ffe19e0b6a0b0dc79e9b13c69a | seshasaibehara/multishifter | /tests/regress/compare_pos.cpp | C++ | cpp | 1,179 | permissive | #include <casmutils/xtal/structure_tools.hpp>
#include <casmutils/xtal/lattice.hpp>
#include <filesystem>
#include <iostream>
//Super rudimentary way to check if two POSCAR files are the same,
//without having to worry about indentation, significant figures,
//or +0.0 vs -0.0
int main(int argc, char** argv)
{
name... |
41ac5b480fa22add5a49bdcf2a8bf751e915ad25 | a0b71ce57c43c75ca2bad386d2a156a04c1b6d12 | YiranK/Leetcode | /3 Longest Substring Without Repeating Characters.cpp | C++ | cpp | 722 | no_license | class Solution {
public:
int lengthOfLongestSubstring(string s) {
int len = 0, max = 0;
vector<char> letter;
for (int i = 0; i < s.length(); i++) {
// add a not duplicate char to vector
vector<char>::iterator iter = find(letter.begin(), letter.end(), s[i]);
... |
11506b2d63b0aa7ec2da6b3ef20c51211d47a77b | 8e5b1f84346f56f07a32f283b33c27e90adb6c8a | Mengman/VTK | /Rendering/FreeTypeFontConfig/vtkFontConfigFreeTypeTools.cxx | C++ | cxx | 5,982 | permissive | /*=========================================================================
Program: Visualization Toolkit
Module: vtkFontConfigFreeTypeTools.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
Thi... |
226877421a7f8edd6da771f96b0c5b2b712ee96c | d78ce75c34e137633799424941f71f52641eea2a | okigan/RobustMVC | /WebServer/web_server.cpp | C++ | cpp | 13,797 | no_license | // WebServer.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <vector>
#include <gl/glew.h>
#pragma comment(lib, "glew32.lib")
#include <gl/GL.h>
#pragma comment(lib, "opengl32.lib")
#include <gl/GLU.h>
#pragma co... |
e2f4b78739f1ac5ab40c4cf7b582a33f56557812 | be16539914d91d072c7a177e4a180ee35494483a | Hansimov/cs-notes | /leetcode/0466.cpp | C++ | cpp | 3,086 | no_license | /*
= cnt The Repetitions - LeetCode Articles
https://leetcode.com/articles/cnt-the-repetitions/
= 【Leetcode】466. cnt The Repetitions 统计重复个数 - lemonmillie的博客 - CSDN博客
https://blog.csdn.net/lemonmillie/article/details/86701249
= Accepted 8ms Java solution with explanation - LeetCode Discuss
https://leetcod... |
7f07ae19bc0ace16fde5b457d2081c9ca7c5e52b | c8904040bc43ff1b99cbd546e8c8674c5c2b8bdf | jiachengii/chromium | /components/translate/core/common/translate_util.cc | C++ | cc | 1,264 | permissive | // Copyright 2014 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 "components/translate/core/common/translate_util.h"
#include <stddef.h>
#include <algorithm>
#include <set>
#include <vector>
#include "base/co... |
17f8ced4a5815936ac9700bce5607e4f4334fba1 | ab942e721dee76a34f11966a96a9ce67f0355937 | glavaux2/arrayfire | /src/api/c/memoryapi.hpp | C++ | hpp | 3,379 | permissive | /*******************************************************
* Copyright (c) 2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
**********************************************... |
342b7062934b5503cc7c0285371598a7c34df4c1 | 5e95d5d9307edba6f099952e27d80c08adfa840c | Stary2001/BakaBot | /src/config.cpp | C++ | cpp | 4,989 | permissive | #include <string>
#include <vector>
#include <fstream>
#include "config.h"
#include "logger.h"
#include "util.h"
Config::Config(std::string path)
{
root = std::shared_ptr<ConfigNode>(new ConfigNode());
std::ifstream config_file(path, std::ios::in);
if(config_file.good())
{
std::string s;
... |
90892189fad70ef98d6d51b4ec7a7695f92bc5a3 | 754bf6e9f8f0c4a6c5d5d40d6769977ddbba1234 | huchuanlu/15_3 | /caffe/src/caffe/layers/conv_layer.cpp | C++ | cpp | 3,069 | permissive | #include <vector>
#include "caffe/filler.hpp"
#include "caffe/layer.hpp"
#include "caffe/util/im2col.hpp"
#include "caffe/util/math_functions.hpp"
#include "caffe/vision_layers.hpp"
namespace caffe {
template <typename Dtype>
void ConvolutionLayer<Dtype>::compute_output_shape() {
this->height_out_ = (this->height_... |
990d1de49fdd042f350dd86c1ec2d4ab11b4cb18 | fdf6b6c19baaf3fb565f927fe148ec21780f6166 | growlercab/VTK | /Rendering/Core/Testing/Cxx/TestPointSelectionWithCellData.cxx | C++ | cxx | 6,453 | permissive | /*=========================================================================
Program: Visualization Toolkit
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRAN... |
8b67c113c6bfe456bc2aa42969987363c9c9129d | f9a9d890cbf337446c2e6a4fdc1e158c90d91aab | HecatePhy/IdeaPlaceEx | /src/place/nlp/nlpSecondOrderKernels.hpp | C++ | hpp | 7,388 | permissive | /**
* @file nlpSecondOrderKernel.hpp
* @brief The non-lnear programming second order optimization kernel for global plaement
* @author Keren Zhu
* @date 04/24/2020
*/
#pragma once
#include "global/global.h"
#include "nlpOptmKernels.hpp"
#include "nlpFirstOrderKernel.hpp"
PROJECT_NAMESPACE_BEGIN
namespace nlp
{... |
7ea8aed81d17ff9f6090de5dfbd22be9ec02085c | 560c3b143da4a18b91c0b67b00d5fd6da6d1fe88 | ck89119/Algorithm | /apac/2017/Round_A/c.cpp | C++ | cpp | 1,611 | no_license | #include <bits/stdc++.h>
using namespace std;
#define dump(x) cerr << __LINE__ << " : "<< #x << " = " << (x) << endl
#define clr(a, x) memset(a, x, sizeof(a)) //0:0, -1:-1, INF:0x3f, -INF:0x80
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define lson l, m, rt << 1
#define rson m + 1, r, rt << 1 | 1
#... |
0b57be5ac41cd928dae18baa5d5f4f2516c06a33 | a7a7308cc7829459b19a6f117942b132ba238d41 | sweethoneybee/baekjoon | /C++/next_permutation(순열).cpp | C++ | cpp | 625 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void)
{
vector<int> widget;
for(int i = 1; i <= 4; i++)
{
widget.push_back(i);
}
// widget[0] = 4;
// widget[3] = 1;
cout << "widget : ";
for(int i = 0; i <= 3; i++)
{
cout << w... |
3f43fda962e56006354c17f049c07325951a0bc2 | 6fbb4df124f171aa3874940d4c333be1ea0b80f8 | Xoooo/fuchsia | /src/developer/feedback/boot_log_checker/tests/reboot_log_handler_unittest.cc | C++ | cc | 7,231 | permissive | // Copyright 2019 The Fuchsia 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 "src/developer/feedback/boot_log_checker/reboot_log_handler.h"
#include <lib/async_promise/executor.h>
#include <lib/fit/result.h>
#include <lib/fit... |
7e45dcff33d22d6c5dc0c8c170610f5b89e5aa89 | 2d4edc97c549d38b2107d6af1d5fe3faf32122e0 | ruijiefang/llvm-hcs | /libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp | C++ | cpp | 2,841 | permissive | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
d21d950b9c1b89672ff6a0ee4f42f71d2a6f8a47 | 77e27152b0fc4f948a65aa8b0cfade9f38e30448 | MBakr007/Biology | /Protein.cpp | C++ | cpp | 6,560 | no_license | #include "Protein.h"
Protein::Protein()
{
}
Protein::~Protein()
{
delete seq;
}
Protein:: Protein(char * p)
{
seq = new char [strlen(p)];
for(int i=0 ; i<strlen(p) ; i++)
{
seq[i] = p[i];
}
}
void Protein::Print()
{
for(int i=0 ; i<strlen(seq) ; i++)
{
... |
d2eaf0d984d5a133e7105a8b163de6683af21ed2 | 40c206db9b8fad4901343a3f1b7c3aea66c59357 | jsaevecke/Harbinger-of-Eternity-2D-Space-Game | /Eternity Engine (Outerspace)/Code/code/ETY-Engine/Dev-Libs/boost_old/mpl/map/aux_/map0.hpp | C++ | hpp | 2,248 | no_license |
#ifndef BOOST_MPL_MAP_AUX_MAP0_HPP_INCLUDED
#define BOOST_MPL_MAP_AUX_MAP0_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_... |
f29aca02390bcc9985bfb0479b5f16a383b7f106 | 83310c4ba5097e780fa811d61a515ce22d37eba6 | otcshare/chromium-src | /third_party/blink/renderer/core/css/css_length_resolver.cc | C++ | cc | 9,698 | permissive | // Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/css/css_length_resolver.h"
#include "third_party/blink/renderer/core/css/css_resolution_units.h"
namespace blink {
double CSSLength... |
97a0b1ac3b7dcaf127a9848136b6dc9b60daf9af | 76a83fc6af1441923cd88def64e7663783df01b3 | Jeonghwan-Yoo/brain_system | /12_쓰레드의생성과소멸/12_3.cpp | C++ | cpp | 3,198 | no_license | //쓰레드를 이용한 작업의 분할
#include <stdio.h>
#include <tchar.h>
#include <Windows.h>
//프로세스 유사 형태 쓰레드 생성
DWORD WINAPI ThreadProc(LPVOID lpParam)
{
DWORD* nPtr = (DWORD*)lpParam;
//쓰레드 함수 호출 시 두 개의 인자가 전달.
//전달인자의 포인터를 적절히 변환해서 값을 취한다.
//배열의 형태로 선언된 전달인자가 필요하다.
DWORD numOne = *nPtr;
DWORD numTwo = *(nPtr + 1);
DWORD t... |
36e912c4fa9fb1d3735e79769957c7576d2150cb | bb5564a4f26056e1210825d0ab3821458a1f52df | hisptoot/JoyShockLibrary | /JoyShockLibrary/JoyShock.cpp | C++ | cpp | 40,097 | permissive | #pragma once
#include "JoyShockLibrary.h"
#include <bitset>
#include "hidapi.h"
#include <chrono>
#include <thread>
#include <unordered_map>
#include <atomic>
#include "tools.cpp"
#include <cstring>
#ifdef __GNUC__
#define _wcsdup wcsdup
#endif
// PS4 stuff
// http://www.psdevwiki.com/ps4/DS4-USB
// http://www.psdev... |
492894e074e2069c5d438f6960757356f77034dd | ec10f3bdcb2f2d49e157961fb3a9bd6c6547e76a | dstrube1/playground_cPlusPlus | /Test_MFC_Mouse/Test_MFC_MouseView.cpp | C++ | cpp | 1,507 | no_license | // Test_MFC_MouseView.cpp : implementation of the CTest_MFC_MouseView class
//
#include "stdafx.h"
#include "Test_MFC_Mouse.h"
#include "Test_MFC_MouseDoc.h"
#include "Test_MFC_MouseView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CTest_MFC_MouseView
IMPLEMENT_DYNCREATE(CTest_MFC_MouseView, C... |
69f4636c1b07bc5e460af38d632e6cc1b05ca7c7 | ca460bf1d41e4c72061e1c14c235ad6df7797d88 | waaberi/chromium | /chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc | C++ | cc | 51,639 | 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 "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h"
#include <stddef.h>
#include <stdint.h>
#include <set>
#include <utility>
... |
e1dc411c69457527e4ec539fccfd4340563e655c | 0efa2f1c29c631876584bcd12ac1ed126a34ef79 | OrigenesZhang/Project-Euler | /67.cpp | C++ | cpp | 1,153 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define all(x) (x).begin(), (x).end()
#define reset(x, y) memset(x, ... |
57d176a4249175cedfb7865fc3e7fdb9903e0fa7 | 27abfbae42de9740f435ba1ff468102b1376c5a0 | chaabaj/SimpleReflexion | /include/Object.hpp | C++ | hpp | 874 | permissive | #ifndef _REFLEXION_OBJECT_HPP_
#define _REFLEXION_OBJECT_HPP
#include "ClassInfo.hpp"
#include "PropertyContainer.hpp"
#include "MethodContainer.hpp"
namespace reflexion
{
template<typename T>
class Object : public PropertyContainer, public MethodContainer
{
public:
Object()
{
... |
507f175eefa939e997d4890f6dcc9407f9d7e681 | a14cee52fda1319e4cdd5ef2e8275dfbea24a28a | idovelemon/simplepathtracer | /spt/spt/spt/sptshade.cpp | C++ | cpp | 8,738 | no_license | //----------------------------------------------------------
// Declaration: Copyright (c), by i_dovelemon, 2017. All right reserved.
// Author: i_dovelemon[1322600812@qq.com]
// Date: 2017 / 05 / 07
// Brief: Shade a pixel
//----------------------------------------------------------
#include "sptshade.h"
#include <ve... |
fbd4077edf93d2b224d9345da87ecf27f3c3f0ef | 3d383f6a19366d683f4ecb08064a965c08ae0795 | triphan2k3/CP_Train | /SPOJ/SAFENET2.cpp | C++ | cpp | 1,341 | no_license | #include <bits/stdc++.h>
#define ll long long
#define ii pair<int,int>
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define inp "SAFENET2.INP"
#define out "SAFENET2.OUT"
using namespace std;
const int N=(int)1e5+7;
const int MOD=(int)1e9+7;
const ll INF=(ll)1e18+7;
int n,m,sz,T,res;
int nu... |
5d17d6b00b8297c2246274d9283907fdd6e7693a | a7b579b57e17c0da73b56b4ed492aab0fabb71ea | eteran/PcapPlusPlus | /Pcap++/src/PcapFileDevice.cpp | C++ | cpp | 22,618 | permissive | #define LOG_MODULE PcapLogModuleFileDevice
#include <stdio.h>
#include <cerrno>
#include "PcapFileDevice.h"
#include "light_pcapng_ext.h"
#include "Logger.h"
#include <string.h>
#include <fstream>
namespace pcpp
{
struct pcap_file_header
{
uint32_t magic;
uint16_t version_major;
uint16_t... |
184fab1db379dcf3d5ddb78fc4c804298aa24aa2 | 50423318f93889f77bbf284641873f3bc40b717f | samhelmholtz/skinny-dip | /code/skinny-dip/sgpp/src/sgpp/grid/type/LinearGrid.hpp | C++ | hpp | 1,431 | permissive | /******************************************************************************
* Copyright (C) 2009 Technische Universitaet Muenchen *
* This file is part of the SG++ project. For conditions of distribution and *
* use, please see the copyright notice at http://www5.in.tum.de/SGpp *
... |
4ea02be62ad8de4b94f507f694c6a8571584e9ab | 5e80d4273ea0da29aacd2676eaaf0f699ea9239e | Kitware/vtk-examples | /src/Cxx/Visualization/MovableAxes.cxx | C++ | cxx | 5,276 | permissive | #include <vtkActor.h>
#include <vtkAssembly.h>
#include <vtkAssemblyPath.h>
#include <vtkAxesActor.h>
#include <vtkCallbackCommand.h>
#include <vtkCommand.h>
#include <vtkConeSource.h>
#include <vtkFollower.h>
#include <vtkInteractorStyleTrackballActor.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPol... |
f3f8f26c59222ba94e754efd69d163fb7f3806da | 1aafa006ed892c8ff37fee8b6863324cec826512 | viraj071/LeetCode | /RotateImage.cpp | C++ | cpp | 688 | no_license | /*
Problem: Rotate Image
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
Solution: Rotate in-place
Time Complexity: O(n*n)
Space Complexity: O(1)
*/
class Solution {
public:
void rotate(vector<vector<int> > &matrix) {
... |
a8f64932a3de371d39d72ade7c122ac4d5da4570 | 548db52fd88332d1819603d0236ef5ceec28264c | dummas2008/chromium | /src/chrome/browser/ui/app_list/app_list_service_impl.cc | C++ | cc | 16,707 | 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 "chrome/browser/ui/app_list/app_list_service_impl.h"
#include <stddef.h>
#include <stdint.h>
#include <string>
#include <utility>
#include "bas... |
7372d12f83cb6d32f5c8b36dc8ad3d6922768e3a | 5291dae895a3bf49187d3e325856c72995ffb1c1 | novo1985/Leetcode | /Missing And Duplicate Numbers/41. First Missing Positive.cpp | C++ | cpp | 1,778 | no_license | /* Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.*/
/* Thinking: Given an array, size = n, the perfect case is [1,2,3,..,n]
* Because we need find the first missi... |
2a4b09675d062b6041a2e91198eb14d47925c4da | b8995bffe0fed4d573eae8bfc9ade2faa34bc908 | puneetmadaan/pnacl-libcxx | /test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp | C++ | cpp | 3,168 | permissive | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------... |
c9a214173b53dd52b22c0d59cdbc90a3ea8660d2 | 4fb8a4a354d5347dd60a86c0e4704aecc5dc5792 | JiaRenChang/Batch_Normalized_Maxout_NIN | /matlab/src/bits/nnconv.hpp | C++ | hpp | 2,098 | no_license | // @file nnconv.cu
// @brief Convolution block
// @author Andrea Vedaldi
// @author Max Jaderberg
/*
Copyright (C) 2014 Andrea Vedaldi and Max Jaderberg
Copyright (C) 2015 Andrea Vedaldi.
All rights reserved.
This file is part of the VLFeat library and is made available under
the terms of the BSD license... |
c08d4d5915a52a2444afe75390556619841abb2c | b9480610f679ff207c2e2a46a781bae567e8cfa0 | juengs/chromium | /cc/trees/effect_node.cc | C++ | cc | 4,806 | permissive | // Copyright 2016 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 "cc/trees/effect_node.h"
#include "base/trace_event/traced_value.h"
#include "cc/layers/layer.h"
#include "cc/trees/property_tree.h"
namespace c... |
3599f8035d116efaf243107587949642ea9282f9 | d9db127a3534350c0dfb8d2cc4fda6ceb37ca707 | flameshimmer/Leet2015_2 | /Leet2015_2/Leet2015_2/HIndexII.cpp | C++ | cpp | 629 | no_license | #include "stdafx.h"
//Follow up for H - Index: What if the citations array is sorted in ascending order ? Could you optimize your algorithm ?
//
//Hint :
//
// Expected runtime complexity is in O(log n) and the input is sorted.
namespace Solution2
{
namespace HIndexII
{
int hIndex(vector<int>& cit) {
int len ... |
75838ebc6a6d461a865a0429995026401e8fef44 | af8c2cb8eb3d60ec1e7d01cccdc1ffc68a246a26 | salarwalker/homeworkRPG2 | /BakudanBitoUsingHardware/Vector2.cpp | C++ | cpp | 1,130 | no_license | #include "Vector2.h"
Vector2::Vector2(){}
Vector2::Vector2( int aX, int aY ){
x = static_cast< double >( aX );
y = static_cast< double >( aY );
}
Vector2::Vector2( double aX, double aY ) :
x( aX ),
y( aY ){
}
Vector2::Vector2( const Vector2& a ) :
x( a.x ),
y( a.y ){
}
void Vector2::operator+=( const Vector2& ... |
c97acff3737747d33a85de6762946472fe506edc | 6efd117ef3bbbd63f08405ae86cefe3496152b19 | richj25/STL | /map.cc | C++ | cc | 2,287 | no_license | #include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include <algorithm>
typedef std::pair<std::string,int> intpair;
std::string numberAsString(int i, bool upper);
void print(const std::map<std::string,int> &intmap);
void print(const std::map<std::string,int> &intmap)
{
std::cout << std::setios... |
20e80efa6846d292d482612aad5b7c55074bc55d | 9d1040d88dd315a2ce4414b8065111bf6cb8035f | Dylaann/Light | /Light/Block.cpp | C++ | cpp | 1,063 | no_license | #include "Block.h"
Block::Block(b2World & world, std::string filename, float x, float y, float const SCALE)
{
if (!m_texture.loadFromFile("box.png"))
{
std::cout << "Error Loading Block Texture!" << std::endl;
}
m_bodyDef.position = b2Vec2(x / SCALE, y / SCALE);
m_bodyDef.type = b2_staticBody;
m_body = world.C... |
aef9915e5e87bd93dd7d39409d4061a22098bfb6 | aa173422ee4f0571b08b8c078a23bbadfde563c4 | iwanhae/FakeCoin_Algorithm_Term_Project | /CompareBy3_rvs.cpp | C++ | cpp | 2,138 | no_license | #include "common.h"
knownSet CompareBy3_rvs(vector<int> real, vector<int> fake, vector<int> unknown) {
// If we use p directly, parameter flag can be added to determine comparison should be r2f1 or r1f2
int left[4];
int right[4];
bool completed = true;
knownSet output;
right[0] = real[0];
right[1] = fake[0];
r... |
6da499ecbad87530f3c8eb0048138c07926c9ee0 | c2e0b868c8ffefca2bd9166784e6fc1f3fce1fad | walsvid/pytorch3d | /pytorch3d/csrc/compositing/weighted_sum_cpu.cpp | C++ | cpp | 3,567 | permissive | /*
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
*/
#include <torch/extension.h>
#include <cmath>
#include <vector>
torch::Tensor weightedSumCpuForward... |
76cff6a36009e904e1f733f35984c8cf5a99e8d7 | dca7490994f1bb4d667f05ec41505fe8a4bccf98 | koenigsreiter/cpp_monitoring | /src/server/health_checker.cpp | C++ | cpp | 934 | no_license | /*
* Name: Königsreiter Simon
* Class: 5BHIF
* MatrNr.: i14084
*/
#include "health_checker.hpp"
#include <asio.hpp>
#include "networking.hpp"
#include "logger.hpp"
#include "messages.pb.h"
void health_checker::operator()(unsigned short int port) {
logger::log->info("Healthchecker is listening on port {}", po... |
54faa1406dea616b57b81b6b0bc69cdddaf06cdb | 12d08adfe79c34c9e1e97da13fc492c0ffb727f6 | matthewgraham1/serenity | /Libraries/LibJS/Runtime/SymbolPrototype.cpp | C++ | cpp | 3,696 | permissive | /*
* Copyright (c) 2020, Matthew Olsson <matthewcolsson@gmail.com>
* 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 noti... |
30e9c302bb961f59bf98b62833359691c596f83e | 94b525416a6d439ee41e5abfc4ec1a3d1f63f7a3 | Porokhnya/UROV | /MAIN/UTFT_Buttons_Rus.cpp | C++ | cpp | 15,132 | no_license | /*
UTFT_Buttons_Rus.cpp - Add-on Library for UTFT: Buttons
Copyright (C)2016 Rinky-Dink Electronics, Henning Karlsen. All right reserved
This library adds simple but easy to use buttons to extend the use
of the UTFT and URTouch libraries.
You can find the latest version of the library at
http://www.Rin... |
cf97071134b34fa1200dea3606b5fbb4dafe0226 | 520872bfccced3c5067216aed17c6e1a5ec15059 | UBC-Snowbots/IGVC2015 | /sb_jaus/JAUS++/src/cxutils/examples/ExampleKeyboard.cpp | C++ | cpp | 5,750 | no_license | ////////////////////////////////////////////////////////////////////////////////////
///
/// \file ExampleKeyboard.cpp
/// \brief This is a sample program for testing/demonstrating use of the
/// Keyboard.
///
/// <br>Author(s): Daniel Barber
/// <br>Created: 09 March 2009
/// <br>Copyright (c) 2009
/// ... |
6d70ea045526431c165a8a66c3b2d8787e15daff | 888673a5072a924ac3a86cc29d0ddfe51acc2d60 | jfuku14/CMMPPT | /gsa/wit/COIN/Osi/OsiGlpk/include/OsiGlpkSolverInterface.hpp | C++ | hpp | 28,640 | permissive | // LAST EDIT: Mon 25 Feb 2002 by Brady Hunsaker
//-----------------------------------------------------------------------------
// name: OSI Interface for GLPK
// author: Vivian DE Smedt
// Bruxelles (Belgium)
// email: vdesmedt@cso.ulb.ac.be
// date: 17/11/2001
// comments: please scan t... |
e8ca243bdf1403e14a53b57fb33043f40d625c59 | 17d015eb3fe861bff3b00572be566f317ffd942e | MedicaicloudLink/Rosetta | /main/source/src/core/scoring/etable/etrie/TrieCountPairGeneric.hh | C++ | hh | 75,564 | no_license | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... |
2a9f0d2bc0952228f5ee2c0ba915d00ceea98fb3 | 293358224a3ebb1ad58dd6533140c2431fce7d80 | Karylus/PracticasED | /tests/pruebapegado.cpp | C++ | cpp | 943 | no_license | #include "imagen.h"
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main(int argc, char *argv[])
{
if (argc != 8)
{
cout << "Los parametros son :" << endl;
cout << "1.-La imagen de fondo" << endl;
cout << "2.-La imagen a pegar" << endl;
cout << "3.-La máscara de la... |
62563bfaa7d97cf3b8fc81e5b3ec8fd149f3126d | 5561289f01039d8a77f6695ec3ada0536b3d7f86 | 15831944/bastionlandscape | /LuaPlus/Src/Modules/windows/windows.cpp | C++ | cpp | 31,333 | permissive | #include <windows.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "LuaPlus/LuaPlus.h"
#include "KeystrokeEngine.h"
using namespace LuaPlus;
static int LS_GetForegroundWindow( LuaState* state )
{
HWND hwnd = ::GetForegroundWindow();
state->PushInteger((UINT)hwnd);
return 1;
}
... |
b8ae14141e93a75e23a5c9f32a56caed9c1eb4e8 | 3eafd8747128362a795340bdea299efa59816236 | danvorobyev/ParProg2020 | /CompMath2/src/main.cpp | C++ | cpp | 4,668 | no_license | #include <iostream>
#include <iomanip>
#include <fstream>
#include <mpi.h>
#include <unistd.h>
#include <cmath>
void calc(double* frame, uint32_t ySize, uint32_t xSize, double delta, int rank, int size)
{
MPI_Status status;
MPI_Bcast (&xSize, 1, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Bcast (&ySize, 1, MPI_INT, 0, MPI_COM... |
bb5a26016081f5ceae67e9b52bebab76e202ed2d | 9600a6afe3226cc842e69708f829b8e6fde50c43 | otcshare/chromium-src | /net/base/escape_unittest.cc | C++ | cc | 5,901 | permissive | // Copyright (c) 2012 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 <algorithm>
#include <string>
#include "net/base/escape.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#in... |
bcb122ed0a8fac7dbb44809e0871ff307ffca20f | f0805d91b22f40f11329c7947d008bbd09e96ff5 | ghumman3131/Altcoin-Bitcoin-v0.10.1-fork | /src/init.cpp | C++ | cpp | 61,352 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/newcoin-config.h"
#endif
#include "init.h... |
5906b4b37b7c026995ea3335f3ff29822de0a90d | 9dfbed88f3095457b2e5187abc16198aa3335998 | ollevche/cpp-piscine | /d00/ex01/headers/contact.hpp | C++ | hpp | 1,164 | no_license | // ************************************************************************** //
// //
// ::: :::::::: //
// contact.hpp :+: :+: :+: ... |
4f1162cdb5209ac43cd1fcc8bea8051d2e360bc5 | f41123c992e52d2f95d08bc898ac179a3d06251b | Infraelly/old-infraelly-engine | /FilenameBox.hpp | C++ | hpp | 3,751 | no_license | /*-----------------------------------------------------------------------------\
| ____ |
| __ / __ \ /\ /\ |
| /_/ / / \/ / / / / ... |
af4a7b5cedd8ada03f57649ad9abfe8b884b6246 | fbdb48cf3db84c05749dc0b1e900e1cf2fa362d8 | liaoyubinAI/DataStructuresAndAlgorithmAnalysis | /STL/test_set.cpp | C++ | cpp | 1,439 | no_license | #include <set>
#include <iostream>
using namespace std;
template <typename Container>
void PrintContents (const Container & stlContainer);
int main()
{
//create set and multiset!
set <int> setIntegers;
multiset <int> msetIntegers;
//insert element to set
setIntegers.insert(60);
setIntegers.insert(-1);
setInteg... |
3741ebbde864fc589476ef6d71162e78987f6e70 | fdb6012800f2262f93e695b93c1c41481743542b | T-M-L-C/vespa | /storage/src/tests/distributor/updateoperationtest.cpp | C++ | cpp | 6,926 | permissive | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <cppunit/extensions/HelperMacros.h>
#include <iomanip>
#include <tests/common/dummystoragelink.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storageapi/message/state.h>... |
d13c9950027a5e74c3d5a8ecafdeac8f91b7f1ff | 8a8f0b878eaefb080e361bced36c50d8a40a914d | kevinbird61/p4c | /frontends/p4/unusedDeclarations.cpp | C++ | cpp | 4,659 | permissive | /*
Copyright 2013-present Barefoot Networks, 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 applicable law or agreed to in w... |
f8e089786ba5e557923ac53eeec2d5670ad453a7 | 2208dcf28dc44c665d77f6b58fa224a1150df058 | lineCode/coroutine-1 | /test/channel_write_fail_after_close.cpp | C++ | cpp | 1,495 | permissive | //
// Author : github.com/luncliff (luncliff@gmail.com)
// License : CC BY 4.0
//
#include <coroutine/channel.hpp>
#include <coroutine/return.h>
#include "test.h"
using namespace std;
using namespace coro;
using channel_without_lock_t = channel<int>;
auto coro_channel_write_return_false_after_close_test() {
a... |
0d2cbcb30976d9d2a843450cd7a79327205f54b9 | 03cbde82aabee976e3f56c0e30ceff6acfc2085d | msrLi/portingSources | /ACE/ACE_wrappers/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.cpp | C++ | cpp | 7,454 | permissive | #include "orbsvcs/Log_Macros.h"
#include "orbsvcs/Log_Macros.h"
#include "orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.h"
#include "tao/Monitor/Monitor_Impl.h"
#include "ace/Auto_Ptr.h"
#include "ace/Monitor_Point_Registry.h"
#include "ace/Monitor_Base.h"
#if defined (TAO_HAS_MONITOR_FRAMEWORK) ... |
5f670d80e53592dcff540998d4d21c8ca54caa73 | b65408622615acf6560e9ec416753432040a492c | ArmanAugusto/ProcessControlBlock | /PCB.cpp | C++ | cpp | 714 | no_license | /*
* File: TestPCB.cpp
* Author: Arman Augusto
* Project Name: Process Control Block
* Description: This file contains the function definitions and behaviors
* of the PCB header file.
*
* Created on January 30, 2019, 11:10 AM
*/
#include <iostream>
#inclu... |
fd4dbfb304a760bffc2fde3c8abcd128ec0d2376 | 980c8b62b74fc7a704d1720a5ad3c7e226c931b3 | MnSakibOvi/competitive-programming | /codeforces/D. Queue.cpp | C++ | cpp | 408 | no_license |
#include<bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
sort(arr,arr+n);
int sum=0,cnt=0;
for(int i=0;i<n;i++)
{
///cout<<arr[i]<<" ";
if(sum<=arr[i])
{
cnt++;
sum=sum+arr[i];
}
}
//cout<<endl;
cout<<cnt<<endl;
}
int ... |
fb74679e79b18d7ec0ee29e5b19d9e169b15bf5f | c07f6fdfaa1637b0c1f8e8058b318e2ce78acf8f | technopwnsauce/os-sim | /OS/main.cpp | C++ | cpp | 10,552 | no_license | /*
* main.cpp
*
* Created on: Mar 24, 2016
* Author: kylearchuleta
*/
#include <iostream>
#include <ctime>
#include <limits>
#include <string>
#include "PCB.h"
#include "StateMachine.h"
#include "LowLevelScheduler.h"
#include "HighLevelScheduler.h"
listStruct newList = { NULL, NULL, NULL }; //List ... |
006cdc17170bd7558236bce399b91490a018a21c | f2db234c267966ae3c52d64e7e9c49aeb671b2fa | Qazwar/ParabellumFramework | /ParabellumEngine/ParabellumGUI/PGUIButtonBox.cpp | C++ | cpp | 3,000 | permissive | #include "stdafx.h"
#include "PGUIButtonBox.h"
// --------------------------------------------------------------------
// Statics
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// Constructors
// -----------------------... |
d83d2487095352a2123ccdd8fb587f9dc58b8385 | 2115d4480eef0065f8acde7cdb026eb952cfc547 | Maeiky/CpcdosOS2.1-1 | /CONTRIB/LLVM/src/lib/Tg/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp | C++ | cpp | 9,541 | permissive | //===-- SystemZMCTargetDesc.cpp - SystemZ target descriptions -------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
667f598e338b4a9db0d7b5ae85baa8ff614eec91 | 45512d5508ecb3c6bae2efa4f8e5e53b0a6390d8 | messmerd/dmf2mod | /extern/zstr/strict_fstream.hpp | C++ | hpp | 7,760 | permissive | #pragma once
#include <cassert>
#include <fstream>
#include <cstring>
#include <string>
#include <vector>
/**
* This namespace defines wrappers for std::ifstream, std::ofstream, and
* std::fstream objects. The wrappers perform the following steps:
* - check the open modes make sense
* - check that the call to ope... |
14e3f01804f9a5552eeaddf0db3b67744664c1b4 | d679c420e5b4d12e699227d594119fc27f3710d7 | blockspacer/yamail | /src/memory/limiters_repository.cc | C++ | cc | 3,681 | no_license | #include <yamail/memory/limiters_repository.h>
YAMAIL_FQNS_MEMORY_BEGIN
limiters_repository& limiters_repository::inst()
{
static limiters_repository intstance;
return intstance;
}
limiters_repository::limiters_repository()
: global_limit_(0), session_limit_(0), suid_limit_(0)
, global_limiter_(facto... |
b2308b5ea98ed168dc1beca02e30a7c971d2c568 | 6b8f8558bd640a7e7eb484b51362acdb44163bd6 | my-hoang-huu/My-hh | /1. Nhap mon lap trinh_chuong04_ma tran/bai144.cpp | C++ | cpp | 2,157 | no_license | #include<iostream>
#include<iomanip>
#include<cstdlib>
#include<ctime>
using namespace std;
void Nhap(int[][50], int&, int&);
void Xuat(int[][50], int, int);
bool Kt(int[][50], int, int);
bool NguyenTo(int);
bool ChinhPhuong(int);
void XuLy(int[][50], int, int);
int main()
{
int a[20][50];
int m;
int n;
Nhap(a, m,... |
4685e39f4b797a40242abe6c1a128200aa924d55 | a872018101908d88953e3f0f3380084b7b25e0a1 | heeseokjung/boj | /boj_7562.cpp | C++ | cpp | 1,250 | no_license | #include <stdio.h>
#include <utility>
#include <queue>
using namespace std;
int N;
pair<int, int> p1, p2;
int dr[8] = {-2, -1, 1, 2, 2, 1, -1, -2};
int dc[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int dist[300][300];
int bfs() {
if(p1 == p2)
return 0;
for(int i = 0; i < N; ++i)
for(int j = 0; j < N; ... |
cbf36f54ad33ced10065813677ce0d857678c1a0 | 73218660e3b869f0c7fc7fff59efc326a9405e2a | zykis/questions | /questiontablemodel.cpp | C++ | cpp | 7,824 | no_license | #include "questiontablemodel.h"
#include <QFile>
#include <QFileInfo>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QSettings>
QuestionQueryModel::QuestionQueryModel(QObject *parent)
: QAbstractItemModel(parent)
{
m_roles[ROLE_ID] = "id";
m_roles[ROLE_TEXT_EN]... |
08ae5d1e51e07acada114a4a44629b350a020c1c | 484dc1819df3c5a688bfe5f714762c9b40466568 | cryptoknowing/KYAN | /src/kyan-cli.cpp | C++ | cpp | 16,214 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2014-2019 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#i... |
617cd260d9466e5acd51dcedd4aaefe41af3cd62 | 809ac2a06bc6d4076b72784a40c046dfe9c1ef2a | sbudilko/my_chess | /engine/include/Game.hpp | C++ | hpp | 11,312 | no_license | #ifndef GAME_H
#define GAME_H
#include "EngineUtils.hpp"
#include "GameBoard.hpp"
#include <iostream>
#include<iomanip>
class Game
{
public:
Game() : m_PlayerTurn(COLOR::WHITE) {}
void changeTurn();
GAME_STATUS checkCastling(std::string chess_note)
{
BoardCoordinate source = ChessNotationToBoardCoor(chess_... |
b6b364f844ba99f2fa4155ba51a1811304067e53 | c75bc4165f2f3a555d374238c1f1f131c2e29bdb | ssaukkonen/BankSimul_ryhma_31 | /qt_frontend/ATM/pin.cpp | C++ | cpp | 548 | no_license | //#include "pin.h"
//#include "ui_pin.h"
//pin::pin(QWidget *parent) :
// QDialog(parent),
// ui(new Ui::pin)
//{
// ui->setupUi(this);
// ui->linePin->setEchoMode(QLineEdit::Password);
//}
//pin::~pin()
//{
// delete ui;
//}
//void pin::receiveKorttiFromEngine(long long kortti2)
//{
// kortti=kort... |
d0b5ce75bbce22511932f0b47831b45f34398577 | dbe6780fc28b23911a3c2c3e85f5ab7414c7eb90 | wpumacay/dart | /dart/dynamics/PlaneShape.hpp | C++ | hpp | 3,469 | permissive | /*
* Copyright (c) 2011-2022, The DART development contributors
* All rights reserved.
*
* The list of contributors can be found at:
* https://github.com/dartsim/dart/blob/master/LICENSE
*
* This file is provided under the following "BSD-style" License:
* Redistribution and use in source and binary forms, w... |
6302f01933f3e50d1ba3888895bb602f6d014867 | 9bc0c673442a2805bf019a7bfbe1a2a7cb79421b | mikechen66/CPP-Programming | /CPP-Primer-Plus/chapter12-dma/placenew2.cpp | C++ | cpp | 1,673 | no_license | // placenew2.cpp -- new, placement new, no delete
#include <iostream>
#include <string>
#include <new>
using namespace std;
const int BUF = 512;
class JustTesting
{
private:
string words;
int number;
public:
JustTesting(const string & s = "Just Testing", int n = 0)
{words = s; numbe... |
0ec9145f4f950429b63308b76ab40c20a55b5919 | c5cf65439770c57ecb29a9c9ef49ec723a52dc86 | codefresher32/CompetitiveProgramming | /OnlineJudgeSolutions/Codeforces/codeforces 545B.cpp | C++ | cpp | 795 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s1,s2,o;
int cnt=0,l;
cin>>s1>>s2;
l=s1.size();
for(int i=0;i<l;i++)
{
if(s1[i]!=s2[i])
cnt++;
}
if(cnt&1)
{
cout<<"impossible\n";
return 0;
}
int j=1;
... |
eb7663b06b24769438735d667abcdaf2fc6c71e0 | c5c257de504a113243bd940f4a7ce437f8405108 | ABasitIrfan/Intensive-Programming-Cpp-Basics | /ArrayPointer.cpp | C++ | cpp | 366 | no_license | #include<conio.h>
#include<stdio.h>
int *sum(int a[]);
main()
{
int a[10],i,sum1=0;
//printf("Sum: %d",sum1);
a[10]=*sum(a);
sum1=0;
for(i=0;i<10;i++)
{
sum1=sum1+a[i];
//printf("Sum: %d",sum1);
}
printf("Sum: %d",sum1);
//sum(a);
}
int *sum(int a[])
{
int i,sum1=0;
for(i=0;i<10;i++)
... |
6a075002b1af7dc211eb478c93051dd0258806fb | f2e60debc3bc587d8784922ead71757b80a359a2 | aws/aws-sdk-cpp | /generated/src/aws-cpp-sdk-transcribe/source/model/DeleteTranscriptionJobRequest.cpp | C++ | cpp | 1,004 | permissive | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/transcribe/model/DeleteTranscriptionJobRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::TranscribeService::Model;
using namespace Aws:... |
ff045a943612d7a00ecfbbeb8e3ce821c8dd2c19 | 7cb0c46fb18a14fd0ea56da66b02f2c45a0897e7 | cg8530/WorkSplace | /04_Code/adtv/jni/novel_supertv_dvb_jni_JniEpgSearch.cpp | C++ | cpp | 12,512 | no_license | #include <jni.h>
#include <android/log.h>
#include <tvcore.h>
#include <tvcomm.h>
#ifdef LOG_TAG
#undef LOG_TAG
#undef LOGI
#undef LOGE
#endif
#define LOG_TAG "JniEpgSearch"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.