commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 4.24k | new_contents stringlengths 1 5.44k | subject stringlengths 14 778 | message stringlengths 15 9.92k | lang stringclasses 277
values | license stringclasses 13
values | repos stringlengths 5 127k |
|---|---|---|---|---|---|---|---|---|---|
846f2bc9e367f386a10560171c9055ce03826810 | test/SemaCXX/using-decl-pr17575.cpp | test/SemaCXX/using-decl-pr17575.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
// expected-no-diagnostics
void bar();
namespace foo { using ::bar; }
using foo::bar;
void bar() {}
void f();
using ::f;
void f() {}
| Add a test case for PR17575. | Add a test case for PR17575.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@202922 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl... | |
d5d0b58ebdf17210261f145ffb7e0ce9a3fa7a0f | Tests/UnitTests/Models/CharacterTests.cpp | Tests/UnitTests/Models/CharacterTests.cpp | // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
// We are making my contributions/submissions to this project solely in our
// personal capacity and are not conveying any rights to any intellectual
// property of any third parties.
#include <Utils/TestUtils.hpp>
#include "gtest/gtest.h"
#include <Ros... | Add unit test for Character class | test: Add unit test for Character class
| C++ | mit | Hearthstonepp/Hearthstonepp,Hearthstonepp/Hearthstonepp | |
0a4f18696ccda75a00012b941430414954e678b9 | test/CodeGenCXX/rtti-layout.cpp | test/CodeGenCXX/rtti-layout.cpp | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -O3 -o - | FileCheck %s
#include <typeinfo>
class __pbase_type_info : public std::type_info {
public:
unsigned int __flags;
const std::type_info *__pointee;
enum __masks {
__const_mask = 0x1,
__volatile_mask = 0x2,
__restrict_mask = 0x4,... | Add a (currently failing) RTTI layout test. | Add a (currently failing) RTTI layout test.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@91580 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-cl... | |
5684229a4583355a6b20a950614731c1a6d38f88 | test/FrontendC++/2009-09-04-modify-crash.cpp | test/FrontendC++/2009-09-04-modify-crash.cpp | // RUN: %llvmgxx %s -emit-llvm -fapple-kext -S -o -
// The extra check in 71555 caused this to crash on Darwin X86
// in an assert build.
class foo {
virtual ~foo ();
};
foo::~foo(){}
| Test for llvm-gcc commit 81037. | Test for llvm-gcc commit 81037.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@81038 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,chubb... | |
15009f439f7e6728ccc2559b8412d755be89637d | mctest.cpp | mctest.cpp | #include "cmbf.h"
#include <unordered_map>
using namespace sketch::cmbf;
int main(int argc, char *argv[]) {
cmbf_exp_t thing(4, 16, 1);
cmbf_t thingexact(4, 16, 5);
auto [x, y] = thing.est_memory_usage();
std::fprintf(stderr, "stack space: %zu\theap space:%zu\n", x, y);
size_t nitems = argc > 1 ?... | Add testing code for min-counting. | Add testing code for min-counting.
| C++ | mit | dnbh/hll,dnbh/hll | |
b9d50d128af1029fa9a86451c31c597c62b66794 | 1/1_1.cpp | 1/1_1.cpp | #include <iostream>
#include <string>
#include <vector>
using std::string;
using std::vector;
bool isunique (const string& s);
bool isuniqueV2 (const string& s);
int main()
{
string s = "cciao";
if (isuniqueV2(s))
std::cout << "All characters are unique" << std::endl;
else
std::cout << ... | Check if a string contain just unique charachers | Check if a string contain just unique charachers
| C++ | mit | pietroblandizzi/cracking-the-coding-interview | |
fca1fe5f00edba57df977f59f4a32dfe64476e22 | cpp/types/alignmentandsizeof.cpp | cpp/types/alignmentandsizeof.cpp | #include <iostream>
#include <iomanip>
#include <type_traits>
#include <typeinfo>
#include <typeindex>
class A { };
class A1 { char c; };
class A2 { char c1; char c2; };
class B { char c; int i; };
class C { char c; int i; double d; };
class D { int i; char c; double d; };
class E { char c... | Print alignment and size of fundamantal and user-defined types | Print alignment and size of fundamantal and user-defined types
| C++ | mit | satishgoda/closetothemachine,satishgoda/closetothemachine | |
d6235ac8219ee4c40fa5cb2def6c6f65f1aee6a9 | test/SemaCXX/PR21679.cpp | test/SemaCXX/PR21679.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
int w = z.; // expected-error {{use of undeclared identifier 'z'}} \
// expected-error {{expected unqualified-id}}
int x = { y[ // expected-error {{use of undeclared identifier 'y'}} \
// expected-note {{to match this '['}} \
// ex... | Add the test that was supposed to be included with r223162. | Add the test that was supposed to be included with r223162.
The test case is based on the reduction from PR21679 and has to be
freestanding to work correctly, since some of the expected errors (and
some of the problems that were fixed) only occur when the end of the
file is reached.
git-svn-id: ffe668792ed300d6c2daa1... | C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... | |
fb0ec10b9579996f58f0a2f1523a40af40be26ba | bit_manipulation/1461.cc | bit_manipulation/1461.cc | class Solution {
public:
bool hasAllCodes(string s, int k) {
if (k > s.size()) {
return false;
}
int need = 1 << k;
for (int i = 0; i <= (s.size()-k); ++i) {
std::string cur = s.substr(i, k);
auto iter = s_.find(cur);
if (iter == s_.end... | Check If a String Contains All Binary Codes of Size K | Check If a String Contains All Binary Codes of Size K
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
d065ea4c470a52237ec76d30828bab9599080b0c | test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp | test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp | // RUN: %clang_cc1 -std=c++1z -verify %s
void f() noexcept;
void (&r)() = f;
void (&s)() noexcept = r; // expected-error {{cannot bind}}
void (&cond1)() noexcept = true ? r : f; // expected-error {{cannot bind}}
void (&cond2)() noexcept = true ? f : r; // expected-error {{cannot bind}}
// FIXME: Strictly, the rules i... | Add another testcase missed from r284905. | Add another testcase missed from r284905.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@284906 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl... | |
a191ec9db776c533116d13d1a45c6a1dad491f08 | week10/solutions/problem1/stack.cpp | week10/solutions/problem1/stack.cpp | #include <iostream>
using std::cout;
using std::endl;
template <typename T>
struct Node {
T data;
Node *next;
Node(T _data, Node *_next = nullptr) :
data(_data), next(_next) {}
};
template <typename T>
class Stack {
Node<T> *top;
int size;
void clear() {
while (!isEmpty(... | Add solution to problem 1 | Add solution to problem 1
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
cea9e758e23a33eec1201b771fc393ae620fe5e3 | c++/array/RemoveDuplicatesFromSortedArrayII.cpp | c++/array/RemoveDuplicatesFromSortedArrayII.cpp | //
// RemoveDuplicatesFromSortedArrayII.cpp
// c++
//
// Created by sure on 1/20/15.
// Copyright (c) 2015 Shuo Li. All rights reserved.
//
// http://blog.csdn.net/myjiayan/article/details/26334279
// Gives me a better solution. Implement it in C++
#include <stdio.h>
class Solution {
public:
int removeDuplica... | Remove Duplicates From Sorted Array II | Remove Duplicates From Sorted Array II
| C++ | mit | lsingal/leetcode,sureleo/leetcode,sureleo/leetcode,lsingal/leetcode,sureleo/leetcode,lsingal/leetcode | |
7b954aa8b885e87b8a95738c9545e3e32dd31a13 | test/AST/ast-dump-array.cpp | test/AST/ast-dump-array.cpp | // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck -strict-whitespace %s
void testArrayInitExpr()
{
int a[10];
auto l = [a]{
};
// CHECK: |-ArrayInitLoopExpr 0x{{[^ ]*}} <col:15> 'int [10]'
// CHECK: | `-ArrayInitIndexExpr 0x{{[^ ]*}} <<invalid sloc>> 'unsigned long'
}
| Add dump tests for ArrayInitLoopExpr and ArrayInitIndexExpr | Add dump tests for ArrayInitLoopExpr and ArrayInitIndexExpr
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@348093 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl... | |
af16ec90d72130cd8e4a6816b18cc50dda5321e9 | sort/bucket_sort/c++/Circle_sort.cpp | sort/bucket_sort/c++/Circle_sort.cpp |
#include<bits/stdc++.h>
using namespace std;
bool circleSortRec(int a[], int low, int high)
{
bool swapped = false;
if (low == high)
return false;
int lo = low, hi = high;
while (lo < hi)
{
if (a[lo] > a[hi])
{
swap(a[lo], a[hi]);
... | Add "Circle sort" to the list | Add "Circle sort" to the list
I cant find and c++ folder in Circle sort folder so i go here to put it down :< | C++ | cc0-1.0 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | |
7ea4613a48dd914900fe041a52496d8e393f254a | test18_16_17.cpp | test18_16_17.cpp | #include <iostream>
namespace Exercise {
int ivar = 0;
double dvar = 0;
const int limit = 1000;
}
int ivar = 0;
//using namespace Exercise;
//using Exercise::ivar;
//using Exercise::dvar;
//using Exercise::limit;
void manip() {
// using namespace Exercise;
using Exercise::ivar;
usin... | Add solution for chapter 18 test 16, test 17 | Add solution for chapter 18 test 16, test 17 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
1a873ae65f8814eae6c9b8786f164ce70c645a21 | test/SemaTemplate/instantiation-default-3.cpp | test/SemaTemplate/instantiation-default-3.cpp | // RUN: clang -fsyntax-only -verify %s
template<typename T> struct A { };
template<typename T, typename U = A<T*> >
struct B : U { };
template<>
struct A<int*> {
void foo();
};
template<>
struct A<float*> {
void bar();
};
void test(B<int> *b1, B<float> *b2) {
b1->foo();
b2->bar();
}
| Add a test case that goes with the last commit | Add a test case that goes with the last commit
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@66510 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
8d9ca065637db5e658416fb824378accef24ac45 | fortune_points/__tests__/algorithm/fortune_unittest.cpp | fortune_points/__tests__/algorithm/fortune_unittest.cpp | #include <stdio.h>
#include <stdlib.h>
#include "gtest/gtest.h"
#include "test_helper/samples_reader.h"
#include "fortune_points/diagram/site.h"
#include "fortune_points/diagram/voronoi.h"
#include "fortune_points/algorithm/fortune.h"
#include "fortune_points/geom/floating_point.h"
namespace{
const int NUMBER_OF_TE... | Test for the algorithm output | Test for the algorithm output
| C++ | mit | matheusdallrosa/voronoi-diagram-construction,matheusdallrosa/voronoi-diagram-construction | |
d6f5a581ab968a2618b0c5a8472ea2ab37797916 | lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp | lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp | //===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | Remove default case from fully covered switch. | Remove default case from fully covered switch.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@178025 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GP... |
e377d9332645ca261747ef7bdc7c8016ec5c81cc | test/special_cases.cpp | test/special_cases.cpp | #include "catch.hpp"
#include "etl/fast_vector.hpp"
#include "etl/fast_matrix.hpp"
TEST_CASE( "deep_assign/vec<mat>", "deep_assign" ) {
etl::fast_vector<etl::fast_matrix<double, 2, 3>, 2> a;
a = 0.0;
for(auto& v : a){
for(auto& v2 : v){
REQUIRE(v2 == 0.0);
}
}
}
TEST_CAS... | Add test for special cases of assignment | Add test for special cases of assignment
| C++ | mit | wichtounet/etl,wichtounet/etl | |
e67068c5f90d7cbc39f970e951d7e8622c485838 | test/CXX/temp/temp.res/temp.dep.res/temp.point/p1.cpp | test/CXX/temp/temp.res/temp.dep.res/temp.point/p1.cpp | // RUN: clang-cc -fsyntax-only -verify %s
// XFAIL
// Note: we fail this test because we perform template instantiation
// at the end of the translation unit, so argument-dependent lookup
// finds functions that occur after the point of instantiation. Note
// that GCC fails this test; EDG passes the test in strict mod... | Add a test illustrating our current inability to properly cope with the point of instantation of a member function of a class template specialization | Add a test illustrating our current inability to properly cope with the point of instantation of a member function of a class template specialization
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@73956 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
f3897acaa1bb8fd2070e719716db29a13263b394 | two_arrays.cpp | two_arrays.cpp | #include <iostream>
#include <algorithm>
using namespace std;
bool cmp(int a, int b)
{
return a > b;
}
int main()
{
int T;
cin >> T;
while (T--) {
int n, k;
cin >> n >> k;
int *a = new int[n];
int *b = new int[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
cin >... | Add the solution to "Two arrays". | Add the solution to "Two arrays".
| C++ | mit | clasnake/hackerrank,clasnake/hackerrank | |
e55af0c27455b4737a1cf0cb572092b8792bd032 | unit_tests/engine/guidance_assembly.cpp | unit_tests/engine/guidance_assembly.cpp | #include "engine/guidance/assemble_overview.hpp"
#include "engine/guidance/assemble_geometry.hpp"
#include "engine/guidance/assemble_steps.hpp"
#include "engine/guidance/assemble_route.hpp"
#include "engine/guidance/assemble_leg.hpp"
#include <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
BOO... | Add guidance assembly unit test stub | Add guidance assembly unit test stub
| C++ | bsd-2-clause | arnekaiser/osrm-backend,deniskoronchik/osrm-backend,arnekaiser/osrm-backend,beemogmbh/osrm-backend,hydrays/osrm-backend,KnockSoftware/osrm-backend,neilbu/osrm-backend,bjtaylor1/osrm-backend,deniskoronchik/osrm-backend,felixguendling/osrm-backend,yuryleb/osrm-backend,felixguendling/osrm-backend,hydrays/osrm-backend,hydr... | |
1badf925ed44b0d4301beed2fc03881663d959b3 | test/floodfill_test.cc | test/floodfill_test.cc | #include <iostream>
#include <cvd/connected_components.h>
#include <cvd/image.h>
using namespace std;
using namespace CVD;
int main()
{
for(int i=0; i < (1<<9); i++)
{
cout << "------------------------\n" << i << endl;
int j=i;
vector<ImageRef> p;
for(int y=0; y < 3; y++)
for(int x=0; x < 3; x++)
{
... | Test program for finding bugs in connected_components. | Test program for finding bugs in connected_components.
There is a bug.
| C++ | lgpl-2.1 | oneminot/libcvd,oneminot/libcvd,oneminot/libcvd | |
f083150af7d28bffd333828b2186c5155b40fa3a | data_structures/treap/C++/treap.cpp | data_structures/treap/C++/treap.cpp | #include <cstdlib>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// Treap has 2 main operations that are O(log(n)):
// - split(t, k) -> split t into 2 trees, one with all keys <= k, the other with the rest
// - merge(t1, t2) -> merge 2 trees where keys of t1 are smalle... | Add implementation of Treap in C++ | Add implementation of Treap in C++
| C++ | cc0-1.0 | Cnidarias/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,Deepak345/al-go-rithms,Cnidarias/al-go-rithms,Cnidarias/al-go-ri... | |
4e784cb52a6f5806d00b1afacf7949a8360b5e7e | data_structures/binary_tree/Nodes_at_distance_K.cpp | data_structures/binary_tree/Nodes_at_distance_K.cpp | #include <iostream>
#include <queue>
using namespace std;
// Code for finding all nodes at a distanc of K from a given node in a binary tree.
class Node {
public:
int data;
Node *left;
Node *right;
Node(int x) {
data = x;
left = NULL;
right = NULL;
}
};
// Function for finding nodes in subtree... | Add Code for finding all nodes at a distanc of K from a given node in a binary tree. | Add Code for finding all nodes at a distanc of K from a given node in a binary tree.
| C++ | cc0-1.0 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | |
b3ebb8919eb48780e0e5df5f685e13d6ec07e522 | Math/NumberTheory/ExtendedEuclides.cpp | Math/NumberTheory/ExtendedEuclides.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector < ll > vl;
vl arr(3);
/*
returs gcd(a,b) and find the coeficcients of bezout
such that d = ax + by
arr[0] gcd
arr[1] x
arr[2] y
*/
void extended(ll a, ll b){
ll y =0;
ll x =1;
ll xx =0;
ll yy =1;
while(b){
ll q = a / b;
... | Add extended euclidean theorem algorithm. | Add extended euclidean theorem algorithm.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
fb55256d37352acebd002d48d4e3c78c6f04b998 | examples/basic_usage.cc | examples/basic_usage.cc | /*
* (C) Copyright 2016 Mirantis 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 agre... | Add example showing the basic usage scenario for static_ptr. | Add example showing the basic usage scenario for static_ptr.
Signed-off-by: Radoslaw Zarzynski <a52790b05ba389f3162dc3512ddfd95cc95e8d6a@mirantis.com>
| C++ | apache-2.0 | rzarzynski/static_ptr | |
8acd2600d50a291096f7249e29b01728118103c1 | test/unit/math_c11_test.cpp | test/unit/math_c11_test.cpp | #include <gtest/gtest.h>
TEST(MathMeta, ensure_c11_features_present) {
int s[] = {2, 4};
auto f = [&s](auto i) { return i + s[0]; };
EXPECT_EQ(4, f(2));
}
| Revert "remove test temporarily to debug" | Revert "remove test temporarily to debug"
This reverts commit 489b5dae75d6b097e706dcabca581e1edfe5625b.
| C++ | bsd-3-clause | stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math | |
868de88694544563db4b3bd75dc1347d18a51f19 | karum/insertNodeDLL.cpp | karum/insertNodeDLL.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *prev, *next;
Node(){}
Node(int d){
data=d;
prev=NULL;
next=NULL;
}
Node *insertNode(Node *head, int d){
Node *np=new Node(d);
Node *t=head;
if(head==NULL)
return np;
while(t->next!=NULL)
t=t->next;
t->n... | Add code to insert node in doubly linked list | Add code to insert node in doubly linked list
| C++ | mit | shivan1b/codes | |
8efec7d5487c6a5855d962c1db9766bae0fefdf7 | core/AbcData.cpp | core/AbcData.cpp | /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
... | Change 262430 by wsharp@WSHARP-380 on 2006/12/04 07:26:06 | Change 262430 by wsharp@WSHARP-380 on 2006/12/04 07:26:06
missing one file from last checkin
| C++ | mpl-2.0 | pfgenyun/tamarin-redux,pnkfelix/tamarin-redux,pfgenyun/tamarin-redux,pnkfelix/tamarin-redux,pfgenyun/tamarin-redux,pnkfelix/tamarin-redux,pnkfelix/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pfgenyun/tamarin-redux,pnkfelix/tamarin-redux,pnkfelix/tamarin-redux,pnkfelix/tamarin-redu... | |
e9a2901255edba91024e87a0f868bce54ed34926 | runner_agent.cpp | runner_agent.cpp | #include <atomic>
#include <chrono>
#include <thread>
#include <utility>
#include <fmt/printf.h>
#include <gsl/gsl_assert>
template <typename Agent> concept IsAgent = requires(Agent agent) {
{agent.doWork()};
};
template <typename Agent> requires IsAgent<Agent> class Runner {
public:
Runner(Agent &&agent) : m_ag... | Add runner agent with concepts example. | Add runner agent with concepts example.
| C++ | apache-2.0 | tisma/ctorious,tisma/ctorious | |
ad680f42848be5ffe9d34da143902ab311d48ecf | tree/623.cc | tree/623.cc | /**
* 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... | Add One Row to Tree | Add One Row to Tree
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
c251999fd6808e608a8efbb110f967c6fa422c74 | Source/System/FileIO/OSB/OSGOSBTest.cpp | Source/System/FileIO/OSB/OSGOSBTest.cpp |
#include <UnitTest++.h>
// Unit tests for vec classes
#include <OpenSG/OSGNode.h>
#include <OpenSG/OSGNameAttachment.h>
#include <OpenSG/OSGSceneFileHandler.h>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/operations.hpp>
namespace bf = boost::filesystem;
struct FileFixture
{
FileFixture... | Add test to demonstrate bug where names are not loaded by the osb loader. | Add test to demonstrate bug where names are not loaded by the osb loader.
git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@241 4683daeb-ad0f-0410-a623-93161e962ae5
| C++ | lgpl-2.1 | jondo2010/OpenSG,jondo2010/OpenSG,jondo2010/OpenSG,jondo2010/OpenSG,jondo2010/OpenSG | |
8264b310d52e34fce3a2e3cb6b2d48d9f906438e | fuzz/oss_fuzz/FuzzNullGLCanvas.cpp | fuzz/oss_fuzz/FuzzNullGLCanvas.cpp | /*
* Copyright 2018 Google, LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "../Fuzz.h"
void fuzz_NullGLCanvas(Fuzz* f);
extern "C" {
// Set default LSAN options.
const char *__lsan_default_options() {
// Don't print the li... | Add libFuzzer style fuzzer for NullGLCanvas for use on OSS-Fuzz. | Add libFuzzer style fuzzer for NullGLCanvas for use on OSS-Fuzz.
Bug: 827225
Change-Id: Icb30c0c234326340213af0cc402a4124dd0336b3
Reviewed-on: https://skia-review.googlesource.com/117150
Commit-Queue: Mike Klein <14574f09dfa9b4e14759b88c3426a495a0e627b0@chromium.org>
Reviewed-by: Mike Klein <14574f09dfa9b4e14759b88c34... | C++ | bsd-3-clause | google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,google/skia,google/skia,... | |
02b7ca757c1af0d64de1d0507d95e00780905994 | src/practice/dp/increase.sequence-466D.cpp | src/practice/dp/increase.sequence-466D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
int a[2010];
int dp[2010][2010];
int main(void) {
int n, h;
scanf("%d %d", &n, &h);
for (int i = 1; i <= n; i++)
scanf("%d", &a[i]);
// fill up the base cases
dp[1][0] = (a[1] == h || a[1] + 1 =... | Increase Sequence - 466D - Codeforces | Increase Sequence - 466D - Codeforces
http://codeforces.com/contest/466/problem/D
Great problem. The dynamic programming solution involved thinking
of transitions as opening or closing segments and the state was
(i, open) where
i: the index at which we are
open: the number of still open segments we hav... | C++ | mit | paramsingh/codechef-solutions,paramsingh/codechef-solutions,paramsingh/cp,paramsingh/cp,paramsingh/cp,paramsingh/cp,paramsingh/cp,paramsingh/codechef-solutions,paramsingh/codechef-solutions | |
caeb61d765374bdd9eda7252934b844f2a2d08a5 | Maximum_Subarray/C++/mike168m/max_sub_array.cpp | Maximum_Subarray/C++/mike168m/max_sub_array.cpp | #include <algorithm>
#include <iostream>
#include <vector>
template<typename T>
T kadane_method(const std::vector<T>& v){
T ret = 0;
std::for_each(v.begin(), v.end(), [c_max = 0, max = 0, &ret](T m) mutable {
c_max = c_max + m;
// the ccurrent max is a negative number,
// we can't use that cuz it will not giv... | Add max sub array implementaion in C++ | Add max sub array implementaion in C++
| C++ | mit | n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implemen... | |
864996bb78ec311432a22843e4d262dac5c01535 | psimpl-c.cpp | psimpl-c.cpp | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
psimpl-c
Copyright (c) 2013 Jamie Bullock <jamie@jamiebullock.com>
Based on psimpl
Copyright (c) 2010-201... | Add basic wrapper for Douglas-Peucker | Add basic wrapper for Douglas-Peucker
| C++ | mpl-2.0 | jamiebullock/psimpl-c,jamiebullock/psimpl-c,jamiebullock/psimpl-c,jamiebullock/psimpl-c | |
63a0b2a9b4242913fc2763b217dc7ad71180711a | lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | //===- SimplifyCFG.cpp - CFG Simplification Routines -------------*- C++ -*--=//
//
// This file provides several routines that are useful for simplifying CFGs in
// various ways...
//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/SimplifyCFG.h"
#include "llvm... | Add method to unify all exit nodes of a method | Add method to unify all exit nodes of a method
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@143 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOp... | |
19d06f4dad3d8830802a2fd95574c9f909f0151d | generator/geo_objects/geo_objects_filter.cpp | generator/geo_objects/geo_objects_filter.cpp | #include "generator/geo_objects/geo_objects_filter.hpp"
#include "generator/osm_element_helpers.hpp"
#include "indexer/ftypes_matcher.hpp"
using namespace feature;
namespace generator
{
namespace geo_objects
{
bool GeoObjectsFilter::IsAccepted(OsmElement const & element)
{
return osm_element::IsBuilding(element) ... | #include "generator/geo_objects/geo_objects_filter.hpp"
#include "generator/osm_element_helpers.hpp"
#include "indexer/ftypes_matcher.hpp"
using namespace feature;
namespace generator
{
namespace geo_objects
{
bool GeoObjectsFilter::IsAccepted(OsmElement const & element)
{
return osm_element::IsBuilding(element) ... | Fix features filter: ignore lines | [generator:geo_objects] Fix features filter: ignore lines
| C++ | apache-2.0 | VladiMihaylenko/omim,rokuz/omim,mpimenov/omim,matsprea/omim,mapsme/omim,VladiMihaylenko/omim,VladiMihaylenko/omim,milchakov/omim,rokuz/omim,darina/omim,rokuz/omim,mpimenov/omim,mapsme/omim,rokuz/omim,matsprea/omim,darina/omim,rokuz/omim,darina/omim,darina/omim,darina/omim,mpimenov/omim,darina/omim,mpimenov/omim,mpimeno... |
a6935dc4b8f0ca393b1e67c248bee5b9e63b50c9 | chapter20/chapter20_ex04.cpp | chapter20/chapter20_ex04.cpp | // Chapter 20, Exercise 04: Find and fix the errors in the Jack-and-Jill example
// from 20.3.1 by using STL techniques throughout.
#include "../lib_files/std_lib_facilities.h"
double* get_from_jack(int* count)
{
string ifname = "pics_and_txt/chapter20_ex02_in1.txt";
ifstream ifs(ifname.c_str());
if (!ifs... | Add Chapter 20, exercise 4 | Add Chapter 20, exercise 4
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
95051d774a3f4e8266bb75310db5d9e053134a0a | media/base/media_stub.cc | media/base/media_stub.cc | // Copyright 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 "media/base/media.h"
#include "base/logging.h"
// This file is intended for platforms that don't need to load any media
// libraries (e.g., And... | // Copyright 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 "media/base/media.h"
#include "base/logging.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "media/base/android/media... | Fix media and content unittests on Android debug bots | Android: Fix media and content unittests on Android debug bots
BUG=
Review URL: https://codereview.chromium.org/13467037
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@192880 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | Just-D/chromium-1,dednal/chromium.src,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,ltilve/chromium,littlstar/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,ltilve/chromium,ondra-novak/chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,hujiajie/pa-chromium,jaru... |
d01c7fa62613b7927d7c2a68a64259ac2821fa54 | TESTS/mbedmicro-rtos-mbed/condition_variable/main.cpp | TESTS/mbedmicro-rtos-mbed/condition_variable/main.cpp | /* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* 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 require... | Add test cases for ConditionVariable | Add test cases for ConditionVariable
Add basic tests for the ConditionVariable class.
| C++ | apache-2.0 | c1728p9/mbed-os,Archcady/mbed-os,infinnovation/mbed-os,mazimkhan/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,kjbracey-arm/mbed,c1728p9/mbed-os,mbedmicro/mbed,infinnovation/mbed-os,karsev/mbed-os,Archcady/mbed-os,andcor02/mbed-os,mbedmicro/mbed,CalSol/mbed,ryankurte/mbed-os,ryankurte/mbed-os,infinnovation/mbed-os,ryankurte... | |
8ff18f162bc6d9479b326ec234e3d681d3768387 | test/C++Frontend/2007-05-15-FieldAccess.cpp | test/C++Frontend/2007-05-15-FieldAccess.cpp | // Test case for PR1420
// RUN: %llvmgxx %s -O0 -o %t.exe
// RUN: %t.exe > %t.out
// RUN: grep {sizeof(bitFieldStruct) == 8} %t.out
// RUN: grep {Offset bitFieldStruct.i = 0} %t.out
// RUN: grep {Offset bitFieldStruct.c2 = 7} %t.out
// XFAIL: *
#include <stdio.h>
class bitFieldStruct {
public:
int i;
unsig... | Add a test case for PR1420 | Add a test case for PR1420
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@37082 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | bsd-2-clause | chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,chu... | |
f6b4c281a2d6e8bcc1cbf38bbef1bb4b08ae1036 | alignment.cpp | alignment.cpp | #include <cassert>
#include <cstdint>
#include <iostream>
#include <malloc.h>
#include <new>
class alignas(32) Vec3d {
double x, y, z;
};
int main() {
std::cout << "sizeof(Vec3d) is " << sizeof(Vec3d) << '\n';
std::cout << "alignof(Vec3d) is " << alignof(Vec3d) << '\n';
auto Vec = Vec3d{};
auto ... | Add struct alignement test example. | Add struct alignement test example.
| C++ | apache-2.0 | tisma/ctorious,tisma/ctorious | |
3ebbdedf470e7095f6bbd596f25020ea0b0ba818 | test/Analysis/string.cpp | test/Analysis/string.cpp | // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -verify %s
// expected-no-diagnostics
// Test functions that are called "memcpy" but aren't the memcpy
// we're looking for. Unfortunately, this test cannot be put into
// a namespace. The out-of-class weird memcpy needs to be recognized
// as a normal C function... | Add the forgotten test file. | [analyzer] CStringChecker: Add the forgotten test file.
Differential Revision: https://reviews.llvm.org/D55873
rdar://problem/45366551
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@349683 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 2ac8dae2d6fcf14ef1b60e456eacd2a9eeb5a6ee)
| C++ | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang | |
c3ad1003fda622abc091827a4dca8e5f81cc26d5 | test/CodeGenCXX/debug-info-static-member.cpp | test/CodeGenCXX/debug-info-static-member.cpp | // RUN: %clangxx -g -O0 %s -emit-llvm -S -o - | FileCheck %s
// PR14471
class C
{
static int a;
const static int const_a = 16;
protected:
static int b;
const static int const_b = 17;
public:
static int c;
const static int const_c = 18;
int d;
};
int C::a = 4;
int C::b = 2;
int C::c = 1;
int main()
{
... | Add testcase missed yesterday. Patch from Paul Robinson. | Add testcase missed yesterday. Patch from Paul Robinson.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@172648 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/cl... | |
59c3bc551cffdd11e9bcbd0c88fb25d15c6cd3eb | containers/sequences/array/iterators.pass.cpp | containers/sequences/array/iterators.pass.cpp | //===----------------------------------------------------------------------===//
//
// 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.
//
//===----------------------------------------... | Implement tests for NULL iterators for <array> re: N3644 | Implement tests for NULL iterators for <array> re: N3644
git-svn-id: 273b07cebdae5845b4a75aae04570b978db9eb50@187809 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | bsd-3-clause | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx | |
7c116474b2522cc2fc11082cf2dbcff1ad25b1ad | ch09/9.exercise.04.cpp | ch09/9.exercise.04.cpp | // 9.exercise.04.cpp
//
// Look at the headache-inducing last example of §8.4. Indent it properly and
// explain the meaning of the construct. Note that the example doesn't do
// anything meaningful; it is pure obfuscation.
//
// COMMENTS
int maint()
try
{
return 0;
}
catch(exception& e)
{
cerr << e.what(... | Prepare exercise 4 from chapter 9. | Prepare exercise 4 from chapter 9.
| C++ | mit | 0p3r4t4/PPPUCPP2nd,0p3r4t4/PPPUCPP2nd,0p3r4t4/PPPUCPP2nd | |
01e28b14b7b7e2798c87f45bb4cd1593543da242 | week4/homework/solutions/problem1/library.cpp | week4/homework/solutions/problem1/library.cpp | #include <iostream>
#include <cstring>
using namespace std;
class Card {
char title[100];
char author[100];
unsigned int count;
public:
Card(const char _title[], const char _author[], unsigned int _count) {
strcpy(title, _title);
strcpy(author, _author);
count = _count;
}... | Add solution to task 1 | Add solution to task 1
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
71110e0085786768c6437806f4fce5a1ea0af5c5 | week2/homework/problem1/point_3d.cpp | week2/homework/problem1/point_3d.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Point3D {
double x;
double y;
double z;
public:
double getX() {
return x;
}
double getY() {
return y;
}
double getZ() {
return z;
}
void setX(double newX) {
x = newX;
}
void setY(double newY) {
y = newY;
... | Add solution to the first problem - '3D point' | Add solution to the first problem - '3D point'
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
07725f5b2512924f15ee84acaeef31a6a28b17db | test/xray/TestCases/Posix/fdr-reinit.cc | test/xray/TestCases/Posix/fdr-reinit.cc | // RUN: %clangxx_xray -g -std=c++11 %s -o %t
// RUN: rm xray-log.fdr-reinit* || true
// RUN: XRAY_OPTIONS="verbosity=1" %run %t
// RUN: rm xray-log.fdr-reinit* || true
#include "xray/xray_log_interface.h"
#include <cassert>
#include <cstddef>
#include <thread>
volatile uint64_t var = 0;
std::atomic_flag keep_going = ... | Add a test for re-initialising FDR mode (NFC) | [XRay] Add a test for re-initialising FDR mode (NFC)
This change adds an end-to-end test that ensures FDR mode can be
re-initialised safely in the face of multiple threads being traced.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@347368 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt | |
779e5c2ea57ab23c97042ae4183b5c8e84a8962a | atom/browser/atom_browser_main_parts_linux.cc | atom/browser/atom_browser_main_parts_linux.cc | // Copyright (c) 2014 GitHub, Inc. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_browser_main_parts.h"
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "library_loaders/lib... | Set scale factor to the value in gsettings | linux: Set scale factor to the value in gsettings
| C++ | mit | sshiting/electron,leolujuyi/electron,jonatasfreitasv/electron,gabrielPeart/electron,mattdesl/electron,leethomas/electron,cqqccqc/electron,webmechanicx/electron,gabrielPeart/electron,aecca/electron,tonyganch/electron,mjaniszew/electron,gabrielPeart/electron,fomojola/electron,digideskio/electron,kenmozi/electron,bobwol/e... | |
b35ea83b2485af7cdd77e0f43274a44a7b17bc0c | go_quic_spdy_server_stream_go_wrapper.cc | go_quic_spdy_server_stream_go_wrapper.cc | #include "go_quic_spdy_server_stream_go_wrapper.h"
#include "net/quic/quic_session.h"
#include "net/quic/quic_data_stream.h"
#include "go_functions.h"
GoQuicSpdyServerStreamGoWrapper::GoQuicSpdyServerStreamGoWrapper(net::QuicStreamId id, net::QuicSession* session, void* go_quic_spdy_server_stream)
: net::QuicDataSt... | #include "go_quic_spdy_server_stream_go_wrapper.h"
#include "net/quic/quic_session.h"
#include "net/quic/quic_data_stream.h"
#include "go_functions.h"
GoQuicSpdyServerStreamGoWrapper::GoQuicSpdyServerStreamGoWrapper(net::QuicStreamId id, net::QuicSession* session, void* go_quic_spdy_server_stream)
: net::QuicDataSt... | Fix GoQuicSpdyServerStreamGoWrapper not returning correct len | Fix GoQuicSpdyServerStreamGoWrapper not returning correct len
| C++ | bsd-3-clause | rikuayanokozy/goquic,jbenet/go-quic-lib,jbenet/go-quic-lib,jbenet/go-quic-lib,postfix/goquic,jbenet/go-quic-lib,postfix/goquic,sairion/goquic,rikuayanokozy/goquic,postfix/goquic,rikuayanokozy/goquic,postfix/goquic,jujueyeball/goquic,sairion/goquic,sairion/goquic,jujueyeball/goquic,sairion/goquic,jujueyeball/goquic,riku... |
b64b96ae42790cbe2221004dff856a11fd9e2e78 | f80789_1a.cpp | f80789_1a.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int binary_to_decimal(char * number)
{
int result = 0;
int power = 0;
for (int i = strlen(number) - 1; i >= 0; i--)
{
int x = number[i] - '0';
result += x * (1 << power);
power++;
}
return result;
}
int octal_to_decimal(char * number... | Add a solution for task 1a | Add a solution for task 1a
| C++ | mit | ralcho/AdvancedProgrammingNBU | |
dc4521b991bca13ddc6b2af81c2b647becb12f14 | test/unit/datasource/gdal.cpp | test/unit/datasource/gdal.cpp | /*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2015 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as p... | Add test that GDAL plugin does not upsample. | Add test that GDAL plugin does not upsample.
| C++ | lgpl-2.1 | mapycz/mapnik,mapycz/mapnik,mapycz/mapnik | |
85425d3b13070000f27bb163596ef4f593bbda57 | test18_29.cpp | test18_29.cpp | #include <iostream>
using namespace std;
class Class {
public:
Class() {
cout << "Class()" << endl;
}
};
class Base : public Class {
public:
Base() {
cout << "Base()" << endl;
}
};
class D1 : virtual public Base {
public:
D1() {
cout << "D1()" << endl... | Add solution for chapter 18, test 29 | Add solution for chapter 18, test 29 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
59f3dbbe4a52bdbe26abb6e3b0b63ce5546da3e8 | move_bugs.cpp | move_bugs.cpp | #include <iostream>
#include <cassert>
class [[clang::consumable(unconsumed)]] Object {
public:
Object() {}
Object(Object&& other) { other.invalidate(); }
[[clang::callable_when(unconsumed)]]
void do_something() { assert(m_valid); }
private:
[[clang::set_typestate(consumed)]]
void invalidate()... | Add example of clang attributes for prevention of use after move. | Add example of clang attributes for prevention of use after move.
Compile with:
clang -Wconsumed move_bugs.cpp -o move_bugs -lstdc++
Warning message is generated during compilation:
move_bugs.cpp:20:12: warning: invalid invocation of method 'do_something' on object 'object' while it is in the 'consumed' state [-Wco... | C++ | apache-2.0 | tisma/ctorious,tisma/ctorious | |
08f9e71ce4641079442deeeaf1834606aa8284b4 | experiments/bitfield-c.cpp | experiments/bitfield-c.cpp | #include <atomic>
#include <thread>
#include <iostream>
struct thing {
unsigned int a : 15;
unsigned int b : 15;
};
thing x;
void f1(int n) {
for (int i = 0; i < n; i++) {
x.a++;
}
}
void f2(int n) {
for (int i = 0; i < n; i++) {
x.b++;
}
}
int main() {
std::cout << size... | Add an experiment that tests some bitfield stuff | Add an experiment that tests some bitfield stuff
| C++ | mit | msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler | |
7cdb244291bf91a2e42493198a67b2986d4734fe | tests/hp/crash_04.cc | tests/hp/crash_04.cc | //---------------------------- crash_04.cc ---------------------------
// $Id$
// Version: $Name$
//
// Copyright (C) 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// to the file deal.II/doc... | Add new test that shows failure in DerivativeApproximation | Add new test that shows failure in DerivativeApproximation
git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@12458 0785d39b-7218-0410-832d-ea1e28bc413d
| C++ | lgpl-2.1 | shakirbsm/dealii,natashasharma/dealii,naliboff/dealii,naliboff/dealii,lpolster/dealii,naliboff/dealii,adamkosik/dealii,andreamola/dealii,rrgrove6/dealii,Arezou-gh/dealii,JaeryunYim/dealii,kalj/dealii,lpolster/dealii,lue/dealii,adamkosik/dealii,mac-a/dealii,andreamola/dealii,flow123d/dealii,jperryhouts/dealii,EGP-CIG-RE... | |
ecf190854068c7095fe43fccee0ceb074af3c3b5 | contrib/fparser/examples/optimizer_bug.cc | contrib/fparser/examples/optimizer_bug.cc | // Simple example file for the the fparser optimization bug
// (c) 2014 by Daniel Schwen
// ========================================================
// $CXX -o optimizer_bug optimizer_bug.cc -I ../../../installed/include/libmesh/ ../../../build/contrib/fparser/.libs/libfparser_la-fp*
#include "../fparser.hh"
#inclu... | Add minimal testcase for optimizer bug in FParser. | Add minimal testcase for optimizer bug in FParser.
| C++ | lgpl-2.1 | Mbewu/libmesh,Mbewu/libmesh,Mbewu/libmesh,Mbewu/libmesh,Mbewu/libmesh,Mbewu/libmesh,Mbewu/libmesh,Mbewu/libmesh,Mbewu/libmesh | |
3177c777f4eebf8eb3abee7d1e14f3c560ab784d | test19_13.cpp | test19_13.cpp | #include <iostream>
#include <string>
#include "test16_62_Sales_data.h"
using namespace std;
int main() {
Sales_data item("book1", 4, 30.0), *p = &item;
auto pdata = &Sales_data::isbn;
cout << (item.*pdata)() << endl;
cout << (p ->* pdata)() << endl;
return 0;
}
| Add solution for chapter 19, test 13 | Add solution for chapter 19, test 13 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
f103e516eed1eac7968df09c90287f3bfa79f3d2 | cpp/getfilename_test.cc | cpp/getfilename_test.cc | /** \file xml_parser_test.cc
* \brief Tests the FileUtil::GetFileName() function.
* \author Dr. Johannes Ruscheinski
*/
/*
Copyright (C) 2015, Library of the University of Tübingen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General ... | Test for the new FileUtil::GetFileName() functions. | Test for the new FileUtil::GetFileName() functions.
| C++ | agpl-3.0 | ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools | |
0aa70e8302d94b94a537aeef01c5113bd843a701 | tbb/psort.cc | tbb/psort.cc | #include "tbb/parallel_sort.h"
#include <math.h>
using namespace tbb;
const int N = 100000;
float a[N], b[N], c[N], d[N];
void SortExample() {
for( int i = 0; i < N; i++ ) {
a[i] = sin((double)i);
b[i] = cos((double)i);
c[i] = 1/sin((double)i);
d[i] = 1/cos((double)i);
}
parallel_sort(a, a ... | Add in Intel TBB tests | Add in Intel TBB tests
| C++ | bsd-3-clause | dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps | |
2c9a3175b5c50e57aefe88928ab878615b253db3 | tests/src/TestVec2i.cpp | tests/src/TestVec2i.cpp | #include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "Vec2i.h"
TEST(TestVec2i, DisplacingDirectionWithOffsetWillWrap ) {
ASSERT_EQ( Knights::EDirection::kWest, Knights::wrapDirection( Knights::EDirection::kNorth, -1 ) );
ASSERT_EQ( Knights::EDirection::kNorth, Knights::wrapDirection( Knights::EDirec... | Add basic test for Vec2 | Add basic test for Vec2
| C++ | bsd-2-clause | TheFakeMontyOnTheRun/dungeons-of-noudar,TheFakeMontyOnTheRun/dungeons-of-noudar | |
981c66be4e9e98b2cb599a02826e75a7055fb627 | lib/vpsc/variable.cpp | lib/vpsc/variable.cpp | /**
*
* Authors:
* Tim Dwyer <tgdwyer@gmail.com>
*
* Copyright (C) 2005 Authors
*
* This version is released under the CPL (Common Public License) with
* the Graphviz distribution.
* A version is also available under the LGPL as part of the Adaptagrams
* project: http://sourceforge.net/projects/adaptagrams.... | Add the vpsc library for IPSEPCOLA features | Add the vpsc library for IPSEPCOLA features
| C++ | epl-1.0 | pixelglow/graphviz,tkelman/graphviz,pixelglow/graphviz,tkelman/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,tkelman/graphviz,kbrock/graphviz,jho1965us/graphviz,MjAbuz/graphviz,pixelglow/graphviz,MjAbuz/graphviz,pixelglow/graphviz,jho1965us/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,kbrock/graphviz,pixelglow/graph... | |
b05969e2f71269cbf5f30e8312348c88cca53fb6 | test/C++Frontend/2006-09-27-Debug-Protection.cpp | test/C++Frontend/2006-09-27-Debug-Protection.cpp | // RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep 'uint 1,' &&
// RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep 'uint 2,'
class A {
public:
int x;
protected:
int y;
private:
int z;
};
A a;
| Make sure C++ protection shows up in debug info | Make sure C++ protection shows up in debug info
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@30626 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | bsd-2-clause | chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,l... | |
1a1a3736c163275889408500d3f34623b12eebc0 | cli/imagedemo.cpp | cli/imagedemo.cpp | //
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
// Creation Date: Mon 18 Apr 2022 06:34:46 PM UTC
// Last Modified: Mon 18 Apr 2022 06:34:49 PM UTC
// Filename: imagedemo.cpp
// URL: https://github.com/craigsapp/humlib/blob/master/cli/imagedemo.cpp
// Syntax: C++11
// vim: ... | Add image generation demo file. | Add image generation demo file.
| C++ | bsd-2-clause | craigsapp/humlib,craigsapp/humlib,craigsapp/humlib | |
8c57b747cf664a8cbe3ad127cf06128d80d4825f | string/2138.cc | string/2138.cc | class Solution {
public:
vector<string> divideString(string s, int k, char fill) {
std::vector<std::string> ret;
std::string cur;
for (int i = 0; i < s.size(); i += k) {
ret.emplace_back(s.substr(i, k));
}
while (ret[ret.size()-1].size() < k) {
ret[ret... | Divide a String Into Groups of Size k | Divide a String Into Groups of Size k
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
0daf232540c63b2a2d50b1bf505e3be07f5565d4 | validateBST.cpp | validateBST.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
inline bool isLeaf(TreeNode* n) {
return n->left == NULL && n->right == NULL;
}
... | Validate if a binary tree is BST | Validate if a binary tree is BST | C++ | mit | gnadathur/Coding | |
7f97789777742ca20e206ee146ff22b87f4af48d | chrome/browser/download/download_extension_apitest.cc | chrome/browser/download/download_extension_apitest.cc | // 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/extension_apitest.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#... | // 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/extension_apitest.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#... | Disable DownloadsApiTest.DownloadsApiTest because it is too flaky and times out too often. | Disable DownloadsApiTest.DownloadsApiTest because it is too flaky and times out too often.
BUG=130950
TBR=benjhayden@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10499011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@140249 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | M4sse/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,M4sse/ch... |
a5698772d4f194a3dd7720e220e4255e2d0d8c98 | test/C++Frontend/2005-01-03-StaticInitializers.cpp | test/C++Frontend/2005-01-03-StaticInitializers.cpp | // RUN: %llvmgxx %s -S -o - | grep '%XX = global int 4'
struct S {
int A[2];
};
int XX = (int)&(((struct S*)0)->A[1]);
| Add a testcase to check that initializer that CAN be evaluated statically ARE. | Add a testcase to check that initializer that CAN be evaluated statically ARE.
These used to result in dynamic initializations.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@19278 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen... | |
0746ec9f81f71d024bb7768e05bf66702bbc2e40 | karum/printLinkedList.cpp | karum/printLinkedList.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next,*head;
Node(){}
Node(int d){
data=d;
next=NULL;
}
Node *addElement(Node *head, int d){
Node *nde=new Node(d);
Node *tmp=head;
if(head==NULL)
return nde;
else{
while(tmp->next)
tmp=tmp->next;
}
tm... | Add code to print linked list | Add code to print linked list
| C++ | mit | shivan1b/codes | |
508ad9e86d953e8d0bae15e2c1a67ab237e3acf6 | read_lines_from_file.cpp | read_lines_from_file.cpp | #include <iostream>
#include <fstream>
int main()
{
std::ifstream file("data.txt");
std::string line;
// See: https://stackoverflow.com/q/7219062/496459
// std::getline has no buffer-size limitation, per the standard.
while(std::getline(file, line))
{
std::cout << line << '\n';
}
... | Add idiom to read lines from a file. | Add idiom to read lines from a file.
| C++ | mit | mpoullet/cpp-snippets,mpoullet/cpp-snippets | |
f5fcc5baec1c5aea7dbd7a2a8fdd41ae8b422a6e | cpp_thread_test/gemm64.cpp | cpp_thread_test/gemm64.cpp | #include <iostream>
#include <cblas.h>
int main ( int argc, char* argv[] ) {
const long n = ((long)1 << 31) - 1;
std::cout << n <<std::endl;
float* A = new float[n];
float* B = new float[n];
float* C = new float[1];
for(long i =0; i <n; i++){
A[i] = 1;
B[i] = 1;
}
cbl... | Add trivial gemm test for multithread consistency | Add trivial gemm test for multithread consistency | C++ | bsd-3-clause | xianyi/OpenBLAS,xianyi/OpenBLAS,xianyi/OpenBLAS,xianyi/OpenBLAS,xianyi/OpenBLAS,xianyi/OpenBLAS,xianyi/OpenBLAS,xianyi/OpenBLAS | |
e2ad5efdfff581bd48b354cbac4b71d8d08b402a | quicksort_1.cpp | quicksort_1.cpp | #include <iostream>
#include <cstring>
using namespace std;
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
void reverse(int *a, int start, int end)
{
for (int i = 0; i < (end - start + 1) / 2; i++) {
swap(a[start + i], a[end - i]);
}
}
void partition(int *a, int n)
{
int *temp = new int[n];
in... | Add the solution to "QuickSort1 - Partition". | Add the solution to "QuickSort1 - Partition".
| C++ | mit | clasnake/hackerrank,clasnake/hackerrank | |
d0490f579dc6ae17af6a9df65eef284149e9b8d0 | 331.cpp | 331.cpp | class Solution {
public:
bool isValidSerialization(string preorder) {
vector<string> h;
string t;
for(int i=0;i<preorder.size();){
if(preorder[i]==','){
h.push_back(t);
t.erase(t.begin(),t.end());
preorder.erase(preorder.begin()+i,p... | Verify Preorder Serialization of a Binary Tree | Verify Preorder Serialization of a Binary Tree | C++ | mit | zfang399/LeetCode-Problems | |
7b97ff371e4aa42bfc4b9f4b95557d67c781768c | GUI/src/main.cpp | GUI/src/main.cpp | #include <iostream>
#include <interpreter.h>
#include <gui.h>
#include <easylogging++.h>
#include <SFML/Graphics.hpp>
INITIALIZE_EASYLOGGINGPP
int main(int argc, char *argv[]) {
START_EASYLOGGINGPP(argc, argv);
int i = foo();
std::cout << str() + 1 << std::endl << i << std::endl;
LOG(INFO) << "Drawin... | #include <iostream>
#include <interpreter.h>
#include <gui.h>
#include <easylogging++.h>
#include <SFML/Graphics.hpp>
INITIALIZE_EASYLOGGINGPP
int main(int argc, char *argv[]) {
START_EASYLOGGINGPP(argc, argv);
std::cout << "Who am I ? where am I ? Lei" << std::endl;
int i = foo();
std::cout << s... | Revert "Revert "this is my test"" | Revert "Revert "this is my test""
This reverts commit e59e3561a7b65c75b584757780adb3ceaf6181c6.
| C++ | mit | Graphics-Interpreter/cmake-demo,Lw-Cui/cmake-demo,Graphics-Interpreter/cmake-demo,Lw-Cui/cmake-demo |
c69ca9972369affc3541bc800b1613c165ae583b | sandbox/linux/services/resource_limits_unittests.cc | sandbox/linux/services/resource_limits_unittests.cc | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sandbox/linux/services/resource_limits.h"
#include <errno.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
#include "bas... | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sandbox/linux/services/resource_limits.h"
#include <errno.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
#include "bas... | Disable ResourceLimits.NoFork in sandbox_linux_unittests on Android. | Disable ResourceLimits.NoFork in sandbox_linux_unittests on Android.
This fixes sandbox_linux_unittests on Android.
TBR=jln@chromium.org
BUG=459158
Review URL: https://codereview.chromium.org/929213002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#316560}
| C++ | bsd-3-clause | fujunwei/chromium-crosswalk,ltilve/chromium,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,TheTypoMas... |
c07f288d3eca9862659370e937b77241b86b59bf | chapter20/chapter20_ex15.cpp | chapter20/chapter20_ex15.cpp | // Chapter 20, Exercise 15: define a pvector to be like a vector of pointers
// except that it contains pointer to objects and its destructor deletes each
// object
#include "../lib_files/std_lib_facilities.h"
//------------------------------------------------------------------------------
template<class Elem>
class... | Add Chapter 20, exercise 15 | Add Chapter 20, exercise 15
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
62aea71d13892ea09996c2bea3b7ba6d58856029 | test17_4.cpp | test17_4.cpp | #include <iostream>
#include <tuple>
#include <algorithm>
#include <vector>
#include <string>
#include "test16_62_Sales_data.h"
using namespace std;
bool compareIsbn(const Sales_data &lhs, const Sales_data &rhs) {
return lhs.isbn() < rhs.isbn();
}
typedef tuple<vector<Sales_data>::size_type, vecto... | Add solution for chapter 17 test 4 | Add solution for chapter 17 test 4 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
feaf1bd2f4db6ede183b16c1bf2493f5022f6cd1 | week3/homework/solutions/problem1/client.cpp | week3/homework/solutions/problem1/client.cpp | #include <iostream>
using namespace std;
const int MAX = 100;
struct Person {
string firstName;
string lastName;
void input() {
cout << "Enter person's first and last names separated by a space: ";
cin >> firstName >> lastName;
}
void print() {
cout << firstName << ' ' << lastName << '\n';
... | Add solution to first problem | Add solution to first problem
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
fb5beb9af541d3405329789ad61945c20b03ef39 | atom/browser/javascript_environment.cc | atom/browser/javascript_environment.cc | // Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/javascript_environment.h"
#include "base/command_line.h"
#include "gin/array_buffer.h"
#include "gin/v8_initializer.h"
namespace atom {
JavascriptEnvironment:... | // Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <string>
#include "atom/browser/javascript_environment.h"
#include "base/command_line.h"
#include "gin/array_buffer.h"
#include "gin/v8_initializer.h"
namespace atom {
Jav... | Add --js-flags support for main thread. | Add --js-flags support for main thread.
Allow use of flags that must be set before V8 is initialized, such as
"--harmony_proxies", e.g. --js-flags="--harmony_proxies
--harmony_collections"
| C++ | mit | wan-qy/electron,gerhardberger/electron,noikiy/electron,gabriel/electron,tylergibson/electron,aichingm/electron,kokdemo/electron,tinydew4/electron,etiktin/electron,Floato/electron,felixrieseberg/electron,brave/electron,deed02392/electron,biblerule/UMCTelnetHub,rajatsingla28/electron,Gerhut/electron,kcrt/electron,Floato/... |
88294396f1ee287cef4105f86f8cdddb72bbc166 | test/focus-cycle.cpp | test/focus-cycle.cpp | #include <iostream>
#include <vector>
#include <UnitTest++.h>
#include "model/focus-cycle.h"
#include "logging/logging.h"
#include "logging/stream.h"
const int last_window = 9;
StreamLog log(std::cerr);
struct FocusCycleFixture
{
FocusCycle cycle;
std::vector<Window> windows;
FocusCycleFixture() :
... | Add a test for FocusCycle. | Add a test for FocusCycle.
| C++ | bsd-2-clause | 8l/swm,8l/swm,8l/SmallWM,8l/SmallWM | |
ed5631c809f0bb75e6f2ba85803049ce3995e2ed | unittest/testTaskBase.cpp | unittest/testTaskBase.cpp | #include "TaskBase.h"
#include <gtest/gtest.h>
#include <unistd.h>
using namespace tpool;
namespace {
struct FakeTask : public TaskBase {
virtual void DoRun()
{
sleep(2);
}
};
}
TEST(TaskBase, test_GetState)
{
FakeTask task;
EXPECT_EQ(TaskBase::INIT, task.GetState());
}
| Add unit test for TaskBase. | Add unit test for TaskBase.
| C++ | mit | airekans/Tpool,airekans/Tpool,airekans/Tpool | |
85cd367f19b9a36729671f810dbcd0faeb5ca528 | src/tests/test-placesview.cpp | src/tests/test-placesview.cpp | #include <QApplication>
#include <QMainWindow>
#include <QToolBar>
#include <QDir>
#include <QDebug>
#include "../placesview.h"
#include "libfmqt.h"
int main(int argc, char** argv) {
QApplication app(argc, argv);
Fm::LibFmQt contex;
QMainWindow win;
Fm::PlacesView view;
win.setCentralWidget(&view... | Add a missing test case for places view. | Add a missing test case for places view.
| C++ | lgpl-2.1 | lxde/libfm-qt,lxde/libfm-qt,vc-01/libfm-qt,vc-01/libfm-qt | |
f818a8b598dabf924bec4c491d02cbfcfe2d0c2e | test/Headers/wchar_limits.cpp | test/Headers/wchar_limits.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -fshort-wchar %s
#include <limits.h>
const bool swchar = (wchar_t)-1 > (wchar_t)0;
#ifdef __WCHAR_UNSIGNED__
int signed_test[!swchar];
#else
int signed_test[swchar];
#endif
int max_test[WCHAR_MAX == (swchar ? -(WCHAR_MIN+1) : (wcha... | Add a missing test for the limits on wchar | Add a missing test for the limits on wchar
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@135708 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
52ddca5627d62ca31400ffc83e2cc4d307d13a0c | Bit_Manipulation/Check_Pow_2.cpp | Bit_Manipulation/Check_Pow_2.cpp | #include <iostream>
using namespace std;
bool check_pow_2(int num) {
if ((num & (num-1)) == 0)
return true;
return false;
}
int main() {
int num = 2;
check_pow_2(num) ? cout << "Num is a Power of 2" : cout << "Num is not a power of 2";
cout << endl;
num = 5;
check_pow_2(num) ? cout... | Check power of 2 cpp | Check power of 2 cpp
| C++ | mit | anubhavshrimal/Data_Structures_Algorithms_In_Python | |
1661beb70e6567b73d69dcfba7b5bfa15dd41131 | chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc | chrome/browser/sync/glue/chrome_report_unrecoverable_error.cc | // 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/sync/glue/chrome_report_unrecoverable_error.h"
#include "base/rand_util.h"
#include "build/build_config.h"
#if defined(OS_W... | // 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/sync/glue/chrome_report_unrecoverable_error.h"
#include "base/rand_util.h"
#include "build/build_config.h"
#if defined(OS_W... | Revert 144124 - [Sync] Set error upload rate to 0. | Revert 144124 - [Sync] Set error upload rate to 0.
This prevents sync from uploading error stacks to breakpad.
BUG=134607
TEST=
Review URL: https://chromiumcodereview.appspot.com/10664028
TBR=zea@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10680007
git-svn-id: de016e52bd170d2d4f2344f9bf92d5047... | C++ | bsd-3-clause | M4sse/chromium.src,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,keishi/chromi... |
75ec5aa40177caeb6531afab8c0757183dddc101 | test/CodeGenCXX/dllexport-dtor-thunks.cpp | test/CodeGenCXX/dllexport-dtor-thunks.cpp | // RUN: %clang_cc1 -mconstructor-aliases -fms-extensions %s -emit-llvm -o - -triple x86_64-windows-msvc | FileCheck %s
struct __declspec(dllexport) A { virtual ~A(); };
struct __declspec(dllexport) B { virtual ~B(); };
struct __declspec(dllexport) C : A, B { virtual ~C(); };
C::~C() {}
// This thunk should *not* be d... | Test that deleting destructor thunks are not exported | [MS] Test that deleting destructor thunks are not exported
The MSVC linker emits the LNK4102 warning if they are.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@306836 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
68cd60c77470fd6e0f86bad1e4c68796d516cc06 | lib/asan/asan_dll_thunk.cc | lib/asan/asan_dll_thunk.cc | //===-- asan_dll_thunk.cc -------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | Add the first version of the RTL thunk that should be linked with instrumented DLLs | [ASan/Win] Add the first version of the RTL thunk that should be linked with instrumented DLLs
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@188267 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt | |
ecf85c3a2b902805d0d11877154392c40559cc67 | test16_39.cpp | test16_39.cpp | #include <iostream>
#include <string>
#include "test16_2_compare.h"
using namespace std;
template <typename It>
auto fcn3(It beg, It end) -> decltype(*beg + 0) {
return *beg;
}
int main() {
cout << compare<char*>("hi", "world") << endl;
cout << compare<string>("dad", "bye") << endl;
... | Add solution for chapter 16 test 39. | Add solution for chapter 16 test 39. | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
def575a6c23a59237ec9cf944cbf8db0d4b5dc71 | doc/examples/hash_quickly.cpp | doc/examples/hash_quickly.cpp | #include <botan/botan.h>
#include <botan/benchmark.h>
#include <botan/filters.h>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <cstdlib>
/*
Try to find the fastest SHA-1 implementation and use it to hash
files. In most programs this isn't worth the bother and
overhead. However with ... | Add an example of using the benchmark system to choose the fastest SHA-1 implementation and then setting it as the default. | Add an example of using the benchmark system to choose the fastest SHA-1
implementation and then setting it as the default.
| C++ | bsd-2-clause | randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/b... | |
c9755d53996e0d2285f80be418b854d289cd7f33 | counting-sort/testCountingSort.cpp | counting-sort/testCountingSort.cpp | /*
This program tests Counting sort
*/
#include<iostream>
#include<vector>
#include "countingsort.h" // My implementation of Counting sort
// Displays vector
void printVector(std::vector<int> A){
for(auto x: A){
std::cout<<x<<" ";
}
std::cout<<std::endl;
}
// Tests Counting sort on vector A
void testCount... | Add test program for counting sort | Add test program for counting sort
| C++ | mit | rohitkhilnani/cpp-And-Me | |
86e5ff546dbed36fb90e98fb075a18a30fe95d79 | examples/sync_folder_hierarchy.cpp | examples/sync_folder_hierarchy.cpp |
// Copyright 2018 otris software AG
//
// 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 l... | Add example for SyncFolderHierarchy operation | Add example for SyncFolderHierarchy operation
| C++ | apache-2.0 | m-Schlitzer/ews-cpp,otris/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp | |
1739d3ef0af711c71d61f996e635fb7fb2c1927b | test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp | test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp | // -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// 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.
//
//===-------------------------... | Add test case for PR31384 | Add test case for PR31384
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@289774 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
dfd0568a50c11e997a8cb9bcfe6dc740026a2ecc | test/networking/packet_manager_test.cpp | test/networking/packet_manager_test.cpp | //===----------------------------------------------------------------------===//
//
// Peloton
//
// packet_manager_test.cpp
//
// Identification: test/wire/packet_manager_test.cpp
//
// Copyright (c) 2016-17, Carnegie Mellon University Database Group
//
//===------------------------------------... | Add simple wire protocol test | Add simple wire protocol test
| C++ | apache-2.0 | AngLi-Leon/peloton,malin1993ml/peloton,apavlo/peloton,yingjunwu/peloton,vittvolt/peloton,prashasthip/peloton,vittvolt/15721-peloton,cmu-db/peloton,haojin2/peloton,apavlo/peloton,seojungmin/peloton,vittvolt/15721-peloton,AllisonWang/peloton,ShuxinLin/peloton,phisiart/peloton-p3,vittvolt/peloton,AllisonWang/peloton,seoju... | |
252dc6307437762a6bf7c1cfc7ef88e6088330a9 | PWGLF/STRANGENESS/Lifetimes/macros/AddTaskStrangenessLifetimes.cc | PWGLF/STRANGENESS/Lifetimes/macros/AddTaskStrangenessLifetimes.cc | AliAnalysisTaskStrangenessLifetimes *AddTaskStrangenessLifetimes(
TString tskname = "LifetimesFiltering", TString suffix = "") {
// Get the current analysis manager
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTaskStrangenessLifetimes", "No analysis manager fou... | AliAnalysisTaskStrangenessLifetimes *AddTaskStrangenessLifetimes(bool isMC = false,
TString tskname = "LifetimesFiltering", TString suffix = "") {
// Get the current analysis manager
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTaskStrangenessLifetimes", "No an... | Enable MC flag in the AddTask 😅 | Enable MC flag in the AddTask 😅
| C++ | bsd-3-clause | dstocco/AliPhysics,sebaleh/AliPhysics,rihanphys/AliPhysics,SHornung1/AliPhysics,AMechler/AliPhysics,rbailhac/AliPhysics,SHornung1/AliPhysics,rderradi/AliPhysics,AMechler/AliPhysics,kreisl/AliPhysics,alisw/AliPhysics,btrzecia/AliPhysics,kreisl/AliPhysics,mvala/AliPhysics,hzanoli/AliPhysics,nschmidtALICE/AliPhysics,amari... |
8d79a52d1ddd4b8205821afa54feaefb57901472 | 79_word_search.cc | 79_word_search.cc | // https://leetcode.com/problems/word-search/
// Using a DFS solution, stop as early as possible.
class Solution {
bool dfs(const vector<vector<char> > &board,
int r, int c,
const char* word,
vector<vector<bool> >* visited){
if (*word != board[r][c]) {
r... | Add a solution for problem 79: Word Search. | Add a solution for problem 79: Word Search.
| C++ | apache-2.0 | shen-yang/leetcode_solutions,shen-yang/leetcode_solutions,shen-yang/leetcode_solutions | |
83bc08fd6c8986a2ca9b7e5a428ca3813065eabc | linux/main.cpp | linux/main.cpp | /**
* @file main.cpp
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Mar 2015
* @brief
*/
//#define BLYNK_DEBUG
#define BLYNK_PRINT stdout
#ifdef RASPBERRY
#include <BlynkApiWiringPi.... | /**
* @file main.cpp
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Mar 2015
* @brief
*/
//#define BLYNK_DEBUG
#define BLYNK_PRINT stdout
#ifdef RASPBERRY
#include <BlynkApiWiringPi.... | Fix pin name in example | Fix pin name in example
| C++ | mit | csicar/blynk-library,blynkkk/blynk-library,blynkkk/blynk-library,sstocker46/blynk-library,ivankravets/blynk-library,blynkkk/blynk-library,okhiroyuki/blynk-library,flashvnn/blynk-library,johan--/blynk-library,okhiroyuki/blynk-library,flashvnn/blynk-library,csicar/blynk-library,ivankravets/blynk-library,okhiroyuki/blynk-... |
aaa460a1537dcca4530d71746113027a3a54c991 | test/correctness/gpu_assertion_in_kernel.cpp | test/correctness/gpu_assertion_in_kernel.cpp | #include "Halide.h"
using namespace Halide;
bool errored = false;
void my_error(void *, const char *msg) {
printf("Expected error: %s\n", msg);
errored = true;
}
void my_print(void *, const char *msg) {
// Empty to neuter debug message spew
}
int main(int argc, char **argv) {
Target t = get_jit_targ... | Add test for gpu assertions | Add test for gpu assertions
| C++ | mit | tdenniston/Halide,ronen/Halide,psuriana/Halide,psuriana/Halide,jiawen/Halide,tdenniston/Halide,kgnk/Halide,kgnk/Halide,ronen/Halide,ronen/Halide,jiawen/Halide,ronen/Halide,ronen/Halide,ronen/Halide,tdenniston/Halide,kgnk/Halide,kgnk/Halide,kgnk/Halide,psuriana/Halide,jiawen/Halide,psuriana/Halide,psuriana/Halide,tdenni... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.