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 |
|---|---|---|---|---|---|---|---|---|
9c8ca47fe4308cb9922baa256e4b74734558103c | f31846ba58c6c0ac35fb44c7e588a45dbab0ceed | LinkHS/fih-image | /modules/cvLocalStatisticsFiltering.cpp | C++ | cpp | 17,899 | no_license | #define LOG_TAG "FIH/cvLSFilter"
#define DEBUG_LEVEL 0
#include "includes.h"
#include "cvLocalStatisticsFiltering.h"
#include "common/PreCalculatedTables.h"
#include "basic_process/cvOthers.h"
#include "porting/debug.h"
using namespace cv;
#if DEBUG_PLATFORM != DEBUG_IN_WINDOWS
#define... |
15615fc7149aca30a5f036a5d80d4c5b53c574ee | 1752b603cb03319fbdd109ee854ba0ea1f63bf20 | gsmith23/EdMedPhysics | /include/EdMedPhAnalysis.hh | C++ | hh | 1,935 | no_license | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration... |
ea37f02dbd1de462a0e78b32ab08e7e6c6b16a24 | a70f05a9ae0c221e2e20b535faa63375738aefcf | mlitman/csc300_spring2020_binarytree | /BinaryTree.cpp | C++ | cpp | 810 | no_license | #include "BinaryTree.hpp"
BinaryTree::BinaryTree(int payload)
{
this->payload = payload;
this->leftChild = 0;
this->rightChild = 0;
}
void BinaryTree::displayInOrder()
{
}
void BinaryTree::displayPreOrder()
{
}
void BinaryTree::displayPostOrder()
{
}
void BinaryTree::add(int payload)
{
i... |
2964b8528ef48e4cd59a8da48df7f6a9b717dda1 | d1a6b7165773395bd1e3454fee811643d3431f08 | jonjon33/college | /cs120/labs/pet/petbasic.cpp | C++ | cpp | 1,460 | permissive | #include<iostream>
#include<string>
using namespace std;
class pet{
private:
int hunger;
int happy;
string name;
public:
pet();
void play();
void feed();
void print();
int check_health();
};
int main(){
pet pet1;
int choice;
int health_check;
do{
pet1.print();
cout << "What would you like to do with y... |
20a06f2d5000cb130453a959c965c358b1179200 | f33f1fda229d5a585f77ebe78af11edf268cc864 | xiaos09lzu/knowledgePoint | /Test/whileLoop.cpp | C++ | cpp | 2,815 | no_license | #include <stdlib.h>
#include <memory>
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
class Animal
{
public:
Animal(){ cout << "Animal constructor... " << endl; initialize(); }
virtual ~Animal() = default;
virtual string getMyName()const{
return string(myName);
}
/... |
995a442db262865119cc3bbd11b1941e695c79e6 | beded39458ed4f4004dd368fc1b5667068675e29 | NikhilRajPandey/Fork_CPP | /CodeChef/Practice Solutions/Beginner/Lucky Four/Solution_by_Pandz18.cpp | C++ | cpp | 282 | permissive | #include<iostream>
using namespace std;
void solve() {
int n; cin >> n;
int temp=n;
int count=0;
while(temp!=0) {
if(temp%10==4) count++;
temp/=10;
}
cout << count << endl;
}
int main() {
int t; cin >> t;
while(t--)
solve();
return 0;
}
|
d7f14bfce5e8304f5aeb3f33d1f4674759b51c91 | dd6e610116cfbc0ef90969e71409832ef22049ac | tfrichard/Twister-cpp | /Twister-cpp/samples/main.cpp | C++ | cpp | 3,852 | no_license | //
// main.cpp
// Twister-cpp
//
// Created by Fei Teng on 9/11/13.
// Copyright (c) 2013 Fei Teng. All rights reserved.
//
//#include "log4cxx/logger.h"
//#include "log4cxx/basicconfigurator.h"
//#include "log4cxx/propertyconfigurator.h"
//#include "log4cxx/helpers/exception.h"
#include "boost/thread.hpp"
#includ... |
6b957c7ea081032cd48d3d7c72ad4f32a16be2a3 | ee3b728580ce0399c4a233b52d0988a4f680b340 | sysq/support-chain | /blockchain/chain/include/vm_xmax.hpp | C++ | hpp | 3,094 | permissive | /**
* @file
* @copyright defined in xmax/LICENSE
*/
#pragma once
#include <blockchain_exceptions.hpp>
#include <message_xmax.hpp>
#include <message_context_xmax.hpp>
#include <IR/Module.h>
#include <Runtime/Runtime.h>
namespace Xmaxplatform { namespace Chain {
class chain_xmax;
class wasm_memory;
/**
* @class v... |
f04269836e2a8cfc2f6d4bf96e83c63bf32e6aec | ac790103d3778d5c3ed2cf3e47c35e41d1f02337 | hemakshis/SPOJ | /FARIDA.cpp | C++ | cpp | 459 | no_license | #include <iostream>
#include <stdio.h>
#include <vector>
#define NIL -1
using namespace std;
long cal(int n,long a[],vector<long long>& dp){
}
int main(void)
{
int t;
scanf("%d",&t);
for(int w=1;w<=t;w++){
printf("Case %d: ",w);
int n;
scanf("%d",&n);
lon... |
e9f4081003af7f1226f0f1550c5c8f1dfe6d6248 | ae50cb4f261da2b3f982ad9ba6c41fc24e124da6 | sock-lobster/CollisionDetection | /src/sweepnprunealgorithmsimple.cpp | C++ | cpp | 3,255 | no_license | #include "sweepnprunealgorithmsimple.h"
SweepNPruneAlgorithmSimple::SweepNPruneAlgorithmSimple(double xIn, double yIn, int numParticles) :
Algorithm(xIn, yIn)
{
createParticles2D(numParticles);
// unique to sweepN'prune:
for (Particle* p : particles)
{
boundingBoxes.push_back(new BoundingB... |
1a80c26029b89cef5b4effce0180304414c3e5c4 | cf082c12cce81bb393297771787b91ae84c5f106 | Blakemcw/compiler-design | /string_set.cpp | C++ | cpp | 1,390 | no_license | // $Id: string_set.cpp,v 1.7 2019-04-04 14:28:49-07 - - $
#include <string>
#include <unordered_set>
using namespace std;
#include "string_set.h"
unordered_set<string> string_set::set;
string_set::string_set() {
set.max_load_factor (0.5);
}
string_set set;
const string* string_set::intern (const char* string) ... |
69312fe180f56820bb39366dc673ee78494fa830 | 661dd990c13ae6edfc69597f9d2c16e6b7a39135 | BrightOS/laba3 | /main.cpp | C++ | cpp | 12,529 | no_license | #pragma ide diagnostic ignored "hicpp-multiway-paths-covered"
#pragma ide diagnostic ignored "cert-err34-c"
#pragma ide diagnostic ignored "performance-inefficient-string-concatenation"
#include <cstdio>
#include <cmath>
#include <deque>
#include <sstream>
#include <fstream>
#include <vector>
#include <windows.h>
usi... |
3a2696248687bc40ca930d0a3875098e99845186 | 31f1cf0768c54e89126e55b037097052fa4b4e25 | rousse101/arrayfire | /examples/image_processing/morphing.cpp | C++ | cpp | 3,919 | permissive | /*******************************************************
* Copyright (c) 2014, 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
**********************************************... |
cc243ee2c4943852211a23de55153b0495d3209f | 624d86ca3cdc70920a2e51c59eefaf647769313a | dnobori/DN-OSS-Learn | /v8-181230/v8/src/global-handles.cc | C++ | cc | 36,049 | permissive | // Copyright 2009 the V8 project 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/global-handles.h"
#include "src/api-inl.h"
#include "src/cancelable-task.h"
#include "src/objects-inl.h"
#include "src/objects/slots.h"
#... |
d05725b47f25c13faf07fd6a4a8b819fff82974a | 14a0e90ad14250d117c3190b96a301f246edd718 | m1keall1son/Ecstatic_Computation | /src/Scenes/Scenes.cpp | C++ | cpp | 1,432 | no_license | //
// Scenes.cpp
// System_test
//
// Created by Mike Allison on 5/18/15.
//
//
#include "cinder/Log.h"
#include "Scenes.h"
#include "SystemEvents.h"
#include "Actor.h"
#include "Components.h"
#include "CameraManager.h"
#include "ActorManager.h"
#include "Light.h"
#include "LightComponent.h"
#include "Controller.h"... |
61735d4c0357cba21fe5b7bc6a3e796c095ef782 | 67f59b660bd90ce3dff076e843afe3a686d716ad | Bryang2303/TECFileSystemP3D2 | /controllernode.cpp | C++ | cpp | 18,581 | no_license | #include "disknode.h"
#include "controllernode.h"
#include "filesmanagement.h"
string ParityXnor(string p1, string p2, string p3){
string xnor;
string xnorF;
for (int i = 0;i<16;i++){
if (p1[i]==p2[i]){
xnor+="1";
} else {
xnor+="0";
}
}
for (int j = ... |
3ae08458f5da791ad7609b716adc45afd2ee75ab | f553fb3a5ab0405b370395d1744eb2110cbdcbaf | NiuBenn/face | /data/data.cc | C++ | cc | 2,088 | no_license | #include <iostream>
#include <string>
#include <cstring>
#include <stack>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <mysql/mysql.h>
#include <unistd.h>
#include "data.hpp"
using namespace std;
MYSQL mysql;
MYSQL_ROW row;
MYSQL_FIELD* field = NULL;
MYSQL_RES* result;
vo... |
22faec0935170af68b5ce0f2af8357497d1946cc | a9d9eb096452c4d9c5468f8ac3f4a404110567a0 | propulsion4swtest/JeongHae_CPP | /B_Baekjoon/DP/11057.cpp | C++ | cpp | 598 | no_license | #include<iostream>
#include<string.h>
#define MOD 10007
using namespace std;
int N;
int cache[10][1010];
int DFS(int arrSize, int prevNum)
{
if (arrSize == N - 1)
return 1;
if (cache[prevNum][arrSize] != -1)
return cache[prevNum][arrSize];
int tmp = 0;
for (int i = prevNum; i <= 9; i++)
{
tmp += DFS... |
d604dc190837f6476b05b5c9146f52d52ce7b539 | 8413c156227c4d7922f8e608483f68f1ee5059b8 | hanasaan/ofxInteractivePrimitives | /example/src/testApp.cpp | C++ | cpp | 2,895 | no_license | #include "testApp.h"
#include "ofxInteractivePrimitives.h"
class MyRect : public ofxInteractivePrimitives::Node
{
public:
string my_string;
MyRect()
{
setPosition(ofRandomWidth(), ofRandomHeight(), 0);
my_string = "drag me";
}
void update()
{
if (!isDown())
{
move(ofRandom(-2, 2), ofRandom(-... |
cd4a994db6b1e69791b9ae9afc2fd6a098964ed9 | 00739c3d432d9c890ac9dedc1debb262c050dbd2 | GaryCao97/CodeWarehouse | /C++/dev/acm/决赛/js2.cpp | C++ | cpp | 941 | no_license | #include<iostream>
#include<stdlib.h>
using namespace std;
#define maxn 15
int hang[maxn],res[maxn];
int zuoxie[maxn],youxie[maxn];
int n;
int cur;
void dfs(int x)
{
if(x==n)
{
cur++;
return ;
}
for(int i=x;i<n;i++)
{
if(hang[i])continue;
for(int j=0;j<n;j++)
... |
3a4a1c392f503ac126e4245b5d5081a166803dbe | 89fbfcf15ed6f76323f959392704567094a5860c | cezarybednarz/JNP1-zadanie1 | /kasa.cc | C++ | cc | 12,868 | no_license | #include <iostream>
#include <string>
#include <set>
#include <vector>
#include <regex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <unordered_map>
#include <climits>
#include <unordered_set>
using ULL = unsigned long long;
const ULL INF = 1e18 + 10;
// makra do odpowiadajace typom z... |
574852e9fa597261abb4182738a958238c8240b4 | 925d48b68a927e3cf1f5dd700954fa177570ad39 | supersojo/chromium | /media/filters/source_buffer_range.cc | C++ | cc | 6,146 | 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 "media/filters/source_buffer_range.h"
#include "media/base/timestamp_constants.h"
namespace media {
// static
bool SourceBufferRange::IsUncomm... |
4aca1bd54f5fc474c57cb5e12bdd92b61d6873c7 | 7003ec139bf138ab1a1adb1ba41a21fe1ea3b062 | zichaotong/Computation_using_CPP | /test_matrix_exponential/test_matrix_exponential.cpp | C++ | cpp | 17,514 | no_license | # include <cstdlib>
# include <iostream>
# include <iomanip>
# include <cmath>
# include <ctime>
# include <cstring>
using namespace std;
# include "test_matrix_exponential.hpp"
# include "r8lib.hpp"
//****************************************************************************80
double *mexp_a ( int test, int n )
... |
affc0d26ffe9e88455a10ab4d3d2e0a1dfa89394 | a094c9946d8845e07511dbdfbee2a3b5da57ed70 | Hooolly/Evaluating-Human-Hand-Pose | /using_markers/src/handrotation.cpp | C++ | cpp | 1,932 | no_license | /**
* @file handrotation.cpp
* transform handmodel to the postion of point cloud.
* @author Hao Xu
*/
#include "handrotation.h"
#include <iostream>
#include <pcl/pcl_macros.h>
#include <stdio.h>
#include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <math.h>
#include <ros/ros.h>
#include <s... |
ebd3bfc4c8bfbbb4bd8324e3f01ea22bfa0c4a88 | e457581a58ba5e4950ccfa863e72fa99e5fbff57 | SPYcyCODER/playground | /base-der.cpp | C++ | cpp | 950 | no_license | #include <iostream>
using namespace std;
class base{
public:
base(){cout<<"default base constructor...\n";}
base(int x){cout<<"base parameterised constructor...\n";}
};
class derive:public base{
const int v;
public:
//derive(){cout<<"default derive constructor...\n";}
derive(int val):v(val) {cout<<"derive paramete... |
1e1c23fe528506a40528fb219796aa0b66528c03 | 25523b7826dd104b61574cfe1ba0f5369f642e37 | abhayrp2000/Interview-Prepration | /Practice/bfs/zigzag.cpp | C++ | cpp | 1,442 | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... |
8558ffd04e370890082a6b47f63583b3a8666397 | e2b9f0e161a168df1b13534e252d3cc7f24935bd | yulefox/elfox | /src/test/test_cp.cpp | C++ | cpp | 1,337 | permissive | /*
* Copyright (C) 2012 Yule Fox. All rights reserved.
* http://www.yulefox.com/
*/
#include <elf/elf.h>
#include <elf/db.h>
#include <stdio.h>
#include <tut/tut.hpp>
namespace tut {
struct cp {
cp() {
}
~cp() {
}
};
typedef test_group<cp> factory;
typedef factory::object object;
static tut::fac... |
7d43d2775afefbcc5cf7bb83d070c0cc614c3f4e | 8d4e52eae8c802f4f172b0f5fb931dd20829ce8e | wallydz/chromium-1 | /components/autofill/content/renderer/autofill_agent.cc | C++ | cc | 25,066 | 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 "components/autofill/content/renderer/autofill_agent.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop/messag... |
596f0765bac202516b6569726cb2e81011886cb4 | e12348fb3b07231d42e816e90aad0101cf52df2e | Liuchanghong1999/GameBox | /game.cpp | C++ | cpp | 2,397 | permissive | #include "game.h"
#include <QFile>
#include <QJsonDocument>
#include <QTextStream>
Game::Game()
{
mPlayer = new Character;
mProcess = new Progress;
}
bool Game::loadGame()
{
QFile loadFile(QStringLiteral("save.json"));
if (!loadFile.open(QIODevice::ReadOnly)) {
qWarning("Couldn't open save f... |
27e98ba8500011a9430d0ab4dbd644ff7cf1eb90 | fd963f943262c41508512329156f5c59d42d0d67 | githubsigmod2021/CodecDB | /engine/src/lqf/tpch/query18.cc | C++ | cc | 5,304 | permissive | //
// Created by harper on 4/6/20.
//
#include <parquet/types.h>
#include <lqf/data_model.h>
#include <lqf/filter.h>
#include <lqf/agg.h>
#include <lqf/sort.h>
#include <lqf/print.h>
#include <lqf/join.h>
#include <lqf/mat.h>
#include "tpchquery.h"
namespace lqf {
namespace tpch {
using namespace agg;
... |
42fb5e3dc01cc5ce74e52ff5f0b5bbbe6c8bf591 | 29e0d873cc93b49856404d4a5b906ab28c1bc0ab | yaoshengzhe/codeforces | /500D_New_Year_Santa_Network/Solution.cc | C++ | cc | 2,714 | no_license | #define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define VAR(V,init) __typeof(init) V=(init)
#define FOREACH(I,C) ... |
adaf9f3bb49b5ad9f313a9fd94b3024d299f8e3f | 2d4fe576d215b36cda939d99ecf30f31f47566b8 | gary-sweet/renderdoc | /renderdoc/driver/dxgi/dxgi_hooks.cpp | C++ | cpp | 5,568 | permissive | /******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015-2018 Baldur Karlsson
* Copyright (c) 2014 Crytek
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (t... |
b7e5551b2248e9656d44301bf3d969316d878545 | 9497536a895bcaeb654009e5bfe4f17f6eb3bdc8 | BartSiwek/Gris | /graphics/tests/src/test_trackball_camera.cpp | C++ | cpp | 34,210 | permissive | #include <catch2/catch.hpp>
#include <gris/graphics/cameras/trackball_camera.h>
#include <glm/gtx/euler_angles.hpp>
#include <glm/gtx/string_cast.hpp>
#include <glm/gtx/transform.hpp>
namespace
{
template<typename MatrixT>
class GlmMatrixApprox : public Catch::Detail::Approx
{
public:
explicit GlmMatrixApprox(c... |
a3fb77a09d9c2f28304b3cad528809b901ed115e | 79b29cb6b49ed841a171c78d80c0b31955082064 | handsone-u/Algorithm | /Graph/10026.cpp | C++ | cpp | 1,140 | no_license | #include<iostream>
using namespace std;
int n,ans,dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
char map[101][101];
bool ck[101][101];
bool pos(int x,int y){
if(x<0||y<0||x>=n||y>=n) return false;
return true;
}
void dfs(int x,int y,char col){
for(int i=0;i<4;i++){
int tx=x+dx[i], ty=y+dy[i];
if(!pos(... |
1cbbbfed9bc0814a3d88364c7a5a9824e535fb60 | 51410e2809fef985413a7e07fb5a91708cbf56d9 | timopulkkinen/BubbleFish | /chromeos/attestation/attestation_flow_unittest.cc | C++ | cc | 11,010 | 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 "base/bind.h"
#include "base/run_loop.h"
#include "chromeos/attestation/mock_attestation_flow.h"
#include "chromeos/cryptohome/mock_async_met... |
4b821c82a760ff0354d404006e9cd9c433cadf99 | 04b710fc2efef42dafcedf3c1f533f3daf34222c | younghajung/chromium | /content/browser/service_worker/fake_embedded_worker_instance_client.cc | C++ | cc | 7,948 | 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 "content/browser/service_worker/fake_embedded_worker_instance_client.h"
#include <utility>
#include "base/bind.h"
#include "base/run_loop.h"
#i... |
1d4ef50d991ea316d0b2b19b644f821bddcd00f6 | d314535c973b993b640ca1370dfc043819819f70 | zeroeffects/TempestRenderer | /tests/graphics/copy-data/copy-data-test.cc | C++ | cc | 6,474 | permissive | #include "tempest/utils/testing.hh"
#include "tempest/graphics/api-all.hh"
TGE_TEST("Testing the rendering context")
{
Tempest::WindowDescription wdesc;
wdesc.Width = 800;
wdesc.Height = 600;
wdesc.Title = "Test window";
auto sys_obj = Tempest::CreateSystemAndWindowSimple<Tempest::PreferredSystem>(... |
0ed74e22606a7dd6c5c60db36282f46688d22455 | 85f12ac34df0b0c3884abe5248725d505804e3da | vbhv17/DSA-Questions | /Binary Tree/8. Postorder traversal of a tree Recursive & Iterative.cpp | C++ | cpp | 1,819 | no_license | Recursive Solution:
class Solution {
public:
void recursivePreorder(TreeNode *root, vector<int> &ans)
{
if (root == NULL)
return;
recursivePreorder(root->left, ans);
recursivePreorder(root->right, ans);
ans.push_back(root->val);
}
vector<int> postorderTraversal(TreeNode* root) {
ve... |
d4648bcef0118b5b3fedaca2e91ea2c9a1758a4c | e5b97e42c073b6805878a661554710ef71a90731 | ErikHorus1249/Cpp | /QHD/S.cpp | C++ | cpp | 343 | no_license | #include <iostream>
using namespace std;
const int M = 1e9+7;
long long C[1001][1001];
main(){
int n,k,t = 0,i,j;
cin >> t;
while(t-- ){
cin >> n >> k;
for(i = 0 ; i <= n; i++)
for(j = 0 ; j <= i; j++)
if(j == 0 || j == i)
C[i][j] = 1;
else
C[i][j] = (C[i-1][j-1] + C[i-1][j])%M;
cout << ... |
d3e8815a4441a2425220488818796c79cbb52ec1 | 16a5a9059ca5b6be5709e625625d39f8fd31d4d8 | sebas095/Competitive-Programming | /URI/Sphere.cpp | C++ | cpp | 318 | no_license | #include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define PI 3.14159
using namespace std;
typedef long long ll;
int main() {
fast;
ll r;
cin >> r;
r = r * r * r;
cout << "VOLUME = " << fixed << setprecision(3) << r * PI * (4/3.0) << endl;
return 0;
}
|
a93acaa6f560ba05ab56c2e96313314adfd522ed | 5d60547acaa85442dd27b251b3740679fc37fe0c | boostorg/asio | /test/windows/random_access_handle.cpp | C++ | cpp | 5,116 | no_license | //
// random_access_handle.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot 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)
//
// Disable autolink... |
5c7fb30adbec78aceee06ffbcfb4393c0dcaf3fc | 1f489b71ad998817feeec1988ce6d3dac871b9ca | ziglang/zig | /lib/tsan/sanitizer_common/sanitizer_procmaps_bsd.cpp | C++ | cpp | 3,090 | permissive | //===-- sanitizer_procmaps_bsd.cpp ----------------------------------------===//
//
// 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
//
//===---------------------------... |
6671eff8cb3ffa20bd300b785e7fbf986815bb8d | ed442d89b21bc191f16ace572c5458bfbeecaa57 | Mudit18/spoj | /longestPathInaTree.cpp | C++ | cpp | 1,069 | no_license | #include<iostream>
#include<bits/stdc++.h>
using namespace::std;
vector<long long int> graph[10001];
long long int v[10001],height[10001];
long long int maxDepthsrc=1;
long long int hght(long long int src){
long long int mx=0;
v[src]=1;
for(long long int i=0;i<graph[src].size();i++){
if(v[graph[src][i]]==0){
... |
5a75657471af2d576b32d5cf97c92b762517a595 | f701bad5c81f18e407986a3a52e85aaecdc62efc | elfmedy/vvdn_tofa | /mdk_release_18.08.10_general_purpose/mdk/common/components/kernelLib/MvCV/kernels/maxPool3x3s2hh/unittest/maxPool3x3s2hh_unittest.cpp | C++ | cpp | 3,370 | no_license | // maxPool3x3s2hh kernel test
//Asm function prototype:
// void mvcvMaxPool3x3s2hh_asm(half** in, half** out, u32 outputWidth);
//Asm test function prototype:
// void maxPool3x3s2hh_asm_test(half **input, half **output, unsigned int outputWidth);
//C function prototype:
// void mvcvMaxPool3x3s2hh(h... |
4005bdfce12ce790798a1abf50ba1c58f60c6713 | 91662ed2891c7fa467b53187116635fccd6829f4 | bitcoinnext2018/bitcoinnext | /src/qt/askpassphrasedialog.cpp | C++ | cpp | 9,923 | permissive | // Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "askpassphrasedialog.h"
#include "ui_askpassphrasedialog.h"
#include "guiconstants.h"
#include "walletmodel.h"
#inc... |
0497efd9460a12e7641abfc978a1285e16f8165a | 47b5ca831cb160eb67ba64e778e6a21b12b97019 | RichyRaj/cppdb | /src/db.cpp | C++ | cpp | 1,193 | permissive | //
// Copyright (c) Richard Raj. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#include "cppdb/db.h"
cppdb::Status cppdb::DB::open(const std::string& name) {
cppdb::Status s;
if (isOpen) {
s = h.close();
if (s.isError()) {
return cppdb::St... |
d6b7ae319589ff034aa91ec61299d0d14e188fc0 | 6db6d3bfb488b05ef9763e5cf6c0943b89cd92b7 | coderTong/aws-sdk-cpp | /aws-cpp-sdk-greengrass/source/model/DeploymentType.cpp | C++ | cpp | 2,492 | permissive | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
3c1e6285476b93dfc1ae2c71338c880183dde810 | 417230b9e506f50b82e32ba03f72dc6d36518618 | Jagholin/Bouncy | /scenenode.cpp | C++ | cpp | 2,660 | no_license | #include "scenenode.h"
#include "state.h"
#include "stateelements.h"
#include "scene.h"
#include <utility>
#include <algorithm>
SceneNode::SceneNode(GraphicsScene* scene, std::string const &name) : m_nodeState(new GraphicsStateSet), m_parent(nullptr), m_nodeTransform(1.0f), m_name(name), m_scene(scene)
{
//if (parent... |
d322a6fe82269286fc9a5d939d4e853f2a1dec09 | 49d4a49dac8d8cfaf69c25f825deae1bb2611b1a | HeNeos/CompetitiveProgramming | /ProjectEuler/401.cpp | C++ | cpp | 895 | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1000000000;
const long long n = 1000000000000000LL;
const int N = (int)(sqrt(n));
ll T(ll x){
ll ans = 1;
if(x%2 == 0){
ans = x/2;
ans %= MOD;
x %= MOD;
ans *= (x+1); ans %= MOD;
}
else{... |
ee76a1ded649b0d391cc6e719a248e3416a44e52 | 61641e2a7c961324aa1028e2a1b46cf6c2c78ad1 | openharmony-sig-ci/utils_native | /base/test/unittest/common/utils_securec_test.cpp | C++ | cpp | 3,940 | permissive | /*
* Copyright (c) 2021 Huawei Device 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 ... |
c5ce0107c4d459fd5a1bfb00e027b82676511575 | 30da3a6460e4f33bf6d87bdc4dfb6aaf7de57c74 | zanzo420/Sea-Of-Thieves-SDK | /SDK/BP_dirt_01_Desc_functions.cpp | C++ | cpp | 550 | permissive | // Name: SeaOfThieves, Version: 2.0.23
#include "../pch.h"
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Functions
//--------------------------------------------... |
37aa03e2af8c77be8a0795114b09e908909c8fd3 | 57919aa451ed17b7da7c218669186f024a01d7db | WannesVanHooste/RealmOfTheMadGod | /RealmOfTheMadGod/RayCast.cpp | C++ | cpp | 2,108 | no_license | #include "stdafx.h"
#include "RayCast.h"
#include "Avatar.h"
RayCast::RayCast()
:m_Vertices{}
, m_LevelBoundaries{}
{
m_LevelBoundaries.GetVerticesFromSvgFile("Resources/LevelSvg2.svg", m_Vertices);
}
void RayCast::Update(float elapsedSec, const Rectf& shape, Vector2f& horizontalVelocity, Vector2f& verticalVelocit... |
7a350e8bf3abec09b056783b254060e93657fa20 | f669cff5dad12f9b8ac9f6ef52aed34938ee820a | raywray/cs236project2 | /Project1_Starter_Code/LeftParen.cpp | C++ | cpp | 217 | no_license | //
// Created by Raya Esplin on 5/3/21.
//
#include "LeftParen.h"
void LeftParenAutomaton::S0(const std::string& input) {
if (input[index] == '(') {
inputRead = 1;
}
else {
Serr();
}
} |
1cc2f2e55481426b8a9ac38b12b0e7c016eea5e4 | 314d3cebd4cf24ce15b59298839efbbf28f09f39 | mingfx/LeuSqlQuery | /MySqlQuery/MainWindow.cpp | C++ | cpp | 9,850 | no_license | #include "MainWindow.h"
#include "Widget.h"
#include "AddWidget.h"
#include <QMessageBox>
#include <QSqlError>
#include <QSqlRecord>
#include <QDebug>
#include <QDir>
#include <fstream>
#include <QStandardItemModel>
#include <QFileDialog>
#include <iostream>
using namespace std;
bool IsDateInside(QDate dateStart,QDate... |
a6495f37b8b2c05e837c37b7f696366d24dce995 | 71ae41b1eefecd024e9fd13a54daece168c53636 | Parquery/mapry | /test_cases/docs/schema/introductory_example/cpp/test_generate/parse.cpp | C++ | cpp | 790 | permissive | // File automatically generated by mapry. DO NOT EDIT OR APPEND!
#include "parse.h"
#include <string>
#include <vector>
namespace book {
namespace address {
namespace parse {
Errors::Errors(size_t cap) : cap_(cap) {}
void Errors::reserve(size_t expected_errors) {
errors_.reserve(expected_errors);
}
void Errors... |
b5cdb4f793da4d2e442569bbb93c0cbced236bb7 | efd1d6ec5036f2f475cc95a5faa5df1bd3ada583 | WaykiChain/wicc-wasm-cdt | /libraries/wasmlib/contracts/inline_transaction.hpp | C++ | hpp | 17,015 | permissive | /**
* @file
* @copyright defined in wasm/LICENSE
*/
#pragma once
#include <cstdlib>
#include "../core/serialize.hpp"
#include "../core/datastream.hpp"
#include "../core/name.hpp"
#include "../core/ignore.hpp"
#include "../core/time.hpp"
#include "../core/regid.hpp"
#include <boost/preprocessor/variadic/size.hpp>... |
af07d0027ed3bbce99ba5cb0319e1b13f3eab943 | 49540c5efdeb8f776fd5d5c200fd47139b540a05 | soplwang/chemkit | /src/graphics/graphicsproteinitem.cpp | C++ | cpp | 8,534 | permissive | /******************************************************************************
**
** Copyright (C) 2009-2011 Kyle Lutz <kyle.r.lutz@gmail.com>
** All rights reserved.
**
** This file is a part of the chemkit project. For more information
** see <http://www.chemkit.org>.
**
** Redistribution and use in source and binar... |
c7579bf471e6b441261e1172a7867e4aa5aa63b2 | 44bf769010496eb8f5178fe79ae86a3f4c84a571 | Hiroki11x/ofxCustomAddons | /ofxAlembic/src/ofxAlembicWriter.cpp | C++ | cpp | 2,150 | permissive | #include "ofxAlembicWriter.h"
using namespace ofxAlembic;
using namespace Alembic::AbcGeom;
bool Writer::open(const string& path, float fps)
{
ofxAlembic::init();
archive = OArchive(Alembic::AbcCoreHDF5::WriteArchive(), ofToDataPath(path));
if (!archive.valid()) return false;
archive.setCompressionHint(1);
i... |
7cd89367816ff177fe2cd47a74048c13cf0059a9 | fa53ed3c916e08b673e08bd9ccd84f43c0271209 | ExpLife/Norton_AntiVirus_SourceCode | /Corporate_Edition/win32/r10.2/src/Jettison/REGKEY.CPP | C++ | cpp | 5,698 | no_license | //-----------------------------------------------------------------------------
// RegKey.Cpp
// A component of the MacNuke Project
// PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
// Copyright 1997, 2005 (c) Symantec Corp.. All rights reserved.
// SYMANTEC CONFIDENTIAL
//
// Re... |
6c08fc61e8a77d60c3c5ae6d509afb25ca71ef31 | 2e3a3dfb91cf031edc1428c9f804e74b6ea0539a | shawon39/C-C-plus-plus-Programming | /Old Things/Blue Team Problem/MULTQ3 - Multiples of 3.cpp | C++ | cpp | 1,904 | no_license | // Not complete
#include <bits/stdc++.h>
using namespace std;
#define mx 100001
int arr[mx];
int ans = 0;
struct info {
int prop, sum, mod;
} tree[mx * 3];
void update(int node, int st, int ed, int l, int r, int x)
{
if (l > ed || r < st)
return;
if (st >= l && ed <= r)
{
tree[node].... |
bcd22e42cfe42c6caa597554d07f30830e8e91c9 | 4837332d1fed965c722c3791058109aab9e2cfe8 | sananand007/algo-cpp | /sort1.cpp | C++ | cpp | 4,434 | no_license | /*
* Insertion Sort
* Merge Sort - You have an array, you Merge a chunk of it from position p to position r
*/
#include <iostream>
#include "math.h"
#include "limits.h"
using namespace std;
void insertionsort(int *array, int l);
void insertionsort_noninc(int *array,int l);
void merge(int array[],int p, int q, int ... |
6b8b8d914480adbea56468b95b563aaba39e65d1 | 4517581069ce751b1968cdb833d9f7ae7ab357c0 | KernelPanic-OpenSource/Win2K3_NT_drivers | /serveravailability/watchdog/timer.cpp | C++ | cpp | 3,536 | no_license | /*++
Copyright (c) 1991 - 2002 Microsoft Corporation
Module Name:
###### #### ## ## ##### ##### #### ##### #####
## ## ### ### ## ## ## ## # ## ## ## ##
## ## ######## ## ## ## ## ## ## ## ##
## ## # ### ## ##### ##### ## ## ## ## ##
... |
35deb95d2e0ca5aabd11994a3a896b468cedc61c | 10fea7c6909930701dc5a8015a4540a5ed619988 | CMS-TMTT/cmssw | /EventFilter/L1TRawToDigi/plugins/implementations_stage2/GlobalAlgBlkUnpacker.cc | C++ | cc | 5,663 | permissive | #include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h"
#include "GTCollections.h"
#include "GlobalAlgBlkUnpacker.h"
namespace l1t {
namespace stage2 {
bool
GlobalAlgBlkUnpacker::unpack(const Block& block, UnpackerCollections *coll)
{
LogD... |
803348ec86bdd0aaf3ac46ef5feb6b5f9410ca59 | 79314dbdee42b3fd0b6462bf2d96b8d441bfa96e | 13575896587/PIG | /main.cpp | C++ | cpp | 200 | no_license | #include "mainwindow.h"
#include <QApplication>
#include<QThread>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
|
26c710e6d5876ac6fde02cd58413fdd148164b51 | 78a1934f6007355d8997b9715720b7793b9ba0f5 | venkatarajasekhar/shawn-1 | /src/sys/transm_models/transmission_model_keeper.cpp | C++ | cpp | 1,402 | permissive | /************************************************************************
** This file is part of the network simulator Shawn. **
** Copyright (C) 2004-2007 by the SwarmNet (www.swarmnet.de) project **
** Shawn is free software; you can redistribute it and/or modify it **
** under the terms of t... |
25a42ea89b26159cca761f32efa0728cc491b2c0 | edfd1ce3fc5bd953ed6358d9b48bdf173ac622ca | digitalism/retroshare | /plugins/VOIP/gui/SpeexProcessor.cpp | C++ | cpp | 19,079 | no_license | #include "SpeexProcessor.h"
#include <speex/speex.h>
#include <speex/speex_preprocess.h>
#include <sstream>
#include <iostream>
#include <fstream>
#include <fcntl.h>
#include <math.h>
#include <cstdlib>
#include <QDateTime>
#include <limits.h>
#include "interface/rsvoip.h"
//#include "gui/settings/rsharesettings.h"... |
da4033328c3e78a4d8fd4a0fbef14c5cd85f969d | db0806acad299a3d465962d78160ab4da0b032f1 | timpostuvan/competitive-programming | /Olympiad/COI/Policija2006.cpp | C++ | cpp | 2,523 | no_license | /*
Idea:
- http://hsin.hr/coci/archive/2006_2007/ (COI solutions)
*/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF ((int) 2e9)
#define MOD (1000 * 1000 * 1000 + 7)
#define maxn 100111
#define logn 20
typedef long long ll;
typed... |
c00b88d664ebd00c53a6d499fc835556b43e05d5 | 8a7367ff0f1fc32c13d6cf97a95f3862bacf13e4 | microsoft/tensorflow-directml | /third_party/mlir/lib/Support/TranslateClParser.cpp | C++ | cpp | 4,179 | permissive | //===- TranslateClParser.h - Translations command line parser -------------===//
//
// Copyright 2019 The MLIR Authors.
//
// 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.... |
14f1238caa5f516b9226beb572b72fc8ed81f576 | 8d5f742f9732adbe83d33f106f464c59d822b8a1 | msorvig/qt-webassembly-examples | /core_eventloop/main.cpp | C++ | cpp | 7,342 | no_license | #include <QtCore/QtCore>
#include <emscripten/bind.h>
#include <emscripten/val.h>
#include <thread>
using namespace emscripten;
class EventTarget;
QCoreApplication *g_app = nullptr;
QThread *g_eventLoopThread = nullptr;
std::thread *g_eventPosterThread = nullptr;
std::condition_variable g_condition;
std::mutex g_... |
d27e1aa73070e7d3df6a40fde8a431f2f40cbf8b | 99d9be41b2f469438ee3cf9ebeeb8d55f6ecf7a7 | nyaxs/chromium | /chrome/browser/ui/webui/tab_search/tab_search_page_handler_unittest.cc | C++ | cc | 25,161 | permissive | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/tab_search/tab_search_page_handler.h"
#include "base/test/bind.h"
#include "base/timer/mock_timer.h"
#include "build/bu... |
46e30ddc39438dc64db622073cdc2c34bda5809e | ac2b9a18fa6ba8587c4fe5fc54ba39a4969772e2 | edwinsun98/Competitive-Programming-Solutions | /Atcoder/ABC204_B.cpp | C++ | cpp | 801 | permissive | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define f first
#define s second
#define all(vec) begin(vec), end(vec)
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define mk make_pair
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
ty... |
1558f58e6dc06159b2a50fde6db2684e1d903c32 | 2ecdd648c87b9b618209d48ee71ffd2336ed4884 | skn123/boundary-first-flattening | /src/mesh/HalfEdge.cpp | C++ | cpp | 1,750 | permissive | #include "bff/mesh/HalfEdge.h"
#include "bff/mesh/Mesh.h"
namespace bff {
HalfEdge::HalfEdge(Mesh *mesh_):
onBoundary(false),
index(-1),
nextIndex(-1),
prevIndex(-1),
flipIndex(-1),
vertexIndex(-1),
edgeIndex(-1),
faceIndex(-1),
cornerIndex(-1),
mesh(mesh_)
{
}
HalfEdge::HalfEdge(const HalfEdge& he):
onBoundary(he.... |
9b08ec01023fdf5206950863b5d20690b02c9376 | 47dc2e222cd340fa2ad6123887d813362a4994d0 | Yudditeruya/opengl | /cg/common/src/GLWindow.cpp | C++ | cpp | 8,252 | no_license | //[]---------------------------------------------------------------[]
//| |
//| Copyright (C) 2018 Orthrus Group. |
//| |
//| This software is provided 'as-is', w... |
4189914b167c446c7d925cd70ce73792d4140ba0 | 461833b87494783be77512d0c2b0bd1cf71b6455 | s-tama/Toywars | /MyGame/WinMain.cpp | C++ | cpp | 1,879 | no_license | //
// WinMain.cpp
//
// 定数の定義 -------------------------------------------------------------------------
#define STRICT // 型チェックを厳密に行う
#define WIN32_LEAN_AND_MEAN // ヘッダーからあまり使われない関数を省く
#define _WIN32_WINNT 0x600 // Windows Vista 以降対応アプリを指定
#define SAFE_RELEASE(x) { if(x) { (x)->Release(); (x) = nullptr; } } ... |
03fd0f27e73dceba888665101650c702b63bc811 | b220f2919092d9212aa304ee0855e9de56ddffdc | wuyou33/Enabling-Robust-State-Estimation-through-Measurement-Error-Covariance-Adaptation | /3rdparty/GPSTk/core/tests/FileHandling/Rinex3Obs_T.cpp | C++ | cpp | 26,607 | permissive | //============================================================================
//
// This file is part of GPSTk, the GPS Toolkit.
//
// The GPSTk is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; ei... |
3a7d7e0960165c6f5a998c16e4061361cf2ed76c | 166549778249665b828349d40e24efff9a4391d4 | nshokri/Movie-Rental-Project | /drama.cpp | C++ | cpp | 618 | no_license | #include "drama.h"
Drama::Drama(char type, int stock, string director, string title, int year)
: Movie(type, stock, director, title, year)
{
}
Drama::~Drama()
{
}
bool Drama::operator<(const Drama& other) const
{
if (director < other.director)
{
return true;
}
else if (director == other.director)
{
if (t... |
a1d699eccd2658c0e9909159b5cfcaf784324f45 | 0c83d407755edde9c888e6b6b1832dcbb6f41992 | AirGear18/D3D11 | /Object/BaseObject.cpp | C++ | cpp | 354 | no_license | #include "../pch.h"
#include "BaseObject.h"
//#include "../Renderer/DeferredShader.h"
//#include "../Renderer/DeferredRenderer.h"
BaseObject::BaseObject()
{
}
BaseObject::~BaseObject()
{
}
//Update objects
void BaseObject::Update(float DeltaTime)
{
}
//Renderer objects
void BaseObject::Renderer(XMMATRIX&view, XMMAT... |
9b034949579371579083649c45a7993448aaf9e2 | 8307ecd843d47b9dcdb8203e2261d9d07dd23325 | acane77/SimpleCalculator | /intermediate.cpp | C++ | cpp | 1,363 | no_license | #include "intermediate.hpp"
#include "symbols.hpp"
using namespace std;
namespace Miyuki {
std::deque<Quad> quads;
map<int, int> labels;
void EmitQuad(int o, Factor *o1, Factor *o2, Factor * re) {
quads.push_back(Quad(o, o1,o2, re));
}
void emitLabel(int n) {
labels.insert({ n, ... |
d91914adaeb31467c233750af8c810d76c396424 | aaccca3b9cd254381a476f9fea2c70a89a359f63 | TharwatBaghdady/prinfo1 | /Praktikum Informatik I/Versuch08/Person.cpp | C++ | cpp | 441 | no_license | /*!
* @file Person.cpp
*/
#include "Person.h"
// Konstruktor
Person::Person(std::string initName, Datum initGeburtsdatum)
: name(initName)
, geburtsdatum(initGeburtsdatum)
{
}
// Destruktor
Person::~Person()
{
}
// Zugriffsfunktion auf das Geburtsdatum
Datum Person::getGeburtsdatum() const
{
... |
d2be4ce5b3001de0ad118d85493740c80091fdc6 | e65bf982f32a458a6ab9b457d520665b216bc74e | ubneutrinos/searchingfornues | /Selection/SelectionTools/SelectionExample_tool.cc | C++ | cc | 2,453 | no_license | #ifndef SELECTION_SELECTIONEXAMPLE_CXX
#define SELECTION_SELECTIONEXAMPLE_CXX
#include <iostream>
#include "SelectionToolBase.h"
namespace selection
{
////////////////////////////////////////////////////////////////////////
//
// Class: SelectionExample
// File: SelectionExample.cc
//... |
7728c87110d68fc4e8143cc698419c81ee98c322 | 99764a0a249541c44b5f0409567c84a15bfe9700 | XieQinghua/CppLearning | /CppLearning/JD/003.cpp | C++ | cpp | 496 | no_license | #include <iostream>
#include <cassert>
#include <stack>
#include <math.h>
#include<algorithm>
using namespace std ;
bool cmp(int a,int b){
return a<b;
}
float EvaluateMedian(int a[], int n)
{
sort(a,a+n,cmp);
if(n % 2 !=0)
{
return a[n / 2];
}
else
{
return ((float)a[n / 2] + a[n / 2 - 1]) / 2;
}
}
... |
766ef5bad458cf103f9e17a232d065f5e6cb99cb | 133f5237573e33b878464aa6ea9087c309f6c2f5 | opensourceyouthprogramming/h5vcc | /external/chromium/chrome/browser/extensions/user_script_master_unittest.cc | C++ | cc | 9,049 | 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 "chrome/browser/extensions/user_script_master.h"
#include <string>
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/f... |
4adab2745b7bebde4b98220844db117c08632ad5 | 6d31bb0b8cca6641d95eee541acf24706d5c3951 | MrCythos/GridFluidSim3D | /polygonizer3d.cpp | C++ | cpp | 34,303 | no_license | /*
Copyright (c) 2015 Ryan L. Guy
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and ... |
ba1d26df377beeac8bf3cb3c5d14cebb13580b3d | bca3f3f6cb4c40df94266063503c5c9cfca8732c | atique7465/Competetive_programming | /codeforces/Educational Codeforces Round 130 (Rated for Div. 2)/A - Parkway Walk.cpp | C++ | cpp | 431 | no_license | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll t, n, k, m, x;
int main() {
cin >> t;
while (t--) {
cin >> n;
cin >> m;
ll sum = 0;
for (ll i = 1; i <= n; i++) {
cin >> x;
sum += x;
}
if (m >= sum) {
... |
eb693cd54ff7fe786ec845e3c734f6203f24ca5f | 8ccaa8b9cb4582491c2e07b21deb136d4363d46b | Thanduriel/NaReTi | /ScriptEngine/immstring.hpp | C++ | hpp | 396 | no_license | #pragma once
namespace utils{
//#pragma pack
template<typename T>
class ImmBasicString
{
public:
ImmBasicString(utils::DetorAlloc& _alloc, const std::string& _str) :
size((int)_str.size())
{
buf = static_cast<T*>(_alloc.alloc((size+1) * sizeof(T)));
memcpy(buf, _str.c_str(), (size+1) * sizeof(T))... |
af2be3e41fc148c5b29d54e1f0e22bc4e0efc1b4 | e8ce6f3b997b747480f761c65857d05af39b9282 | samdauwe/BabylonCpp | /src/BabylonCpp/tests/math/vector3_test.cpp | C++ | cpp | 9,122 | permissive | #include <gtest/gtest.h>
#include <cmath>
#include <babylon/maths/vector3.h>
namespace TestVector3 {
float x = 1.2f;
float y = 3.4f;
float z = 5.6f;
} // end of namespace TestVector3
TEST(TestVector3, Constructor)
{
using namespace BABYLON;
using namespace TestVector3;
// Constructor
Vector3 v;
EXPECT_FL... |
b53f663ec231c75b7d05d2ea1cedae37052c4afb | 9d1a34345f10f1d0f58598c5509862d247dc4139 | mss7z/2019A_HarunaMC_Nova | /aPid.hpp | C++ | hpp | 1,821 | no_license | #ifndef __A_PID_HPP__
#define __A_PID_HPP__
#include "mbed.h"
namespace __aPid_internal__{
template <typename T>
class delta{
private:
T preVal;
T deltaT;
public:
delta(T dt=(T)1):preVal((T)0),deltaT(dt){}
T f(T val){
const T ans=(val-preVal)/deltaT;
preVal=val;
return ans;
}
void reset(){
... |
c0c012138c2456577af1200c8e4f3858af86e0fa | 52d9a10131873d8c63086bb3b770e9878084d6fa | cgerum/libcpu | /arch/arm/arm_translate.cpp | C++ | cpp | 9,071 | permissive | /*
* libcpu: arm_translate.cpp
*
* main translation code
*/
#include "llvm/Instructions.h"
#include "libcpu.h"
#include "libcpu_llvm.h"
#include "frontend.h"
#include "arm_internal.h"
#include "arm_types.h"
#include "tag.h"
using namespace llvm;
#define ptr_N ((ccarm_t*)cpu->feptr)->ptr_N
#define ptr_Z ((cc... |
da57c79b059a6d644da256c7593453d089ad8f10 | b92d0ffd8a30e144f85413d37018338209c3ee87 | yangdaiyu123/stiffdetection | /src/sensor_driver/sensor_driver/src/gps/AnalysisGPS.cpp | C++ | cpp | 15,032 | no_license | #include "AnalysisGPS.h"
CAnalysisGPS::CAnalysisGPS()
{
}
CAnalysisGPS::~CAnalysisGPS()
{
}
bool CAnalysisGPS::Init(int port)
{
addrlen = sizeof(myaddr); /* length of addresses */
/* create a UDP socket */
if((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
{
perror("cannot create socket\n");
retur... |
b8b4c293e87372a1b0ed4aece689e3f83e140e09 | b70674d7661402c63ba6d4859c831e5157d88188 | cookry/mjolnir | /test/utrecht.cc | C++ | cc | 7,129 | permissive | #include "test.h"
#include "mjolnir/osmnode.h"
#include "mjolnir/pbfgraphparser.h"
#include <valhalla/midgard/sequence.h>
#include <fstream>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/filesystem.hpp>
#include <valhalla/baldr/graphconstants.h>
#include <valh... |
85dd61d1298b265038d0b7dd513a6893273679cb | 780089c422f7d93e8cca87dd80278f403ae5e0dc | 3541/serenity | /Userland/Libraries/LibC/fenv.cpp | C++ | cpp | 5,947 | permissive | /*
* Copyright (c) 2021, Mițca Dumitru <dumitru0mitca@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 notice... |
98392d56be4617f2887668b4d08dba23df15c2cb | b01e8838713d7149c1c24954c9154ae6a9c235b0 | ZhekehZ/Stepik | /OS/MMU/MMU.cpp | C++ | cpp | 1,393 | no_license | #include "MMU.h"
using namespace std;
struct LogicalAddr {
uint64_t PML4, DirectoryPtr, Directory, Table, Offset;
LogicalAddr(uint64_t addr) {
auto getbits = [](uint64_t x, int from, int to) {
return x >> from & ~(~0 << (to - from));
};
PML4 = getbits(addr, 39, 48);
DirectoryPtr = getbits(addr, 30, 39)... |
04d90f410ea7e2b3cdbbc37c52c5e88376483cb7 | d3c1bb8c093eb17bed2c6f4f78a3937de78b5913 | zsq001/oi-code | /judgement/10.22/source/Stu-59-ELZAT/chess/chess.cpp | C++ | cpp | 1,696 | no_license | #include<cstdio>
#include<algorithm>
#include<stack>
using namespace std;
int n,m,flag,mp[55][55];
char s[55];
int dfn[2510],low[2510],vis[2510],cnt,tot,num[2510];
stack<int>S;
struct edge{
int v,next;
}e[50010];
int head[2510];
void add(int u,int v)
{
e[++cnt].v = v;
e[cnt].next = head[u];
head... |
f6cb52008ae949813d7c0b4d642e39c84ff99fc7 | 49397398aaf91121c55f6107c87d7e52df92b775 | alu0101132020/divide-and-conquer-template | /examples/fibonaccip.cpp | C++ | cpp | 526 | no_license |
#include "fibonaccip.h"
FibonacciP::FibonacciP(int n) : Problema::Problema() {
_n = n;
}
FibonacciP::~FibonacciP() {
}
bool FibonacciP::isCasoMinimo() {
return (_n < 2);
}
pair<Problema*,Problema*> FibonacciP::descomponer() {
pair<Problema*,Problema*> subProblemas;
subProblemas.first = new FibonacciP(_n-1);
... |
3854e6c61e3a8d8c6c8504aa8dad8fd6c4cc4af6 | 2edb0005f2d3d377c22de392138896a2101165e8 | cyberbotics/webots | /src/webots/vrml/WbNode.hpp | C++ | hpp | 18,282 | permissive | // Copyright 1996-2023 Cyberbotics 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
772deb0b589b37bec47e13aac8641dd503224abe | c6d91418bb9bcdf027dc7d9a0eb9c8e1bbd5657f | cms-nanoAOD/cmssw | /EventFilter/CSCRawToDigi/src/CSCDMBHeader.cc | C++ | cc | 1,418 | permissive | #include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h"
#include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader2005.h"
#include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader2013.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <iostream>
CSCDMBHeader::CSCDMBHeader(uint16_t firmware_versi... |
621ca3ef3eacc6ba514705180768da4133edddc4 | b47613306a77840b9baac59550a7c63af36b3d29 | vRien/20171118 | /GameFramework/PP01.HelloSDL/Game.cpp | C++ | cpp | 1,574 | no_license | #include "Game.h"
#include "InputHandler.h"
Game* Game::s_pInstance = 0;
bool Game::init(const char* title, int xpos, int ypos,
int width, int height, bool fullscreen)
{
if (SDL_Init(SDL_INIT_EVERYTHING) >= 0)
{
m_pWindow = SDL_CreateWindow(title, xpos, ypos, width, height, SDL_WINDOW_SHOWN);
if (m_pWindow != ... |
b83dd137788a4fb8cc086848bf945c14c5b819f9 | cf6d105b011d3dc429f5a8bdc29602722408caf2 | juane619/ETSIIT-1-MP | /matrizBooleanos/matrizBooleanos/matriz_operaciones.cpp | C++ | cpp | 3,499 | no_license | #include <iostream>
#include <fstream>
#include "matriz_operaciones.h"
using namespace std;
int Longitud(char v[]){
int i=0;
while(v[i] != '\0')
i++;
return i;
}
/*
int Colum(std::istream is){
int colum = 0;
char car;
while(!is.eof()){
is.get(car);
if(car... |
a97f7b5b7b3a8a94bc743b660433978cad7014aa | dd43b67213da91c68b7e4330949dc32c59d6d039 | danielealbano/cachegrand | /tests/unit_tests/test-program-ulimit.cpp | C++ | cpp | 3,226 | permissive | #include <catch2/catch_test_macros.hpp>
#include <limits.h>
#include <sys/types.h>
#include <sys/resource.h>
#include "memory_fences.h"
#include "program_ulimit.h"
TEST_CASE("program_ulimit.c", "[program][program_ulimit]") {
SECTION("program_ulimit_wrapper") {
ulong current_value;
struct rlimit ... |
1e574803cd67b65ecfe0aace46542ed38821e0a0 | 8711d399324150fb68a0cb482fc1b5bf03ac10c1 | violetForeden/chromium | /third_party/blink/renderer/core/loader/resource/script_resource_test.cc | C++ | cc | 4,706 | permissive | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this sink code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "third_party/blink/renderer/core/loader/resource/script_resource.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/ren... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.