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 |
|---|---|---|---|---|---|---|---|---|---|
8dd7e894fbd8e2e743739f03a09815cedf65d863 | test/error/memoize_different_compute_store.cpp | test/error/memoize_different_compute_store.cpp | #include <Halide.h>
#include <stdio.h>
using namespace Halide;
int main(int argc, char **argv) {
Param<float> val;
Func f, g;
Var x, y;
f(x, y) = val + cast<uint8_t>(x);
g(x, y) = f(x, y) + f(x - 1, y) + f(x + 1, y);
g.split(y, y, _, 16);
f.store_root();
f.compute_at(g, y).memoize()... | Add error test for memoizing a Func with compute and storage at different levels. | Add error test for memoizing a Func with compute and storage at different levels.
Former-commit-id: 8ce76cf39a05a6ab234ef2ae547e0bda5fd353a3 | C++ | mit | darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide | |
ea421db4d7d32ce7f47e4ef6787c945a720901fa | enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/LUTTables.cpp | enhanced/classlib/trunk/modules/awt/src/main/native/gl/shared/LUTTables.cpp | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you... | Patch for HARMONY-3677 "[classlib][awt] Results of running checker tool" | Patch for HARMONY-3677 "[classlib][awt] Results of running checker tool"
svn path=/harmony/; revision=532705
| C++ | apache-2.0 | freeVM/freeVM,freeVM/freeVM,freeVM/freeVM,freeVM/freeVM,freeVM/freeVM | |
d435b2496c8a53ed36de2f21759f0461cc9cb4e3 | 2course/Programming/docs/lectures/2017_2018/FP/примеры_с_практик/пример6_1_very_simple_exceptions_example.cpp | 2course/Programming/docs/lectures/2017_2018/FP/примеры_с_практик/пример6_1_very_simple_exceptions_example.cpp | /**
Очень простой вводный пример на демонстрацию исключений
*/
#include <iostream>
#include <exception>
#include <string>
struct MyError
{
std::string msg;
};
class Test
{
public:
~Test()
{
std::cout << "Вызван деструктор\n";
}
};
double sin_by_sharnin(double x)
{
const size_t fakt_3... | Add simplest exception example from lesson | Add simplest exception example from lesson
| C++ | unlicense | posgen/OmsuMaterials,posgen/OmsuMaterials,posgen/OmsuMaterials | |
f0ebdd7463275f8183df94f1f8a8ec3761652e7c | bench/DrawBitmapAABench.cpp | bench/DrawBitmapAABench.cpp | /*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkString.h"
/**
* This bench measures the rendering time of SkCanvas::drawBi... | Add a bench for measuring drawBitmap anti-aliasing overhead | Add a bench for measuring drawBitmap anti-aliasing overhead
R=reed@google.com,mtklein@google.com
Review URL: https://codereview.chromium.org/1207403007
| C++ | bsd-3-clause | nvoron23/skia,google/skia,vanish87/skia,todotodoo/skia,Jichao/skia,noselhq/skia,vanish87/skia,shahrzadmn/skia,HalCanary/skia-hc,google/skia,pcwalton/skia,aosp-mirror/platform_external_skia,todotodoo/skia,shahrzadmn/skia,rubenvb/skia,Jichao/skia,shahrzadmn/skia,vanish87/skia,noselhq/skia,nvoron23/skia,nvoron23/skia,omin... | |
084609f437ce6bc03d716b612f441d9bc7aff1bf | lib/ubsan/ubsan_init_standalone_preinit.cc | lib/ubsan/ubsan_init_standalone_preinit.cc | //===-- ubsan_init_standalone_preinit.cc
//------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===---------------------------------------------... | Add file missing from r313583 | [ubsan] Add file missing from r313583
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@313584 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 | |
70679f2f473963104d4035983cb65b7ecfe226dc | week4/solutions/problem2/main.cpp | week4/solutions/problem2/main.cpp | #include <iostream>
#include <cstring>
using namespace std;
struct WordTranslation {
char word[100], translation[100];
WordTranslation(const char _word[] = "", const char _translation[] = "") {
strcpy(word, _word);
strcpy(translation, _translation);
}
};
class Dictionary {
int size;
... | Add solution to the dictionary task | Add solution to the dictionary task
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
83a976ed229ca88250ed4a4275953e29db3a7356 | 1-common-tasks/classes/rule-of-zero.cpp | 1-common-tasks/classes/rule-of-zero.cpp | // The rule of zero
#include <memory>
class shallow
{
private:
std::shared_ptr<int> p = std::make_shared<int>(5);
};
class deep
{
public:
deep() = default;
deep(deep const& other)
: p{std::make_unique<int>(*other.p)}
{ }
private:
std::unique_ptr<int> p = std::make_unique<int>(5);
};
// Use existin... | Add rule of zero sample | Add rule of zero sample
| C++ | cc0-1.0 | vjacquet/CppSamples-Samples,darongE/CppSamples-Samples,rollbear/CppSamples-Samples,sftrabbit/CppSamples-Samples,mnpk/CppSamples-Samples,thatbrod/CppSamples-Samples,brunotag/CppSamples-Samples,tmwoz/CppSamples-Samples | |
fc3c82a804c9b5eda24d96c21f7e6ff66bc2c529 | lib/CodeGen/UnreachableBlockElim.cpp | lib/CodeGen/UnreachableBlockElim.cpp | //===-- UnreachableBlockElim.cpp - Remove unreachable blocks for codegen --===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===--------... | Add a trivially simple pass to delete unreachable blocks from the CFG. This pass is required to paper over problems in the code generator (primarily live variables and its clients) which doesn't really have any well defined semantics for unreachable code. | Add a trivially simple pass to delete unreachable blocks from the CFG. This
pass is required to paper over problems in the code generator (primarily
live variables and its clients) which doesn't really have any well defined
semantics for unreachable code.
The proper solution to this problem is to have instruction sel... | C++ | apache-2.0 | apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,appl... | |
91dbcb6db6b2bc3ed77540c2d79cf46eeb4c707e | test/UnitTests/src/Assets/AssetWrapperTest.cpp | test/UnitTests/src/Assets/AssetWrapperTest.cpp | /*-----------------------------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2015-2018 OSRE ( Open Source Render Engine ) by Kim Kulling
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation f... | Add missing file to fix the build. | Add missing file to fix the build.
| C++ | mit | kimkulling/osre,kimkulling/osre,kimkulling/osre,kimkulling/osre,kimkulling/osre,kimkulling/osre,kimkulling/osre | |
19f0e14dd7ea5226fc04eaf345f2643c65018814 | chapter20/chapter20_ex05.cpp | chapter20/chapter20_ex05.cpp | // Chapter 20, Exercise 05: Define an input and an output operator (>> and <<)
// for vector.
#include "../lib_files/std_lib_facilities.h"
template<class T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
os << "{ ";
for (int i = 0; i<v.size(); ++i) {
os << v[i];
if (i+1<v.size()) os <<... | Add Chapter 20, exercise 5 | Add Chapter 20, exercise 5
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
26b15959f15bca2619ec33eb080afdbd86582ea7 | quic/core/crypto/common_cert_set_empty.cc | quic/core/crypto/common_cert_set_empty.cc | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/crypto/common_cert_set.h"
#include <cstddef>
#include "net/third_party/quiche/src/quic/core/quic_util... | Add flag to remove common certs | Add flag to remove common certs
The common certs contain around ~140kb of data that isn't used in some cases. The flag allows us to remove the data if not used.
Additional flag added won't affect gfe production.
PiperOrigin-RevId: 321615235
Change-Id: I31b675ab95ea7050de074d07438df47cc3e8f6a2
| C++ | bsd-3-clause | google/quiche,google/quiche,google/quiche,google/quiche | |
b1d1a4fcb6c8a79c2f3d1d7872d43ca25a50b219 | lib/asan/lit_tests/TestCases/large_allocator_unpoisons_on_free.cc | lib/asan/lit_tests/TestCases/large_allocator_unpoisons_on_free.cc | // Test that LargeAllocator unpoisons memory before releasing it to the OS.
// RUN: %clangxx_asan %s -o %t
// RUN: ASAN_OPTIONS=quarantine_size=1 %t
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
int main() {
void *p = malloc(1024 * 1024);
free(p);
char *q = (char *)mmap(p, 4... | Test that LargeAllocator unpoisons memory before releasing it to the OS. | [asan] Test that LargeAllocator unpoisons memory before releasing it to the OS.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@195243 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 | |
1de15f518f29c2805a16b27790a2c76abe49518b | test/utilities/function.objects/refwrap/type_properties.pass.cpp | test/utilities/function.objects/refwrap/type_properties.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.
//
//===----------------------------------------... | Add test for type properties of std::reference_wrapper | Add test for type properties of std::reference_wrapper
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@221224 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
cdb7b9e999ccfc26ca4f161b1d9bb27e0e0a13c1 | karum/deleteNodeCLL.cpp | karum/deleteNodeCLL.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(){}
Node(int d){
data=d;
next=this;
}
Node *insertNode(Node *head, int d){
Node *np=new Node(d);
Node *t=head;
if(head... | Add code to delete node in circular linked list | Add code to delete node in circular linked list
| C++ | mit | shivan1b/codes | |
904519569f4467bbd7d0e86f9b21f731710cd26a | cracking-the-coding-interview/arrays-and-strings/test_reverse_str.cpp | cracking-the-coding-interview/arrays-and-strings/test_reverse_str.cpp | /*
This programtests class reverse_str
*/
#include "reverse_str.h"
#include<iostream>
void test_single(char* s){
// avoid printing nullpointer
if(s!=nullptr)
std::cout<<"\nString: "<<s;
else
std::cout<<"\nnull";
std::cout<<"\nLength: "<<Reverse_str::get_length(s);
Reverse_str::reverse(s);
// avoid p... | Add test case for method to reverse null terminated string | Add test case for method to reverse null terminated string
| C++ | mit | rohitkhilnani/cpp-And-Me | |
2c1265a4915a1fe04877335c6418f98a656d77b0 | chapter20/chapter20_ex07.cpp | chapter20/chapter20_ex07.cpp | // Chapter 20, Exercise 07: find the lexicographical last string in an unsorted
// vector<string>. Beware that "lexicographical" is not the same as "alphabeti-
// cal", as "Zzzz"<"aaa" (uppercase letters are lexicographically before lower-
// case letters).
#include "../lib_files/std_lib_facilities.h"
// returns an i... | Add Chapter 20, exercise 7 | Add Chapter 20, exercise 7
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
f941bdf499e4b9dd17c9461c6e3271f522594873 | base64.encode.cpp | base64.encode.cpp | /*
* Website:
* https://github.com/wo3kie/dojo
*
* Author:
* Lukasz Czerwinski
*
* Compilation:
* g++ --std=c++11 base64.encode.cpp -o base64.encode
*
* Usage:
* $ ./base64.encode "Hello World"
* SGVsbG8gV29ybGQ
*/
#include <iostream>
#include <string>
#include <boost/archive/i... | Implement a program to do base64 encoding | Implement a program to do base64 encoding
| C++ | mit | wo3kie/dojo,wo3kie/cxxDojo,wo3kie/cxxDojo,wo3kie/dojo,wo3kie/cxxDojo | |
85a175a9b44b02fdf258c0325604a2c23355867c | test/remove-cstr-calls/basic.cpp | test/remove-cstr-calls/basic.cpp | // RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ -c %t/test.cpp","file":"%t/test.cpp"}]' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: remove-cstr-calls "%t" "%t/test.cpp"
// RUN: cat "%t/test.cpp" | FileCheck %s
// FIXME: implement a mode for refactoring tools th... | Copy the existing regression test for remove-cstr-calls from the tooling branch to preserve its history. It's not yet functional. | Copy the existing regression test for remove-cstr-calls from the tooling branch
to preserve its history. It's not yet functional.
git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@161401 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra | |
193e928fa410bfd3e7a38bb52f93ad2649298d4c | chapter20/chapter20_ex13.cpp | chapter20/chapter20_ex13.cpp | // Chapter 20, Exercise 13: modify exercise 12 to use 0 to represent the one
// past the last element (end()) instead of allocating a real Link
#include "../lib_files/std_lib_facilities.h"
template<class Elem> struct Link {
Link(const Elem& v = Elem(), Link* p = 0, Link* s = 0)
:prev(p), succ(s), val(v) {... | Add Chapter 20, exercise 13 | Add Chapter 20, exercise 13
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
ea447a68b9d378e096d22e01a2e1376e23843f16 | chap8/ex8_2_3.cpp | chap8/ex8_2_3.cpp | #include <iostream>
#include <vector>
#include <stdexcept>
using namespace std;
/*Ex8.2:
Write a function print() that prints a vector of ints to cout. Give it
two arguments: a string for “labeling” the output and a vector.
*/
void print(string label, vector<int> v){
cout << label << ": " << endl;
for (int i ... | Add chap8, ex2 + ex3 | Add chap8, ex2 + ex3
| C++ | mit | ksvbka/pppuc | |
bced299ff0077a6babbb2ca1184f330790270d95 | tests/app_suite/strmem_tests.cpp | tests/app_suite/strmem_tests.cpp | /* **********************************************************
* Copyright (c) 2011 Google, Inc. All rights reserved.
* **********************************************************/
/* Dr. Memory: the memory debugger
*
* This library is free software; you can redistribute it and/or
* modify it under the term... | Add memmove tests to app_suite | Add memmove tests to app_suite
SVN-Revision: 349
| C++ | lgpl-2.1 | LohithBlaze/drmemory,code4bones/drmemory,LohithBlaze/drmemory,code4bones/drmemory,sigma-random/drmemory,code4bones/drmemory,code4bones/drmemory,LohithBlaze/drmemory,LohithBlaze/drmemory,sigma-random/drmemory,code4bones/drmemory,sigma-random/drmemory,sigma-random/drmemory,LohithBlaze/drmemory,sigma-random/drmemory | |
71c5bfaa64b74453e2e11086a064a503bdd4200f | merge-sort/testMergeSort.cpp | merge-sort/testMergeSort.cpp | /*
This program tests merge sort
*/
#include<iostream>
#include<vector>
#include "mergesort.h" // My implementation of merge sort
// Displays vector
void printVector(std::vector<int> A){
for(auto x: A){
std::cout<<x<<" ";
}
std::cout<<std::endl;
}
// Tests merge sort on vector A
void testMergeSort(std::ve... | Add test program for mergesort | Add test program for mergesort
| C++ | mit | rohitkhilnani/cpp-And-Me | |
b1e5a53cfcdb615ccbc60176dcaf88a47edcc559 | 80.cpp | 80.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if(nums.size()<3) return nums.size();
int f=0,r=1;
while(r<nums.size()){
if(nums[f]==nums[r]){
if(r-f>1) nums.erase(nums.begin()+r,nums.begin()+r+1);
else r++;
}else{
... | Remove Duplicates from Sorted Array II | Remove Duplicates from Sorted Array II | C++ | mit | zfang399/LeetCode-Problems | |
d22950fefbfae4108d08003b914b87aa6ac0d7d5 | hackerRank/30DaysOfCode/day0HelloWorld.cpp | hackerRank/30DaysOfCode/day0HelloWorld.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
// Declare a variable named 'input_string' to hold our input.
string input_string;
// Read a full line of input from stdin (cin) and save it to our variable, input_string.
... | Add c++ solution to the hello World problem | Add c++ solution to the hello World problem
| C++ | mit | clemus90/competitive-programming,clemus90/competitive-programming,clemus90/competitive-programming,clemus90/competitive-programming | |
a466eb183cc17a5061bcbf0505874c4556983152 | binding/c/test/FormatTest.cpp | binding/c/test/FormatTest.cpp | #include <boost/test/unit_test.hpp>
#include <ygo/deck/c/Format.h>
#include <ygo/deck/c/DB.h>
struct Format_Fixture
{
Format_Fixture()
{
DB_NAME(set_path)("test/card.db");
}
};
BOOST_FIXTURE_TEST_SUITE(Format, Format_Fixture)
BOOST_AUTO_TEST_CASE(Create)
{
int count;
auto formatDates = FO... | Add unit tests for format c bindings | Add unit tests for format c bindings
| C++ | mit | DeonPoncini/ygodeck,DeonPoncini/ygodeck,DeonPoncini/ygodeck | |
ed2a6c012a61a2f96be294727099c0c6171d0c62 | .github/workflows/linux_scip_off.cpp | .github/workflows/linux_scip_off.cpp | name: SCIP Disabled
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release... | Add job with SCIP support disabled | ci(cmake): Add job with SCIP support disabled
Since SCIP doesn't use an OSI approved license, lots of customer,
may want to use OR-Tools with SCIP support disabled...
| C++ | apache-2.0 | or-tools/or-tools,or-tools/or-tools,google/or-tools,google/or-tools,google/or-tools,or-tools/or-tools,or-tools/or-tools,or-tools/or-tools,google/or-tools,google/or-tools,or-tools/or-tools,google/or-tools | |
c8d77eb1dde2014063bbf36e02809b0ca9c35cc2 | others/DS/BT/sum_tree.cc | others/DS/BT/sum_tree.cc | #include <stdio.h>
typedef struct _NODE {
int data;
_NODE* left;
_NODE* right;
} NODE;
NODE* newNode(int data) {
NODE* node = new NODE();
node->data = data;
node->left = nullptr;
node->right = nullptr;
return node;
}
int sum(NODE* root) {
if (root == nullptr) return 0;
return (sum(root->left) + ... | Check whether given tree is sum tree. | Check whether given tree is sum tree.
| C++ | apache-2.0 | pshiremath/practice,pshiremath/practice | |
a27c5c05e7c034354c35625e64bf8af874192686 | chapter23/chapter23_ex14.cpp | chapter23/chapter23_ex14.cpp | // Chapter 23, exercise 14: like the sample program from 23.8.7, but read input
// from file into memory and experiment with patterns including '\n'
#include<regex>
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
int main()
{
string ifname = "pics_and_txt/chapter23_ex12_in.txt";
if... | Add Chapter 23, exercise 14 | Add Chapter 23, exercise 14
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
0ef74612206f1501773689868290905d18fca4e2 | Sorting/sortc++.cpp | Sorting/sortc++.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector < ll > vl;
int main(){
vl data = {234234LL, 2322LL,1LL, -1LL, 3454LL};
sort(data.begin(), data.end());
for (int i=0; i< data.size(); i++)
printf("%lld ", data[i]);
return 0;
}
| Add faster algorithm for working with sorting. | Add faster algorithm for working with sorting.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
41f40a211ea75f83ad4f57e97d0b496a155af849 | JPetAnalysisTools/JPetAnalysisToolsTest.cpp | JPetAnalysisTools/JPetAnalysisToolsTest.cpp | #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1].setTi... | #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1].setTi... | Change tests in JPetAnalysisTools to use double instead of int | Change tests in JPetAnalysisTools to use double instead of int
| C++ | apache-2.0 | JPETTomography/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework |
464818a3219a96df6b18d217c35e69c6b01486a7 | ch10/10.exercise.06.cpp | ch10/10.exercise.06.cpp | // 10.exercise.06.cpp
//
// Define a Roman_int class for holding Roman numerals (as ints) with a << and
// >>. Provide Roman_int with an as_int() member that returns the int value,
// so that if r is a Roman_int, we can write cout << "Roman" << r << "equals"
// << r.as_int() << '\n';.
int main()
try
{
return ... | Prepare exercise 6 from chapter 10. | Prepare exercise 6 from chapter 10.
| C++ | mit | 0p3r4t4/PPPUCPP2nd,0p3r4t4/PPPUCPP2nd,0p3r4t4/PPPUCPP2nd | |
849f1f1d2e51f91a0d4982e374e84dd6ee3e2405 | codeforces/527A.cpp | codeforces/527A.cpp | /*
* Copyright (C) 2015 Pavel Dolgov
*
* See the LICENSE file for terms of use.
*/
/* http://codeforces.com/contest/527/submission/11525645 */
#include <iostream>
int main() {
long long int a, b;
std::cin >> a >> b;
long long int ans = 0;
while (b > 0) {
ans += a / b;
a = a % b;
... | Add the first codeforces problem | Add the first codeforces problem
Directory for codeforces problems.
| C++ | mit | zer0main/problems,zer0main/problems,zer0main/problems | |
b9e3f400f93893b32e965673a38baf4672069bdc | Algorithms/DP/rod_cutting.cpp | Algorithms/DP/rod_cutting.cpp | /**
* Rod Cutting
* Given a length of rod, sample lengths and its
* corresponding profits find the maximum profit
* that can be made given the length.
* @Author: wajahat siddiqui
*/
#include <iostream>
using namespace std;
inline unsigned int max(unsigned int a, unsigned int b) {
return (a > b) ? a : b;
}
void... | Implement rod cutting to maximize profit using DP | Implement rod cutting to maximize profit using DP
Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
| C++ | apache-2.0 | WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace | |
6e6c92918d5530daf2a482aa5a747434d9c60ae1 | InverseFastFourierTransform/C++/Inverse_FFT.cpp | InverseFastFourierTransform/C++/Inverse_FFT.cpp | /*
* @author Abhishek Datta
* @github_id abdatta
* @since 15th October, 2017
*
* The following algroithm takes complex coeeficients
* and calculates its inverse discrete fourier transform
*/
#include <complex>
#include <iostream>
#include <iomanip>
#include <valarray>
const double PI = std::acos(-1);
typedef std::... | Add algorithm for Inverse FFT | Add algorithm for Inverse FFT
| C++ | apache-2.0 | maazsq/Algorithms_Example,Thuva4/Algorithms_Example,AtoMc/Algorithms_Example,maazsq/Algorithms_Example,Astrophilic/Algorithms_Example,churrizo/Algorithms_Example,maazsq/Algorithms_Example,Thuva4/Algorithms_Example,churrizo/Algorithms_Example,Astrophilic/Algorithms_Example,pranjalrai/Algorithms_Example,Astrophilic/Algor... | |
f4473010ca2e342648817444d55563b23a938261 | chrome/browser/extensions/extension_infobar_apitest.cc | chrome/browser/extensions/extension_infobar_apitest.cc | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
#if defined(TOOLKI... | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
#if defined(TOOLKI... | Mark a test as flaky on ChromeOS. | Mark a test as flaky on ChromeOS.
BUG=40141
TEST=None
Review URL: http://codereview.chromium.org/1575015
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@43384 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | Chilledheart/chromium,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,patrickm/chromium.src,jaruba/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,rogerwang/chromium,ltilve/chr... |
092803bcffd910a87e81ab444596d12a21c8de33 | base/i18n/timezone_unittest.cc | base/i18n/timezone_unittest.cc | // 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 "base/i18n/timezone.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
#if defined(... | // 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 "base/i18n/timezone.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
#if defined(OS_ANDROID)
// icu's timezone u... | Revert 235842 "fix android build by adding build_config.h" | Revert 235842 "fix android build by adding build_config.h"
> fix android build by adding build_config.h
>
> BUG=none
> TBR=dewittj@chromium.org
>
> Review URL: https://codereview.chromium.org/75663003
TBR=estade@chromium.org
Review URL: https://codereview.chromium.org/66973004
git-svn-id: de016e52bd170d2d4f2344f9... | C++ | bsd-3-clause | mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,dednal/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,ondra-novak/chromium.src,hgl888/chromium-crosswalk,patrickm/chromi... |
ee8ab823011b611244c5ced763befa1f8eeb89fb | tests/unit/evaluation/ROCEvaluation_unittest.cc | tests/unit/evaluation/ROCEvaluation_unittest.cc | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2013 Viktor Gal
*/
#include <shogun/base/init... | Add unit test for ROCEvaluation as currently this little example fails | Add unit test for ROCEvaluation
as currently this little example fails
| C++ | bsd-3-clause | shogun-toolbox/shogun,lisitsyn/shogun,besser82/shogun,Saurabh7/shogun,sorig/shogun,sorig/shogun,geektoni/shogun,sorig/shogun,geektoni/shogun,sorig/shogun,lisitsyn/shogun,karlnapf/shogun,lisitsyn/shogun,shogun-toolbox/shogun,karlnapf/shogun,besser82/shogun,besser82/shogun,sorig/shogun,karlnapf/shogun,karlnapf/shogun,lis... | |
de2dc8dc770dbb0724332e247d08d46d09738b98 | fuzz/oss_fuzz/FuzzPolyUtils.cpp | fuzz/oss_fuzz/FuzzPolyUtils.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_PolyUtils(Fuzz* f);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
auto fuzz = Fuzz(SkData::MakeWithoutCopy(dat... | Add oss-fuzz entrypoint for Polyutils fuzz | Add oss-fuzz entrypoint for Polyutils fuzz
Bug: skia:
Change-Id: Iee7fe4344e65290ae25e4cd51f338d9ce56def55
Reviewed-on: https://skia-review.googlesource.com/c/161421
Reviewed-by: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>
| C++ | bsd-3-clause | google/skia,rubenvb/skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,Hikari-no-Te... | |
7bbb8c58a7c01802dad8b637b6dd6278a0547272 | chapter20/chapter20_ex12.cpp | chapter20/chapter20_ex12.cpp | // Chapter 20, Exercise 12: complete the definition of list from 20.4.1-2 and
// get the high() example to run. Allocate a Link to represent one past the end.
#include "../lib_files/std_lib_facilities.h"
template<class Elem> struct Link {
Link(const Elem& v = Elem(), Link* p = 0, Link* s = 0)
:prev(p), su... | Add Chapter 20, exercise 12 | Add Chapter 20, exercise 12
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
3ccaa3b451ba2a5592360f6942bc4439fe488131 | test/Modules/pr21217.cpp | test/Modules/pr21217.cpp | // RUN: not %clang_cc1 -fmodules -fmodule-map-file=does-not-exist.modulemap -verify %s 2>&1 | FileCheck %s
// CHECK: module map file 'does-not-exist.modulemap' not found
| Add test file missed from r223561. | Add test file missed from r223561.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@223595 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
16a8c0c37267dcd9847a591d7f3d857ece6539f5 | week2/problem1/point_2d_v3.cpp | week2/problem1/point_2d_v3.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Point2D {
double x;
double y;
public:
double getX() {
return x;
}
double getY() {
return y;
}
void setX(double newX) {
x = newX;
}
void setY(double newY) {
y = newY;
}
void translate(double dx, double dy) {
... | Add solution to third part of first problem. Replace the structure with class with getters and setters | Add solution to third part of first problem.
Replace the structure with class with getters and setters
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
e7510924c5f681d0aff826d4ed875440d44b1efe | cpp/167_Two_Sum_II_Input_array_is_sorted.cpp | cpp/167_Two_Sum_II_Input_array_is_sorted.cpp | 167. Two Sum II - Input array is sorted
/**
* Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
*
* The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than... | Add Solution for 167. Two Sum II - Input array is sorted | Add Solution for 167. Two Sum II - Input array is sorted
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
2f180a52a5a9be4d55ab083237911360faf50b8d | DataStructures/Stacks/minimum_stack.cpp | DataStructures/Stacks/minimum_stack.cpp | /**
* To implement minimum stack that returns minimum element in O(1) time
*/
#include <iostream>
#include <stack>
using namespace std;
class MinStack {
private:
stack<int> min;
stack<int> s;
public:
void push(int data) {
if (min.empty()) {
min.push(data);
} else if (data < min.top()) {
min... | Implement minimum stack that will return the minimum element from the entire stack in O(1) time | Implement minimum stack that will return
the minimum element from the entire stack
in O(1) time
Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
| C++ | apache-2.0 | WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace | |
d4846f9cc30e5e83d9dda2aa4086cd6f6c53b177 | practicum/queue/dequeue-min.cpp | practicum/queue/dequeue-min.cpp | #include <iostream>
#include <queue>
using std::cout;
using std::queue;
int dequeue_min(queue<int>& q) {
unsigned long queue_size = q.size();
int min = q.front();
q.pop();
for (int i = 1; i < queue_size; ++i) {
int front = q.front();
q.pop();
if (front < min) {
q.push(min);
min = fr... | Add dequeue min task solution | Add dequeue min task solution
| C++ | mit | dimitaruzunov/data-structures-fmi-2016 | |
faa296bc7c95a878d2ee3be1024a84d1b82b420c | length_of_period_of_1_by_n.cpp | length_of_period_of_1_by_n.cpp | /*
* Copyright 2010, NagaChaitanya Vellanki
*
* Author NagaChaitanya Vellanki
*
* Print length of the period of decimal representation of 1/n for n > 1
*/
#include <inttypes.h>
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
int32_t n = 0;
cout << "Enter n(n > 1)" << endl;
cin >... | Add period length of 1/n | Add period length of 1/n
| C++ | isc | chaitanyav/fun_code,chaitanyav/fun_code | |
fa8bc82160092ea23f9fb33abffd41da618e04be | test18_26_27.cpp | test18_26_27.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
struct Base1 {
void print(int i) const {
cout << "Base1::print(int)" << endl;
}
protected:
int ival;
double dval;
char cval;
private:
int *id;
};
struct Base2 {
void print(double d) c... | Add solution for chapter 18, test 26, 27 | Add solution for chapter 18, test 26, 27 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
4556888c07e844ad418473372010a358ce76e319 | 1-common-tasks/output-streams/write-class-type-objects-to-stream.cpp | 1-common-tasks/output-streams/write-class-type-objects-to-stream.cpp | // Write class type objects to a stream
#include <iostream>
class foo
{
public:
foo(int x)
: x(x)
{ }
friend std::ostream& operator<<(std::ostream& stream,
foo const& f);
private:
int x;
};
std::ostream& operator<<(std::ostream& stream,
foo ... | Add "write class type objects" sample | Add "write class type objects" sample
| C++ | cc0-1.0 | tmwoz/CppSamples-Samples,brunotag/CppSamples-Samples,mnpk/CppSamples-Samples,vjacquet/CppSamples-Samples,rollbear/CppSamples-Samples,sftrabbit/CppSamples-Samples,darongE/CppSamples-Samples,thatbrod/CppSamples-Samples | |
05f3b0f1de1cac1e118413fa3966f7d65e3f6878 | recipes/yaml-cpp/test/main.cpp | recipes/yaml-cpp/test/main.cpp | #include <iostream>
// yaml-cpp includes
#include "yaml-cpp/yaml.h"
int main()
{
YAML::Emitter out;
out << "Hello, World!";
std::cout << "Here's the output YAML:\n" << out.c_str();
return 0;
}
| #include <iostream>
#include <yaml-cpp/yaml.h>
int main()
{
YAML::Emitter out;
out << "Hello, World!";
std::cout << "Here's the output YAML:\n" << out.c_str();
return 0;
}
| Remove comment. Just a trigger for a new build. | Remove comment. Just a trigger for a new build.
| C++ | bsd-3-clause | kwilcox/staged-recipes,SylvainCorlay/staged-recipes,Juanlu001/staged-recipes,patricksnape/staged-recipes,dschreij/staged-recipes,asmeurer/staged-recipes,jochym/staged-recipes,scopatz/staged-recipes,Juanlu001/staged-recipes,synapticarbors/staged-recipes,isuruf/staged-recipes,ReimarBauer/staged-recipes,igortg/staged-reci... |
04573025311590897474b08ca729d1b65362f353 | src/parfil/main.cc | src/parfil/main.cc | #include <cmath>
#include <memory>
#include <vector>
#include <parfil/robot.h>
#include <parfil/filter.h>
void TestCase1(std::vector<parfil::Motion>& motions, std::vector<parfil::Measurement>& measurements) {
// fill in motions
int num_motions = 8;
motions.resize(num_motions);
for (int i=0; i<num_motions; ++i)... | Add toy example showing use of the interface | Add toy example showing use of the interface
| C++ | mit | iglesias/parfil,iglesias/parfil-graphlab | |
d58f63c9f12f7121ee7eade3c92983fa2520996d | pnm_src/bmp_write.cc | pnm_src/bmp_write.cc | #include "cvd/internal/load_and_save.h"
#include "cvd/internal/io/bmp.h"
#include <vector>
using namespace std;
using namespace CVD;
namespace CVD{
namespace BMP{
void writeBMPHeader(unsigned int width, unsigned int height, unsigned int channels, std::ostream& out);
class WritePimpl
{
public:
WritePimpl(ostream&... | Add missing file from the previous commit. | Add missing file from the previous commit.
| C++ | lgpl-2.1 | oneminot/libcvd,oneminot/libcvd,oneminot/libcvd | |
868bd3047d2d770512a3df68c84df509b520b9ce | test/Modules/using-decl-inheritance.cpp | test/Modules/using-decl-inheritance.cpp | // RUN: %clang_cc1 -x c++ -fmodules -fmodules-local-submodule-visibility -fmodules-cache-path=%t %s -verify
// RUN: %clang_cc1 -x c++ -fmodules -fmodules-cache-path=%t %s -verify
// expected-no-diagnostics
#pragma clang module build A
module A { }
#pragma clang module contents
#pragma clang module begin A
struct A ... | Add test for using declaration in classes. | [modules] Add test for using declaration in classes.
Summary:
This adds a test that checks if the using declaration in classes still works as intended with modules.
The motivation for this is that we tried to add a shortcut to `removeDecl` that would skip the removal of declarations from the lookup table if they are ... | C++ | apache-2.0 | 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,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-cl... | |
13c06850a226240302ed08a1b133e3a4ee6592f3 | TESTS/mbedmicro-rtos-mbed/malloc/main.cpp | TESTS/mbedmicro-rtos-mbed/malloc/main.cpp | #include "mbed.h"
#include "test_env.h"
#include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
#define NUM_THREADS 5
#define THREAD_STACK_SIZE 256
DigitalOut led1(LED1);
volatile bool should_exit = false;
volatile bool allocation_failure = false;
void tas... | Add a test for thread-safe malloc | Add a test for thread-safe malloc
Add a test to repeatedly malloc and free from different threads to
test if these functions are thread safe.
| C++ | apache-2.0 | screamerbg/mbed,mbedmicro/mbed,kl-cruz/mbed-os,theotherjimmy/mbed,screamerbg/mbed,j-greffe/mbed-os,Archcady/mbed-os,andcor02/mbed-os,arostm/mbed-os,catiedev/mbed-os,bulislaw/mbed-os,andreaslarssonublox/mbed,pradeep-gr/mbed-os5-onsemi,YarivCol/mbed-os,tung7970/mbed-os,cvtsi2sd/mbed-os,RonEld/mbed,fahhem/mbed-os,maximmbe... | |
a91a9ce74fbc2b2bf486e561e5601ad438b047a9 | test/correctness/interleave_x.cpp | test/correctness/interleave_x.cpp | #include <stdio.h>
#include "Halide.h"
using namespace Halide;
int main(int argc, char **argv) {
//int W = 64*3, H = 64*3;
const int W = 128, H = 48;
Image<uint16_t> in(W, H, 2);
for (int c = 0; c < 2; c++) {
for (int y = 0; y < H; y++) {
for (int x = 0; x < W; x++) {
... | Add test failing on hexagon. | Add test failing on hexagon.
| C++ | mit | psuriana/Halide,ronen/Halide,kgnk/Halide,kgnk/Halide,ronen/Halide,jiawen/Halide,kgnk/Halide,kgnk/Halide,ronen/Halide,psuriana/Halide,jiawen/Halide,jiawen/Halide,kgnk/Halide,jiawen/Halide,jiawen/Halide,jiawen/Halide,psuriana/Halide,ronen/Halide,ronen/Halide,kgnk/Halide,ronen/Halide,jiawen/Halide,kgnk/Halide,ronen/Halide... | |
e24a9a2a4654bcfa882aa4580567064508e715bb | 02-Medium/War/main.cpp | 02-Medium/War/main.cpp | #ifndef MAIN_CPP
#define MAIN_CPP
#include <algorithm>
#include <vector>
#include <iostream>
int main() {
std::vector<char> cards = {'1','1','1','1','2','2','2','2','3','3','3','3','4','4','4','4','5','5','5','5','6','6','6','6','7','7','7','7','8','8','8','8','9','9','9','9','T','T','T','T','J','J','J','J','Q','Q',... | Add string generator for war | Add string generator for war
| C++ | mit | acmatku/ku-ipc-2016,acmatku/ku-ipc-2016,acmatku/ku-ipc-2016,acmatku/ku-ipc-2016 | |
e832c0a670efb845d23e28b0925cb41c20385da8 | arrays_with_auto.cpp | arrays_with_auto.cpp | #include <array>
// C++17 only
// requires template argument deduction for class templates
namespace std
{
template <typename... T>
array(T... t) -> array<std::common_type_t<T...>, sizeof...(t)>;
}
int main()
{
int a[] = {1,2,3};
int b[] {4,5,6};
// See: https://stackoverflow.com/q/7107606
//... | Add explanation about auto and arrays. | Add explanation about auto and arrays.
| C++ | mit | mpoullet/cpp-snippets,mpoullet/cpp-snippets | |
55bd4260728ded2876dc48b9adc11676e89ecb9d | C++/199_Binary_Tree_Right_Side_View.cpp | C++/199_Binary_Tree_Right_Side_View.cpp | #include <stddef.h>
// 199 Binary Tree Right Side View
/**
* Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
*
* For example:
* Given the following binary tree,
* 1 <---
* / \
* 2 3 <---
* \ ... | Add 199 Binary Tree Right Side View | Add 199 Binary Tree Right Side View
| C++ | mit | FreeTymeKiyan/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res | |
be71e3b28a1440fe08c45ecbe25899d99235c309 | test/CodeGenCXX/vtable-layout-abi-examples.cpp | test/CodeGenCXX/vtable-layout-abi-examples.cpp | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts 2>&1 | FileCheck %s
/// Examples from the Itanium C++ ABI specification.
/// http://www.codesourcery.com/public/cxx-abi/
namespace Test1 {
// This is from http://www.codesourcery.com/public/cxx-abi/cxx-vtable-ex.html
// CHEC... | Add tests from the Itanium C++ ABI spec. | Add tests from the Itanium C++ ABI spec.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@96586 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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,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/cl... | |
ec3966c0bd8c49f537e45b40df11ca374012ae59 | test/opengl/inline_reduction.cpp | test/opengl/inline_reduction.cpp | #include "Halide.h"
using namespace Halide;
int main() {
// This test must be run with an OpenGL target
const Target &target = get_jit_target_from_environment();
if (!target.has_feature(Target::OpenGL)) {
fprintf(stderr, "ERROR: This test must be run with an OpenGL target, e.g. by setting HL_JIT_... | Add failing opengl test using an inline reduction | Add failing opengl test using an inline reduction
Former-commit-id: 3bfba4f85346721aa33cea58841060f01b759019 | C++ | mit | darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide | |
c4b5ae2776dd5f0613663a2448027d4dea87a6eb | examples/iteration_over_variables.cpp | examples/iteration_over_variables.cpp | /*
Example of iterating over cell's variables using boost::mpl.
Copyright 2015 Ilja Honkonen
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyr... | Add an example of iteration over (some) variables in a cell with boost::mpl. | Add an example of iteration over (some) variables in a cell with boost::mpl.
| C++ | bsd-3-clause | nasailja/gensimcell | |
014db9ddf7782457fd761d90c4a6ba100ff24a43 | unittests/ADT/SmallStringTest.cpp | unittests/ADT/SmallStringTest.cpp | //===- llvm/unittest/ADT/SmallStringTest.cpp ------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | Add SmallString unit test. - Patch by Ryan Flynn! | Add SmallString unit test.
- Patch by Ryan Flynn!
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@76081 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple... | |
687ef458249b1d42aa81ecb5d10745da3643d346 | tests/unit/lineWrapTests.cpp | tests/unit/lineWrapTests.cpp | #include "catch.hpp"
#include "tangram.h"
#include "style/textStyle.h"
#include "alfons/textBatch.h"
#include "alfons/textShaper.h"
#include "alfons/atlas.h"
#include "alfons/alfons.h"
#include "alfons/fontManager.h"
#include "text/lineWrapper.h"
#include <memory>
namespace Tangram {
struct ScratchBuffer : public ... | Add unit tests for alfons | wip: Add unit tests for alfons
| C++ | mit | tangrams/tangram-es,cleeus/tangram-es,cleeus/tangram-es,cleeus/tangram-es,tangrams/tangram-es,tangrams/tangram-es,tangrams/tangram-es,quitejonny/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,quitejonny/tangram-es,quitejonny/tangram-es,cleeus/tangram-es,quitejonny/tangram-es,tangrams/tangram-es,cleeus/tangram-es,ta... | |
38c76081a715aba3622d93d994badb9454cd5b81 | examples/move_item.cpp | examples/move_item.cpp |
// Copyright 2016 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 MoveItem operation | Add example for MoveItem operation
| C++ | apache-2.0 | m-Schlitzer/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp | |
91b00d779c455c60c6dbe0bb79ad03986d7ae8cc | unittest/powerset/element_generator_test.cpp | unittest/powerset/element_generator_test.cpp | #include <boost/test/unit_test.hpp>
#include "../unittest_config.h"
#include "test_element.h"
#include "clotho/mutation/element_generator.hpp"
typedef clotho::powersets::element_key_of< test_element >::key_type key_type;
struct test_key_generator {
key_type operator()( key_type & k ) { return k; }
}... | Test whether element generator template works | Test whether element generator template works
| C++ | apache-2.0 | putnampp/clotho,putnampp/clotho,putnampp/clotho | |
38ba62bee5418c30a9c46d2d431e9a1a7a973bec | deal.II/base/source/config.cc | deal.II/base/source/config.cc | //---------------------------------------------------------------------------
// $Id$
// Version: $Name$
//
// Copyright (C) 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/l... | //---------------------------------------------------------------------------
// $Id$
// Version: $Name$
//
// Copyright (C) 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/l... | Remove a DEAL_II_NAMESPACE_CLOSE which has been added accidentally. | Remove a DEAL_II_NAMESPACE_CLOSE which has been added accidentally.
git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@14086 0785d39b-7218-0410-832d-ea1e28bc413d
| C++ | lgpl-2.1 | EGP-CIG-REU/dealii,mac-a/dealii,shakirbsm/dealii,pesser/dealii,lue/dealii,msteigemann/dealii,YongYang86/dealii,nicolacavallini/dealii,naliboff/dealii,johntfoster/dealii,andreamola/dealii,ESeNonFossiIo/dealii,naliboff/dealii,angelrca/dealii,kalj/dealii,kalj/dealii,rrgrove6/dealii,ibkim11/dealii,spco/dealii,mac-a/dealii,... |
b09450204e742f22dd05da444fb0dcfbd6831de7 | base/common_test.cpp | base/common_test.cpp | // Copyright (c) 2011 Timur Iskhodzhanov and MIPT students. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gtest/gtest.h"
#include "base/common.h"
TEST(CommonTest, DebugOrRelease) {
#ifdef NDEBUG
printf("NDEBUG defined, this is... | Add a test that prints out the current build type | Add a test that prints out the current build type | C++ | bsd-3-clause | denfromufa/mipt-course,denfromufa/mipt-course,denfromufa/mipt-course,denfromufa/mipt-course | |
c05babe58ca0fe825a2c4d362f132f409217e39a | test/CXX/except/except.spec/p14.cpp | test/CXX/except/except.spec/p14.cpp | // RUN: %clang_cc1 -fexceptions -verify %s
struct A { };
struct B { };
struct X0 {
virtual ~X0() throw(A); // expected-note{{overridden virtual function is here}}
};
struct X1 {
virtual ~X1() throw(B); // expected-note{{overridden virtual function is here}}
};
struct X2 : public X0, public X1 { }; // expected-... | Add Sema test case for exception-specifiers implicitly added to destructors. | Add Sema test case for exception-specifiers implicitly added to destructors.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@107395 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,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,apple/swift-clang,llvm-mirror/cl... | |
97204552708cda46ce4adb27e81f6d295f02fec1 | test/Index/complete-ctor-inits.cpp | test/Index/complete-ctor-inits.cpp | // The run lines are below, because this test is line- and
// column-number sensitive.
template<typename T>
struct X {
X(T);
};
struct Virt { };
struct Y : virtual Virt { };
struct Z : public X<int>, public Y {
Z();
int a, b, c;
};
Z::Z() : ::X<int>(0), Virt(), a() { }
// RUN: c-index-test -code-completion-... | Add missing test case for constructor-initializer code completions | Add missing test case for constructor-initializer code completions
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@112453 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/cl... | |
1100afad780eeeb0584a1a21ec7ea821110292df | ExampleSFMLIntegration.cpp | ExampleSFMLIntegration.cpp | #include <SFML\Graphics.hpp>
#include "Vector2d.h"
int main()
{
sf::CircleShape object(15, 3);
sf::Vector2f vector2f; //original compatible vector2f object from SFML
Vector2d vector2d; //vector from Vector2d class, if you want to compute vector first you must create vector object, becouse it have float type comp... | Add a Example Integrations with SFML graphics library | Add a Example Integrations with SFML graphics library
| C++ | apache-2.0 | mrtycjan/Vector2d,mrtycjan/Vector2d | |
f150e7f7d0a49bf9d5595c3424605e7c658b33f4 | src/common/species_dialog.cc | src/common/species_dialog.cc | #include "fish_detector/common/species_dialog.h"
#include "ui_species_dialog.h"
namespace fish_detector {
SpeciesDialog::SpeciesDialog(QWidget *parent)
: QDialog(parent)
, ui_(new Ui::SpeciesDialog) {
ui_->setupUi(this);
}
void SpeciesDialog::on_ok_clicked() {
}
void SpeciesDialog::on_cancel_clicked() {
}
v... | Add framework for source file | Add framework for source file
| C++ | mit | BGWoodward/FishDetector | |
c79b792fac2d5c03afbfda86630072f850c23824 | specimen6/main.cpp | specimen6/main.cpp | // Attempting to replicate the CFG from Figure 11.25 of Aho and Ullman 1972.
#include <iostream>
int main() {
unsigned n;
std::cin >> n;
int *A = new int[n];
int i = -1;
int sum = 0;
_2:
++i;
_3:
if (A[i] % 2 == 0) {
goto _4;
}
_7:
sum += A[i];
goto _2;
_4:
if (i < n && A[i] % 3 == 0) {
... | Add Example 11.34 from Aho'72 | Add Example 11.34 from Aho'72
| C++ | mit | smanilov/loop-examples,smanilov/loop-examples | |
43d2820e2f5a45c39604feaed7a23f05e7889b5d | test/SemaCXX/constexpr-turing-cxx2a.cpp | test/SemaCXX/constexpr-turing-cxx2a.cpp | // RUN: %clang_cc1 -verify -std=c++2a %s
// expected-no-diagnostics
const unsigned halt = (unsigned)-1;
enum Dir { L, R };
struct Action {
bool tape;
Dir dir;
unsigned next;
};
using State = Action[2];
// An infinite tape!
struct Tape {
constexpr Tape() = default;
constexpr ~Tape() {
if (l) { l->r = nu... | Add a C++20 version of the existing turing machine test. | [c++20] Add a C++20 version of the existing turing machine test.
Unlike the C++11 version, this one uese mutable state and dynamic
allocation instead of a carefully balanced and ever-accumulating pile of
temporaries.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@373281 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang | |
c616397386057a6a565ef74263297ca510b7136d | ui/message_center/message_center.cc | ui/message_center/message_center.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 "ui/message_center/message_center.h"
#include "base/observer_list.h"
#include "ui/message_center/message_center_impl.h"
namespace message_c... | // 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 "ui/message_center/message_center.h"
#include "base/observer_list.h"
#include "ui/message_center/message_center_impl.h"
namespace message_c... | Initialize the global message center instance to NULL | Initialize the global message center instance to NULL
BUG=Uninitialized global message center instance leads to trouble when
modifying gyps.
Review URL: https://codereview.chromium.org/444463007
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@287763 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,dednal/chromium.src,littlstar/chromium.src,Jonekee/chromium.src,TheTypoMaste... |
861e0b81772ec7b638661584ae20af3ee2302bdc | src/lib/arch/avx2/Avx2Internals.cpp | src/lib/arch/avx2/Avx2Internals.cpp | // Copyright 2014 Irfan Hamid
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writ... | Check in avx2 internals in new directory | Check in avx2 internals in new directory
| C++ | apache-2.0 | irfanhamid/khyber,irfanhamid/khyber | |
2ad076115f1a3502dbf4e8f98aceff374830be0e | test/exception_object_alignment.2.pass.cpp | test/exception_object_alignment.2.pass.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
//
//===---------------------------... | Add a test for invalid assumptions on the alignment of exceptions | [libcxxabi] Add a test for invalid assumptions on the alignment of exceptions
rdar://problem/49864414
git-svn-id: 6a9f6578bdee8d959f0ed58970538b4ab6004734@361039 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi,llvm-mirror/libcxxabi | |
294190e3238e60ead3af7a4baedc36d406a31cb5 | CP/PCCA_practices/2015_summer/string/PA.cpp | CP/PCCA_practices/2015_summer/string/PA.cpp | /*************************************************************************
> File Name: PA.cpp
> Author: Gavin Lee
> School: National Chiao Tung University
> Team: NCTU_Ragnorok
> Mail: sz110010@gmail.com
> Created Time: Mon 04 Apr 2016 10:33:00 PM CST
************************************************************... | Add PCCA summer camp practice | Add PCCA summer camp practice
| C++ | mit | calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming,calee0219/Programming | |
5a51cafbf27c79618c32433ed85e3415966f55fd | exercises/06/same-prime-factors.cpp | exercises/06/same-prime-factors.cpp | #include <iostream>
using std::cout;
using std::boolalpha;
bool is_factor(int factor, int number) {
return number % factor == 0;
}
bool is_prime(int number) {
if (number == 2) {
return true;
}
for (int i = 2; i < number; ++i) {
if (is_factor(i, number)) {
return false;
}
}
return true... | Add solution to same prime factors problem | Add solution to same prime factors problem
| C++ | mit | dimitaruzunov/up-2016 | |
4e35140ad71a2e2e3c2a38a95e06824b6667f064 | solution082.cpp | solution082.cpp | /**
* Remove Duplicates from Sorted List II
*
* cpselvis(cpselvis@gmail.com)
* Oct 9th, 2016
*/
#include<iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
if (head... | Remove Duplicates from Sorted List II. | Remove Duplicates from Sorted List II.
| C++ | mit | cpselvis/leetcode | |
52fc3a441ce66c8d0c5d0c59548956fec5fce77e | test/asan/TestCases/use-after-scope-temp2.cc | test/asan/TestCases/use-after-scope-temp2.cc | // RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
struct IntHolder {
const IntHolder& Self() const {
return *this;
}
int val = 3;
};
const IntHolder *saved;
int main(int argc, char *argv[]) {
saved = &IntHolder().Self();
in... | Add test which detects bugs undetectable before r288563 | [asan] Add test which detects bugs undetectable before r288563
Reviewers: kcc, eugenis
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D27583
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@289090 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 | |
30bcc7cda8ac0e2492c8625a9602eccd24d01110 | greedy/1784.cc | greedy/1784.cc | class Solution {
public:
bool checkOnesSegment(string s) {
bool flag = false;
bool cont_flag = false;
for (const auto &c : s) {
if (c == '1') {
if (flag && !cont_flag) {
return false;
}
flag = true;
... | Check if Binary String Has at Most One Segment of Ones | Check if Binary String Has at Most One Segment of Ones
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
bd06247bcef56d4bb90d32751d434e28110d990d | gl_secondary_frag_data/Main.cpp | gl_secondary_frag_data/Main.cpp | #include "utils/GLFWApp.h"
#include <string>
#include "utils/Shader.h"
class UniformOrder: public GLFWApp {
public:
void Init(GLFWwindow*) override {
const std::string vs =
R"(in vec4 a_position;
void main(){
gl_Position = a_position;
... | Add secondary frag data test | Add secondary frag data test
| C++ | mit | Kangz/GLDriverBugs,Kangz/GLDriverBugs | |
80b8a008de76c8788e0b5add64b41cacddd8ae48 | Primes/is_prime.cpp | Primes/is_prime.cpp | #include <iostream>
#include <math.h>
using namespace std;
typedef long long ll;
bool is_prime(ll n){
if (n<=1) return false;
if (n==2) return true;
if (n%2==0) return false;
ll root = sqrt(n);
for (int i=3; i<= root; i+=2){
if(n%i == 0 )
return false;
}
return true;
... | Add folder for storage the problem with primes. | Add folder for storage the problem with primes.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
11403124b67616e4f9eb3989894a9c67643ab30b | src/ch02/linklist_test2.cpp | src/ch02/linklist_test2.cpp | ///////////////////////////////////////
/// file: linklist_test.cpp
///////////////////////////////////////
#include <iostream>
#include "linklist.h"
using namespace std;
///
/// 打印链表
///
template<typename T>
void PrintList(LinkList<T> L)
{
cout << "(";
auto p = L->next;
while(p) {
cout << " " << ... | Add test for locate and traverse of linklist | Add test for locate and traverse of linklist
| C++ | mit | zhuangbo/ds-cpp,zhuangbo/ds-cpp,zhuangbo/ds-cpp,zhuangbo/ds-cpp | |
34981b868914d077b10ec9147801328674d5702c | src/planner/main_action_planner/src/request_posture.cpp | src/planner/main_action_planner/src/request_posture.cpp | #include "impl_request_posture.hpp"
static RequsetPosture* pattern = new PatternRequestPosture;
static RequestPosture* torajectoy = new TorajectoryRequestPosture;
std::map<std::string, RequestPosture*> RequestPostureFactory::reqs = {{"pattern", pattern},
... | Add request posture cpp, and figure of req factory | Add request posture cpp, and figure of req factory
| C++ | mit | agrirobo/arcsys2,agrirobo/arcsys2 | |
70cab433727219b395167d339e7e58347a9d8a96 | tests/lexer/tokenize_with_exceptions.cpp | tests/lexer/tokenize_with_exceptions.cpp | #include "../../source/thewizardplusplus/wizard_parser/lexer/tokenize.hpp"
#include "../../source/thewizardplusplus/wizard_parser/lexer/token.hpp"
#include "../vendor/catch/catch.hpp"
#include <regex>
TEST_CASE("lexer::tokenize() function with exceptions", "[lexer]") {
using namespace thewizardplusplus::wizard_parser... | Add the `lexer::tokenize()` function with exceptions: cover it with tests | Add the `lexer::tokenize()` function with exceptions: cover it with tests
| C++ | mit | thewizardplusplus/wizard-parser,thewizardplusplus/wizard-parser | |
a07fc3a3d807102edfabcfdf861e701d2a74d4ed | C++/096_Unique_Binary_Search_Trees.cpp | C++/096_Unique_Binary_Search_Trees.cpp | // 96 Unique Binary Search Trees
/**
* Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
*
* For example,
* Given n = 3, there are a total of 5 unique BST's.
*
* 1 3 3 2 1
* \ / / / \ \
* 3 2 1 1 3 2
* ... | Add 96 Unique Binary Search Trees | Add 96 Unique Binary Search Trees
| C++ | mit | bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res | |
f221d161ae559ca0395fa5920c36c4c4a688e380 | test/SemaCXX/constexpr-duffs-device.cpp | test/SemaCXX/constexpr-duffs-device.cpp | // RUN: %clang_cc1 -std=c++1y -verify %s
// expected-no-diagnostics
constexpr void copy(const char *from, unsigned long count, char *to) {
unsigned long n = (count + 7) / 8;
switch(count % 8) {
case 0: do { *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to... | Add another C++14 constexpr test case. | Add another C++14 constexpr test case.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@187096 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl... | |
17ef0885507ad1d460d60d5fc8daf753c0ef5949 | tests/set_generate_terms_test.cc | tests/set_generate_terms_test.cc | /*
* Copyright (C) 2015 deipi.com LLC and contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* ri... | Test for generate terms was added | Test for generate terms was added
| C++ | mit | Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand | |
c387f4b0844a03252541db3e2086d9230150608f | tests/unit/linalg/test_cg_indefinite.cpp | tests/unit/linalg/test_cg_indefinite.cpp | // Copyright (c) 2010-2020, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
// This file is part of the MFEM library. For more information and source code
// availability visit ht... | Add (failing) unit test to demonstrate CGSolver bug with indefinite preconditioner. | Add (failing) unit test to demonstrate CGSolver bug with indefinite preconditioner.
| C++ | bsd-3-clause | mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem | |
dd621796bd14e92bfe632db8c110543cd4cc7c5b | src/tests/test-folderview.cpp | src/tests/test-folderview.cpp | #include <QApplication>
#include <QMainWindow>
#include <QToolBar>
#include <QDir>
#include <QDebug>
#include "../core/folder.h"
#include "../foldermodel.h"
#include "../folderview.h"
#include "../cachedfoldermodel.h"
#include "../proxyfoldermodel.h"
#include "../pathedit.h"
int main(int argc, char** argv) {
QAppl... | Add the missing test case for folder view. | Add the missing test case for folder view.
| C++ | lgpl-2.1 | lxde/libfm-qt,vc-01/libfm-qt,lxde/libfm-qt,vc-01/libfm-qt | |
596ba63f80bbada00393f984c688a5e157ce8410 | test/MapTest.cpp | test/MapTest.cpp | #include <gtest/gtest.h>
#include <array>
#include <memory>
#include "Map.hpp"
struct MapTest : public :: testing :: Test{
std::shared_ptr<Map> setmap = std::make_shared<Map>();
};
TEST_F(MapTest, LoadMapSwitchTest) {
EXPECT_EQ(10,(setmap->getGridmap(1)).size());
EXPECT_FALSE((setmap->getGridmap(1)).empty()... | Add unit test for Map class -User Story 8 | Add unit test for Map class -User Story 8
| C++ | mit | zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar,zzjkf2009/Midterm_Astar | |
151b497067b300af9d3da4487ce5f92125ff831b | test/asan/TestCases/use-after-scope-chars.cc | test/asan/TestCases/use-after-scope-chars.cc | // RUN: %clangxx_asan -O1 -mllvm -asan-use-after-scope=1 %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// XFAIL: *
// FIXME: This works only for arraysize <= 8.
char *p = 0;
int main() {
{
char x[1024] = {};
p = x;
}
return *p; // BOOM
}
| Add another failing use-after-scope test | Add another failing use-after-scope test
Summary:
Use after scope is not detected if array larger then 8 bytes.
Subscribers: kubabrecka
Differential Revision: http://reviews.llvm.org/D19572
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@268330 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 | |
6b8a78313bd38dc6581d590023846aac66070e23 | ports/joulecoin/files/patch-src_rpcclient.cpp | ports/joulecoin/files/patch-src_rpcclient.cpp | --- src/rpcclient.cpp.orig 2017-05-18 01:39:08 UTC
+++ src/rpcclient.cpp
@@ -39,7 +39,7 @@ Object CallRPC(const string& strMethod,
// Connect to localhost
bool fUseSSL = GetBoolArg("-rpcssl", false);
asio::io_service io_service;
- ssl::context context(io_service, ssl::context::sslv23);
+ ssl::cont... | Fix build for boost 1.66 | Fix build for boost 1.66
| C++ | bsd-2-clause | tuaris/FreeBSD-Coin-Ports,tuaris/FreeBSD-Coin-Ports,tuaris/FreeBSD-Coin-Ports | |
fbd1f82d2775215c7a97ef4847aca75936ce9fd3 | test/Analysis/lambdas-generalized-capture.cpp | test/Analysis/lambdas-generalized-capture.cpp | // RUN: %clang_cc1 -std=c++14 -fsyntax-only -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -verify %s
int clang_analyzer_eval(int);
void generalizedCapture() {
int v = 7;
auto lambda = [x=v]() {
return x;
};
int result = lambda();
clang_analyzer_eval(result == 7); // expected-warning {{T... | Add tests for generalized lambda capture (C++14). NFC. | [analyzer] Add tests for generalized lambda capture (C++14). NFC.
Add tests demonstrating that the analyzer supports generalized lambda capture. This
support falls out naturally from the work Gábor Horváth did adding C++11 lambdas to
the analyzer.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@254114 91177308-0... | C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/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,llvm-mirror/clang,apple/swift-cl... | |
bb4716e4dc62658d570f4ce771173a5e027839ff | Algorithms/Backtracking/knight_tour.cpp | Algorithms/Backtracking/knight_tour.cpp | #include <iostream>
#define N 8
using namespace std;
// A utility function to check the valid indexes
// of N*N chess board
bool isSafe(int x, int y, int sol[N][N]) {
return (x >= 0
&& y >= 0
&& x < N
&& y < N
&& sol[x][y] == -1);
}
/**
* Print the solution
*/
void printSolution(int sol[N][N]) {
for (in... | Implement Knight in Tours problem | Implement Knight in Tours problem
Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
| C++ | apache-2.0 | WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace | |
1c80b522e45243d91838bb9b549f844b762cd2bf | test/SemaCXX/warn-variable-not-needed.cpp | test/SemaCXX/warn-variable-not-needed.cpp | // RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
namespace test1 {
static int abc = 42; // expected-warning {{variable 'abc' is not needed and will not be emitted}}
template <typename T>
int foo(void) {
return abc;
}
}
namespace test2 {
struct bah {
};
namespace {
struct foo : bah {
stati... | Add a basic testcase for the "variable is not needed" warning and one that regressed in r168519. | Add a basic testcase for the "variable is not needed" warning and one that
regressed in r168519.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@168563 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... | |
e8d3a828c72c17f5004b8c5324da8d11056e5a03 | code/mathematics/numeric_integration.cpp | code/mathematics/numeric_integration.cpp | double integrate(double (*f)(double), double a, double b, double delta = 1) {
if(abs(a - b) < delta) {
return (b-a)/6 * (f(a) + 4 * f((a+b)/2) + f(b));
}
return integrate(f, a, (a+b)/2, delta) + integrate(f, (a+b)/2, b, delta);
}
| Add numeric integration using Simpson's method. | Add numeric integration using Simpson's method.
| C++ | mit | nikhiljangam/CompetitiveProgramming,goswamia/CompetitiveProgramming,SuprDewd/CompetitiveProgramming,nikhiljangam/CompetitiveProgramming,goswamia/CompetitiveProgramming,nikhiljangam/CompetitiveProgramming,goswamia/CompetitiveProgramming,goswamia/CompetitiveProgramming,SuprDewd/CompetitiveProgramming,SuprDewd/Competitive... | |
c63188ee73bbeb021c17215a72afad2ac4b4d0da | subjects/ADMPC201601/avr_hex_decoder.cpp | subjects/ADMPC201601/avr_hex_decoder.cpp | #inlude <bits/stdc++.h>
using namespace std;
void parse_cmd(string str, string cmd) {
// Clear whatever cmd contains
cmd = "";
}
void execute_cmd(string cmd) {
}
int main() {
string hexLine;
string parsedCmd;
int err = 0;
while( !err ) {
// Read each line from .hex file
getline(cin, hexLine);
// Now... | Create initial file version for AVR instruccions parser | Create initial file version for AVR instruccions parser
* At least there will be two methods one for .hex -> cmds
* And from cmds to execute them
Signed-off-by: Ulises Mendez Martinez <64c66da2351c01d4afecd1591810410a1c01865c@gmail.com>
| C++ | mit | Gansito144/CSM,Gansito144/CSM,Gansito144/CSM,Gansito144/CSM,Gansito144/CSM,Gansito144/CSM,Gansito144/CSM | |
516f60300145fc0e6aec0f5622cadad5b4489cc8 | karum/EditDist.cpp | karum/EditDist.cpp | #include<iostream>
using namespace std;
int main()
{
string s1,s2;
cout<<"Enter the two strings:";
cin>>s1>>s2;
int l1=s1.length();
int l2=s2.length();
int d[l1+1][l2+1];
for(int i=0;i<=l1;i++)
for(int j=0;j<=l2;j++){
if(i==0)
d[0][j]=j;
else if(j==0)
d[i][0]=i;
else if(s1[i-1]==s2[j-1])... | Edit distance between two strings | Edit distance between two strings
| C++ | mit | shivan1b/codes | |
7cd8fb053bce8cb4137538fa769f06b6fb4b1f1b | examples/ucl_cpp.cc | examples/ucl_cpp.cc | #include <iostream>
#include <string>
#include "ucl++.h"
int main(int argc, char **argv)
{
std::string input, err;
input.assign((std::istreambuf_iterator<char>(std::cin)),
std::istreambuf_iterator<char>());
auto obj = ucl::Ucl::parse(input, err);
if (obj) {
std::cout << obj.dump(UCL_EMIT_CONFIG) << std::end... | Add a simple C++ example. | Add a simple C++ example.
| C++ | bsd-2-clause | fichtner/libucl,allanjude/libucl,sdebnath/libucl,fichtner/libucl,vstakhov/libucl,allanjude/libucl,vstakhov/libucl,sdebnath/libucl,allanjude/libucl,fichtner/libucl,allanjude/libucl,sdebnath/libucl,fichtner/libucl,sdebnath/libucl,allanjude/libucl,fichtner/libucl,sdebnath/libucl,vstakhov/libucl,vstakhov/libucl,vstakhov/li... | |
b7d9e5f0004d6e93e7cce377a4f6957c4a150d76 | 191_Number_of_1_Bits.cpp | 191_Number_of_1_Bits.cpp | /**
* link: https://leetcode.com/problems/number-of-1-bits/
*/
class Solution {
public:
int hammingWeight(uint32_t n) {
int res = 0;
while(n)
{
res += (n & 1);
n >>= 1;
}
return res;
}
};
| Add solution for 191. Number of 1 Bits. | Add solution for 191. Number of 1 Bits. | C++ | mit | wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.