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 |
|---|---|---|---|---|---|---|---|---|---|
4cdd7bb8ce5744189a7b068b4e24cd1830eded58 | tutorials/users/tutorial_01/wrapper_tutorial_01.cpp | tutorials/users/tutorial_01/wrapper_tutorial_01.cpp | #include "Halide.h"
#include "wrapper_tutorial_01.h"
#include "tiramisu/utils.h"
#include <cstdlib>
#include <iostream>
int main(int, char **)
{
int N = 10;
Halide::Buffer<int32_t> output(N);
init_buffer(output, (int32_t)9);
std::cout << "Array (after initialization)" << std::endl;
print_buffer(o... | Add wrapper for user tuto 01 | Add wrapper for user tuto 01
| C++ | mit | rbaghdadi/tiramisu,rbaghdadi/COLi,rbaghdadi/ISIR,rbaghdadi/ISIR,rbaghdadi/tiramisu,rbaghdadi/COLi,rbaghdadi/tiramisu,rbaghdadi/tiramisu | |
f4e21b8b00562b4c0ff8923ed6580bef10b30f6f | src/ports/SkMemory_mozalloc.cpp | src/ports/SkMemory_mozalloc.cpp | /*
* Copyright 2011 Google Inc.
* Copyright 2012 Mozilla Foundation
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkTypes.h"
#include "mozilla/mozalloc.h"
#include "mozilla/mozalloc_abort.h"
#include "mozilla/mozalloc_oom.h"
void sk_throw()... | Add a new SkMemory implementation that uses mozalloc instead of malloc | Add a new SkMemory implementation that uses mozalloc instead of malloc
git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@5292 2bbb7eff-a529-9590-31e7-b0007b416f81
| C++ | bsd-3-clause | MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,Frankie-666/color-emoji.s... | |
884dd99514f4e1066e067d72ef73208153c29424 | printAllPaths.cpp | printAllPaths.cpp | // Print all root to leaf paths of a binary tree
/*
Algorithm:
initialize: pathlen = 0, path[1000]
// 1000 is some max limit for paths, it can change
// printPathsRecur traverses nodes of tree in preorder
printPathsRecur(tree, path[], pathlen)
1) If node is not NULL then
a) push data to path array:
... | Print all paths from root to node separately. | Print all paths from root to node separately. | C++ | mit | Raghav1806/Geeks-for-Geeks-DS,Raghav1806/Geeks-for-Geeks-DS | |
906c2cde74261636e66783e370227cf85a3243ac | chapter26/chapter26_ex12.cpp | chapter26/chapter26_ex12.cpp | // Chapter 26, exercise 12: generate random floating point numbers and sort them
// using std::sort(). Measure time used to sort 500,000 doubles and 5,000,000
// doubles.
#include<ctime>
#include<cstdlib>
#include<iostream>
#include<exception>
#include<vector>
#include<limits>
#include<algorithm>
using namespace std;... | Add Chapter 26, exercise 12 | Add Chapter 26, exercise 12
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
060511a0617eba41d7c2b2e48e3caa8414d1d8ef | 412_Fizz_Buzz.cpp | 412_Fizz_Buzz.cpp | /*
* https://leetcode.com/problems/fizz-buzz/
* Write a program that outputs the string representation of numbers from 1 to n.
* But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.
* For numbers which are multiples of both three and five output “Fiz... | Add solution 412. Fizz Buzz | Add solution 412. Fizz Buzz | C++ | mit | wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode | |
5d56905d44c0a30cf0ced68f22c4eb9918f97022 | chrome/test/remoting/webapp_javascript_unittest.cc | chrome/test/remoting/webapp_javascript_unittest.cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/path_service.h"
#include "chrome/test/remoting/qunit_browser_test_runner.h"
#if defined(OS_MACOSX)
#include "base/mac/foundation_util.h"
#... | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/path_service.h"
#include "chrome/test/remoting/qunit_browser_test_runner.h"
#if defined(OS_MACOSX)
#include "base/mac/foundation_util.h"
#... | Disable flakily timing out QUnitBrowserTestRunner.Remoting_Webapp_Js_Unittest | Disable flakily timing out QUnitBrowserTestRunner.Remoting_Webapp_Js_Unittest
TBR=garykac
BUG=504204
Review URL: https://codereview.chromium.org/1204143002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#336081}
| C++ | bsd-3-clause | Just-D/chromium-1,hgl888/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,Chilledheart/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk... |
851250f5d3dec8f8b039210acc4f547a31a959a9 | kissfft_cpp.cc | kissfft_cpp.cc | #include "kiss_fft.h"
#include <complex>
#include <iostream>
#include <vector>
using namespace std;
int main() {
const int nfft = 256;
kiss_fft_cfg fwd = kiss_fft_alloc(nfft, 0, NULL, NULL);
kiss_fft_cfg inv = kiss_fft_alloc(nfft, 1, NULL, NULL);
vector<std::complex<float>> x(nfft, 0.0);
vector<std::complex... | Add an example of Kiss FFT in C++. | Add an example of Kiss FFT in C++.
| C++ | mit | mpoullet/audio-tools,mpoullet/audio-tools,mpoullet/audio-tools,mpoullet/audio-tools,mpoullet/audio-tools | |
4796bbc0280d9d6349b3ab82d64f33c7a2ecc97f | 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
Former-commit-id: aaa460a1537dcca4530d71746113027a3a54c991 | C++ | mit | Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide | |
c37645c6adf20e17910cd26fb68323d34cf78c08 | others/DS/BT/boundary_traversal.cc | others/DS/BT/boundary_traversal.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;
}
void printBoundaryLeft(NODE* root) {
if (root) {
if (root->left) {
prin... | Implement Boundary traversal of tree. | Implement Boundary traversal of tree.
| C++ | apache-2.0 | pshiremath/practice,pshiremath/practice | |
3ff8f66aef95ed8041c5af5f5047fbfe43f74935 | lib/range_minimum_query.cpp | lib/range_minimum_query.cpp | // Verified: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_A
struct RMQ {
int size;
ll default_value;
vector<ll> tree;
RMQ (int n, ll def) {
default_value = def;
size = 1;
while(size < n)size *= 2;
tree = vector<ll>(size * 2 - 1, default_value);
}
void update(int x, ll y){... | Add library (Range Minimum Query) | Add library (Range Minimum Query)
| C++ | mit | utgw/programming-contest,utgw/programming-contest,utgw/programming-contest | |
765601f7a3fe8a92916f110396c2414d85f2e1ff | src/visual.cc | src/visual.cc | #include <string>
#include "configuration.hh"
int from_visual(const std::string& cont, int x) {
if(cont.size() == 0) return 0;
int count = 0,
til = 0;
int numTab = 0;
for(unsigned int i = 0; i < cont.length(); i++) {
unsigned int len;
if(cont[i] == '\t') {
len = TAB... | #include <string>
#include "configuration.hh"
int from_visual(const std::string& cont, int x) {
if(cont.size() == 0) return 0;
int count = 0,
til = 0;
int numTab = 0;
for(unsigned int i = 0; i < cont.length(); i++) {
unsigned int len;
if(cont[i] == '\t') {
len = TAB... | Use prefix ``++`` for objects | Use prefix ``++`` for objects
| C++ | mpl-2.0 | czipperz/vick,czipperz/vick |
6b66362539334859252515497a60c7fd7660d543 | practice04/04.cpp | practice04/04.cpp | #include <stdio.h>
#include <stdlib.h> /* rand(), srand() */
#include <time.h> /* time() */
#include <math.h> /* abs() */
int main(void)
{
srand(time(NULL));
int N, T;
printf("Enter N= "); scanf("%d", &N);
printf("Enter T= "); scanf("%d", &T);
int step = 0;
for(int count = 0; count < T; ++cou... | Add solution of prob 4 | Add solution of prob 4
| C++ | mit | kdzlvaids/problem_solving-pknu-2016,kdzlvaids/problem_solving-pknu-2016 | |
93640fbe842dc8fe8cb3e7e9b9234f82b19e5308 | Amazon/Set-244/max_right_element.cc | Amazon/Set-244/max_right_element.cc | #include <stdio.h>
void PrintNextGreatest(int arr[], int size) {
int temp[size];
int max = -1;
temp[size - 1] = max;
for (int count = size - 2; count >= 0; count--) {
if (arr[count] > max) {
max = arr[count];
}
temp[count] = max;
}
printf("Original array \n");
for (int i = 0; i < size;... | Print max right element in array. | Print max right element in array.
| C++ | apache-2.0 | pshiremath/practice,pshiremath/practice | |
42ca9960c88e390e458acab659f4a36f2ffc0a3b | 381.cpp | 381.cpp | class RandomizedCollection {
public:
map<int,vector<int>> index;
vector<int> nums;
/** Initialize your data structure here. */
RandomizedCollection() {
}
/** Inserts a value to the collection. Returns true if the collection did not already contain the specified element. */
bool insert(int ... | Insert Delete GetRandom O(1) - Duplicates allowed | Insert Delete GetRandom O(1) - Duplicates allowed | C++ | mit | zfang399/LeetCode-Problems | |
21f09948caec5fd11c8c3307e5a5d7a463dbb2ca | chapter21/chapter21_ex05.cpp | chapter21/chapter21_ex05.cpp | // Chapter 21, Exercise 5: redesign and reimplement find() and count() to take
// iterators to first and last elements (no end()), compare results to the
// standard versions - can't return iterator to end() if not found
#include "../lib_files/std_lib_facilities.h"
//-------------------------------------------------... | Add Chapter 21, exercise 5 | Add Chapter 21, exercise 5
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
48d699f0c1bea33e68829c2a8aa254ff8b5ac6ff | test/Lexer/cxx2a_keyword_as_cxx17.cpp | test/Lexer/cxx2a_keyword_as_cxx17.cpp | // RUN: %clang_cc1 %s -verify -fsyntax-only -Wc++2a-compat -std=c++17
#define concept constexpr bool
template<typename T>
concept x = 0;
#undef concept
int concept = 0; // expected-warning {{'concept' is a keyword in C++2a}}
int requires = 0; // expected-warning {{'requires' is a keyword in C++2a}}
| Add missing test for warning added in r310803. | Add missing test for warning added in r310803.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@310978 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,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,apple/swift-clang,apple/swift-cl... | |
85b009e034498295048ae8e2ffb7cdd96e5fb386 | 669.cpp | 669.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:
TreeNode* trimBST(TreeNode* root, int L, int R) {
if(!root) return NULL;
if(roo... | Trim a Binary Search Tree | Trim a Binary Search Tree | C++ | mit | zfang399/LeetCode-Problems | |
2714dd09cfcf43203ed1165b36270dff363a3bab | test/Headers/x86-intrinsics-headers-clean.cpp | test/Headers/x86-intrinsics-headers-clean.cpp | // Make sure the intrinsic headers compile cleanly with no warnings or errors.
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wsystem-headers \
// RUN: -fsyntax-only -x c++ -Wno-ignored-attributes -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wsystem-headers \
// RUN: -fsyntax-only -x c++ -Wno-... | Add a test to verify the x86 intrinsic headers compile cleanly with no warnings or errors. | Add a test to verify the x86 intrinsic headers compile cleanly with no warnings or errors.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@335088 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
0a4dfd12053ea043e13f34e2e6ba4522ab8362a1 | student_scheduling.cpp | student_scheduling.cpp | #include <iostream>
#include <algorithm>
using namespace std;
typedef struct node
{
int time;
int due;
}task_node;
bool cmp(task_node a, task_node b)
{
return a.due < b.due;
}
bool is_possible(task_node *a, int n)
{
sort(a, a + n, cmp);
int sum = 0;
for (int i = 0; i < n; i++) {
if (a[i].time > a[i].due - su... | Add the solution to "Student Scheduling". | Add the solution to "Student Scheduling".
| C++ | mit | clasnake/hackermeter,clasnake/hackermeter | |
7cf69ad21ed1b483b902b0ef0dd1209e5534945b | subjects/Microcomputer-Architecture/cache-simulation/full-back.cpp | subjects/Microcomputer-Architecture/cache-simulation/full-back.cpp | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <deque>
#define MEM_SIZE (1<<20)
#define CACHE_SIZE (1<<8)
#define DATA_SIZE (1<<8)
using namespace std;
int main() {
// Variables used
int dir, cmd, op;
unsigned char dat, wait;
// Plant the seed
srand(time(0));
// Infinit Loop
while(true){... | Add body skeleton for cache simulation program | Add body skeleton for cache simulation program
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 | |
565f8d6cc0c5e5a14fa9a8c93970e23378307ff7 | test/CXX/expr/expr.post/expr.ref/p3.cpp | test/CXX/expr/expr.post/expr.ref/p3.cpp | // RUN: %clang_cc1 -verify -fsyntax-only %s
template<typename T> struct Node {
int lhs;
void splay( )
{
Node<T> n[1];
(void)n->lhs;
}
};
void f() {
Node<int> n;
return n.splay();
}
| Test case for my last fix. | Test case for my last fix.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@103252 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,llvm-mirror/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-cl... | |
b49107fb6ac8b736fa033d01e10daa2d61de7aef | src/motion/arm_id_based/src/arm_id_based_node.cpp | src/motion/arm_id_based/src/arm_id_based_node.cpp | #include"ros/ros.h"
#include"arm_msgs/ArmAnglesDegree.h"
#include"servo_msgs/IdBased.h"
#include<vector>
void armMsgCb(const arm_msgs::ArmAnglesDegree::ConstPtr& msg);
ros::Publisher pub;
int main(int argc, char* argv[]) {
ros::init(argc, argv, "arm_id_based_node");
ros::NodeHandle pnh("~");
std::vector<int> ... | Add arm_id_baesd_node without callback function | Add arm_id_baesd_node without callback function
| C++ | mit | agrirobo/arcsys2,agrirobo/arcsys2 | |
247cbe732756968cef079a9e9d77cf168702304b | test/libcxx/atomics/atomics.order/memory_order.underlying_type.pass.cpp | test/libcxx/atomics/atomics.order/memory_order.underlying_type.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 PR40977 | [libc++] Add a test for PR40977
Even though the header makes the exact same check since https://llvm.org/D59063,
the headers could conceivably change in the future and introduce a bug.
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@356376 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
0ba3efd27cf4479f71129d86dc6bc021145fbb1c | preceding_palindrome.cpp | preceding_palindrome.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
using namespace std;
int reverse(int x)
{
int r = 0;
while (x > 0) {
r = r * 10 + x % 10;
x /= 10;
}
return r;
}
bool is_palindrome(int x)
{
if (reverse(x) == x) {
return true;
}
return false;
}
int main()
{
int T;
cin >> T;
... | Add the solution to "Preceding Palindrome". | Add the solution to "Preceding Palindrome".
| C++ | mit | clasnake/hackermeter,clasnake/hackermeter | |
af5a751c2f66a438425d8769a87d6f902e3b12f4 | test/CXX/basic/basic.start/basic.start.init/p3.cpp | test/CXX/basic/basic.start/basic.start.init/p3.cpp | // RUN: %clang_cc1 -verify %s -pedantic-errors
// RUN: %clang_cc1 -verify %s -pedantic-errors -DINLINE
// RUN: %clang_cc1 -verify %s -pedantic-errors -DSTATIC
// RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++11 -DCONSTEXPR
// RUN: %clang_cc1 -verify %s -std=c++11 -DDELETED
#if INLINE
inline // expected-error {{'... | Add a test file missed from r199782. | Add a test file missed from r199782.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@199783 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
ea7c228d10eb4e1d82075fe36f2134db0fe7ea1d | test19_18.cpp | test19_18.cpp | #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
using namespace std;
using std::placeholders::_1;
int main() {
vector<string> svec = {"", "a", "", "b", "c"};
//use mem_fn
cout << count_if(svec.cbegin(), svec.cend(), mem_fn(&string::empty)) << ... | Add solution for chapter 19, test 18 | Add solution for chapter 19, test 18 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
a6da8f08deff651a1f6b9f42e492d72d4935767a | Source/System/FieldContainer/Base/testFCPtrs.cpp | Source/System/FieldContainer/Base/testFCPtrs.cpp |
#include <OpenSG/OSGBaseInitFunctions.h>
#include <OpenSG/OSGNode.h>
#include <OpenSG/OSGNodeCore.h>
#include <OpenSG/OSGRefPtr.h>
int main (int argc, char **argv)
{
OSG::osgInit(argc, argv);
// Test getting pointers
OSG::NodePtr node_ptr = OSG::Node::create();
OSG::Node* node_cptr = get_pointer(no... | Add a test application for the get_pointer methods. This should really be in a unittest framework... | Add a test application for the get_pointer methods. This should really be in a unittest framework...
git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@89 4683daeb-ad0f-0410-a623-93161e962ae5
| C++ | lgpl-2.1 | jondo2010/OpenSG,jondo2010/OpenSG,jondo2010/OpenSG,jondo2010/OpenSG,jondo2010/OpenSG | |
0cc883c3b0760eccfb86af86a16ddaeb1b72263d | lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp | lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp | // Test that we can jump from a type unit in one dwo file into a type unit in a
// different dwo file.
// REQUIRES: lld
// RUN: %clang %s -target x86_64-pc-linux -fno-standalone-debug -g \
// RUN: -fdebug-types-section -gsplit-dwarf -c -o %t1.o -DONE
// RUN: %clang %s -target x86_64-pc-linux -fno-standalone-debug -... | Add one more type unit test | [DWARF] Add one more type unit test
This test passes already, but it seems interesting to test that we can
jump between type units in different dwo files nonetheless.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@364890 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb | |
0f79beb33f7204f962bd3c7c8bcf320fd23ea4a1 | cpp/415_Add_Strings.cpp | cpp/415_Add_Strings.cpp | // 415. Add Strings
/**
* Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.
*
* Note:
*
* 1. The length of both num1 and num2 is < 5100.
* 2. Both num1 and num2 contains only digits 0-9.
* 3. Both num1 and num2 does not contain any leading zero.
* 4. You mus... | Add Solution for 415 Add Strings | Add Solution for 415 Add Strings
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
1a4e307deb8a9c67a8442009b0ff239570b74167 | countingsort1.cpp | countingsort1.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int maxn = 100;
int main()
{
int n;
cin >> n;
int *c = new int[maxn];
memset(c, 0, sizeof(c));
while (n--) {
int x;
cin >> x;
c[x]++;
}
for (int i = 0; i < maxn; i++) {
cout << c[i] << " ";
}
delete [] c;
return 0;
} | Add the solution to "Counting Sort 1". | Add the solution to "Counting Sort 1".
| C++ | mit | clasnake/hackerrank,clasnake/hackerrank | |
8040ddb6e5f6302327782df0c6b7eb9959decc9a | src/proj/test/test_main.cc | src/proj/test/test_main.cc | #include "test/test_main.h"
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// what ever initialization you need here
// invode the test
return RUN_ALL_TESTS();
}
| Add the aggregate test file. | Add the aggregate test file.
| C++ | mit | nguyentu1602/seamless-gtest,nguyentu1602/seamless-gtest | |
efdb86deef9d16459462abcb1dec252e03b078f0 | cpp/005_Longest_Palindromic_Substring.cpp | cpp/005_Longest_Palindromic_Substring.cpp | // 5. Longest Palindromic Substring
/**
* Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
*
* Example:
*
* Input: "babad"
* Output: "bab"
* Note: "aba" is also a valid answer.
*
* Example:
*
* Input: "cbbd"
* Output: "bb"
*
* Tags: S... | Add Solution for 5. Longest Palindromic Substring | Add Solution for 5. Longest Palindromic Substring
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
f977078a729400bcd96a206b77e261621dc0bba5 | test/asan/TestCases/use-after-scope-goto.cc | test/asan/TestCases/use-after-scope-goto.cc | // RUN: %clangxx_asan -O0 -fsanitize-address-use-after-scope %s -o %t && %run %t
// Function jumps over variable initialization making lifetime analysis
// ambiguous. Asan should ignore such variable and program must not fail.
#include <stdlib.h>
int *ptr;
void f1(int cond) {
if (cond)
goto label;
int tmp;
... | Test jumps which bypass variables declaration | [asan] Test jumps which bypass variables declaration
Summary:
Clang should not generate lifetime intrinsics for such variables. D24693
PR28267
Reviewers: eugenis
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24696
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@285343... | C++ | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt | |
30214f7241f6f8e5c898247985c81c4952e3474a | chapter21/chapter21_trythis4.cpp | chapter21/chapter21_trythis4.cpp | // Chapter 21, Try This 4: get Dow Jones map example to work
#include "../lib_files/std_lib_facilities.h"
#include<map>
#include<numeric>
//------------------------------------------------------------------------------
double weighted_value(const pair<string,double>& a,
const pair<string,double>& b)
{
return... | Add Chapter 21, Try This 4 | Add Chapter 21, Try This 4
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
c3b33d5bab6a53c0f1dbde9f5be0aefc12719f1f | tests/host/core/test_pgmspace.cpp | tests/host/core/test_pgmspace.cpp | /*
test_pgmspace.cpp - pgmspace tests
Copyright © 2016 Ivan Grokhotkov
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 rights
to use, co... | Add missing pgmspace test file | Add missing pgmspace test file
| C++ | lgpl-2.1 | Juppit/Arduino,Links2004/Arduino,jes/Arduino,Links2004/Arduino,gguuss/Arduino,quertenmont/Arduino,martinayotte/ESP8266-Arduino,gguuss/Arduino,gguuss/Arduino,Adam5Wu/Arduino,lrmoreno007/Arduino,Juppit/Arduino,me-no-dev/Arduino,Adam5Wu/Arduino,Lan-Hekary/Arduino,KaloNK/Arduino,quertenmont/Arduino,Adam5Wu/Arduino,quertenm... | |
0375929f25e2e8b614e094ddfeead63c289bfe33 | microbenchmarks/memstorage.cpp | microbenchmarks/memstorage.cpp | #include <libdariadb/storage/memstorage/memstorage.h>
#include <libdariadb/storage/settings.h>
#include <libdariadb/utils/async/thread_manager.h>
#include <libdariadb/utils/logger.h>
#include <benchmark/benchmark_api.h>
class BenchmarkLogger : public dariadb::utils::ILogger {
public:
BenchmarkLogger() {}
~Benchma... | Add new track to memory | microbenchmark: Add new track to memory
| C++ | apache-2.0 | lysevi/dariadb,lysevi/dariadb,lysevi/dariadb | |
419147e9038aa2d030efb77cc6fba0b6a97d4493 | src/cmdline.cpp | src/cmdline.cpp | #include <iostream>
#include <cstring>
#include "cmdline.h"
CMDLINE::CMDLINE(int argC, char **argV)
{
argc = argC;
for (int i = 0; i < argc; i++)
argv[i] = argV[i];
}
int CMDLINE::help()
{
std::cout << "Help! (coming soon)" << std::endl;
return 0;
}
int CMDLINE::version()
{
std::cout << "Version: no v... | Add the class 'CMDLINE'. So the user is able to change default setting. | Add the class 'CMDLINE'. So the user is able to change default setting.
| C++ | mit | wkohlenberg/simple_GA | |
62995ca95a91fa1692631ba2ead5ecf86f4b43bb | preorder.cpp | preorder.cpp | #include <iostream>
#include <string>
using namespace std;
struct Node
{
string s;
Node *left;
Node *right;
};
Node *new_node(string s)
{
Node *temp = new Node();
temp->s = s;
temp->left = NULL;
temp->right = NULL;
return temp;
}
bool add_edge(Node *root, Node *father, Node *child)
{
if (root == NULL) {
r... | Add the solution to "Preorder Perusal". | Add the solution to "Preorder Perusal".
| C++ | mit | clasnake/hackerrank,clasnake/hackerrank | |
699c8888b4215f3af5270a2ce4097b7bbcdeaa26 | practice04/01.cpp | practice04/01.cpp | #include <stdio.h>
int main(void)
{
const double r = 100;
int count = 1; /* Include (0, 0) which makes denominator to zero */
for(double x = 1; x <= r; ++x)
for(double y = 1 / (3 * x); x * x + y * y <= r * r && y <= 2 / (3 * x); ++y, ++count);
printf("Result: %d\n", count);
return 0;
}
| Add solution of prob 1 | Add solution of prob 1
| C++ | mit | kdzlvaids/problem_solving-pknu-2016,kdzlvaids/problem_solving-pknu-2016 | |
c665fb100a313bda75d1bdfdfe371e0d5e0e16e9 | chrome/test/webdriver/commands/response.cc | chrome/test/webdriver/commands/response.cc | // Copyright (c) 2011 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/test/webdriver/commands/response.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/values.h"
namespace... | Fix build. Forgot to explictly add file while patching. BUG=none TEST=none TBR=rsleevi | Fix build. Forgot to explictly add file while patching.
BUG=none
TEST=none
TBR=rsleevi
Review URL: http://codereview.chromium.org/6544032
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@75507 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | keishi/chromium,hgl888/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,Just-D/chromium-1,anirudhSK/chromium,bright-sparks/chromium-spacewalk,ltilve/chromium,krieger... | |
a84dfe0729cdd12871c8f9f9842ab80eef228cbc | test/CXX/dcl.dcl/dcl.attr/dcl.attr.fallthrough/p1.cpp | test/CXX/dcl.dcl/dcl.attr/dcl.attr.fallthrough/p1.cpp | // RUN: %clang_cc1 -std=c++1z -verify %s
void f(int n) {
switch (n) {
case 0:
n += 1;
[[fallthrough]]; // ok
case 1:
if (n) {
[[fallthrough]]; // ok
} else {
return;
}
case 2:
for (int n = 0; n != 10; ++n)
[[fallthrough]]; // expected-error {{does not directly precede ... | Add accidentally forgotten testcase from r262881. | Add accidentally forgotten testcase from r262881.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@262882 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/cl... | |
0b3c45fa6283245f01c1c67015224ed1568b176c | C++/108_Convert_Sorted_Array_to_Binary_Search_Tree.cpp | C++/108_Convert_Sorted_Array_to_Binary_Search_Tree.cpp | // 108. Convert Sorted Array to Binary Search Tree
/**
* Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
*
* Tags: Tree, Depth-first Search
*
* Similar Problems: (M) Convert Sorted List to Binary Search Tree
*
* Author: Kuang Qin
*/
#include "stdafx.h"
#include... | Add Solution for Problem 108 | Add Solution for Problem 108
| C++ | mit | FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res | |
70bf507e5f49a5e39dd905df3e25d03eb74b79bc | SurgSim/Framework/UnitTests/TimerTest.cpp | SurgSim/Framework/UnitTests/TimerTest.cpp | // This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions 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/LICE... | Add UnitTests for Timer class. | Add UnitTests for Timer class.
| C++ | apache-2.0 | simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim | |
b0dccefb789249c986481858f3ff56483875224b | 405.cpp | 405.cpp | class Solution {
public:
string toHex(int num) {
if(num==0) return "0";
string ans;
char hexa[16]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
int cnt=0;
while(num!=0 && cnt<8){
ans=hexa[(num&15)]+ans;
num=num>>4;
cnt+... | Convert a Number to Hexadecimal | Convert a Number to Hexadecimal | C++ | mit | zfang399/LeetCode-Problems | |
8c6eb98c259dfe1c5cb5711628073cb78925105c | tools/gn/value_unittest.cc | tools/gn/value_unittest.cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "testing/gtest/include/gtest/gtest.h"
#include "tools/gn/value.h"
TEST(Value, ToString) {
Value strval(NULL, "hi\" $me\\you\\$\\\"");
EXPECT... | Add missing GN test file. | Add missing GN test file.
This was missing from the last upload of https://codereview.chromium.org/265693003 but was present in the initial review.
TBR=scottmg
BUG=
Review URL: https://codereview.chromium.org/265883014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@268043 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | Jonekee/chromium.src,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,littlstar/chromium.src,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaste... | |
bb5edfb2fd5fa4c9ddafaab188d956973c39c8cd | misc/UnicodeTest1.cc | misc/UnicodeTest1.cc | #include <windows.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
system("cls");
// Write character.
wchar_t ch = 0x754C; // U+754C (CJK UNIFIED IDEOGRAPH-754C)
DWORD actual = 0;
BOOL ret = WriteConsoleW(
GetStdHandle(STD_OUTPUT_HANDLE),
... | Add a test program that writes and reads a non-ASCII character. | Add a test program that writes and reads a non-ASCII character.
| C++ | mit | rprichard/winpty,fracting/winpty,rprichard/winpty,rprichard/winpty,fracting/winpty,rprichard/winpty,fracting/winpty,fracting/winpty | |
49dae67cbec6853cc146a2a6e8fc0e1b71944146 | mshp/algo/geo/convex_polygon.cpp | mshp/algo/geo/convex_polygon.cpp | /*
* Copyright (C) 2015-2016 Pavel Dolgov
*
* See the LICENSE file for terms of use.
*/
#include <bits/stdc++.h>
typedef std::pair<int, int> IntPair;
typedef std::deque<IntPair> IntPairs;
IntPairs vertices;
// make vector from two points
IntPair makeVector(IntPair p0, IntPair p1) {
IntPair vect(p1.first - p... | Add convexity test for polygon | Add convexity test for polygon
| C++ | mit | zer0main/problems,zer0main/problems,zer0main/problems | |
5677389d81fb0c372b6988e5611c97a23ed767ac | src/unittest/multipath_alignment_graph.cpp | src/unittest/multipath_alignment_graph.cpp | /// \file multipath_alignment_graph.cpp
///
/// unit tests for the multipath mapper's MultipathAlignmentGraph
#include <iostream>
#include "json2pb.h"
#include "vg.pb.h"
#include "../multipath_mapper.hpp"
#include "../build_index.hpp"
#include "catch.hpp"
namespace vg {
namespace unittest {
TEST_CASE( "MultipathAl... | Add a test for the MultipathAlignmentGraph that just explodes | Add a test for the MultipathAlignmentGraph that just explodes
| C++ | mit | ekg/vg,ekg/vg,ekg/vg | |
aee8b90336c3a63aa1238b51e93d7c4480c16010 | 1-common-tasks/functions/return-multiple-values.cpp | 1-common-tasks/functions/return-multiple-values.cpp | // Return multiple values
// C++11
#include <tuple>
std::tuple<int, bool, float> foo()
{
return std::make_tuple(128, true, 1.5f);
}
int main()
{
int obj1;
bool obj2;
float obj3;
std::tie(obj1, obj2, obj3) = foo();
}
// Return multiple values of different types from a function.
//
// The `foo` function on [6-... | // Return multiple values
// C++11
#include <tuple>
std::tuple<int, bool, float> foo()
{
return std::make_tuple(128, true, 1.5f);
}
int main()
{
std::tuple<int, bool, float> result = foo();
int value = std::get<0>(result);
int obj1;
bool obj2;
float obj3;
std::tie(obj1, obj2, obj3) = foo();
}
// Return mult... | Add std::get example to return multiple values sample | Add std::get example to return multiple values sample
| C++ | cc0-1.0 | sftrabbit/CppSamples-Samples,rollbear/CppSamples-Samples,thatbrod/CppSamples-Samples,brunotag/CppSamples-Samples,tmwoz/CppSamples-Samples,vjacquet/CppSamples-Samples |
f127690cd0cafdd53c70f839dddaab98eca7406f | test/Index/Store/record-hash-crash-invalid-name.cpp | test/Index/Store/record-hash-crash-invalid-name.cpp | // Makes sure it doesn't crash.
// XFAIL: linux
// RUN: rm -rf %t
// RUN: not %clang_cc1 %s -index-store-path %t/idx -std=c++14
// RUN: c-index-test core -print-record %t/idx | FileCheck %s
namespace rdar32474406 {
void foo();
typedef void (*Func_t)();
// CHECK: [[@LINE+4]]:1 | type-alias/C | c:record-hash-crash-inv... | Add a test for a crash with unnamed NamedDecls | [index] Add a test for a crash with unnamed NamedDecls
Previously this would crash during record hashing.
rdar://problem/32474406
| 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 | |
515dc68e0cd377d6d2c77da81ce249db577faf71 | tPermutation.cpp | tPermutation.cpp | #include "boost/unordered_map.hpp"
#include <iostream>
#include <vector>
#include "utils/Timer.hpp"
using Bucket = std::vector<int>;
void print(Bucket &buckets) {
std::for_each(buckets.begin(), buckets.end(), [](auto item) { std::cout << item << " "; });
std::cout << "\n";
}
class CountAllPermutations {
p... | Add solutons that count all permutations. | Add solutons that count all permutations.
| C++ | bsd-2-clause | hungptit/algorithms | |
5f1112917a17365787da516897cb82e0259ea34f | org.jenetics/src/test/cpp/trng/random_output.cpp | org.jenetics/src/test/cpp/trng/random_output.cpp | #include <cstdlib>
#include <iostream>
#include <iomanip>
#include <vector>
#include <trng/lcg64_shift.hpp>
unsigned long long pow(unsigned long long x, unsigned long long n) {
unsigned long long result=1;
while (n > 0) {
if ((n&1) > 0) {
result=result*x;
}
x = x*x;
n >>= 1;
}
return result;
}
unsigned... | Add cpp program which created the LCG64ShiftRandom test data. | Add cpp program which created the LCG64ShiftRandom test data.
| C++ | apache-2.0 | jenetics/jenetics,jenetics/jenetics,jenetics/jenetics,jenetics/jenetics,jenetics/jenetics,jenetics/jenetics,jenetics/jenetics | |
06845a8ab4152c3079d87b1c7494b22721546438 | test/clang-tidy/export-diagnostics.cpp | test/clang-tidy/export-diagnostics.cpp | // RUN: grep -Ev "// *[A-Z-]+:" %s > %t-input.cpp
// RUN: clang-tidy %t-input.cpp -checks='-*,google-explicit-constructor,clang-diagnostic-missing-prototypes' -export-fixes=%t.yaml -- -Wmissing-prototypes > %t.msg 2>&1
// RUN: FileCheck -input-file=%t.msg -check-prefix=CHECK-MESSAGES %s -implicit-check-not='{{warning|e... | Add a test for proper handling of locations in scratch space. | [clang-tidy] Add a test for proper handling of locations in scratch space.
This test examines the behavior change of clang::tooling::Diagnostic in r347372.
git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@347373 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 | |
e9b46bc17ae1f242febee4728ae3089faf127f98 | Leetcode2/019.cpp | Leetcode2/019.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
ListNode *fast = head, *slow = head;
for(int i=0;fast && i < n;i... | Remove Nth Node From End of List | Remove Nth Node From End of List | C++ | mit | nolink/algorithm,nolink/algorithm | |
c8d124d304ccf3b71abf74a1463a7cf0710e55b6 | src/main.cpp | src/main.cpp | // This is the starting point
//
#include <iostream>
int main() {
std::string testString("This is a sample string");
std::cout << testString << std::endl;
return 0;
}
| Add stub for the starting point | Add stub for the starting point
| C++ | bsd-2-clause | ambidextrousTx/RGrep-CPP | |
ae4f5b95fa6db4b9280ad9a5c9be967306b2caf9 | tests/unit/fem/test_pa_kernels.cpp | tests/unit/fem/test_pa_kernels.cpp | #include "mfem.hpp"
#include "catch.hpp"
#include <fstream>
#include <iostream>
using namespace mfem;
namespace pa_kernels
{
double test_nl_convection_nd(int dim)
{
Mesh *mesh;
if (dim == 2)
{
mesh = new Mesh(2, 2, Element::QUADRILATERAL, 0, 1.0, 1.0);
}
if (dim == 3)
{
mesh = new Mesh(... | Add test case verifying PA convection | Add test case verifying PA convection
Verify that the partial assembly and fully assembly for nonlinear convection give the same results in 2D and 3D
| C++ | bsd-3-clause | mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem | |
93e82b50e153fb9858da0fd9ca2de72539ae96c8 | arangod/Aql/Types.cpp | arangod/Aql/Types.cpp | ////////////////////////////////////////////////////////////////////////////////
/// @brief fundamental types for the optimisation and execution of AQL
///
/// @file arangod/Aql/Types.cpp
///
/// DISCLAIMER
///
/// Copyright 2010-2014 triagens GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.... | Add the forgotten file. splice is only a stub. | Add the forgotten file. splice is only a stub.
| C++ | apache-2.0 | hkernbach/arangodb,Simran-B/arangodb,hkernbach/arangodb,joerg84/arangodb,baslr/ArangoDB,joerg84/arangodb,Simran-B/arangodb,baslr/ArangoDB,fceller/arangodb,jsteemann/arangodb,kangkot/arangodb,Simran-B/arangodb,thurt/arangodb,jsteemann/arangodb,baslr/ArangoDB,m0ppers/arangodb,baslr/ArangoDB,joerg84/arangodb,m0ppers/arang... | |
e59e3561a7b65c75b584757780adb3ceaf6181c6 | 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);
std::cout << "Who am I ? where am I ? Lei" << std::endl;
int i = foo();
std::cout << s... | #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... | Revert "this is my test" | Revert "this is my test"
This reverts commit acb4d53a4a705d7ec91c0acfedc73f8cedef621e.
| C++ | mit | Graphics-Interpreter/cmake-demo,Lw-Cui/cmake-demo,Graphics-Interpreter/cmake-demo,Lw-Cui/cmake-demo |
ed78d7d28695994ee0af2067452876281e6d935e | karum/insertNodeCLL.cpp | karum/insertNodeCLL.cpp | #include<iostream>
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==NULL)
return np;
while(t->next!=head)
t=t->next;
t->next=np;
... | Add code to insert a node in circular linked list | Add code to insert a node in circular linked list
| C++ | mit | shivan1b/codes | |
af854a02c22c113b0a68b23ec9e52ad4e2758976 | examples/example-contest/easy1/sol/soluzione-lenta.cpp | examples/example-contest/easy1/sol/soluzione-lenta.cpp | #include <cstdio>
volatile int x[40000000];
int main() {
//#ifdef EVAL
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
//#endif
int N, max;
scanf("%d", &N);
for (long long i=0; i < 40000000; i++) {
x[i] = 1;
}
for (long long i=0; i < 10000000; i++) {
... | Add slow solution to `easy1` example problem | Add slow solution to `easy1` example problem
| C++ | mpl-2.0 | algorithm-ninja/task-wizard,algorithm-ninja/task-wizard,algorithm-ninja/task-wizard | |
f4b14f8bb43b897ac2f8f927dc49f21878718cba | test/unit/encoding/geometry_to_feature_pbf.cpp | test/unit/encoding/geometry_to_feature_pbf.cpp | #include "catch.hpp"
// mapnik vector tile
#include "vector_tile_geometry_feature.hpp"
#include "vector_tile_layer.hpp"
// mapnik
#include <mapnik/geometry.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/feature_factory.hpp>
#include <mapnik/util/variant.hpp>
// protozero
#include <protozero/pbf_writer.hpp>
// ... | Add test for invalid geometry encoding | Add test for invalid geometry encoding
There's currently a segmenation fault when an invalid geometry is
encoded to a layer builder due to the use of protozero rollback function
| C++ | bsd-3-clause | mapbox/mapnik-vector-tile,tomhughes/mapnik-vector-tile,mapbox/mapnik-vector-tile,mapbox/mapnik-vector-tile,mapbox/mapnik-vector-tile,tomhughes/mapnik-vector-tile,tomhughes/mapnik-vector-tile,tomhughes/mapnik-vector-tile | |
2791ae48b3ed171606f2ce5918d0eb648f347d9f | doc/GUARD.cpp | doc/GUARD.cpp |
/*
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-------------------------------------------------------------------------------
CLASS
-------------------------------------------------------------------------------
/////////////////////////////... | Add file with comments to be used in the file | Add file with comments to be used in the file
| C++ | apache-2.0 | renatocf/MAC0431-PROJECT | |
5425ba06f6aebbf78060f0ca3b856187c6c20568 | test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp | test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.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 to ensure that the converting constructor in N4089 is present and working | Add test to ensure that the converting constructor in N4089 is present and working
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@261874 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
4e7398196fe5ef38d9815dfd1a8153841ae2df7f | 1-common-tasks/templates/conditionally-instantiate-class-templates.cpp | 1-common-tasks/templates/conditionally-instantiate-class-templates.cpp | // Conditionally instantiate class templates
#include <type_traits>
#include <limits>
template <typename T, typename Enable = void>
class foo;
template <typename T>
class foo<T, typename std::enable_if<std::is_integral<T>::value>::type>
{ };
template <typename T>
class foo<T, typename std::enable_if<std::is_floatin... | Add "class templates SFINAE" sample | Add "class templates SFINAE" sample
| C++ | cc0-1.0 | sftrabbit/CppSamples-Samples,mnpk/CppSamples-Samples,brunotag/CppSamples-Samples,tmwoz/CppSamples-Samples,vjacquet/CppSamples-Samples,darongE/CppSamples-Samples,rollbear/CppSamples-Samples,thatbrod/CppSamples-Samples | |
562b332cd04228d28cd995c24945e5130fa16916 | removeDuplicates.cpp | removeDuplicates.cpp | #include <iostream>
using namespace std;
int removeDuplicates(int A[], int n) {
if (n == 0) {
return 0;
}
int prev = 0;
int length = 1;
for (int i = 1; i < n; ++i) {
if (A[i] == A[prev]) {
continue;
} else {
++length;
++prev;
... | Remove duplicates from a sorted array | Remove duplicates from a sorted array
| C++ | mit | srijanshetty/code | |
fd1c7cb4b4d33ec86d957b6fc2ce78fba8bad0b6 | test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp | test/std/language.support/support.types/byteops/enum_direct_init.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 specific test for P0138R2, direct-list-init of fixed enums from integers, part 3/3. | [test] Add specific test for P0138R2, direct-list-init of fixed enums from integers, part 3/3.
Test the C++17 Core Language feature independently from other std::byte tests.
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@302946 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
8616fb21ca5d57a4ec4bb05b08ecf23e2bfa1379 | src/scheduler/testcoro.cc | src/scheduler/testcoro.cc | #include <iostream>
#include <scheduler/coroutine.hh>
Coro* mc;
Coro* c1, *c2;
void start2(void*)
{
int x=1;
int y = 12;
std::cerr <<"c2 start " << std::endl;
std::cerr <<"c2->c1 " << std::endl;
x++;
coroutine_switch_to(c2, c1);
assert(x==2);
x++;
std::cerr <<"c2->main " << std::endl;
assert(x==3)... | Add Matthieu's coroutines test program to the repository. | Add Matthieu's coroutines test program to the repository.
* src/scheduler/testcoro.cc: New.
| C++ | bsd-3-clause | aldebaran/urbi,aldebaran/urbi,aldebaran/urbi,aldebaran/urbi,urbiforge/urbi,aldebaran/urbi,urbiforge/urbi,aldebaran/urbi,urbiforge/urbi,aldebaran/urbi,aldebaran/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi | |
e51dd32d80d117711a81d2ea7e43bab6f000013f | chrome/test/base/run_all_remoting_unittests.cc | chrome/test/base/run_all_remoting_unittests.cc | // Copyright (c) 2011 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.
// A basic testrunner that supports JavaScript unittests.
// This lives in src/chrome/test/base so that it can include chrome_paths.h
// (required for... | // Copyright (c) 2011 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.
// A basic testrunner that supports JavaScript unittests.
// This lives in src/chrome/test/base so that it can include chrome_paths.h
// (required for... | Add --brave-new-test-launcher support to remoting_unittests. | GTTF: Add --brave-new-test-launcher support to remoting_unittests.
BUG=236893
Review URL: https://chromiumcodereview.appspot.com/23499015
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@222684 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | anirudhSK/chromium,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,crosswalk-pro... |
673166545e99280c9baaf4453c4f8d4ebf5fbd7c | test/construct.cc | test/construct.cc | #include <gmi_mesh.h>
#include <gmi_null.h>
#include <apfMDS.h>
#include <apfMesh2.h>
#include <apfConvert.h>
#include <apf.h>
#include <PCU.h>
int main(int argc, char** argv)
{
assert(argc==3);
MPI_Init(&argc,&argv);
PCU_Comm_Init();
PCU_Protect();
gmi_register_mesh();
gmi_register_null();
int* conn;
... | #include <gmi_mesh.h>
#include <gmi_null.h>
#include <apfMDS.h>
#include <apfMesh2.h>
#include <apfConvert.h>
#include <apf.h>
#include <PCU.h>
int main(int argc, char** argv)
{
assert(argc==3);
MPI_Init(&argc,&argv);
PCU_Comm_Init();
PCU_Protect();
gmi_register_mesh();
gmi_register_null();
int* conn;
... | Add test for setting coordinates | Add test for setting coordinates
| C++ | bsd-3-clause | YetAnotherMinion/core,YetAnotherMinion/core,YetAnotherMinion/core,YetAnotherMinion/core,yangf4/core,yangf4/core,yangf4/core,yangf4/core,YetAnotherMinion/core,yangf4/core |
71100de51b2c54c917d447a83be585a64b564913 | source/architecture/ARM/ARMv6-M-ARMv7-M/ARMv6-M-ARMv7-M-isInInterruptContext.cpp | source/architecture/ARM/ARMv6-M-ARMv7-M/ARMv6-M-ARMv7-M-isInInterruptContext.cpp | /**
* \file
* \brief isInInterruptContext() implementation for ARMv6-M and ARMv7-M
*
* \author Copyright (C) 2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was... | Add ARMv{6,7}-M implementation of architecture::isInInterruptContext() | Add ARMv{6,7}-M implementation of architecture::isInInterruptContext() | C++ | mpl-2.0 | CezaryGapinski/distortos,jasmin-j/distortos,jasmin-j/distortos,DISTORTEC/distortos,DISTORTEC/distortos,jasmin-j/distortos,DISTORTEC/distortos,CezaryGapinski/distortos,DISTORTEC/distortos,CezaryGapinski/distortos,CezaryGapinski/distortos,jasmin-j/distortos,jasmin-j/distortos,CezaryGapinski/distortos | |
21ebae8b2fc9e0b113d7271a0d208f42d2ccf724 | webkit/support/test_webplugin_page_delegate.cc | webkit/support/test_webplugin_page_delegate.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 "webkit/support/test_webplugin_page_delegate.h"
#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
#include "third_par... | // 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 "webkit/support/test_webplugin_page_delegate.h"
#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
#include "third_par... | Fix plugin visibility in DRT | Fix plugin visibility in DRT
Ensure that SetContainerVisibility is called on WebPluginDelegateImpls when they're created in DRT, or else their cliprects will be wrong.
BUG=168900
Review URL: https://chromiumcodereview.appspot.com/12382007
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@185729 0039d316-1c4b-42... | C++ | bsd-3-clause | patrickm/chromium.src,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk... |
fc7496f50c51c05bcc4f139a9776bc1cd464314d | double_list_reverse.cpp | double_list_reverse.cpp | #include<iostream>
using namespace std;
struct Node
{
int data;
Node* next;
Node* prev;
};/*
Reverse a doubly linked list, input list may also be empty
Node is defined as
struct Node
{
int data;
Node *next;
Node *prev
}
*/
Node* Reverse(Node *head)
{
if (head == NULL || head->next =... | Add the solution to "Reverse a doubly linked list". | Add the solution to "Reverse a doubly linked list".
| C++ | mit | clasnake/hackerrank,clasnake/hackerrank | |
04870fb3b2def191b7dc2c4bdd8353203ca20442 | src/practice/kquery.cpp | src/practice/kquery.cpp | #include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
struct query {
int l, r;
int id;
} queries[200000];
int s;
int cmp(const void* a, const void* b) {
struct query* x = (struct query *) a;
struct query* y = (struct query *) b;
if ( (x->l) / s == (y->l) / s) {
r... | Work on KQUERY on spoj | Work on KQUERY on spoj
| C++ | mit | paramsingh/codechef-solutions,paramsingh/cp,paramsingh/cp,paramsingh/cp,paramsingh/cp,paramsingh/codechef-solutions,paramsingh/cp,paramsingh/codechef-solutions,paramsingh/codechef-solutions | |
c7b04c697bf923d13d139a8b162c5dd7d888396c | src/caffe/test/test_layer_factory.cpp | src/caffe/test/test_layer_factory.cpp | #include <map>
#include <string>
#include "gtest/gtest.h"
#include "caffe/common.hpp"
#include "caffe/layer.hpp"
#include "caffe/layer_factory.hpp"
#include "caffe/test/test_caffe_main.hpp"
namespace caffe {
template <typename TypeParam>
class LayerFactoryTest : public MultiDeviceTest<TypeParam> {};
TYPED_TEST_CA... | Add unit test for LayerRegistry::CreateLayer | Add unit test for LayerRegistry::CreateLayer
| C++ | mit | gogartom/caffe-textmaps,tackgeun/caffe,longjon/caffe,gnina/gnina,gnina/gnina,tackgeun/caffe,CZCV/s-dilation-caffe,gnina/gnina,tackgeun/caffe,gogartom/caffe-textmaps,CZCV/s-dilation-caffe,gnina/gnina,wangg12/caffe,gogartom/caffe-textmaps,gnina/gnina,wangg12/caffe,gogartom/caffe-textmaps,wangg12/caffe,wangg12/caffe,longj... | |
abce6999b271f4928aa98b11d42ffebedcde1e13 | test/CodeGenCXX/virtual-base-destructor-call.cpp | test/CodeGenCXX/virtual-base-destructor-call.cpp | // RUN: clang-cc %s -emit-llvm -o - | FileCheck %s
struct basic_ios{~basic_ios(); };
template<typename _CharT> struct basic_istream : virtual public basic_ios {
virtual ~basic_istream(){}
};
template<typename _CharT> struct basic_iostream : public basic_istream<_CharT>
{
virtual ~basic_iostream(){}
};
basic_ios... | Test for my last patch. | Test for my last patch.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@90159 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-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... | |
4daa551d9f75fa1233fb1e94fcddcf1833f9ce74 | doc/examples/cert_verify.cpp | doc/examples/cert_verify.cpp | /*
* Simple example of a certificate validation
* (C) 2010 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#include <botan/botan.h>
#include <botan/x509cert.h>
#include <botan/x509stor.h>
#include <stdio.h>
using namespace Botan;
int main()
{
LibraryInitializer init;
X509_Certificate ca... | Add a simple cert validation example | Add a simple cert validation example
| C++ | bsd-2-clause | randombit/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombi... | |
80dfd74732369352d65599ee26d1aceb5df4f7bb | test/test_pcrepp.cc | test/test_pcrepp.cc |
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <string>
#include "pcrepp.hh"
int main(int argc, char *argv[])
{
pcre_context_static<30> context;
int retval = EXIT_SUCCESS;
{
pcrepp nomatch("nothing-to-match");
pcre_input pi("dummy");
assert(!nomatch.match(context, pi));
... | Add a test for cprepp. | Add a test for cprepp.
| C++ | bsd-2-clause | sureshsundriyal/lnav,acleasby/lnav,acleasby/lnav,tstack/lnav,sureshsundriyal/lnav,sureshsundriyal/lnav,tstack/lnav,acleasby/lnav,acleasby/lnav,sureshsundriyal/lnav,tstack/lnav,acleasby/lnav,tstack/lnav | |
e79e1bc2768eb2cfc8f26aefc9b31c439071243b | C++/172_Factorial_Trailing_Zeroes.cpp | C++/172_Factorial_Trailing_Zeroes.cpp | // 172. Factorial Trailing Zeroes
/**
* Given an integer n, return the number of trailing zeroes in n!.
*
* Note: Your solution should be in logarithmic time complexity.
*
* Tags: Math
*
* Similar Problems: (H) Number of Digit One
*/
#include "stdafx.h"
// in the factorial, there are many 2s, so it is enough... | Add Solution for Problem 172 | Add Solution for Problem 172
| C++ | mit | bssrdf/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res | |
a2306a8718ef1aacd7f7762b88a0ace9768fa024 | tests/set_geospatial_test.cc | tests/set_geospatial_test.cc | /*
* Copyright (C) 2017 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... | Add set of test for geospatial | Add set of test for geospatial
| C++ | mit | Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand,Kronuz/Xapiand | |
d2e195ebb37d88e1024954ba4546414250b0d3c2 | C++/patternMatch.cpp | C++/patternMatch.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <string>
#include <ctime>
#include <set>
#include <utility>
#include <algorithm>
#include <map>
using namespace std;
bool isPatternMatched(string& str, string& pattern) {
if (pattern.size() < 1) {
return true;
}
vector<vector<map<char, ... | Check if an input string matches the pattern | Check if an input string matches the pattern
"bigboyboybig" matches "ABBA"
| C++ | mit | yaoyuan0801/MiniLecture,yaoyuan0801/MiniLecture | |
9cc677b63a304a85edde2ea5f95d52b72ea08b15 | others/DS/BT/sub_tree_check.cc | others/DS/BT/sub_tree_check.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;
}
bool isIdentical(NODE* T, NODE* S) {
if (T == nullptr && S == nullptr) return tru... | Check whether given tree is sub tree of other. | Check whether given tree is sub tree of other.
| C++ | apache-2.0 | pshiremath/practice,pshiremath/practice | |
10467d29e05d9957a6e3cb2335f8eeba1fd8896e | tensorflow/core/ops/manip_ops.cc | tensorflow/core/ops/manip_ops.cc | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | Improve shape function check for `tf.roll` | Improve shape function check for `tf.roll`
The `tf.roll` op has requirements for the shape of inputs. However,
the shape of the inputs are only done at the runtime inside the kernel.
This fix improve the shape function so that the check could be
done early if shape is already known in the shape function.
Signed-off-b... | C++ | apache-2.0 | dendisuhubdy/tensorflow,theflofly/tensorflow,frreiss/tensorflow-fred,seanli9jan/tensorflow,dancingdan/tensorflow,cxxgtxy/tensorflow,adit-chandra/tensorflow,brchiu/tensorflow,theflofly/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-experimental_link_static_libraries_once,dongjoon-hyun/tensorflow,gunan/tens... |
30d452c44a41e4e487fb1c97577c8ed40175ab38 | chapter3/load-texture.cpp | chapter3/load-texture.cpp | #include"Game.h"
int main(int argc, char **args)
{
Game *game = new Game();
const char windowTitle[] = "Chapter 1: Setting up SDL";
game->init(windowTitle, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, false);
while (game->isRunning()) {
game->handleEvents();
game->update();
game->render();
... | Update branch chapter3 and resolve conflicts. | Update branch chapter3 and resolve conflicts.
| C++ | bsd-2-clause | caiotava/SDLBook | |
d990a8c88bb583dccf4a084f6268807ac37008a6 | gpu/src/GrGLUtil.cpp | gpu/src/GrGLUtil.cpp |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GrGLConfig.h"
#include "GrGLInterface.h"
void GrGLClearErr(const GrGLInterface* gl) {
while (GR_GL_NO_ERROR != gl->fGetError()) {}
}
void GrGLCheckErr(const ... |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GrGLConfig.h"
#include "GrGLInterface.h"
void GrGLClearErr(const GrGLInterface* gl) {
while (GR_GL_NO_ERROR != gl->fGetError()) {}
}
void GrGLCheckErr(const ... | Fix gl error debug print. | Fix gl error debug print.
git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@2356 2bbb7eff-a529-9590-31e7-b0007b416f81
| C++ | bsd-3-clause | Frankie-666/color-emoji.skia,Frankie-666/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,MatChung/color-emoji.skia,hbwhlklive/color-emoji.skia,Hankuo/color-emoji.skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,hbwhlklive/color-emoji... |
9a753c18284e0942ac108d56c7bcf1762a6770c2 | depp-usb-client/depp-peek.cpp | depp-usb-client/depp-peek.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <dpcdecl.h>
#include <dmgr.h>
#include <depp.h>
uint8_t
peek(int reg)
{
HIF deviceHandle;
int status;
char deviceName[32] = "Cr2s2";
uint8_t data;
status = DmgrOpen(&deviceHandle, deviceName);
if (!status) {
printf("Problem opening device... | Add ability to peek registers through USB, beautify code. | Add ability to peek registers through USB, beautify code.
| C++ | mit | rkujawa/cr2amiga,rkujawa/cr2amiga | |
4b684b08c9a9f508169131a4fa193f9173dc019d | samplepp.cc | samplepp.cc | #include <sys/types.h> /* size_t, ssize_t */
#include <stdarg.h> /* va_list */
#include <stddef.h> /* NULL */
#include <stdint.h> /* int64_t */
#include "kcgi.h"
#include <iostream>
int
main(int argc, char *argv[])
{
enum kcgi_err er;
struct kreq r;
const char *const pages[1] = { "index" };
/* Set up our ... | Add a sample C++ file. | Add a sample C++ file.
| C++ | isc | kristapsdz/kcgi,kristapsdz/kcgi | |
00c053d3af114659a75a6a8b2377d9389d8ab4b6 | src/tests/errors.cpp | src/tests/errors.cpp | // This file is part of playd.
// playd is licensed under the MIT licence: see LICENSE.txt.
/**
* @file
* Tests for command results.
*/
#include <sstream>
#include "catch.hpp"
#include "../cmd_result.hpp"
#include "dummy_response_sink.hpp"
// This file is part of playd.
// playd is licensed under the MIT licence:... | Add tiny test for Error::Message(). | Add tiny test for Error::Message().
Should bump coverage on errors.cpp to 100%.
| C++ | mit | LordAro/ury-playd,LordAro/ury-playd,LordAro/ury-playd | |
ce812a50d7cf6bd13e7c4a2592f4f2a2484ce381 | test/error/float16_t_implicit_downcast.cpp | test/error/float16_t_implicit_downcast.cpp | #include "Halide.h"
#include <stdio.h>
#include <cmath>
using namespace Halide;
// FIXME: We should use a proper framework for this. See issue #898
void h_assert(bool condition, const char *msg) {
if (!condition) {
printf("FAIL: %s\n", msg);
abort();
}
}
int main() {
Halide::Func f;
H... | Add test case to check that implicit downcasting when a Func returns float (32 bits) but the buffer has type float16_t (16 bits) is an error. | Add test case to check that implicit downcasting when a Func returns
float (32 bits) but the buffer has type float16_t (16 bits) is an error.
| C++ | mit | adasworks/Halide,jiawen/Halide,psuriana/Halide,psuriana/Halide,tdenniston/Halide,ronen/Halide,myrtleTree33/Halide,ronen/Halide,tdenniston/Halide,ronen/Halide,jiawen/Halide,tdenniston/Halide,tdenniston/Halide,ronen/Halide,delcypher/Halide,smxlong/Halide,adasworks/Halide,mcanthony/Halide,tdenniston/Halide,myrtleTree33/Ha... | |
12ae7f43ab18111b9d8fa4108c6715b141448de1 | src/main.cc | src/main.cc | #include <iostream>
namespace
{
class Repl
{
std::istream& in_;
std::ostream& out_;
std::string prompt_ = "mclisp> ";
public:
Repl(std::istream& in=std::cin, std::ostream& out=std::cout) : in_(in), out_(out) {};
int loop();
};
int Repl::loop()
{
std::string val;
while (val != "quit")
{
ou... | Add a very dumb echo repl. | Add a very dumb echo repl.
| C++ | mit | appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp | |
c75b172676f5b183e556d532c5c30b864ecdb1d0 | HLT/TPCLib/tracking-ca/standalone/interface/create_event_example.cpp | HLT/TPCLib/tracking-ca/standalone/interface/create_event_example.cpp | #include <stdio.h>
#include "../include/AliHLTTPCGeometry.h" //We use this to convert from row number to X
struct ClusterData {
int fId;
int fRow;
float fX;
float fY;
float fZ;
float fAmp;
};
int main(int argc, char** argv)
{
for (int iEvent = 0;iEvent < 2;iEvent++) //Multiple events go to multiple files, name... | Add example file to create event dump manually | Add example file to create event dump manually
| C++ | bsd-3-clause | mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot | |
a66cbb7d644e7f8675c39deb2af1eb6e37014ec6 | Tests/UnitTests/Tasks/SimpleTasks/DamageTaskTests.cpp | Tests/UnitTests/Tasks/SimpleTasks/DamageTaskTests.cpp | // Copyright (c) 2018 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 <hsp... | Add unit test for DamageTask | test: Add unit test for DamageTask
| C++ | mit | Hearthstonepp/Hearthstonepp,Hearthstonepp/Hearthstonepp | |
31cfc08172bf1a47b358f1cae22f44d161847448 | breadth_first_search/BreadthFirstSearch.cpp | breadth_first_search/BreadthFirstSearch.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> BreadthFirstSearch(int vertex,vector<int> adjacent[],int start_vertex,int destination){
queue<int> que;
//bfsPath will store the path
vector<int> bfsPath;
//this array will take care of duplicate traversing
bool visited[vertex];
vector<int>::itera... | Add Breadth First Search in Cpp | Add Breadth First Search in Cpp
| C++ | mit | iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos,iiitv/algos | |
45f3b425be9e6812a2ec9e50ae1501c4b5b52b8b | test/OpenMP/function-attr.cpp | test/OpenMP/function-attr.cpp | // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -stack-protector 2 -emit-llvm -o - %s | FileCheck %s
// Check that function attributes are added to the OpenMP runtime functions.
template <class T>
struct S {
T f;
S(T a) : f(a) {}
S() : f() {}
operator T() { return T(); }
~S() {}
};
// CHE... | Add a test case for r251476. | Add a test case for r251476.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@251477 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-cl... | |
187422275532dad4983ff6777df5ac2ee5fc471b | tests/unit/features/StreamingDenseFeatures_unittest.cc | tests/unit/features/StreamingDenseFeatures_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/features/... | Add basic unit test for StreamingDenseFeatures reading | Add basic unit test for StreamingDenseFeatures reading
| C++ | bsd-3-clause | lisitsyn/shogun,geektoni/shogun,geektoni/shogun,besser82/shogun,lisitsyn/shogun,geektoni/shogun,sorig/shogun,Saurabh7/shogun,lisitsyn/shogun,karlnapf/shogun,besser82/shogun,besser82/shogun,shogun-toolbox/shogun,sorig/shogun,besser82/shogun,shogun-toolbox/shogun,sorig/shogun,sorig/shogun,karlnapf/shogun,karlnapf/shogun,... | |
80a0121c66e623024d23e5bad8fe50238915ec4d | examples/update_folder.cpp | examples/update_folder.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 UpdateFolder operation | Add example for UpdateFolder operation
| C++ | apache-2.0 | otris/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp | |
f0a71faf05c7233253b9290fec5b89937c1e79da | HackerRank/Domains/Data_Structures/Linked_List/merge_point.cpp | HackerRank/Domains/Data_Structures/Linked_List/merge_point.cpp | /*
* Problem: Find Merge Point of Two Lists
* Author: Anirudha Bose <ani07nov@gmail.com>
Find merge point of two linked lists
Node is defined as
struct Node
{
int data;
Node* next;
}
*/
int lengthOfList(Node* head)
{
int l=0;
while(head != NULL)
{
head = h... | Merge point of two lists | HackerRank: Merge point of two lists
| C++ | mit | onyb/cpp,onyb/cpp | |
d56e0b156aa7a26effe70b411d2fd5ce7ea95290 | tests/test_basecpu.cpp | tests/test_basecpu.cpp | #include <cassert>
#include <gtest/gtest.h>
#include <system.h>
#include <basecpu.h>
#define TEST_CLASS BaseCPUTest
class BaseTestCPU : public BaseCPU {
public:
BaseTestCPU(int maxTicks, const System &sys) : maxTicks(maxTicks), ticks(0), resets(0), BaseCPU(sys) { }
void reset() { resets++; }
void tick() {... | Create tests for base cpu | Create tests for base cpu
| C++ | mit | aroxby/cpu,aroxby/cpu | |
8bf6535a1c2b39094c51413f57fce36ef71d8db7 | content/renderer/pepper/usb_key_code_conversion_win.cc | content/renderer/pepper/usb_key_code_conversion_win.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 "content/renderer/pepper/usb_key_code_conversion.h"
#include "base/basictypes.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#i... | // 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 "content/renderer/pepper/usb_key_code_conversion.h"
#include "base/basictypes.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#i... | Fix CodeForKeyboardEvent to properly calculate the scancode. | Fix CodeForKeyboardEvent to properly calculate the scancode.
Current code just uses the key_event.nativeKeyCode which is copied
from the Windows' lParam. The proper scancode needs to be shifted
and masked out of the lParam (as is done for UsbKeyCodeForKeyboardEvent.
BUG=325015
Review URL: https://codereview.chromium... | C++ | bsd-3-clause | patrickm/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,anirudhSK/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,hg... |
5ebbf12c81765b76a511eb2e983224fb3bce8795 | cpp/083_Remove_Duplicates_from_Sorted_List.cpp | cpp/083_Remove_Duplicates_from_Sorted_List.cpp | // 83. Remove Duplicates from Sorted List
/**
* Given a sorted linked list, delete all duplicates such that each element appear only once.
*
* For example,
* Given 1->1->2, return 1->2.
* Given 1->1->2->3->3, return 1->2->3.
*
* Tags: Linked List
*
* Author: Kuang Qin
*/
#include <iostream>
using namespa... | Add Solution for 083 Remove Duplicates from Sorted List | Add Solution for 083 Remove Duplicates from Sorted List
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
d6680e2fc8e263d929572ace992236971ac5d06b | perf/debug_stack_trace.cpp | perf/debug_stack_trace.cpp | //
// Created by Ivan Shynkarenka on 15.02.2016.
//
#include "cppbenchmark.h"
#include "debug/stack_trace.h"
const uint64_t iterations = 1000000;
BENCHMARK("Stack trace")
{
uint64_t crc = 0;
for (uint64_t i = 0; i < iterations; ++i)
crc += CppCommon::StackTrace().frames().size();
// Update ben... | Add capture stack trace benchmark | Add capture stack trace benchmark
| C++ | mit | chronoxor/CppCommon,chronoxor/CppCommon |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.