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 |
|---|---|---|---|---|---|---|---|---|---|
509ba4267a4fa354cd66190b4766b28001b8546f | MS/Overlapping_timestamp.cpp | MS/Overlapping_timestamp.cpp | #include <iostream>
#include<algorithm>
using namespace std;
class interval
{
int start;
int duration;
};
bool myCompare(interval a, interval b)
{
return a.start<b.start;
}
bool conflict(interval a, int timestamp)
{
if(a.start <= timestamp && (a.start + a.duration >= timestamp ) )
return true... | Update Interview question twitter microsoft | Update Interview question twitter microsoft
| C++ | mit | anishacharya/Common-Interview-Questions,anishacharya/Common-Interview-Questions | |
faac08d4a415e3ce0164dd0fab46e145f5bf63d9 | chapter24/chapter24_ex02.cpp | chapter24/chapter24_ex02.cpp | // Chapter 24, exercise 2: same as exercise 1, but with function objects
// instead of functions
#include<iostream>
#include "Matrix.h"
#include "MatrixIO.h"
using namespace std;
using namespace Numeric_lib;
namespace Numeric_lib {;
struct Triple1 {
void operator()(int& a) { a *= 3; }
};
struct Triple2 {
i... | Add Chapter 24, exercise 2 | Add Chapter 24, exercise 2
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
13f5a583d7120861170a3b93f60cb3adef2a31bf | src/logging.cc | src/logging.cc | /*
* Copyright (C) 2011 The Android Open Source Project
*
* 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 app... | Add missing file from last commit. | Add missing file from last commit.
Change-Id: Ia2b35a812b6787f27ec0c2935cd637a177caa92e
| C++ | apache-2.0 | treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst | |
2ca1bda9b6e7d4d183aca03f1d8839f48f18e295 | swapNodes.cpp | swapNodes.cpp | #include "lib/list.cpp"
using namespace std;
ListNode* swapNodes(ListNode* head) {
if (head == NULL || head->next == NULL) {
return head;
}
ListNode* fakeHead = new ListNode(0);
fakeHead->next = head;
ListNode* prev = fakeHead;
ListNode* current = head;
ListNode* temp;
while ... | Swap nodes in a pair | Swap nodes in a pair
| C++ | mit | srijanshetty/code | |
336b55dc252b8c0def4b3a817d8f9d4da7288bf6 | test/TestDistField.cpp | test/TestDistField.cpp | /**
* @file TestDistField.cpp
* @brief Unit test of DistField class
* @author cromod
* @date september 2015
*/
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE TestDistField
#include <boost/test/unit_test.hpp>
#include <iostream>
#include "DistField.hpp"
#include "Exception.hpp"
using namespace Cromod::Geo... | Add unit test of DistField class | Add unit test of DistField class
| C++ | lgpl-2.1 | cromod/CROMOD | |
419753e729eae0515ede9425356c067c5293b124 | test17_35.cpp | test17_35.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
cout << uppercase << hexfloat;
cout << sqrt(2) << endl;
return 0;
}
| Add solution for chapter 17 test 35 | Add solution for chapter 17 test 35 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
adc9cd70f2f87c9723d2d3d82814e28c9fcd836a | string/1791.cc | string/1791.cc | class Solution {
public:
bool areAlmostEqual(string s1, string s2) {
size_t index = 0, count = 0;
std::vector<size_t> arr;
while (index < s1.size()) {
if (s1[index] != s2[index]) {
++count;
if (count > 2)
return false;
... | Check if One String Swap Can Make Strings Equal | Check if One String Swap Can Make Strings Equal
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
00106431629302a9a6b19794dc18a2c42c293d74 | code/Modules/Time/Clock.cc | code/Modules/Time/Clock.cc | //------------------------------------------------------------------------------
// Clock.cc
//------------------------------------------------------------------------------
#include "Pre.h"
#include "Clock.h"
#if ORYOL_EMSCRIPTEN
#include <emscripten/emscripten.h>
#else
#include <chrono>
#endif
namespac... | //------------------------------------------------------------------------------
// Clock.cc
//------------------------------------------------------------------------------
#include "Pre.h"
#include "Clock.h"
#if ORYOL_EMSCRIPTEN
#include <emscripten/emscripten.h>
#elif ORYOL_WINDOWS
#include <Windows.h>
#in... | Use QueryPerformanceCounter on Windows instead of std::chrono::high_frequency_clock, since this has only 1ms accuracy in VS2013 | Use QueryPerformanceCounter on Windows instead of std::chrono::high_frequency_clock, since this has only 1ms accuracy in VS2013
| C++ | mit | tempbottle/oryol,xfxdev/oryol,floooh/oryol,tempbottle/oryol,aonorin/oryol,mgerhardy/oryol,wangscript/oryol,floooh/oryol,mgerhardy/oryol,floooh/oryol,code-disaster/oryol,zhakui/oryol,ejkoy/oryol,bradparks/oryol,zhakui/oryol,bradparks/oryol,ejkoy/oryol,aonorin/oryol,aonorin/oryol,floooh/oryol,ejkoy/oryol,waywardmonkeys/o... |
867c179ed3b5f338537a84da658ecac25addb9f7 | test/SemaCXX/attr-unused.cpp | test/SemaCXX/attr-unused.cpp | // RUN: %clang_cc1 -verify -Wunused -Wused-but-marked-unused -fsyntax-only %s
namespace ns_unused { typedef int Int_unused __attribute__((unused)); }
namespace ns_not_unused { typedef int Int_not_unused; }
void f() {
ns_not_unused::Int_not_unused i1; // expected-warning {{unused variable}}
ns_unused::Int_unused i... | Add missing test from r163874. | Add missing test from r163874.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@163910 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/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,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
f9367b502a23d91203a24492d6a73fbedbb6f8a3 | cpp/237_Delete_Node_in_a_Linked_List.cpp | cpp/237_Delete_Node_in_a_Linked_List.cpp | // 237. Delete Node in a Linked List
/**
* Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.
*
* Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, the linked list should become 1 -> 2 -> 4
* after calling your fun... | Add Solution for 237 Delete Node in a Linked List | Add Solution for 237 Delete Node in a Linked List
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
0b74cb79512c8b2cb10cae3d702c320f381ccb37 | framework/tests/JPetTaskLoaderTest/JPetTaskLoaderTest.cpp | framework/tests/JPetTaskLoaderTest/JPetTaskLoaderTest.cpp | #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetTaskLoaderTest
#include <boost/test/unit_test.hpp>
#define private public
#include "../../JPetTaskLoader/JPetTaskLoader.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE( my_test1 )
{
BOOST_REQUIRE(1==0);
}
BOOST_AUTO_TEST_SUITE_END()
| #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetTaskLoaderTest
#include <boost/test/unit_test.hpp>
#define private public
#include "../../JPetTaskLoader/JPetTaskLoader.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(defaultConstrutocTest)
{
/*JPetOptions::Options options = {
{"inputFile... | Change unit test for JPetTaskLoader. | Change unit test for JPetTaskLoader.
Former-commit-id: 1cbaa59c1010a96926acec93a2e313f482e62943 | C++ | apache-2.0 | alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework,wkrzemien/... |
04136620037f240e65cd65230e396bf48eede2ad | test/error/wrapper_never_used.cpp | test/error/wrapper_never_used.cpp | #include "Halide.h"
using namespace Halide;
using namespace Halide::Internal;
int main() {
Var x("x"), y("y");
Func f("f"), g("g"), h("h");
f(x, y) = x + y;
g(x, y) = 5;
h(x, y) = f(x, y) + g(x, y);
f.compute_root();
f.in(g).compute_root();
// This should cause an error since f.in(g)... | Add error test for func wrapper | Add error test for func wrapper
| C++ | mit | psuriana/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide | |
3a9caaa96edbc99bccb3e27dc7daa1eab4cef9a2 | engine/tests/methcla_tests.cpp | engine/tests/methcla_tests.cpp | // Copyright 2012-2013 Samplecount S.L.
//
// 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 agr... | Add some tests for worker thread implementation | Add some tests for worker thread implementation
| C++ | apache-2.0 | samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla | |
d6db8cb236d72563fc5e9d84dea2102f02995054 | lego_blocks.cpp | lego_blocks.cpp | #include <iostream>
#include <cstring>
#define MODULO 1000000007
#define MAX 1001
using namespace std;
long long mod_add(long long x, long long y)
{
return (x + y) % MODULO;
}
long long mod_sub(long long x, long long y)
{
return (x - y + MODULO) % MODULO;
}
long long mod_mult(long long x, long long y)
{
return (x... | Add the solution to "Lego Blocks". | Add the solution to "Lego Blocks".
| C++ | mit | clasnake/hackerrank,clasnake/hackerrank | |
8b41f5658897ef4201535b64877caf5970ac5b32 | chapter27/chapter27_ex08.cpp | chapter27/chapter27_ex08.cpp | // Chapter 27, exercise 8: write out every character on your keyboard together
// with its integer value; then, write the characters out in the order deter-
// mined by their integer value
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
void print(const string& s)
{
for (int i = 0; i... | Add Chapter 27, exercise 8 | Add Chapter 27, exercise 8
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
8162a20fe33d89e928953afb774a05734b80b073 | fun.cpp | fun.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <random>
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_int_distribution<> dist(5, 30);
static std::uniform_int_distribution<> negator(0, 1);
static std::uniform_int_distribution<> dir(1, 1... | Add alternative game, you know | Add alternative game, you know
| C++ | mit | Rapptz/compo-two | |
eba9acec3780d49acfd32447b1f20d7c366b0959 | test/CXX/special/class.copy/p3.cpp | test/CXX/special/class.copy/p3.cpp | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
// PR6141
template<typename T>
struct X {
X();
template<typename U> X(X<U>);
X(const X<T>&);
};
void f(X<int>) { }
struct Y : X<int> { };
struct Z : X<float> { };
// CHECK: define i32 @main()
int main() {
// CHECK: call void ... | Add test case for PR6141, which was fixed a few days ago | Add test case for PR6141, which was fixed a few days ago
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@97063 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
63a8418daaa92be9263ce40243652d77ef427888 | test/tcpserver_test.cpp | test/tcpserver_test.cpp | #include <gtest/gtest.h>
#include "tcpserver.hpp"
using namespace OpenSofa;
namespace
{
TEST(TCPServerTest, CanBeCreated)
{
Server * server = new TCPServer();
delete server;
}
}
| Add test file for tcpserver | Add test file for tcpserver
| C++ | mit | fbessou/open-sofa | |
f97138f36f34d2aa046d48c5e0a32a8bb570c1ec | ReactAndroid/src/main/jni/first-party/jni/fbjni/android/ReferenceChecking.cpp | ReactAndroid/src/main/jni/first-party/jni/fbjni/android/ReferenceChecking.cpp | /*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifndef __A... | Build first-party C++ deps of OSS React Native with Buck | Build first-party C++ deps of OSS React Native with Buck
Reviewed By: sdwilsh
Differential Revision: D2840290
fb-gh-sync-id: 3dd4f7ee83a520d5c01f7864f443a04aa73b35fa
| C++ | bsd-3-clause | imDangerous/react-native,charlesvinette/react-native,jhen0409/react-native,wenpkpk/react-native,xiayz/react-native,PlexChat/react-native,shrutic/react-native,exponentjs/react-native,Swaagie/react-native,htc2u/react-native,lelandrichardson/react-native,tarkus/react-native-appletv,Emilios1995/react-native,martinbigio/rea... | |
f98e2b86c70e821c754dd474918516312410707a | variadic_template_cpp17.cpp | variadic_template_cpp17.cpp | #include <iostream>
void foo() {
std::cout << __PRETTY_FUNCTION__ << "\n";
std::cout << " ";
}
template <typename Arg>
void foo(Arg arg) {
std::cout << __PRETTY_FUNCTION__ << "\n";
std::cout << arg << " ";
}
template <typename First, typename... Args>
void foo(First first, Args... args) {
std::co... | Add variadic template arguments example in c++17. | Add variadic template arguments example in c++17.
Compile with:
g++ -std=c++17 variadic_template_cpp17.cpp -o variadic_template_cpp17
| C++ | apache-2.0 | tisma/ctorious,tisma/ctorious | |
4285cf378fd249db6075787cf675f6b0e86d4183 | test/src/fast_cdbn_sgd_1.cpp | test/src/fast_cdbn_sgd_1.cpp | //=======================================================================
// Copyright (c) 2014-2016 Baptiste Wicht
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//==================================================================... | Prepare test case for dbn_fast | Prepare test case for dbn_fast
| C++ | mit | wichtounet/dll,wichtounet/dll,wichtounet/dll | |
a8806f7464a55d1cb9d481e7f798868322f6b9a3 | containers/sequences/list/list.special/db_swap_1.pass.cpp | containers/sequences/list/list.special/db_swap_1.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.
//
//===----------------------------------------... | Fix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists. | Fix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists.
git-svn-id: 273b07cebdae5845b4a75aae04570b978db9eb50@178892 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | bsd-3-clause | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx | |
8b6710ed0bd2d0f8b2d9cd6e98da63595b68c58f | src/listener.cpp | src/listener.cpp | #include "listener.h"
#include "log.h"
#include "buffers.h"
void conditionalEnqueue(QUEUE_TYPE(uint8_t)* queue, uint8_t* message,
int messageSize) {
if(queue_available(queue) < messageSize + 1) {
debug("Dropped incoming CAN message -- send queue full\r\n");
return;
}
for(in... | #include "listener.h"
#include "log.h"
#include "buffers.h"
void conditionalEnqueue(QUEUE_TYPE(uint8_t)* queue, uint8_t* message,
int messageSize) {
if(queue_available(queue) < messageSize + 2) {
debug("Dropped incoming CAN message -- send queue full\r\n");
return;
}
for(in... | Use \r in messages so they look decent in serial output. | Use \r in messages so they look decent in serial output.
| C++ | bsd-3-clause | mgiannikouris/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware |
c9e231bf5d54a4851513a0f29b5af3f8fc9d6153 | src/exceptions.cpp | src/exceptions.cpp | //=======================================================================
// Copyright Baptiste Wicht 2011-2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//================================================... | Fix glitch with Clang and boost | Fix glitch with Clang and boost
| C++ | mit | wichtounet/eddic,wichtounet/eddic,vogelsgesang/eddic,wichtounet/eddic,vogelsgesang/eddic,vogelsgesang/eddic | |
56717b26c386f5414c66161f32f2e26f530df167 | cmd/test_timer.cpp | cmd/test_timer.cpp | #include "command.h"
#include "timer.h"
#include <ctime>
#include <unistd.h>
using namespace MR;
using namespace App;
void usage ()
{
DESCRIPTION
+ "test timer interface";
REQUIRES_AT_LEAST_ONE_ARGUMENT = false;
}
void run ()
{
Timer timer;
CONSOLE ("printing Timer::current_time() at 10ms interval... | Add command to test timer (to be deleted on next commit) | Add command to test timer (to be deleted on next commit)
| C++ | mpl-2.0 | MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3 | |
95389dd07343c0b17612329ac1e586776eb13ecf | test/SemaCXX/expressions.cpp | test/SemaCXX/expressions.cpp | // RUN: clang -fsyntax-only -verify %s
void choice(int);
int choice(bool);
void test() {
// Result of ! must be type bool.
int i = choice(!1);
}
| Add missing test case for operator ! result type. | Add missing test case for operator ! result type.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@62532 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,apple/swift-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-cl... | |
aae3dc2518781c531a08455d1137e919e2149061 | src/Scripts/simulate.cpp | src/Scripts/simulate.cpp | #include <iostream>
#include <random>
#define MAX_NUM_ROWS 10
#define NUM_ITERS 1000
#define BLOCK_SIZE 512 // cache line size in bits.
#define NUM_BLOCKS 10000
#define NUM_DOCS BLOCK_SIZE * NUM_BLOCKS
// DESIGN NOTE: tried using go, but the publicly available binomial rng is approximately 10x slower.
// TODO: change... | Add initial 5-minute hack simulation script. | Add initial 5-minute hack simulation script.
| C++ | mit | danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel | |
9cb614291a272d58f3bd41ad4d4a24c3299c1c11 | chapter21/chapter21_ex06.cpp | chapter21/chapter21_ex06.cpp | // Chapter 21, Exercise 6: implement the Fruit example (set) using a
// set<Fruit*,Fruit_comparison> (pointers instead of copies), i.e., define a
// comparison operation for Fruit*
#include "../lib_files/std_lib_facilities.h"
#include<set>
//----------------------------------------------------------------------------... | Add Chapter 21, exercise 6 | Add Chapter 21, exercise 6
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
55dc3fe989b96f242767c6d1da8705cb379fa600 | others/DS/BT/left_view_tree.cc | others/DS/BT/left_view_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;
}
void leftViewUtil(NODE* root, int level, int* max_level) {
if (root == nullptr) r... | Print Left View of the tree. | Print Left View of the tree.
| C++ | apache-2.0 | pshiremath/practice,pshiremath/practice | |
a4d63e3ec05bf799acb649b0c23e9b33576bae0f | src/streams/decodebase64.cpp | src/streams/decodebase64.cpp | #include "base64inputstream.h"
#include <stdio.h>
using namespace jstreams;
using namespace std;
int
main(int argc, char** argv) {
for (int i=1; i<argc; ++i) {
string out = Base64InputStream::decode(argv[i], strlen(argv[i]));
printf("%s\n", out.c_str());
}
return 0;
}
| Add small test program for base64 decoding. | Add small test program for base64 decoding.
svn path=/trunk/playground/base/strigi/; revision=612338
| C++ | lgpl-2.1 | KDE/strigi | |
0db8bd87e9b247c2ed3b654c5fd3d3b7188aecea | seminar/queue/queue_stacks.cpp | seminar/queue/queue_stacks.cpp | #include <iostream>
#include <stack>
using std::cout;
using std::endl;
using std::stack;
class Queue {
stack<int> stackIn, stackOut;
void transfer() {
while (!stackIn.empty()) {
stackOut.push(stackIn.top());
stackIn.pop();
}
}
public:
bool empty() {
return stackIn.e... | Add queue implemented with 2 stacks | Add queue implemented with 2 stacks
| C++ | mit | dimitaruzunov/data-structures-fmi-2016 | |
e95aa87e1660675151dc65569183332b7123b7fe | C++/141_Linked_List_Cycle.cpp | C++/141_Linked_List_Cycle.cpp | // 141 Linked List Cycle
/**
* Given a linked list, determine if it has a cycle in it.
*
* Follow up:
* Can you solve it without using extra space?
*
* Tag: Linked List, Two Pointers
*
* Author: Yanbin Lu
*/
#include <stddef.h>
#include <vector>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#includ... | Add 141 Linked List Cycle | Add 141 Linked List Cycle
| C++ | mit | FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res | |
3d26fae0fb52cd10f99b075f22a2ccc2ad5c3be1 | test/asan/TestCases/Windows/coverage-basic.cc | test/asan/TestCases/Windows/coverage-basic.cc | // RUN: rm -rf %T/coverage-basic
// RUN: mkdir %T/coverage-basic && cd %T/coverage-basic
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o test.exe
// RUN: env ASAN_OPTIONS=coverage=1 %run test.exe
//
// RUN: %sancov print *.sancov | FileCheck %s
#include <stdio.h>
void foo() { fprintf(stderr, "FOO\n"); }
void bar() {... | Add a test that makes sure coverage works at least in the simple cases | [ASan/Win] Add a test that makes sure coverage works at least in the simple cases
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@234496 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 | |
d163f6c8b0eda17f51cfae08fba746ec08326ff4 | linkedlist/138.cc | linkedlist/138.cc | /*
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
*/
class Solution {
public:
Node* copyRandomList(Node* head) {
if (!head) return nullptr;
Node* temp = ... | Copy List with Random Pointer | Copy List with Random Pointer
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
4d966476f4488cb2f6a744b9d12119193f8f0994 | cpp/454_4Sum_II.cpp | cpp/454_4Sum_II.cpp | // 454. 4Sum II
/**
* Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.
*
* To make problem a bit easier, all A, B, C, D have same length of N where 0 <= N <= 500. All integers are in the range of -2^28 to 2^28 - 1
* and the ... | Add Solution for 454 4Sum II | Add Solution for 454 4Sum II
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
67ab97f12c8b9b5f23f594c57f82459db592e400 | digits_of_1_by_n.cpp | digits_of_1_by_n.cpp | /*
* Copyright 2010, NagaChaitanya Vellanki
*
* Author NagaChaitanya Vellanki
*
* Print k digits 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;
int32_t k = 1;
cout << "Enter n(n > 1) and number o... | Add Printing k digits of 1/n | Add Printing k digits of 1/n
| C++ | isc | chaitanyav/fun_code,chaitanyav/fun_code | |
d60e461fc2c37869cc340149a0dfcde7846e6bf8 | week8/solutions/problem1/concert.cpp | week8/solutions/problem1/concert.cpp | #include <iostream>
#include <cstring>
using namespace std;
class Ticket {
int seat;
int price;
public:
Ticket(int _seat) : seat(_seat) {
if (seat >= 1 && seat <= 30)
price = 70;
else if (seat >= 31 && seat <= 70)
price = 55;
else if (seat >= 71 && seat <=... | Add sample solution to the first problem for the first test | Add sample solution to the first problem for the first test
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
e9997d637263f015442b7aaedd27bc5e2e6c9239 | Misc/Win32Test2.cc | Misc/Win32Test2.cc | /*
* This test demonstrates that putting a console into selection mode does not
* block the low-level console APIs, even though it blocks WriteFile.
*/
#define _WIN32_WINNT 0x0501
#include "../Shared/DebugClient.cc"
#include <windows.h>
#include <stdio.h>
const int SC_CONSOLE_MARK = 0xFFF2;
CALLBACK DWORD writerT... | Add another windows test case. | Add another windows test case.
| C++ | mit | traff/winpty,dscho/winpty,peters/winpty,rprichard/winpty,dscho/winpty,peters/winpty,dscho/winpty,fracting/winpty,peters/winpty,rprichard/winpty,fracting/winpty,fracting/winpty,traff/winpty,fracting/winpty,rprichard/winpty,traff/winpty,dscho/winpty,peters/winpty,rprichard/winpty,traff/winpty | |
c90d447e72e597b69b991504ca3585cab4fb0905 | base/android/jni_registrar.cc | base/android/jni_registrar.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 "base/android/jni_registrar.h"
#include "base/logging.h"
#include "base/android/jni_android.h"
namespace base {
namespace android {
bool R... | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_registrar.h"
#include "base/logging.h"
#include "base/android/jni_android.h"
namespace base {
namespace android {
bool R... | Fix Android RegisterNativeMethods failure logic | Fix Android RegisterNativeMethods failure logic
Function returns bool, so !func(env) should be enough. The < 0 check is
probably leftover crud when upstreamed.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11833047
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@176266 0039d316-1c4b-4281-b951-d872f2... | C++ | bsd-3-clause | Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,littlstar/chromium.src,littlstar/chromium.src,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,mogoweb/chromi... |
a64d4604f14056a6a0dfb53421e487e16a653fca | src/algorithms/cell_refine.cpp | src/algorithms/cell_refine.cpp | #include "cell_refine.hpp"
#include <viennagrid/algorithm/refine.hpp>
/***************
* CELL_REFINE *
***************/
// Triangular
tuple TriangularCartesian2D_Domain_cell_refine(TriangularCartesian2D_Domain domain_in, TriangularCartesian2D_Segmentation segmentation_in, bool (*predicate)(const TriangularCartesi... | Implement cell-refinement of triangular cartesian 2D cells. | Implement cell-refinement of triangular cartesian 2D cells.
| C++ | mit | jonancm/viennagrid-python,jonancm/viennagrid-python,jonancm/viennagrid-python | |
b07180690ea7609209dd730315a4d4a3dd6d57da | test/src/autoencoder_dbn.cpp | test/src/autoencoder_dbn.cpp | //=======================================================================
// Copyright (c) 2014-2015 Baptiste Wicht
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//==================================================================... | Add test for autoencoder with RBM pretraining | Add test for autoencoder with RBM pretraining
| C++ | mit | wichtounet/dll,wichtounet/dll,wichtounet/dll | |
6847b87eb51f8af07ebe0fdfef81bf91bd6540a3 | cpp/006_ZigZag_Conversion.cpp | cpp/006_ZigZag_Conversion.cpp | // 6. ZigZag Conversion
/**
* The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this:
* (you may want to display this pattern in a fixed font for better legibility)
*
* P A H N
* A P L S I I G
* Y I R
*
* And then read line by line: "PAHNAPLSIIGYIR"
* Write ... | Add Solution 006 ZigZag Conversion | Add Solution 006 ZigZag Conversion
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
a4bb2d075da74656747aec943345effb2dc75ea6 | test/std/input.output/stream.buffers/streambuf/streambuf.virtuals/streambuf.virt.put/xsputn.PR14074.pass.cpp | test/std/input.output/stream.buffers/streambuf/streambuf.virtuals/streambuf.virt.put/xsputn.PR14074.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 PR14074 | [libc++] Add a test for PR14074
PR14074 was fixed in r165884, but no tests were added.
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@354943 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
7795f06d6f72dc6b8c13f6e5f619498a63b0bfa2 | language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp | language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.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.
//
//===----------------------------------------... | Test for 'bad_array_length'; got left out of initial commit | Test for 'bad_array_length'; got left out of initial commit
git-svn-id: 273b07cebdae5845b4a75aae04570b978db9eb50@190614 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | bsd-3-clause | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx | |
52453e7daa26ef4e817c59acf8a35e2555664d59 | Snippets/compare_doubles.cpp | Snippets/compare_doubles.cpp | #include <stdio.h>
using namespace std;
const double EPS = 1e-15;
/*
* Return
* -1 if x < y
* 0 if x == y
* 1 if x > y
*/
int cmp (double x, double y){
return (x <= y + EPS) ? (x + EPS < y) ? -1 : 0 : 1;
}
int main(){
double d1 = 0.00000000000212;
double d2 = 0.00000000000213;
int res = ... | Implement useful function to compare double in order to prevent problems with precision. | Implement useful function to compare double in order to prevent problems with precision.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
88bb48c1fac0e2386363c10894cfc320839296c9 | span01.cpp | span01.cpp | // g++ -o span01 -Wall -Wextra -pedantic -std=c++14 -I GSL/include span01.cpp
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <gsl/span>
// See e.g. http://codexpert.ro/blog/2016/03/07/guidelines-support-library-review-spant/
template <typename T>
void write_data_pass_by_const_r... | Add an example using gsl::span<T> | Add an example using gsl::span<T>
| C++ | mit | mpoullet/cpp-snippets,mpoullet/cpp-snippets | |
b003093609337d9ba766d1e035a91512fbf94b0f | specimen5/main.cpp | specimen5/main.cpp | // A nested loop.
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int *A = new int[n];
int *B = new int[n];
for (int i = 0; i < n; ++i) {
scanf("%d", &A[i]);
}
for (int i = 0; i < n; ++i) {
scanf("%d", &B[i]);
}
int sum = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < ... | Add nested loop example specimen 5 | Add nested loop example specimen 5
| C++ | mit | smanilov/loop-examples,smanilov/loop-examples | |
18ab9c5bd381a8b88767f37aa89e90aded67b213 | src/main/c/main.cpp | src/main/c/main.cpp | #include "server.h"
using namespace SeaSocks;
int main(int argc, const char* argv[]) {
Server server;
server.serve("src/web", 9090);
return 0;
}
| #include "server.h"
/*
* TODOs:
* * Add logging
* * Connection class does *everything*. Work out better division of labour; server should do more, connection should just be connection stuff, handlers for data?
* * sort out buffers and buffering
* * work out what state to hang on to; handle multiple WS endpoints
... | Add a list of TODOs | [mg] Add a list of TODOs
| C++ | bsd-2-clause | RobertoMalatesta/seasocks,RobertoMalatesta/seasocks,Shin-nn/seasocks,offa/seasocks,RobertoMalatesta/seasocks,offa/seasocks,tet112001/seasocks,tet112001/seasocks,offa/seasocks,Shin-nn/seasocks,RobertoMalatesta/seasocks,mattgodbolt/seasocks,offa/seasocks,RobertoMalatesta/seasocks,Shin-nn/seasocks,mattgodbolt/seasocks,tet... |
cb07a66eefa41e8687fa310544c43bf6a44681fc | workbench/src/mnist_rnn_perf.cpp | workbench/src/mnist_rnn_perf.cpp | //=======================================================================
// Copyright (c) 2014-2020 Baptiste Wicht
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//==================================================================... | Add a RNN perf workbench | Add a RNN perf workbench
| C++ | mit | wichtounet/dll,wichtounet/dll,wichtounet/dll | |
7d5c8eb8e61cc491502e692c75f801d52c4d7ae6 | 1-common-tasks/classes/lexicographic-compare.cpp | 1-common-tasks/classes/lexicographic-compare.cpp | // Lexicographic-compare
// C++11
#include <tuple>
class foo
{
public:
foo(int n_, char c_, double d_)
: n{n_}, c{c_}, d{d_}
{}
friend bool operator<(const foo& lh, const foo& rh)
{
return std::tie(lh.n, lh.c, lh.d)
< std::tie(rh.n, rh.c, rh.d);
}
private:
int n;
char c;
double d;
};
/... | Add lexicographical compare with tie | Add lexicographical compare with tie
| C++ | cc0-1.0 | sftrabbit/CppSamples-Samples,brunotag/CppSamples-Samples,tmwoz/CppSamples-Samples,rollbear/CppSamples-Samples,thatbrod/CppSamples-Samples,vjacquet/CppSamples-Samples | |
cca19e412ee29109c6d67a5156264bf75bdc3561 | src/rpg_chipset.cpp | src/rpg_chipset.cpp | /////////////////////////////////////////////////////////////////////////////
// This file is part of EasyRPG.
//
// EasyRPG 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, o... | /////////////////////////////////////////////////////////////////////////////
// This file is part of EasyRPG.
//
// EasyRPG 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, o... | Set default value for terrain_data field | Set default value for terrain_data field
| C++ | mit | Zegeri/liblcf,glynnc/liblcf,Ghabry/easyrpg-liblcf,carstene1ns/easyrpg-liblcf,Ghabry/easyrpg-liblcf,EasyRPG/liblcf,fdelapena/easyrpg-liblcf,fdelapena/easyrpg-liblcf,Zegeri/liblcf,glynnc/liblcf,EasyRPG/liblcf,glynnc/liblcf,Ghabry/easyrpg-liblcf,Zegeri/liblcf,glynnc/liblcf,EasyRPG/liblcf,carstene1ns/easyrpg-liblcf,EasyRPG... |
5b364406fdec3043bf09f39a00b5be1d831bc806 | app/simple_example.cpp | app/simple_example.cpp | #include <cmath>
#include <iostream>
#include <random>
#include <thread>
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "driver/engine.hpp"
#include "lib/abstract_data_loader.hpp"
#include "lib/labeled_sample.hpp"
#include "lib/parser.hpp"
using namespace csci5570;
using Sample = double;
using DataS... | Add a simple example application | [Example] Add a simple example application
| C++ | apache-2.0 | TatianaJin/csci5570,TatianaJin/csci5570 | |
fb642e74c0cf89592440697c9bc34cfb31e0d6d1 | UDPReader/reader.cpp | UDPReader/reader.cpp | // A simple program that computes the square root of a number
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <allegro5/allegro.h>
#include "TutorialConfig.h"
int main (int argc, char *argv[])
{
if (argc < 2)
{
fprintf(stdout,"%s Version %d.%d\n", argv[0],
... | Add sample code file for Cmake tests | Add sample code file for Cmake tests
| C++ | bsd-3-clause | rlam1/udp-cockpit | |
328dab9635f1d3a032b8f7fe235b765efe438a23 | main.cpp | main.cpp | //
// main.cpp
// CPP
//
// Created by Mgen on 8/27/16.
// Copyright © 2016 Mgen. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
// runs a binary search on a given array, returns the insert position of a given integer
int findInsertPosition(... | Implement a binary search on a sorted array | Implement a binary search on a sorted array
| C++ | mit | mgenware/k-closest-elements | |
8a1d229ac0c1d0860afcc5342c654b61ed0eed2d | test/Parser/cxx-member-initializers.cpp | test/Parser/cxx-member-initializers.cpp | struct x {
x() : a(4) ; // expected-error {{expected '{'}}
};
struct y {
int a;
y() : a(4) ; // expected-error {{expected '{'}}
};
| Add a test for PR3733. | Add a test for PR3733.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@81622 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... | |
aaa4ba86bf8c63d25da280428e0b1e4a5954b5b5 | array/2133.cc | array/2133.cc | class Solution {
public:
bool checkValid(vector<vector<int>>& matrix) {
for (int i = 0; i < matrix.size(); ++i) {
std::vector<int> check(matrix.size()+1, 0);
for (int j = 0; j < matrix[0].size(); ++j) {
if (check[matrix[i][j]] == 1) return false;
check... | Check if Every Row and Column Contains All Numbers | Check if Every Row and Column Contains All Numbers
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
a9699d4f4e037582b86569a378cff035f0bdc904 | 226_Invert_Binary_Tree.cpp | 226_Invert_Binary_Tree.cpp | /**
* [Link:] https://leetcode.com/problems/invert-binary-tree/
*/
/**
* 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* invertTree(Tree... | Add solution for 226. Invert Binary Tree. | Add solution for 226. Invert Binary Tree. | C++ | mit | wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode | |
1619342d7ffcfdfd3e18b7c6da38d2bcbe2bb3f5 | test/CXX/special/class.copy/p20.cpp | test/CXX/special/class.copy/p20.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
struct ConstCopy {
ConstCopy();
ConstCopy &operator=(const ConstCopy&);
};
struct NonConstCopy {
NonConstCopy();
NonConstCopy &operator=(NonConstCopy&);
};
struct VirtualInheritsNonConstCopy : virtual NonConstCopy {
VirtualInheritsNonConstCopy();
VirtualInheri... | Test implicit declaration of copy assignment operator with non-const argument | Test implicit declaration of copy assignment operator with non-const argument
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@107421 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-cl... | |
e09afdc5fbcf17c1b23d012fc885fb9741a23645 | breadth-first-search/testBfs.cpp | breadth-first-search/testBfs.cpp | #include<iostream>
#include "bfs.h" // My implementation of breadth first search
#include<vector>
// tests Bfs traversal, distances and paths
void testBfs(){
// edges
std::vector<std::vector<int> > edges = { {1,5},
{3,5},
{2,4},
{1,4},
{5,7},
{7,6},
... | Add test program for breadth first search | Add test program for breadth first search
| C++ | mit | rohitkhilnani/cpp-And-Me | |
b9e47fe89d4cbdecbec686265f2f15a096e73d75 | Strings/LCS.cpp | Strings/LCS.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int M_MAX = 20; // Máximo size del String 1
const int N_MAX = 20; // Máximo size del String 2
int m, n; // Size de Strings 1 y 2
string X; // String 1
string Y; // String 2
int memo[M_MAX + 1][N_MAX + 1];
int lcs (int m, int n) {
for (int i = 0; i ... | Add algorithm to fing the len of longest common subsequenc.. | Add algorithm to fing the len of longest common subsequenc..
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
c766cb230394356c704d3d20948aa4e4179486c7 | chapter21/chapter21_trythis1.cpp | chapter21/chapter21_trythis1.cpp | // Chapter 21, Try This 1: test two different definitions of the find algorithm
#include "../lib_files/std_lib_facilities.h"
//------------------------------------------------------------------------------
template<class In, class T>
In find1(In first, In last, const T& val)
{
while (first!=last && *first!=val) ... | Add Chapter 21, Try This 1 | Add Chapter 21, Try This 1
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
34887bef64b8ed12eb3057aa4d302548c715cadd | test/scenarios/join_dependent_on_lock.cpp | test/scenarios/join_dependent_on_lock.cpp | /**
* This test checks whether we detect a deadlock arising from a parent thread
* trying to join a child who requires a lock held by its parent in order to
* finish.
*/
#include <d2mock.hpp>
int main(int argc, char const* argv[]) {
d2mock::mutex G;
d2mock::thread t1([&] {
G.lock();
G.un... | Add a scenario showing a kind of deadlock that is unsupported right now. | Add a scenario showing a kind of deadlock that is unsupported right now.
| C++ | mit | ldionne/d2 | |
80464680ce2ae47d30b9a404597643e5d8bf6bba | test/Index/load-staticassert.cpp | test/Index/load-staticassert.cpp |
static_assert(2 + 2 == 4, "Simple maths");
// RUN: c-index-test -test-load-source all -fno-delayed-template-parsing -std=c++11 %s | FileCheck %s
// CHECK: load-staticassert.cpp:2:1: StaticAssert=:2:1 (Definition) Extent=[2:1 - 2:42]
// CHECK: load-staticassert.cpp:2:15: BinaryOperator= Extent=[2:15 - 2:25]
// CHECK: ... | Test that static_assert is properly visited in liblcang | [test] Test that static_assert is properly visited in liblcang
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@285994 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,apple/swift-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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-cl... | |
1a94a46380f0d88d6cf73ce3f5758bcaf4c692e9 | solution019.cpp | solution019.cpp | /**
* Remove Nth Node From End of List
* Double pointer.
*
* cpselvis(cpselvis@gmail.com)
* August 18th, 2016
*/
#include<iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* h... | Remove nth element from the end of list. | Remove nth element from the end of list.
| C++ | mit | cpselvis/leetcode | |
41dafa88609ef07f0b42f00b23406a86c071939e | src/xenia/base/exception_handler_linux.cc | src/xenia/base/exception_handler_linux.cc | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. ... | Add stub exception handler backend for linux | Add stub exception handler backend for linux
| C++ | bsd-3-clause | sephiroth99/xenia,sephiroth99/xenia,sephiroth99/xenia | |
d2ab243399f29b2d95d77f6034519c40e8ac69cc | chapter20/chapter20_trythis8.cpp | chapter20/chapter20_trythis8.cpp | // Chapter 20, Try This 8: same as Try This 7, but with an array of int, a
// vector<int> and a list<int>, with the value { 1, 2, 3, 4, 5 }.
#include "../lib_files/std_lib_facilities.h"
// requires size of array as it decays to a pointer
void ai_func(const int ai[], int sz)
{
cout << "Number of elements in ai: " ... | Add Chapter 20, Try This 8 | Add Chapter 20, Try This 8
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
7ab0482ec6bad12a319bb55390ccb4aa69f43b66 | DataStructures/Queues/queue_using_circular_array.cpp | DataStructures/Queues/queue_using_circular_array.cpp | #include <iostream>
using namespace std;
struct Queue {
int *array;
int front, rear;
int size;
};
Queue* createQueue(int size) {
Queue *queue = new Queue();
if (!queue) return NULL;
queue->front = queue->rear = -1;
queue->size = size;
queue->array = new int[queue->size];
if (!que... | Implement queue using circular array | Implement queue using circular array
Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
| C++ | apache-2.0 | WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace | |
7b6eec7e1175624458a48945bba3f6400e754d33 | tensorflow/core/lib/gtl/optional.cc | tensorflow/core/lib/gtl/optional.cc | /* Copyright 2017 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... | Add cc file with definition of tensorflow::gtl::nullopt. | Add cc file with definition of tensorflow::gtl::nullopt.
If you ODR-use nullopt, you currently get a linker error. Oops.
PiperOrigin-RevId: 172387553
| C++ | apache-2.0 | tensorflow/tensorflow-pywrap_tf_optimizer,hfp/tensorflow-xsmm,aam-at/tensorflow,tensorflow/tensorflow,Bismarrck/tensorflow,snnn/tensorflow,dyoung418/tensorflow,ravindrapanda/tensorflow,kevin-coder/tensorflow-fork,brchiu/tensorflow,AnishShah/tensorflow,drpngx/tensorflow,Intel-Corporation/tensorflow,ppwwyyxx/tensorflow,r... | |
7b70cf68b67dcff1f8320f276e59cc72eb16ccbf | test/Index/invalid-rdar-8236270.cpp | test/Index/invalid-rdar-8236270.cpp | // RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s
// This test case previously just crashed the frontend.
struct abc *P;
int main(
// CHECK: StructDecl=abc:5:8 Extent=[5:1 - 5:11]
// CHECK: VarDecl=P:5:13 (Definition) Extent=[5:8 - 5:14]
// CHECK: VarDecl=main:6:5 (Definition) Extent=[6:1 - 6:9]
| Add test case for crash reported in <rdar://problem/8236270> (which has since been fixed in trunk). | Add test case for crash reported in <rdar://problem/8236270> (which has since been fixed in trunk).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@109834 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-cl... | |
6daa4e68083baab68f037d673fb69a5820467f37 | src/LRUCacheTest.cpp | src/LRUCacheTest.cpp | #include <gtest/gtest.h>
#include "LRUCache.hxx"
TEST(LRUCache, InsertPair)
{
LRUCache<int, std::string, 3> cache;
auto pairResult = cache.insert(std::make_pair<int, std::string>(1, "1"));
EXPECT_EQ(std::string("1"), pairResult.first->second);
EXPECT_TRUE(pairResult.second);
EXPECT_EQ(1, cache.siz... | Add unit tests covering operator[] and insert | Add unit tests covering operator[] and insert
| C++ | mit | LeFlou/CppCache | |
b7e05fbe663fd54c2943c81f6c5964af4ebe01ba | 2013-nov-bronze/1-combo/cpp11/main.cpp | 2013-nov-bronze/1-combo/cpp11/main.cpp | #include <istream>
#include <fstream>
#include <set>
#include <vector>
#include <array>
#include <algorithm>
#include <iterator>
using namespace std;
int main() {
ifstream cin("combo.in");
ofstream cout("combo.out");
int size;
cin >> size;
set<int> options;
for (int i = 0; i < 2; i++) {
int a, b, c;
cin >... | Add C++11 solution for Nov. 2013 Bronze Problem 1 | Add C++11 solution for Nov. 2013 Bronze Problem 1
| C++ | mit | hsun324/usaco-solutions,hsun324/usaco-solutions | |
e1ca17bd33e23673bd43576c4c6734b36b0e9482 | Tests/UnitTests/Tasks/SimpleTasks/ControlTaskTests.cpp | Tests/UnitTests/Tasks/SimpleTasks/ControlTaskTests.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 ControlTask | [WIP] test: Add unit test for ControlTask
| C++ | mit | Hearthstonepp/Hearthstonepp,Hearthstonepp/Hearthstonepp | |
f486de5c767e6edb2bcc477901887e4ac41dbd6e | src/emscripten/EmMain.cpp | src/emscripten/EmMain.cpp |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "glsl_optimizer.h"
static glslopt_ctx* gContext = 0;
#include <emscripten/val.h>
#define str(str) std::string(str)
static bool compileShader2(const char* originalShader, bool vertexShader)
{
if( !originalShader )
return false;
const glslopt_s... | Add entry file building glsl optimzier for emscripten | Add entry file building glsl optimzier for emscripten
| C++ | mit | benaadams/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer | |
4aa9e0eba4a78c22e4e91aa1b2817610e535c0c9 | src/classad/fuzzer.cpp | src/classad/fuzzer.cpp | #include "classad/classad_distribution.h"
#include <string>
#include <string.h>
#include <sys/types.h>
/* This is the driver for the classad fuzz tester.
* Note this is intentionally not in the cmake file, it should not be built
* by default.
*
* To use, compile all of classads with clang -fsanitize=fuzzer-nolin... | Add fuzzing driver to classads HTCONDOR-814 | Add fuzzing driver to classads HTCONDOR-814
| C++ | apache-2.0 | htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor | |
75319c14bcbcc430f09889c39e0843929c20b5ef | examples/SDP_3x_read_interrupt.cpp | examples/SDP_3x_read_interrupt.cpp | #include <Arduino.h>
#include "sdplib.h"
#include "Wire.h"
#define IRQ_PIN 4
SDPclass sdp;
double diff_pressure, temperature;
bool sdpFlag = false;
// Interrupt routine
void SDP_isr(void){
sdpFlag = true;
}
void setup(){
while(!Serial){
Serial.begin(115200);
}
pinMode(IRQ_PIN, INPUT_P... | Add example to read SDP3x using isr | Add example to read SDP3x using isr | C++ | mit | pablovillars/Sensirion_SDP_3x_8xx_Library | |
2b4fe9a67cf22a0716e6a7404a2d452820e9ccab | test/InputArgsTest.cpp | test/InputArgsTest.cpp | // Standard headers
#include <memory>
#include <iostream>
// External headers
#include "gmock/gmock.h"
// Internal headers
#include "InputArgs.hpp"
// Alias
using ::testing::DoubleNear;
const double PI = 3.141592653589793238462643;
class ASetOfInputArguments : public testing::Test {
};
TEST_F(ASetOfInputArguments... | Add tests for 'InputArg' class | Add tests for 'InputArg' class
| C++ | apache-2.0 | renatocf/MAC0438-EP2,renatocf/MAC0438-EP2 | |
7ee34209c63120c771290269f3a0845e9f90ac75 | test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp | test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.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 missed test in r276090. | Add missed test in r276090.
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@276091 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
82d1812ffe8ac7f1b195f2e4d72020edb79854dd | test/correctness/bool_compute_root.cpp | test/correctness/bool_compute_root.cpp | #include <stdio.h>
#include <Halide.h>
using namespace Halide;
int main(int argc, char **argv) {
Var x, y;
Func pred("pred");
pred(x, y) = x < y;
Func selector("selector");
selector(x, y) = select(pred(x, y), 1, 0);
// Load a vector of 8 bools
pred.compute_root();
selector.compute_r... | Add a test to cover the bug that was fixed recently where bool in memory is a byte, but a bool vector inside llvm is bitpacked so loading 8 bools would load a byte, not 8-bytes, if vectorized. | Add a test to cover the bug that was fixed recently where bool in
memory is a byte, but a bool vector inside llvm is bitpacked so
loading 8 bools would load a byte, not 8-bytes, if vectorized.
Former-commit-id: aedfad7bcbc248e545e7666d1a2b0cd74407c6a7 | C++ | mit | Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide | |
8d487d40b29b05aaf95a9f960c2006a69c69d23a | examples/gpio_extint_pin_change.cpp | examples/gpio_extint_pin_change.cpp | #include "board.h"
#include <aery32/gpio.h>
#include <aery32/delay.h>
#include <aery32/intc.h>
using namespace aery;
void isrhandler(void)
{
gpio_toggle_pin(LED);
delay_ms(100); /* Reduce glitch */
porta->ifrc = (1 << 0); /* Remember to clear the interrupt */
}
int main(void)
{
init_board();
/* GPIO pins 0-13 ... | Add new example: external interrupt on pin change | Add new example: external interrupt on pin change
| C++ | bsd-3-clause | aery32/aery32,denravonska/aery32,denravonska/aery32,aery32/aery32 | |
fb4c58ab47ef95821b3bd877a0b5c7041c405418 | src/condor_io/generate_keyfile.cpp | src/condor_io/generate_keyfile.cpp |
#include "condor_auth_passwd.h"
#include "classad/classad.h"
#include "classad/sink.h"
#include "match_prefix.h"
#include "CondorError.h"
#include "condor_config.h"
void print_usage(const char *argv0) {
fprintf(stderr, "Usage: %s -identity USER@UID_DOMAIN [-token VALUE]\n\n"
"Generates a derived key from the local... | Add executable allowing generation of the keyfile. | Add executable allowing generation of the keyfile.
| C++ | apache-2.0 | htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor | |
1a8835e0b5cda4322b993f337f379ed314697f64 | 237_delete_node_in_a_linked_list.cc | 237_delete_node_in_a_linked_list.cc | // https://leetcode.com/problems/delete-node-in-a-linked-list/
// Since node given is not a tail. We could do a trick: copy the contents of
// the next node, then connect to the next of next, delete the next node.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ... | Add a solution to problem 237: Delete Node in a Linked List. | Add a solution to problem 237: Delete Node in a Linked List.
| C++ | apache-2.0 | shen-yang/leetcode_solutions,shen-yang/leetcode_solutions,shen-yang/leetcode_solutions | |
dbe7f4f8913db16a2ce367be2f19de4937c08462 | base/rand_util_nacl.cc | base/rand_util_nacl.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 "base/rand_util.h"
#include <nacl/nacl_random.h>
#include "base/basictypes.h"
#include "base/logging.h"
namespace {
void GetRandomBytes(v... | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/rand_util.h"
#include <nacl/nacl_random.h>
#include "base/basictypes.h"
#include "base/logging.h"
namespace {
void GetRandomBytes(v... | Stop using the nacl_secure_random_init() which is deprecated. | Stop using the nacl_secure_random_init() which is deprecated.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3881
Review URL: https://codereview.chromium.org/345733007
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@278609 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | markYoungH/chromium.src,ondra-novak/chromium.src,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,axinging/chromium-cro... |
d164a397da66143db1855296a87f4853c3291236 | test/error/bad_fold.cpp | test/error/bad_fold.cpp | #include <stdio.h>
#include "Halide.h"
using namespace Halide;
int main(int argc, char **argv) {
Var x, y, c;
Func f, g;
f(x, y) = x;
g(x, y) = f(x-1, y+1) + f(x, y-1);
f.store_root().compute_at(g, y).fold_storage(y, 2);
Image<int> im = g.realize(100, 1000);
printf("Should have gotten ... | Add test for a bad fold. | Add test for a bad fold.
Former-commit-id: 9185511590542db408c42d13df49a5b7c5e8d2d1 | C++ | mit | Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide | |
2e80bf6dc62af6311588d4407e3a6f41693dcc60 | test/src/value/main.cpp | test/src/value/main.cpp | /*
Copyright © 2015 Jesse 'Jeaye' Wilkerson
See licensing at:
http://opensource.org/licenses/BSD-3-Clause
File: test/src/value/main.cpp
Author: Jesse 'Jeaye' Wilkerson
*/
#include <jeayeson/jeayeson.hpp>
#include <jest/jest.hpp>
#include "map/ctor.hpp"
int main()
{
jest::worker const j{};
return j()... | Add the start of a new value test suite | Add the start of a new value test suite
| C++ | bsd-3-clause | kaidokert/jeayeson,kaidokert/jeayeson,jeaye/jeayeson,kaidokert/jeayeson,jeaye/jeayeson,jeaye/jeayeson | |
16572905d2088cbe28294358dc137483ba5dd6a4 | insertion_analysis.cpp | insertion_analysis.cpp | #include <iostream>
using namespace std;
long merge(long *a, long start, long mid, long end)
{
long sum = 0;
long *temp = new long[end - start + 1];
long i = mid, j = end;
long k = end - start;
while (i >= start && j >= mid + 1) {
if (a[i] > a[j]) {
temp[k--] = a[i--];
sum += j - mid;
}
else {
temp... | Add the solution to "Insertion Sort Advanced Analysis". | Add the solution to "Insertion Sort Advanced Analysis".
| C++ | mit | clasnake/hackerrank,clasnake/hackerrank | |
fd849a0f140d5062675a4e39d1fff9b8d220f027 | C++/128_Longest_Consecutive_Sequence.cpp | C++/128_Longest_Consecutive_Sequence.cpp | //128. Longest Consecutive Sequence
/*
*Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
*
*For example,
*Given [100, 4, 200, 1, 3, 2],
*The longest consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4.
*
*Your algorithm should run in O(n) complexity.
*
*... | Add solution for 128 Longest Consecutive Sequence | Add solution for 128 Longest Consecutive Sequence
| C++ | mit | bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res | |
5df75becba41d61db8bfed49e2e4d5f682de554a | karum/deleteNode.cpp | karum/deleteNode.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(){}
Node(int d){
data=d;
next=NULL;
}
Node *insertNode(Node *head, int d){
Node *np=new Node(d);
Node *tmp=head;
if(head==NULL)
return np;
else
while(tmp->next)
tmp=tmp->next;
... | Add code to delete node in linked list | Add code to delete node in linked list
| C++ | mit | shivan1b/codes | |
da9c29365603f9819afe552444ea19b500b90686 | kami/icestick-counter/counter4_tb.cpp | kami/icestick-counter/counter4_tb.cpp | /*
* Copyright 2019 The Project Oak Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | Add missing C++ test bench driver | Add missing C++ test bench driver
| C++ | apache-2.0 | project-oak/silveroak,project-oak/silveroak,project-oak/silveroak | |
758a448958b734be93d6c2ba017ed73f305f9c24 | test/include-fixer/yamldb_plugin.cpp | test/include-fixer/yamldb_plugin.cpp | // RUN: c-index-test -test-load-source-reparse 2 all %s -Xclang -add-plugin -Xclang clang-include-fixer -fspell-checking -Xclang -plugin-arg-clang-include-fixer -Xclang -input=%p/Inputs/fake_yaml_db.yaml 2>&1 | FileCheck %s
foo f;
// CHECK: yamldb_plugin.cpp:3:1: error: unknown type name 'foo'; did you mean 'foo'?
//... | Add a test for the full round trip through libclang and the plugin. | [include-fixer] Add a test for the full round trip through libclang and the plugin.
git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@287230 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 | |
2fa65d4846822340204c9363ebe701dcbad9e38d | tests/unit/linalg/test_chebyshev.cpp | tests/unit/linalg/test_chebyshev.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 unit test for symmetry of OperatorChebyshevSmoother | Add unit test for symmetry of OperatorChebyshevSmoother
| C++ | bsd-3-clause | mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem | |
56ea77ab243b9479f8703d8f735a68ca212d634d | example/03-gsl-span.cpp | example/03-gsl-span.cpp | #include "gsl/gsl-lite.hpp"
#include "nonstd/span.hpp"
int main()
{
const int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, };
{ using gsl::span; span<const int> spn( arr ); }
{ using nonstd::span; span<const int> spn( arr ); }
}
// cl -nologo -EHsc -Dspan_FEATURE_MAKE_SPAN -I../include -I../../span-lite/inclu... | Add example that uses both gsl lite and span lite | [skip ci] Add example that uses both gsl lite and span lite
| C++ | mit | martinmoene/gsl-lite,martinmoene/gsl-lite,martinmoene/gsl-lite | |
14fdccad1b2cfd8fe089aa6adb275758a034f475 | src/httpp/http/Utils.cpp | src/httpp/http/Utils.cpp | /*
* Part of HTTPP.
*
* Distributed under the 3-clause BSD licence (See LICENCE.TXT file at the
* project root).
*
* Copyright (c) 2013 Thomas Sanchez. All rights reserved.
*
*/
#include "httpp/http/Utils.hpp"
#include <boost/algorithm/string.hpp>
#include <iostream>
namespace HTTPP
{
namespace HTTP
{
stat... | /*
* Part of HTTPP.
*
* Distributed under the 3-clause BSD licence (See LICENCE.TXT file at the
* project root).
*
* Copyright (c) 2013 Thomas Sanchez. All rights reserved.
*
*/
#include "httpp/http/Utils.hpp"
#include <boost/algorithm/string.hpp>
#include <iostream>
namespace HTTPP
{
namespace HTTP
{
stat... | Fix timeouts when using keepalive in apache bench. | Fix timeouts when using keepalive in apache bench.
Set `Connection: Keep-Alive` header in response when keepalive
connection requested. According to HTTP 1.1 it is not required, because
keepalive is the default, but ab does not comply to the standard here.
So lets set it explicitly.
| C++ | bsd-2-clause | 0x7f/httpp,0x7f/httpp,daedric/httpp,0x7f/httpp,changbiao/httpp,mlove-au/httpp,daedric/httpp,changbiao/httpp,daedric/httpp,changbiao/httpp,mlove-au/httpp,mlove-au/httpp |
90be9f372f2797251d23cccd68a916308a674bbc | test/libponyc/badpony.cc | test/libponyc/badpony.cc | #include <gtest/gtest.h>
#include <platform.h>
#include "util.h"
/** Pony code that parses, but is erroneous. Typically type check errors and
* things used is invalid contexts.
*
* We build all the way up to and including code gen and check that we do not
* assert, segfault, etc but that the build fails and at l... | Add unit tests for parsable, but erroneous programs | Add unit tests for parsable, but erroneous programs
| C++ | bsd-2-clause | boemmels/ponyc,Praetonus/ponyc,Perelandric/ponyc,ryanai3/ponyc,malthe/ponyc,mkfifo/ponyc,jupvfranco/ponyc,ponylang/ponyc,dckc/ponyc,dipinhora/ponyc,darach/ponyc,sgebbie/ponyc,Perelandric/ponyc,kulibali/ponyc,CausalityLtd/ponyc,ryanai3/ponyc,sgebbie/ponyc,Theodus/ponyc,dipinhora/ponyc,jonas-l/ponyc,Praetonus/ponyc,boemm... | |
9d2f3239313c86d6013d262be8876ee50148b328 | topcoder/SRM/150/250/main.cpp | topcoder/SRM/150/250/main.cpp | #include <cassert>
#include <vector>
using namespace std;
class WidgetRepairs {
public:
int days(vector<int> arrs, int numPerDay) {
int ans = 0;
int stack = 0;
for (int d : arrs) {
stack += d;
if (stack > 0) {
ans++;
}
stack -= numPerDay;
if (stack < 0) {
sta... | Solve SRM 150, Div 2, Problem WidgetRepairs | Solve SRM 150, Div 2, Problem WidgetRepairs
| C++ | mit | mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming | |
fc01cf6743a490ee8381c2d68ac0c4ddcb7aabde | lib/Interpreter/RuntimeExceptions.cpp | lib/Interpreter/RuntimeExceptions.cpp | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Baozeng Ding <sploving1@gmail.com>
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
//------------------------------------------------------------------... | Add forgotten to commit file. | Add forgotten to commit file.
| C++ | lgpl-2.1 | perovic/cling,karies/cling,perovic/cling,marsupial/cling,root-mirror/cling,marsupial/cling,root-mirror/cling,marsupial/cling,karies/cling,karies/cling,karies/cling,root-mirror/cling,root-mirror/cling,root-mirror/cling,marsupial/cling,perovic/cling,marsupial/cling,perovic/cling,marsupial/cling,root-mirror/cling,karies/c... | |
5f224f9c360898a7c6ecb6e55aaec9f37feab5da | Snippets/upper_lower_bound.cpp | Snippets/upper_lower_bound.cpp | // lower_bound/upper_bound example
#include <iostream> // cout
#include <algorithm> // lower_bound, upper_bound, sort
#include <vector> // vector
using namespace std;
int main () {
int myints[] = {10,20,30,30,20,10,10,20};
vector<int> v(myints,myints+8); // 10 20 30 30 20 10 10 20
sort (v.... | Add useful script for lower and upper bound over an array. | Add useful script for lower and upper bound over an array.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
9636a8a7c89df77595e24d211eb47e08b6443054 | test/correctness/gpu_dynamic_shared.cpp | test/correctness/gpu_dynamic_shared.cpp | #include <Halide.h>
#include <stdio.h>
using namespace Halide;
int main(int argc, char **argv) {
Func f, g;
Var x;
f(x) = x;
g(x) = f(x) + f(2*x);
g.gpu_tile(x, 16);
f.compute_at(g, Var::gpu_blocks()).gpu_threads(x);
// The amount of shared memory required varies with x
Image<int> ... | Test for shared allocations and thread blocks that depend on blockidx | Test for shared allocations and thread blocks that depend on blockidx
Former-commit-id: c34c1c917c975e513556b6475c4b4fba2e1a67b3 | C++ | mit | Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide | |
a739bc4ec01b2482b46bed6881fd2e05f3f30f66 | test/rbase_test_string.cpp | test/rbase_test_string.cpp | //--------------------------------------------------------------------------//
/// Copyright (c) 2018 Milos Tosic. All Rights Reserved. ///
/// License: http://www.opensource.org/licenses/BSD-2-Clause ///
//--------------------------------------------------------------------------//
#in... | Add basic string unit test | Add basic string unit test
| C++ | bsd-2-clause | milostosic/rbase,milostosic/rbase | |
6ba25e18e75bdad0814522c84ea845c5da395fa5 | examples/avr/logger/main.cpp | examples/avr/logger/main.cpp |
#include <xpcc/architecture/platform.hpp>
#include <xpcc/debug/logger.hpp>
using namespace xpcc::atmega;
// Create a new UART object and configure it to a baudrate of 115200
Uart0 uart(115200);
xpcc::IODeviceWrapper< Uart0 > loggerDevice(uart);
// Set all four logger streams to use the UART
xpcc::log::Logger xpcc::... |
#include <xpcc/architecture/platform.hpp>
#include <xpcc/debug/logger.hpp>
using namespace xpcc::atmega;
typedef xpcc::avr::SystemClock clock;
// Create a new UART object and configure it to a baudrate of 115200
Uart0 uart;
xpcc::IODeviceWrapper< Uart0 > loggerDevice(uart);
// Set all four logger streams to use the... | Fix Uart in Logger example | Fix Uart in Logger example | C++ | bsd-3-clause | chrism333/xpcc,dergraaf/xpcc,dergraaf/xpcc,dergraaf/xpcc,chrism333/xpcc,dergraaf/xpcc,chrism333/xpcc,chrism333/xpcc |
6f6cafa67e856df6ce7389fc636c35e7c2945cc3 | src/Gulden/Common/diff_common.cpp | src/Gulden/Common/diff_common.cpp | // Copyright (c) 2015 The Gulden developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifdef __APPLE__
#include <TargetConditionals.h>
#import "BRMerkleBlock.h"
#endif
#include "diff_common.h"
#include "diff_delta.h"
#... | Add file missed in previous commit. | Add file missed in previous commit.
| C++ | mit | nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.