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 |
|---|---|---|---|---|---|---|---|---|---|
ff16ec40e85b9615e4f85515d57db11f4c0900cc | solution080.cpp | solution080.cpp | /**
* Remove Duplicates from Sorted Array II
*
* cpselvis(cpselvis@gmail.com)
* September 21th, 2016
*/
#include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
unordered_map<int, int> umap;
int ret = nums.size(... | Remove Duplicates from Sorted Array II. | Remove Duplicates from Sorted Array II.
| C++ | mit | cpselvis/leetcode | |
9791bdc9b67435376f0b65686b627f5b3c6d1869 | test/CXX/temp/temp.decls/temp.mem/p5.cpp | test/CXX/temp/temp.decls/temp.mem/p5.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {
template <class T> operator T*();
};
template <class T> A::operator T*() { return 0; }
template <> A::operator char*(){ return 0; } // specialization
template A::operator void*(); // explicit instantiation
int main() {
A a;
int *ip;
ip = a.operator in... | Test case for naming of conversion function template specializations | Test case for naming of conversion function template specializations
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@93177 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,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/cl... | |
c86e299222e9a3731de97379ca1a4b6bb2b1e414 | tensorflow/lite/micro/stm32f4HAL/debug_log.cc | tensorflow/lite/micro/stm32f4HAL/debug_log.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... | Debug log implementation to use the STM32 HAL UART implementation. Redirects (f)printf HAL_UART_Transmit using a UART_HandleTypeDef that must be provided as DEBUG_UART_HANDLE | Debug log implementation to use the STM32 HAL UART implementation. Redirects (f)printf HAL_UART_Transmit using a UART_HandleTypeDef that must be provided as DEBUG_UART_HANDLE
| C++ | apache-2.0 | karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,frreiss/tensorflow-fred,annarev/tensorflow,karllessard/tensorflow,gunan/tensorflow,ten... | |
78cd9badc11250cae5a1e1ba2ffae345d2eb8cf8 | source/chip/STM32/STM32L4/STM32L4-lowLevelInitialization.cpp | source/chip/STM32/STM32L4/STM32L4-lowLevelInitialization.cpp | /**
* \file
* \brief chip::lowLevelInitialization() implementation for STM32L4
*
* \author Copyright (C) 2017 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 not... | Add empty chip::lowLevelInitialization() for STM32L4 | Add empty chip::lowLevelInitialization() for STM32L4 | C++ | mpl-2.0 | CezaryGapinski/distortos,CezaryGapinski/distortos,DISTORTEC/distortos,CezaryGapinski/distortos,DISTORTEC/distortos,jasmin-j/distortos,CezaryGapinski/distortos,jasmin-j/distortos,jasmin-j/distortos,DISTORTEC/distortos,jasmin-j/distortos,DISTORTEC/distortos,CezaryGapinski/distortos,jasmin-j/distortos | |
997d146afb23fc9e0de714d865f82967261c5dc8 | src/experiments/optical_flow_mat_benchmark.cpp | src/experiments/optical_flow_mat_benchmark.cpp | /*
* optical_flow_mat_benchmark.cpp
*
* Created on: May 22, 2016
* Author: Cody W. Eilar <Cody.Eilar@Gmail.com>
*/
#include <celero/Celero.h>
#include "../readers/video_file_reader.h"
#include "../datatypes/image.h"
#include "../optical_flow/motion_estimation.h"
#include "../optical_flow/optical_flow.h"
#i... | Add benchmark for testing umat vs mat for optical flow | Add benchmark for testing umat vs mat for optical flow
Signed-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com>
| C++ | mit | AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow,AcidLeroy/OpticalFlow | |
cf0395479526c806b89a41e7f004ebb1498ecf5d | 2016-04-Training-for-NOI/Problems/Increase/Increase.cpp | 2016-04-Training-for-NOI/Problems/Increase/Increase.cpp | #include<iostream>
#include<set>
const int MAXN = 300042;
int A[MAXN];
int main()
{
std::cin.tie(0);
std::ios::sync_with_stdio(0);
int n, q;
std::cin >> n >> q;
for(int i = 0; i < n; ++i)
std::cin >> A[i];
std::set<int> break_points;
for(int i = 1; i < n; ++i)
{
if(A[i] <= A[i - 1])
break_points.in... | Add author solution for problem | Add author solution for problem
| C++ | mit | TelerikAcademy/AlgoAcademy,TelerikAcademy/AlgoAcademy,TelerikAcademy/AlgoAcademy,TelerikAcademy/AlgoAcademy | |
4e2bbdb8ee077241c997cb991f5bc08ddec7a5ab | content/public/common/assert_matching_enums.cc | content/public/common/assert_matching_enums.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.
// Use this file to assert that *_list.h enums that are meant to do the bridge
// from Blink are valid.
#include "base/macros.h"
#include "content/public... | // 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.
// Use this file to assert that *_list.h enums that are meant to do the bridge
// from Blink are valid.
#include "base/macros.h"
#include "content/public... | Comment enum matching assert to allow changes in Blink. | Comment enum matching assert to allow changes in Blink.
BUG=162827
Review URL: https://codereview.chromium.org/215313002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@261332 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.s... |
b57380720b2c58fb2819daa6569732f8906f3331 | src/tests/tokeniser.cpp | src/tests/tokeniser.cpp | // This file is part of playd.
// playd is licenced under the MIT license: see LICENSE.txt.
/**
* @file
* Tests for the Tokeniser class.
*/
#include "catch.hpp"
#include "../io/tokeniser.hpp"
SCENARIO("Tokenisers can handle complete, unquoted commands", "[tokeniser]") {
GIVEN("A fresh Tokeniser") {
Tokeniser t... | Implement basic, but useful Tokeniser tests. | Implement basic, but useful Tokeniser tests.
This is by no means a full test suite for Tokeniser.
| C++ | mit | LordAro/ury-playd,LordAro/ury-playd,LordAro/ury-playd | |
a918501d735cc90b6305f67ef821c3214f01e40c | data_structures/Stack/C++/ReverseStringUsingStack.cpp | data_structures/Stack/C++/ReverseStringUsingStack.cpp | // C++ Program Reverse String using Stack
#include<iostream> // include header files
#include<string.h>
using namespace std;
#define size 20 // include preprocessor
int top = -1; // global variables
char stack[size];
char push(char ch) // Function which push string in stack
{
if(top==(size-1)) // condition ch... | Add Reverse of String using Stack | Add Reverse of String using Stack
| C++ | cc0-1.0 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | |
ca24bb081b5fc6f885bec6f1a0c2db05f1184900 | test/xray/TestCases/Linux/arg1-logging-implicit-this.cc | test/xray/TestCases/Linux/arg1-logging-implicit-this.cc | // Intercept the implicit 'this' argument of class member functions.
//
// RUN: %clangxx_xray -g -std=c++11 %s -o %t
// RUN: rm log-args-this-* || true
// RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_logfile_base=log-args-this-" %run %t
//
// XFAIL: arm || aarch64 || mips
// UNSUPPORTED: powerpc64le
#include ... | Add test for logging the implicit "this" argument for C++ member functions. | Add test for logging the implicit "this" argument for C++ member functions.
Summary:
This allows us to do more interesting things with the data available to
C++ methods, to log the `this` pointer.
Depends on D34050.
Reviewers: pelikan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34051... | C++ | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt | |
791278e473dc5fe7b9dc39e78e5e7ad8ad4f0cef | chrome/browser/extensions/extension_tabs_apitest.cc | chrome/browser/extensions/extension_tabs_apitest.cc | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/pref_service.h"
#include "chrom... | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/pref_service.h"
#include "chrom... | Disable ExtensionApiTest.Tabs on Mac. TEST=no random redness on Mac OS X 10.6 bot BUG=37387 TBR=skerner@ | Disable ExtensionApiTest.Tabs on Mac.
TEST=no random redness on Mac OS X 10.6 bot
BUG=37387
TBR=skerner@
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@40616 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | Fireblend/chromium-crosswalk,dednal/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,patrickm/chromium.src,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,nacl-... |
3452ed439b8b954d42cb0f73776d787e5f09f7fd | test/soundcity_console.cpp | test/soundcity_console.cpp | #include <iostream>
#include <OptionList.h>
#include <SQLiteDatabase.h>
#include <SimilarityStrategy.h>
#include <Generator.h>
#define PARAMS 1
using namespace SoundCity;
using std::cout;
using std::endl;
void
usage (char *s)
{
fprintf(stderr, "Usage: %s <database>\n", s);
exit(EXIT_FAILURE);
}
int
main(int a... | Test du Generator et de la Database en console | Test du Generator et de la Database en console
| C++ | mit | NoZip/soundcity,NoZip/soundcity | |
4f23a206ecc89bcd4451a3092c248ad884216f73 | C++/149_Max_Points_on_a_Line.cpp | C++/149_Max_Points_on_a_Line.cpp | // 149. Max Points on a Line
/**
* Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
*
* Tags: Hash Table, Math
*
* Author: Kuang Qin
*/
#include "stdafx.h"
#include <vector>
#include <unordered_map>
using namespace std;
/**
* Definition for a point.
*/
struc... | Add Solution for Problem 149 | Add Solution for Problem 149
| C++ | mit | FreeTymeKiyan/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res | |
1771f3f9037e4ea05fd1b8ebf6fc3bdbc48b71ba | 1-common-tasks/functions/return-multiple-values.cpp | 1-common-tasks/functions/return-multiple-values.cpp | // Return multiple values
#include <tuple>
std::tuple<int, bool, float> foo()
{
return {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 [5-8] returns a
// [`std::t... | // Return multiple values
#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 [5-8] return... | Use std::make_tuple in return multiple values sample | Use std::make_tuple in return multiple values sample
| C++ | cc0-1.0 | mnpk/CppSamples-Samples,brunotag/CppSamples-Samples,thatbrod/CppSamples-Samples,rollbear/CppSamples-Samples,sftrabbit/CppSamples-Samples,tmwoz/CppSamples-Samples,darongE/CppSamples-Samples,vjacquet/CppSamples-Samples |
9535853f7a17dd7aa86ffa9888df795579eb9a93 | cci/17_8.cpp | cci/17_8.cpp | #include <iostream>
#include <tuple>
#include <vector>
namespace {
struct Person {
int weight;
int height;
};
bool operator>(const Person &a, const Person &b) {
return std::tie(a.weight, a.height) > std::tie(b.weight, b.height);
}
bool operator<(const Person &a, const Pers... | Add solution for 17.8 problem. | Add solution for 17.8 problem.
| C++ | bsd-2-clause | hungptit/algorithms | |
08fb75eb57e0bfd2aa84af7e6aba449d0f477db8 | lms/core/main/framework_unix.cpp | lms/core/main/framework_unix.cpp | //TODO remove unused imports
#include <climits>
#include <cstring>
#include <unistd.h>
#include <sys/stat.h>
#include <algorithm>
#include <string>
#include <core/loader.h>
#include <core/module.h>
#include <core/logger.h>
#include <core/framework.h>
namespace lms{
std::string Framework::programDirectory(){
stati... | //TODO remove unused imports
#include <climits>
#include <cstring>
#include <unistd.h>
#include <sys/stat.h>
#include <algorithm>
#include <string>
#include <core/loader.h>
#include <core/module.h>
#include <core/logger.h>
#include <core/framework.h>
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
namespace lms... | Fix Framework::programDirectory on OS X | Fix Framework::programDirectory on OS X
| C++ | apache-2.0 | smarinov/LMS,Bitfroest/LMS,lms-org/LMS,Phibedy/LMS,lms-org/LMS,Bitfroest/LMS,Bitfroest/LMS,smarinov/LMS,Phibedy/LMS |
b4bdd6abd64045960b1d648cb5b7a8de6f292586 | test/SemaCXX/template-default-param-through-using.cpp | test/SemaCXX/template-default-param-through-using.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
// expected-no-diagnostics
namespace llvm {
template<typename T > struct StringSet;
template<int I > struct Int;
template <typename Inner, template <typename> class Outer>
struct TemplTempl;
}
namespace lld {
using llvm::StringSet;
using llvm::Int;
using llvm... | Add Forgotten test for: Fix template parameter default args missed if redecled | Add Forgotten test for: Fix template parameter default args missed if redecled
Addendum to differential revision: https://reviews.llvm.org/D39127
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@316437 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-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,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
f4adccefedb333b070e948c08208f7ed70865b8c | net/url_request/url_fetcher.cc | net/url_request/url_fetcher.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 "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_factory.h"
#include "net/url_request/url_fetcher_impl.h"
namespace ne... | // 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 "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_factory.h"
#include "net/url_request/url_fetcher_impl.h"
namespace ne... | Use URLFetcherFactory for 3-arg overload of URLFetcher::Create | Use URLFetcherFactory for 3-arg overload of URLFetcher::Create
The fact that only one of the overloads was affected by instantiating a
TestURLFetcherFactory/FakeURLFetcherFactory caused me to spend half an
hour wondering why another one of my changes didn't work.
BUG=none
Review URL: https://chromiumcodereview.appsp... | C++ | bsd-3-clause | Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.sr... |
628438b90a0d42a1f0f8007b63c9ced07c9c8954 | binding/c/test/UserTest.cpp | binding/c/test/UserTest.cpp | #include <boost/test/unit_test.hpp>
#include <ygo/deck/c/User.h>
#include <ygo/deck/c/DB.h>
struct User_Fixture
{
User_Fixture()
{
DB_NAME(set_path)("test/card.db");
}
};
BOOST_FIXTURE_TEST_SUITE(User, User_Fixture)
BOOST_AUTO_TEST_CASE(Create)
{
auto user = USER_NAME(new_create)("Test");
... | Add unit tests for user C bindings | Add unit tests for user C bindings
| C++ | mit | DeonPoncini/ygodeck,DeonPoncini/ygodeck,DeonPoncini/ygodeck | |
a71080c452a2a57018f3ef065a4c402828f76fd7 | src/plugins/bineditor/markup.cpp | src/plugins/bineditor/markup.cpp | /****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance wit... | Revert "BinEditor: Remove unused file" | Revert "BinEditor: Remove unused file"
This reverts commit 4d0fbd90dd8a09457c812cc7ca30649b8df68f04.
There is a markup.h file that is built, so we should keep the
source file around.
Change-Id: Ibc55c1bc0fa1fb1743cff5f9855fd075f095328d
Reviewed-by: Tobias Hunger <012f8d714267bccc9d4766fbeace9f175fcc70c4@theqtcompany... | C++ | lgpl-2.1 | martyone/sailfish-qtcreator,xianian/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,xianian/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,xianian/qt-creator,martyone/sailfish-qtcreator,xianian/qt-creator,... | |
20b5f406e76c7dc21c358ae074f0787605b1e188 | Leetcode2/108.cpp | Leetcode2/108.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* transfer(vector<int>& nums, int start, int end){
if(start > end) return NULL;... | Convert Sorted Array to Binary Search Tree | Convert Sorted Array to Binary Search Tree | C++ | mit | nolink/algorithm,nolink/algorithm | |
641c9aa765e61482eb48149ab14b79d332f9b38f | 1-common-tasks/containers/check-existence-of-key.cpp | 1-common-tasks/containers/check-existence-of-key.cpp | // Check existence of a key
// C++11
#include <map>
#include <string>
int main()
{
std::map<std::string, int> m = {{"a", 1}, {"b", 2}, {"c", 3}};
if (m.count("b"))
{
// We know "b" is in m
}
}
// Check if a particular key is in an associative container.
//
// On [9], we create a [`std::map`](cpp/container/m... | // Check existence of a key
// C++11
#include <map>
#include <string>
int main()
{
std::map<std::string, int> m = {{"a", 1}, {"b", 2}, {"c", 3}};
if (m.count("b"))
{
// We know "b" is in m
}
}
// Check if a particular key is in an associative container.
//
// On [9], we create a [`std::map`](cpp/container/m... | Fix typo in key existence sample | Fix typo in key existence sample
| C++ | cc0-1.0 | vjacquet/CppSamples-Samples,rollbear/CppSamples-Samples,tmwoz/CppSamples-Samples,sftrabbit/CppSamples-Samples,thatbrod/CppSamples-Samples,brunotag/CppSamples-Samples |
2af488f07b23589bc9bb6d0d6cccadf645439272 | test/msan/select_float_origin.cc | test/msan/select_float_origin.cc | // Regression test for origin propagation in "select i1, float, float".
// https://code.google.com/p/memory-sanitizer/issues/detail?id=78
// RUN: %clangxx_msan -O2 -fsanitize-memory-track-origins %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out
// RUN: %clangxx_msan -O2 -fsanitize-memory-track-origi... | Fix origin propagation for select of floats. | [msan] Fix origin propagation for select of floats.
MSan does not assign origin for instrumentation temps (i.e. the ones that do
not come from the application code), but "select" instrumentation erroneously
tried to use one of those.
https://code.google.com/p/memory-sanitizer/issues/detail?id=78
git-svn-id: c199f29... | C++ | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt | |
99b8b92f5148126bb32ee75ebd44bd526f39c411 | test/CodeGenCXX/arm-cc.cpp | test/CodeGenCXX/arm-cc.cpp | // RUN: %clang_cc1 %s -triple=arm-linux-gnueabi -target-abi aapcs -emit-llvm -o - | FileCheck %s
class SMLoc {
const char *Ptr;
public:
SMLoc();
SMLoc(const SMLoc &RHS);
};
SMLoc foo(void *p);
void bar(void *x) {
foo(x);
}
void zed(SMLoc x);
void baz() {
SMLoc a;
zed(a);
}
// CHECK: declare arm_aapcscc void @... | Add test for previous commit. | Add test for previous commit.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@105594 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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
40aad0dbcb2bc35aaf628930c243696641abd7dc | deps/test/boost/test_install.cpp | deps/test/boost/test_install.cpp | #include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
using namespace boost::lambda;
typedef std::istream_iterator<int> in;
std::for_each(
in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
| Add script to test install | Add script to test install
| C++ | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | |
35e85f53233edba14ced96417376aad350f67ec2 | src/exercises/constructor-timing/constructor_test.cpp | src/exercises/constructor-timing/constructor_test.cpp | #include <iostream>
#include <chrono>
struct Test {
Test(long N) : n(N) {
long sum = 0;
for (long i = 0; i < n; ++i) {
sum += i;
}
}
Test() : n(1e8) {
Test(n);
}
long n;
}; // struct Test
int main(int argc, char* argv[]) {
const long N(1e8);
auto start = std::chrono::system_clock::now();
Test t1 ... | Create a class to look at difference in time for constructors | Create a class to look at difference in time for constructors
| C++ | mit | j-haj/interview-prep,j-haj/interview-prep,j-haj/interview-prep,j-haj/interview-prep,j-haj/interview-prep | |
28aee560c1cc49505959597e6d4cec5053096c9c | src/test/math/matrix/mdivide_left_spd_test.cpp | src/test/math/matrix/mdivide_left_spd_test.cpp | #include <stan/math/matrix/mdivide_left_spd.hpp>
#include <stan/math/matrix/typedefs.hpp>
#include <gtest/gtest.h>
TEST(MathMatrix,mdivide_left_spd_val) {
using stan::math::mdivide_left_spd;
stan::math::matrix_d Ad(2,2);
stan::math::matrix_d I;
Ad << 2.0, 3.0,
3.0, 7.0;
I = mdivide_left_spd(Ad,Ad)... | Add a test for double version of mdivide_left_sped. | Add a test for double version of mdivide_left_sped.
| C++ | bsd-3-clause | stan-dev/math,stan-dev/math,stan-dev/stan,stan-dev/stan,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/stan,stan-dev/stan,stan-dev/stan,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math | |
5a63fc3c4447952ae87ec5e581b17e10092afaee | gpu/angle_end2end_tests_main.cc | gpu/angle_end2end_tests_main.cc | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/test/launcher/u... | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/test/launcher/u... | Update gpu/angle_end2end_tets with recent file move | Update gpu/angle_end2end_tets with recent file move
BUG=
Review URL: https://codereview.chromium.org/1134953003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#330734}
| C++ | bsd-3-clause | Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Pluto-tv/chromiu... |
b65e24a690482e239dbd7f292bed3e87f644f8f7 | test/FixIt/fixit-cxx11-compat.cpp | test/FixIt/fixit-cxx11-compat.cpp | // RUN: %clang_cc1 -Wc++11-compat -verify -std=c++98 %s
// RUN: cp %s %t
// RUN: not %clang_cc1 -Wc++11-compat -Werror -x c++ -std=c++98 -fixit %t
// RUN: %clang_cc1 -Wall -pedantic-errors -Wc++11-compat -Werror -x c++ -std=c++98 %t
// This is a test of the code modification hints for C++11-compatibility problems.
#d... | Test fix-it added in r152198. | Test fix-it added in r152198.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@152199 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl... | |
dd624c5e26206145f4f1c265f799b77e83de8acf | folly/test/ThreadCachedIntsBenchmark.cpp | folly/test/ThreadCachedIntsBenchmark.cpp | /*
* Copyright 2018-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | Add thread cached ints benchmark | Add thread cached ints benchmark
Summary: Add thread cached ints benchmark
Reviewed By: yfeldblum
Differential Revision: D9212949
fbshipit-source-id: 552aab15e7421f74b5cec3ce4abd211ab3141153
| C++ | apache-2.0 | facebook/folly,facebook/folly,facebook/folly,facebook/folly,facebook/folly | |
acb7f8dfb3fb8e633f20d61fa38cc3bda8ee68a0 | src/timer.cpp | src/timer.cpp | #include <stddef.h>
#include "util/timer.h"
#define MS_PER_SECOND 1000
unsigned long openxc::util::time::startupTimeMs() {
static unsigned long startupTime = time::systemTimeMs();
return startupTime;
}
unsigned long openxc::util::time::uptimeMs() {
return systemTimeMs() - startupTimeMs();
}
/* Private: ... | #include <stddef.h>
#include "util/timer.h"
#define MS_PER_SECOND 1000
unsigned long openxc::util::time::startupTimeMs() {
static unsigned long startupTime = time::systemTimeMs();
return startupTime;
}
unsigned long openxc::util::time::uptimeMs() {
return systemTimeMs() - startupTimeMs();
}
/* Private: ... | Fix use of an uninitialized value. | Fix use of an uninitialized value.
| C++ | bsd-3-clause | ene-ilies/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware |
fb78fa24b95053751f7343cecf69e175829f119f | device/hid/hid_service_unittest.cc | device/hid/hid_service_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 <vector>
#include "base/message_loop/message_loop.h"
#include "device/hid/hid_service.h"
#include "testing/gtest/include/gtest/gtest.h"
namespa... | // 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 <vector>
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "device/hid/hid_service.h"
#include "testing/g... | Fix memory leak in HidServiceTest.Create from r285774 | Fix memory leak in HidServiceTest.Create from r285774
To fix tree-closer in Linux ASan LSan Tests (1) since
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/4338
errors like
Direct leak of 72 byte(s) in 1 object(s) allocated from:
#0 0x44145b in operator new(unsig... | C++ | bsd-3-clause | markYoungH/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,dednal/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswal... |
ac639856e4c15e1b53948f1f6132b3d606c395a5 | 1-common-tasks/functions/return-multiple-values.cpp | 1-common-tasks/functions/return-multiple-values.cpp | // Return multiple values
#include <tuple>
#include <string>
std::tuple<int, bool, std::string> foo()
{
return {128, true, "hello"};
}
int main()
{
int obj1;
bool obj2;
std::string obj3;
std::tie(obj1, obj2, obj3) = foo();
}
// Return multiple values of different types from a function.
//
// The `foo` functi... | Add "multiple return values" sample | Add "multiple return values" sample
| C++ | cc0-1.0 | sftrabbit/CppSamples-Samples,darongE/CppSamples-Samples,brunotag/CppSamples-Samples,tmwoz/CppSamples-Samples,thatbrod/CppSamples-Samples,mnpk/CppSamples-Samples,rollbear/CppSamples-Samples,vjacquet/CppSamples-Samples | |
acd798ae2164d8726ed8fa9225ca78a0178beed7 | examples/get_rooms.cpp | examples/get_rooms.cpp |
// Copyright 2018 otris software AG
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | Add example for the room functions | Add example for the room functions
| C++ | apache-2.0 | m-Schlitzer/ews-cpp,otris/ews-cpp,bkircher/ews-cpp,bkircher/ews-cpp,m-Schlitzer/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp,otris/ews-cpp,otris/ews-cpp,bkircher/ews-cpp | |
b432cb4cccb641202a109d23c5df79abac465b18 | test/cxx-wo-libstdcxx.cpp | test/cxx-wo-libstdcxx.cpp | /* A c++ program that can be linked without libstdc++ */
#include <cstdio> //Seems to be ok, requires libc
#include <cstdlib>
class C
{
public:
C(int x) { data = x; mem = (int *)malloc(sizeof*mem); }
~C() { printf("Destroying C object with data = %i\n",data); free(mem); }
protected:
int data;
int *mem;
};
//... | Add C++ program that does not depend on libstdc++ but still uses many c++ features. This is for testing compilers. | Add C++ program that does not depend on libstdc++ but
still uses many c++ features. This is for testing
compilers.
| C++ | mpl-2.0 | bast/xcfun,dftlibs/xcfun,bast/xcfun,bast/xcfun,robertodr/xcfun,robertodr/xcfun,dftlibs/xcfun,dftlibs/xcfun,dftlibs/xcfun,robertodr/xcfun,robertodr/xcfun,bast/xcfun | |
69919757b7ea144828d5f6b35a1252fcb5d07cb6 | test17_25.cpp | test17_25.cpp | #include <iostream>
#include <string>
#include <regex>
using namespace std;
using namespace std::regex_constants;
int main() {
string phone = "(\\()?(\\d{3})(\\))?([-. ])?(\\d{3})([-. ])?(\\d{4})";
regex r(phone);
string s;
string fmt = "$2.$5.$7";
while(getline(cin, s)) {
cou... | Add solution for chapter 17 test 25 | Add solution for chapter 17 test 25 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
b5d68f0c9e9201c8acbb19f85b932f943c99d14d | utests/compiler_sampler.cpp | utests/compiler_sampler.cpp | /* test OpenCL 1.1 Sampler Objects (section 5.5) */
#include "utest_helper.hpp"
void compiler_sampler(void)
{
OCL_ASSERT(ctx != 0);
cl_sampler s;
cl_int err;
int a1[] = {CL_TRUE, CL_FALSE},
a2[] = {CL_ADDRESS_MIRRORED_REPEAT,
CL_ADDRESS_REPEAT,
CL_ADDRESS_CLAMP_TO_EDGE,
... | Test case for OpenCL 1.1 Sampler Objects | Test case for OpenCL 1.1 Sampler Objects
| C++ | lgpl-2.1 | ignatenkobrain/beignet,zhenyw/beignet,freedesktop-unofficial-mirror/beignet,zhenyw/beignet,wdv4758h/beignet,ignatenkobrain/beignet,wdv4758h/beignet,freedesktop-unofficial-mirror/beignet,zhenyw/beignet,wdv4758h/beignet,wdv4758h/beignet,ignatenkobrain/beignet,freedesktop-unofficial-mirror/beignet,wdv4758h/beignet,ignaten... | |
c19fce63a1f62fc811950002fc29174a16e97b68 | test18_3.cpp | test18_3.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <memory>
using namespace std;
void exercise1(int *b, int *e) {
try {
vector<int> v(b, e);
int *p = new int[v.size()];
ifstream in("ins");
throw p;
} catch(int *p) {
delete[] p;
}
}
... | Add solution for chapter 18 test 3 | Add solution for chapter 18 test 3 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
9f359e1a758a2520518908fa77e64b0b7ac14c68 | questions/solutions/4_1.cpp | questions/solutions/4_1.cpp | #include "data.hpp"
#include "graph.hpp"
#include <string>
#include <vector>
namespace {
enum Status : uint8_t { NONE, VISITED, PROCESSED };
template <typename Graph> struct DFS {
using index_type = unsigned int;
explicit DFS(Graph &g) : graph(g), states(g.get_number_of_vertexes(), NONE) {}
... | Add solution for problem 4.1 | Add solution for problem 4.1
| C++ | bsd-2-clause | hungptit/algorithms | |
ce5916535fa73d67425e1645eee3f5e03b735b88 | chapter02/chapter02_ex01.cpp | chapter02/chapter02_ex01.cpp | // 2.1 - remove duplicates from unsorted linked list
// uses STL list and set
#include<iostream>
#include<list>
#include<set>
using namespace std;
typedef list<int>::iterator iter;
typedef list<int>::const_iterator c_iter;
void remove_duplicates(list<int>& l)
{
set<int> vals;
iter p = l.begin();
while ... | Add Chapter 2, exercise 1: eliminate duplicates in linked list | Add Chapter 2, exercise 1: eliminate duplicates in linked list
| C++ | mit | bewuethr/ctci | |
717a2bf760ef1daf74f839eb3c9ad73ad2aa6d60 | test/SemaCXX/addr-of-overloaded-function-casting.cpp | test/SemaCXX/addr-of-overloaded-function-casting.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
void g();
void f(); // expected-note 9{{candidate function}}
void f(int); // expected-note 9{{candidate function}}
template<class T> void t(T); // expected-note 3{{candidate function}}
template<class T> void t(T*); // expected-note 3{{candidate function}}
template<class T>... | Add missing test case for PR8230 | Add missing test case for PR8230
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@118402 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... | |
e31f4765cea89cc1c5aa19e8c06f8a2b79c62f79 | cpp/Rdtsc.cpp | cpp/Rdtsc.cpp | //usr/bin/g++ "$0" -o /tmp/Rdtsc && exec /tmp/Rdtsc "$@"
/*
* Copyright (c) 2015-2018 Agalmic Ventures LLC (www.agalmicventures.com)
*
* 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 wi... | Add rdtsc snippet and wrapper script | Add rdtsc snippet and wrapper script
| C++ | mit | AgalmicVentures/Environment,AgalmicVentures/Environment,AgalmicVentures/Environment | |
246efc88efea2875e6ac998616b9f549019ec7e7 | tests/AnnUserSpaceSubSystemTest.cpp | tests/AnnUserSpaceSubSystemTest.cpp | #include "stdafx.h"
#include "engineBootstrap.hpp"
#include <catch/catch.hpp>
namespace Annwvyn
{
class TestEvent : public AnnUserSpaceEvent
{
public:
TestEvent(const std::string& message) : AnnUserSpaceEvent("TestEvent"),
storedMessage(message)
{
}
std::string getMessage() const { return storedMessage;... | Add tests for the user defined subsystem interface² | Add tests for the user defined subsystem interface²
| C++ | mit | Ybalrid/Annwvyn,Ybalrid/Annwvyn,Ybalrid/Annwvyn | |
f09a3eea7e96037a12a9608557cea399bb90ebc9 | test16_42.cpp | test16_42.cpp | #include <iostream>
#include <string>
using namespace std;
template <typename T>
void g(T &&val) {
T t = val;
t -= 1;//for test
if(val == t) {
cout << "T is reference" << endl;
} else {
cout << "T is not reference" << endl;
}
}
template <typename T>
void g3(const ... | Add solution for chapter 16 test 42. | Add solution for chapter 16 test 42. | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
472e3deffc05b50624b2ae6de56633c9a3b08e29 | solution027.cpp | solution027.cpp | /**
* Remove Element
*
* cpselvis(cpselvis@gmail.com)
* August 24th, 2016
*/
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int i;
for (i = 0; i < nums.size(); )
{
if (nums[i] == val)
{
nums.erase(nums.b... | Remove gived elements from vector. | Remove gived elements from vector.
| C++ | mit | cpselvis/leetcode | |
2d1a1f37648cfdbda224547ad0054526562462e9 | capBAC/keygen.cc | capBAC/keygen.cc | #include <openssl/bn.h>
#include <openssl/ecdsa.h>
#include <openssl/ec.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <stdio.h>
main() {
EC_KEY *eckey;
BN_CTX *ctx;
ctx = BN_CTX_new();
if(!ctx) {
printf("failed to create bn ctx\n");
return 1;
}
eckey = EC_KEY_new_by_curve_nam... | Add simple function for printing some freshly generated keys. | Add simple function for printing some freshly generated keys.
| C++ | apache-2.0 | jtracey/cuddly-fiesta,jtracey/cuddly-fiesta,jtracey/cuddly-fiesta | |
fd4de45e664421ee21df455d424b4999e90d9ffe | test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp | test/std/utilities/meta/meta.rel/is_convertible_fallback.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 tests for library version of is_convertible | Add tests for library version of is_convertible
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@233285 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
74061660cc870eec8d4e68530b032f684db88243 | roman_to_integer.cpp | roman_to_integer.cpp | #include <unordered_map>
#include <iostream>
using namespace std;
int romanToInteger(const string& s) {
unordered_map<char, int> T = {
{ 'I', 1 },
{ 'V', 5 },
{ 'X', 10 },
{ 'L', 50 },
{ 'C', 100 },
{ 'D', 500 },
{ 'M', 1000 }
};
int sum = T[s.back()];
for (int i = s.length() - 2; i >= 0; i--) {
... | Add conversion Roman numbers to integer value. | Add conversion Roman numbers to integer value.
| C++ | apache-2.0 | tisma/ctorious,tisma/ctorious | |
36271a12c4363e400e89d225e9b72fa6fd8ab635 | C++/077_Combinations.cpp | C++/077_Combinations.cpp | // 77. Combinations
/**
* Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
*
* For example,
* If n = 4 and k = 2, a solution is:
*
* [
* [2,4],
* [3,4],
* [2,3],
* [1,2],
* [1,3],
* [1,4],
* ]
*
* Tags: Backtracking
*
* Similar Problems: (M) Com... | Add Solution for Problem 077 | Add Solution for Problem 077
| C++ | mit | bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res | |
97af307af560dd5f0dfe58bb00dee2a92dacb0d1 | sort/testInsertionSort.cpp | sort/testInsertionSort.cpp | /*
This program tests soring algorithms defined in sort.h
*/
#include<iostream>
#include<vector>
#include "sort.h" // My implementation of some sorting algorithms on std::vector of int
// Displays vector
void printVector(std::vector<int> A){
for(auto x: A){
std::cout<<x<<" ";
}
std::cout<<std::endl;
}
// T... | Add test case for insertion sort | Add test case for insertion sort
| C++ | mit | rohitkhilnani/cpp-And-Me | |
8fb280cbbc8348d4d38f6ed7fa68bb04326814fb | test/Index/load-namespaces.cpp | test/Index/load-namespaces.cpp | // Test is line- and column-sensitive; see below.
namespace std {
namespace rel_ops {
void f();
}
}
namespace std {
void g();
}
// FIXME: using directives, namespace aliases
// RUN: c-index-test -test-load-source all %s | FileCheck %s
// CHECK: load-namespaces.cpp:3:11: Namespace=std:3:11 (Definition) Ext... | Add a simple test for indexing namespaces | Add a simple test for indexing namespaces
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@112598 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
eb4a4058216a21c56b2b9e12bc69d2d119279b73 | 538.cpp | 538.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 {
int presum=0;
public:
TreeNode* convertBST(TreeNode* root) {
inorder(root);
return root... | Convert BST to Greater Tree | Convert BST to Greater Tree
| C++ | mit | zfang399/LeetCode-Problems | |
dae7d05f17eaeadf9d8cce6ed49fe62722dbe247 | two_pointers/80.cc | two_pointers/80.cc | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int cur = 0, count = 0, total = nums.size();
for (auto iter = nums.begin(); iter != nums.end();) {
if (iter == nums.begin()) {
cur = *iter;
count = 1;
++iter;
} ... | Remove Duplicates from Sorted Array II | Remove Duplicates from Sorted Array II
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
f99afbb3d08167373be986c4108d9f473f22a4a3 | cadernaveis/quantaschamadas.cpp | cadernaveis/quantaschamadas.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll sol(ll n, int m) {
ll a, b, c, d, r;
a = 1; b = 0; c = 0; d = 1;
while (n) {
if (n&1) {
r = ((d*b) + (c*a)) % m;
b = (d*(b+a) + (c*b)) % m;
a = r;
}
r = (c*c + d*d) % m;
... | Add quantas chamadas recursivas to cadernaveis | Add quantas chamadas recursivas to cadernaveis
Signed-off-by: Luiz Reis <1c715962a18009093f7c9aeeb7b25a67803831c9@outlook.com>
| C++ | cc0-1.0 | luizreis/programming-contest-notebook,luizreis/programming-contest-notebook,luizreis/programming-contest-notebook | |
966baadfdbc9c3fd5e6618296fafe950003c4ff5 | gpu/gles2_conform_support/native/egl_native.cc | gpu/gles2_conform_support/native/egl_native.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.
extern "C" {
#if defined(GLES2_CONFORM_SUPPORT_ONLY)
#include "gpu/gles2_conform_support/gtf/gtf_stubs.h"
#else
#include "third_party/gles2_conform/GT... | // 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.
extern "C" {
#if defined(GLES2_CONFORM_SUPPORT_ONLY)
#include "gpu/gles2_conform_support/gtf/gtf_stubs.h"
#else
#include "third_party/gles2_conform/GT... | Add a few stubs so we can link the latest OpenGL ES 2.0 conformance tests | Add a few stubs so we can link the latest OpenGL ES 2.0 conformance tests
BUG=83382
Review URL: https://chromiumcodereview.appspot.com/10834073
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@149090 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,dednal/chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,M4sse/chromium.src,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,pozdnyakov/chromium-cros... |
50369517b7ef739a8d83ece3d33ab3302de879f8 | test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp | test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp | // Test on debug info to make sure that anon typedef info is emitted.
// RUN: %llvmgcc -S --emit-llvm -x c++ -g %s -o - | grep composite
typedef struct { int a; long b; } foo;
foo x;
| Test case for llvm-gcc rev. 64648. | Test case for llvm-gcc rev. 64648.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@64649 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | bsd-2-clause | chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,l... | |
a1542322e279225a326313cb936e150f91fbe04a | cpp/ql/test/query-tests/Security/CWE/CWE-611/tests3.cpp | cpp/ql/test/query-tests/Security/CWE/CWE-611/tests3.cpp | // test cases for rule CWE-611
#include "tests.h"
// ---
typedef unsigned int XMLCh;
class XMLUni
{
public:
static const XMLCh fgXercesDisableDefaultEntityResolution[];
};
class SAX2XMLReader
{
public:
void setFeature(const XMLCh *feature, bool value);
void parse(const InputSource &data);
};
class XMLReaderFac... | Add test cases for SAX2XMLReader. | C++: Add test cases for SAX2XMLReader.
| C++ | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | |
8b5738b69cac46d645d8ef58348f3d77dc37942f | tests/testButtonInterrupt.cpp | tests/testButtonInterrupt.cpp | /*
* isr.c:
* Wait for Interrupt test program - ISR method
*
* How to test:
* Use the SoC's pull-up and pull down resistors that are avalable
* on input pins. So compile & run this program (via sudo), then
* in another terminal:
* gpio mode 0 up
* gpio mode 0 down
* at which point it should trigger an int... | Add a pin interrupt test | Add a pin interrupt test
| C++ | apache-2.0 | starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser | |
03a61e29576c32d11a97da8f2bb07256cff65a44 | test/correctness/float16_t_implicit_upcast.cpp | test/correctness/float16_t_implicit_upcast.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 to check implicit upcasting of float16_t works. | Add test to check implicit upcasting of float16_t works.
Former-commit-id: 4516e4579445ff475b4e040b0c9834e86b14c1eb | C++ | mit | Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide | |
ce0eaf006436059dfa791e4c93bcd6175a3c1aca | base/android/sys_utils_unittest.cc | base/android/sys_utils_unittest.cc | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <unistd.h>
#include "base/sys_info.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace android {
TEST(SysUtils, Amoun... | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <unistd.h>
#include "base/sys_info.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace android {
TEST(SysUtils, Amoun... | Fix comparison between signed and unsigned integer expressions. | Fix comparison between signed and unsigned integer expressions.
Only see on internal bots.
Review URL: https://codereview.chromium.org/353013008
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@280256 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | littlstar/chromium.src,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,littlstar/chromium.src,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,axinging/chromi... |
dfd1fc912c2de7e1a11410784ed83f5194c14d56 | event/callback.cc | event/callback.cc | #include <common/buffer.h>
#include <event/action.h>
#include <event/callback.h>
#include <event/event.h>
#include <event/event_system.h>
Action *
Callback::schedule(void)
{
return (EventSystem::instance()->schedule(this));
}
| Add file missed in r574. | Add file missed in r574.
| C++ | bsd-2-clause | wanproxy/wanproxy,wanproxy/wanproxy,wanproxy/wanproxy | |
b132f618311dffed550cf06ad200ced2eb19b713 | practice03/01.cpp | practice03/01.cpp | #include <stdio.h>
int main(void)
{
int sum = 0, count = 0;
do
{
int num;
printf("Enter the num= ");
scanf("%d", &num);
sum += (++count % 2 == 1) ? num : -num;
}
while(sum != 0);
printf("Result: %d\n", count);
return 0;
}
| Add a solution of prob 1 | Add a solution of prob 1
| C++ | mit | kdzlvaids/problem_solving-pknu-2016,kdzlvaids/problem_solving-pknu-2016 | |
7eda0e10bbc479987a411f4dd4147b504437dca9 | alice4/software/hps2fpga_test1/hps2fpga_test1.cpp | alice4/software/hps2fpga_test1/hps2fpga_test1.cpp | #include <cstdio>
#include <cstdlib>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#define FPGA_MANAGER_BASE 0xFF706000
#define FPGA_GPO_OFFSET 0x10
#define FPGA_GPI_OFFSET 0x14
int main()
{
int dev_mem = open("/dev/mem", O_RDWR);
if(dev_mem == 0) {
perror("open");
exit(EXIT_FA... | Add ARM-to-FPGA 32-bit raw I/O example | Add ARM-to-FPGA 32-bit raw I/O example
| C++ | apache-2.0 | lkesteloot/alice,lkesteloot/alice,lkesteloot/alice,lkesteloot/alice,lkesteloot/alice,lkesteloot/alice | |
150c85b0aa4eff7fa1136748f596d7175bfbcfa4 | tools/dexgrep/DexGrep.cpp | tools/dexgrep/DexGrep.cpp | /**
* Copyright (c) 2016-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.
*/
#include <... | Add dexgrep tool -- grep for class definitions | Add dexgrep tool -- grep for class definitions
Summary:
Often, I don't want to dexdump an entire APK -- just the dex(es) that
contain the classes I'm interested in. This makes it easy to figure out which
dexes are of interest.
Reviewed By: bertmaher
Differential Revision: D4575313
fbshipit-source-id: 4212a6d1631289... | C++ | mit | facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex | |
7d03541d86a6f2d790bde436c88f346541e77bf7 | chapter21/chapter21_trythis3.cpp | chapter21/chapter21_trythis3.cpp | // Chapter 21, Try This 3: define a vector<Record>, initialise it with four
// records of your choice, and compute their total price using the functions
// given
#include "../lib_files/std_lib_facilities.h"
#include<numeric>
//------------------------------------------------------------------------------
struct Reco... | Add Chapter 21, Try This 3 | Add Chapter 21, Try This 3
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
b5ed703abcb7b3c18d8c0bb7ed8128b17ffb1ef3 | examples/move_folder.cpp | examples/move_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 MoveFolder operation | Add example for MoveFolder operation
| C++ | apache-2.0 | otris/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp | |
8b78ad2c816b093737c0bacf47ecd567ad8cc366 | chapter25/chapter25_ex10.cpp | chapter25/chapter25_ex10.cpp | // Chapter 25, exercise 10: write an example that initializes a PPN, then reads
// and prints each field value, then changes each field value (by assigning to
// the field) and prints the result. Repeat, but store the PPN information in a
// 32-bit unsigned integer and use bit manipulation operators to access the bits
... | Add Chapter 25, exercise 10 | Add Chapter 25, exercise 10
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
489b65c310127a8d19c7c15955320f46997af75b | Algorithms/Graph/floyd-warshall-all-pairs-shortest-path.cpp | Algorithms/Graph/floyd-warshall-all-pairs-shortest-path.cpp | /**
* Floyd Warshall's Algorithm for All Pairs shortest path problem
*/
#include <iostream>
#include <limits.h>
#define V 4
#define INF INT_MAX
using namespace std;
void print(int array[][V]) {
for (int i = 0; i < V; i++) {
for (int j = 0; j < V; j++) {
if (array[i][j] == INF)
cout<<"INF ";
el... | Add floyd warshall all pairs shortest path | Add floyd warshall all pairs shortest path
Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
| C++ | apache-2.0 | WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace | |
86f8d70d2d1046e2d42f9dae5d7bf276cfd87a2c | cpp/p010.cpp | cpp/p010.cpp | /*
* Summation of primes
*
* The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
*
* Find the sum of all the primes below two million.
*/
#include <iostream>
#include <numeric>
#include <vector>
#include "sieve.hpp"
constexpr Long limit = 2'000'000;
int main(int, char **) {
auto primes = sieve(limit - 1... | Add solution to problem 10. | Add solution to problem 10.
| C++ | mit | PeterFeicht/euler | |
c2d74f823242fb4905f94d711c7392b33487d231 | Algorithms/Sort_Algorithms/Merge_Sort/mergeSort.cpp | Algorithms/Sort_Algorithms/Merge_Sort/mergeSort.cpp | #include <bits/stdc++.h>
using namespace std;
void merge(vector<int>& v, int beg1, int half, int beg2){
int szL, szR;
szL = half-beg1+1;
szR = beg2-half;
//create auxiliar arrays;
int left[szL], right[szR];
for (int i = 0; i < szL; i++)
left[i] = v[beg1 + i];
for (int i = 0; i < sz... | Add merge sort c++ source code | Add merge sort c++ source code
| C++ | mit | salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook,salman-bhai/DS-Algo-Handbook | |
7b2a6f15f977ad1fecbf516780dfd8c1eaea8fc2 | questions/solutions/dag_loop.cpp | questions/solutions/dag_loop.cpp | #include "data.hpp"
#include "graph.hpp"
#include "dag_loop.hpp"
#include <string>
#include <vector>
// We will need two bfs operations to check that there is a path from node A to node B.
namespace graph {
namespace algorithms {
} // namespace algorithms
template <typename Graph>
bool detect_loop(Gra... | Add a DQG cycle detection algorithm. | Add a DQG cycle detection algorithm.
| C++ | bsd-2-clause | hungptit/algorithms | |
a578cb8e5c7fbcb7997699b07cfdeb0df23c462b | string/1880.cc | string/1880.cc | class Solution {
public:
bool isSumEqual(string firstWord, string secondWord, string targetWord) {
return (convert(firstWord) + convert(secondWord)) == convert(targetWord);
}
private:
int convert(std::string word) {
int ret = 0, index = 0;
while (index < word.size() && word[index] ==... | Check if Word Equals Summation of Two Words | Check if Word Equals Summation of Two Words
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
65e08559dd9b0bc349868a0b954d58f3dc9cae48 | content/child/file_info_util.cc | content/child/file_info_util.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 "content/child/file_info_util.h"
#include "base/logging.h"
#include "third_party/WebKit/public/platform/WebFileInfo.h"
namespace content {
voi... | // 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 "content/child/file_info_util.h"
#include "base/logging.h"
#include "third_party/WebKit/public/platform/WebFileInfo.h"
namespace content {
voi... | Upgrade Blink to milliseconds-based last modified filetimes, part 6. | Upgrade Blink to milliseconds-based last modified filetimes, part 6.
Have content::FileInfoToWebFileInfo() no longer fill in
WebFileInfo::modificationTimeMS; it is now unused by Blink.
Once landed, this lets Blink remove the WebFileInfo field entirely.
This is part 6 in the following patch series,
1: [blink] add We... | C++ | bsd-3-clause | Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,hgl... |
a46d46e82aefb13a783fbf43d4343a18e3279ab6 | test/src/unit/cae.cpp | test/src/unit/cae.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)
//==================================================================... | Add convolutional auto encoder unit test | Add convolutional auto encoder unit test
| C++ | mit | wichtounet/dll,wichtounet/dll,wichtounet/dll | |
fc6a5f2d0c0d5a76d2fc6b214d56fbcbeba4244a | Geometry/utilities.cpp | Geometry/utilities.cpp | //Some useful equations
int main(){
//area portion of a circle
A = pi*r^2 * (theta/(2*pi))
//area chord of a circle
A = R * R * acos((R - h)/R) - (R - h) * sqrt(2 * R * h - h * h)
// h is the height of the chord
}
| Add some useful ecuations over a circle. | Add some useful ecuations over a circle.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
8f68ca9cf119598f3daef9838110ccc288efa8e5 | src/osgDB/ImageOptions.cpp | src/osgDB/ImageOptions.cpp | #include <osgDB/ImageOptions>
using namespace osgDB;
ImageOptions::ImageOptions()
{
init();
}
ImageOptions::ImageOptions(const std::string& str)
{
init();
_str = str;
}
void ImageOptions::init()
{
_sourceImageSamplingMode = NEAREST;
_sourceImageWindowMode = ALL_IMAGE;
_destination... | #include <osgDB/ImageOptions>
using namespace osgDB;
ImageOptions::ImageOptions()
{
init();
}
ImageOptions::ImageOptions(const std::string& str)
{
init();
_str = str;
}
void ImageOptions::init()
{
_sourceImageSamplingMode = NEAREST;
_sourceImageWindowMode = ALL_IMAGE;
_destination... | Set default values for datatype & pixelformat. | Set default values for datatype & pixelformat.
| C++ | lgpl-2.1 | tomasthoresen/osg,openscenegraph/osg,marchelbling/osg,openscenegraph/osg,scrawl/osg,artoolkit/osg,jtorresfabra/osg,scrawl/osg,scrawl/osg,marchelbling/osg,tomasthoresen/osg,openscenegraph/osg,artoolkit/osg,artoolkit/osg,jtorresfabra/osg,marchelbling/osg,jtorresfabra/osg,scrawl/osg,openscenegraph/osg,tomasthoresen/osg,to... |
fcee103840716ae97f65d6027ae73a8cce110d56 | fastlib2/contrib/dongryel/proximity_project/cfmm_tree_test.cc | fastlib2/contrib/dongryel/proximity_project/cfmm_tree_test.cc | #include "fastlib/fastlib.h"
#include "fastlib/tree/statistic.h"
#include "general_spacetree.h"
#include "contrib/dongryel/fast_multipole_method/fmm_stat.h"
#include "subspace_stat.h"
#include "cfmm_tree.h"
#include "mlpack/kde/dataset_scaler.h"
int main(int argc, char *argv[]) {
fx_init(argc, argv, NULL);
cons... | Test file for CFMM tree added. | Test file for CFMM tree added.
| C++ | bsd-3-clause | palashahuja/mlpack,darcyliu/mlpack,ajjl/mlpack,BookChan/mlpack,lezorich/mlpack,palashahuja/mlpack,bmswgnp/mlpack,datachand/mlpack,ranjan1990/mlpack,trungda/mlpack,lezorich/mlpack,ersanliqiao/mlpack,chenmoshushi/mlpack,stereomatchingkiss/mlpack,thirdwing/mlpack,trungda/mlpack,thirdwing/mlpack,darcyliu/mlpack,BookChan/ml... | |
9ebf799369f3dd40b4f92e6cc78023dbcdf7f026 | test/messages_request_message.cpp | test/messages_request_message.cpp | #include "gtest/gtest.h"
#include <typeinfo>
#include "request_message.h"
#include "requests.pb.h"
class TypeVisitor : public traffic::RequestVisitor
{
public:
enum Type {
SUMMARY,
STATISTIC,
ERROR,
NOTSET
};
private:
Type _t;
protected:
void visit(traffic::StatisticRequest const &) { _t = STATISTIC;... | Add unittests for summary requests | Add unittests for summary requests
Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>
| C++ | bsd-3-clause | agdsn/traffic-service-server,agdsn/traffic-service-server | |
ff42422cab1c3db5f9ba0f1d521e274514ae66c2 | tree/108.cc | tree/108.cc | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | Convert Sorted Array to Binary Search Tree | Convert Sorted Array to Binary Search Tree
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
5ab97d89538290a6b64b2d42cb49df75a66798b2 | test/unit/renderer/cairo_text_outline.cpp | test/unit/renderer/cairo_text_outline.cpp | #if defined(HAVE_CAIRO)
#include "catch.hpp"
#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/cairo/cairo_renderer.hpp>
#include <sstream>
#include <cairo-pdf.h>
static cairo_status_t write(
void *closure,
const unsigned char *data,
unsigned int length)
{
std::ostream & ss = *stat... | Test of rendering text as outlines | cairo: Test of rendering text as outlines
| C++ | lgpl-2.1 | mapycz/mapnik,mapycz/mapnik,mapycz/mapnik | |
4f96696478e27ec08c16b2a74120171296f5f440 | tests/common/entity_serialization_test.cc | tests/common/entity_serialization_test.cc | #include "gtest/gtest.h"
#include "src/common/entity/Block.h"
#include "src/common/entity/Bomb.h"
#include "src/common/entity/Bonus.h"
#include "src/common/entity/Character.h"
#include "src/common/entity/Fire.h"
#include "src/common/entity/Wall.h"
#include "src/common/net/Deserializer.h"
using namespace common::entit... | Add serialization tests for entities. | Add serialization tests for entities.
| C++ | mit | Neki/bomberman,Neki/bomberman | |
96231a571244ea93c3e0a7ce7122be6e5434e19d | 138.cpp | 138.cpp | /**
* Definition for singly-linked list with a random pointer.
* struct RandomListNode {
* int label;
* RandomListNode *next, *random;
* RandomListNode(int x) : label(x), next(NULL), random(NULL) {}
* };
*/
class Solution {
public:
RandomListNode *copyRandomList(RandomListNode *head) {
if... | Copy List with Random Pointer | Copy List with Random Pointer | C++ | mit | zfang399/LeetCode-Problems | |
2d0c98820001ab65379070e862ff1b7067010074 | Strings/NaiveFind.cpp | Strings/NaiveFind.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string needle = "CD", haystack ="MANICD";
if(haystack.find(needle) != string::npos) cout << "Gotcha!!!";
else cout << "Not Gotcha";
cout << endl;
return 0;
} | Add Naive find over strings. | Add Naive find over strings.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
093afe948e73e70d213b3f8c5f96b1abe45ce23a | You-DataStore-Tests/datastore_api_test.cpp | You-DataStore-Tests/datastore_api_test.cpp | #include "stdafx.h"
#include "CppUnitTest.h"
using Assert = Microsoft::VisualStudio::CppUnitTestFramework::Assert;
namespace You {
namespace DataStore {
namespace UnitTests {
TEST_CLASS(DataStoreApiTest) {
public:
//TEST_METHOD(TestMethod1) {
// // TODO: Your test code here
//}
};
} // namespace UnitTests
} //... | Create unit test file for datastore api | Create unit test file for datastore api
| C++ | mit | cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main | |
02557e1c3863977fa93135df0b2940384683bcad | test/unit/acc/src/AccDevPropsTest.cpp | test/unit/acc/src/AccDevPropsTest.cpp | /* Copyright 2020 Sergei Bastrakov
*
* This file is part of alpaka.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <alpaka/acc/AccDevProps.hpp>
#i... | Add unit test for acc::getAccDevProps | Add unit test for acc::getAccDevProps
| C++ | mpl-2.0 | BenjaminW3/alpaka,BenjaminW3/alpaka | |
772eb96a80f06357c9f204132c88924f3b522829 | 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: http://src.chromium.org/svn/trunk/src@75507 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: 3bf4e114abe2567b8d816c029d3a8a3c65ba2693 | C++ | bsd-3-clause | meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u... | |
9c18b41b9c4a8f6cd8f4fd23f99e46993938be31 | dp/pallindromic_substring/c++/pallindromic_substring.cpp | dp/pallindromic_substring/c++/pallindromic_substring.cpp | #include <bits/stdc++.h>
using namespace std;
vector< vector<bool> > dp;
string s;
void preprocess() {
int n = s.size();
//single letter is always a pallindrome
for(int i = 0; i < n; ++i)
dp[i][i] = true;
//if adjacent letters are same then they are pallindrome
for(int i = 0; i < n - 1; ++i)
if(s[i] == s[... | Add pallindromic substring algorithm to find if a substring of a string is pallindrome or not. | Add pallindromic substring algorithm to find if a substring of a string
is pallindrome or not.
| C++ | cc0-1.0 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | |
babba97ae63a2d8de425c7cc3926d5824f647b9c | fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp | fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp | /*
* Copyright 2020 Google, LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "fuzz/Fuzz.h"
void fuzz_SVGCanvas(Fuzz* f);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
auto fuzz = Fuzz(SkData::MakeWithoutCopy(d... | /*
* Copyright 2020 Google, LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "fuzz/Fuzz.h"
#include "src/core/SkFontMgrPriv.h"
#include "tools/fonts/TestFontMgr.h"
void fuzz_SVGCanvas(Fuzz* f);
extern "C" int LLVMFuzzerTestOneInput(const uin... | Use test font manager for SVG fuzzer | Use test font manager for SVG fuzzer
Change-Id: Ia4f96278e076d300b432b362db5df6b1a1654f3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301218
Commit-Queue: Zepeng Hu <4bcd4d3e41511d83d8c7cefb39b37c1439b78c03@google.com>
Reviewed-by: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>
| C++ | bsd-3-clause | google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_extern... |
b4e34fa29b18e14a166b3568098a92468173b9ed | main.cpp | main.cpp | #include "naive_bayes.h"
#include <iostream>
int main(int argc, char* argv[])
{
NaiveBayes nb;
nb.set_training_data_file(std::string("training.dat"));
nb.add_training_data("Buy cheap viagra SPAM");
nb.add_training_data("Buy cheap airlines airlines tickets HAM");
nb.add_training_data("Dear friend I am the ... | Test source file - initial commit. | Test source file - initial commit. | C++ | mit | bilash/NaiveBayes | |
be4bc197a2596998bbb456b20572f618e437d8f8 | lib/read_and_write_data.cpp | lib/read_and_write_data.cpp | #include <read_and_write_data.h>
using namespace std;
void importData(FileReader &reader, vector<DataObject> &data) {
// Definition goes here!!
}
void exportData(FileWriter &writer, const vector<DataObject> &data) {
// Definition goes here!!
}
| Define the methods declared in read-and-write-data header file | Define the methods declared in read-and-write-data header file
| C++ | mit | Akshay809/kopSkylines,Akshay809/kopSkylines | |
e69ad9b00dc38be95cedc48afd9e696de98fe154 | examples/rmc-cpp.cpp | examples/rmc-cpp.cpp | #include <rmc.h>
// Ok first make sure the regular old C ones still work
void mp_send(rmc_int *flag, rmc_int *data) {
VEDGE(wdata, wflag);
L(wdata, rmc_store(data, 42));
L(wflag, rmc_store(flag, 1));
}
int mp_recv(rmc_int *flag, int *data) {
int rf;
XEDGE(rflag, rdata);
do {
LS(rflag, ... | Add a C++ test. Just using C things now | Add a C++ test. Just using C things now
| C++ | mit | msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler | |
9b950314600f5c9a4a41ecc6dbb142fe8c2b2408 | HLT/TPCLib/tracking-ca/standalone/interface/read_output.cpp | HLT/TPCLib/tracking-ca/standalone/interface/read_output.cpp | #include <stdio.h>
#include <stdlib.h>
#include <vector>
#include "outputtrack.h"
int main(int argc, char** argv)
{
FILE* fpInput = fopen("../output.bin", "rb");
if (fpInput == NULL)
{
printf("Error opening input file\n");
exit(1);
}
//Loop over all events in the input file.
//Number of events is not store... | Add example to read tracks from binary output file | Add example to read tracks from binary output file
| C++ | bsd-3-clause | sebaleh/AliRoot,shahor02/AliRoot,shahor02/AliRoot,alisw/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,coppedis/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,miranov25/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,shahor02/AliRoot,coppedis/AliRoot,alisw/AliRoot,copped... | |
00bc4849348f9a8b2783e495a648908b3ee22d1b | EntityManager.cpp | EntityManager.cpp | #include "EntityManager.h"
namespace zmc
{
EntityManager::EntityManager(std::shared_ptr<ComponentManager> componentManager)
: mLastEntityID(0)
, mComponentManager(componentManager)
{
}
EntityManager::~EntityManager()
{
}
int EntityManager::getEntityCount()
{
return mEntityMap.size();
}
void EntityManag... | #include "EntityManager.h"
namespace zmc
{
EntityManager::EntityManager(ComponentManager *componentManager)
: mLastEntityID(0)
, mComponentManager(componentManager)
{
}
EntityManager::~EntityManager()
{
}
int EntityManager::getEntityCount()
{
return mEntityMap.size();
}
void EntityManager::removeEntity... | Replace std::shared_ptr with pointer and make the constructor explicit | Replace std::shared_ptr with pointer and make the constructor explicit
| C++ | unlicense | Furkanzmc/zmcEntitySystem |
560ba1472cb6dc574ad726bbe01c8311f6fa9187 | test/CodeGenCXX/mangle-neon-vectors.cpp | test/CodeGenCXX/mangle-neon-vectors.cpp | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
typedef float float32_t;
typedef signed char poly8_t;
typedef short poly16_t;
typedef unsigned long long uint64_t;
typedef __attribute__((neon_vector_type(2))) int int32x2_t;
typedef __attribute__((neon_vector_type(4))) int int32x4_t;
typedef __attribute__((neon_ve... | Add a test for Neon vector mangling | Add a test for Neon vector mangling
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@119304 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/cl... | |
384af4a7233f1a8e63f979d9973e69b7b3f9366d | test/SemaCXX/constexpr-steps.cpp | test/SemaCXX/constexpr-steps.cpp | // RUN: %clang_cc1 -std=c++1y -fsyntax-only -verify %s -DMAX=1234 -fconstexpr-steps 1234
// RUN: %clang_cc1 -std=c++1y -fsyntax-only -verify %s -DMAX=10 -fconstexpr-steps 10
// RUN: %clang -std=c++1y -fsyntax-only -Xclang -verify %s -DMAX=12345 -fconstexpr-steps=12345
// This takes a total of n + 4 steps according to ... | Add test forgotten in r181388. | Add test forgotten in r181388.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@181389 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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-cl... | |
a42c26ca26aed2ab878d870f3a6c67b9ea4b146d | c++/problem_21.cpp | c++/problem_21.cpp | // Copyright 2016 Mitchell Kember. Subject to the MIT License.
// Project Euler: Problem 21
// Amicable numbers
#include "common.hpp"
#include <array>
namespace problem_21 {
long solve() {
typedef std::vector<long>::size_type sz_t;
constexpr sz_t max = 10000;
std::vector<long> sums(max);
for (sz_t i = 1; i < m... | Solve problem 21 in C++ | Solve problem 21 in C++
| C++ | mit | mk12/euler,mk12/euler | |
a73a338f0f24a75a34b9883cae6686ab6294f725 | test/matrix.cpp | test/matrix.cpp | // This file is distributed under the MIT license.
// See the LICENSE file for details.
#include <cassert>
#include <visionaray/math/math.h>
#include <gtest/gtest.h>
using namespace visionaray;
//-------------------------------------------------------------------------------------------------
// Helper functions
... | Add unit tests for matrices | Add unit tests for matrices
| C++ | mit | tu500/visionaray,ukoeln-vis/ctpperf,tu500/visionaray,szellmann/visionaray,ukoeln-vis/ctpperf,szellmann/visionaray | |
a0893997c03840ec3a82d31deaf2158097506204 | cpp/test/html_parser_test.cc | cpp/test/html_parser_test.cc | // Test harness for the HtmlParser class.
#include <iostream>
#include <cstdlib>
#include "FileUtil.h"
#include "HtmlParser.h"
#include "util.h"
void Usage() {
std::cerr << "Usage: " << ::progname << " html_filename\n";
std::exit(EXIT_FAILURE);
}
class Parser: public HtmlParser {
public:
Parser(const st... | Test harness for the HtmlParser class. | Test harness for the HtmlParser class.
| C++ | agpl-3.0 | ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools | |
f3081da8134cd87142a2685d8a3e061c9eaa23df | test/correctness/multi_splits_with_diff_tail_strategies.cpp | test/correctness/multi_splits_with_diff_tail_strategies.cpp | #include "Halide.h"
#include "test/common/check_call_graphs.h"
#include <stdio.h>
using namespace Halide;
int main(int argc, char **argv) {
Func f("f"), input("input");
Var x("x"), y("y"), c("c");
f(x, y, c) = x + y + c;
f.reorder(c, x, y);
Var yo("yo"), yi("yi");
f.split(y, yo, yi, 2, TailStr... | Add test case that exposes the out of bound errors in apply split | Add test case that exposes the out of bound errors in apply split
| C++ | mit | kgnk/Halide,psuriana/Halide,psuriana/Halide,ronen/Halide,psuriana/Halide,ronen/Halide,kgnk/Halide,ronen/Halide,ronen/Halide,kgnk/Halide,ronen/Halide,psuriana/Halide,kgnk/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide,kgnk/Halide,kgnk/Halide,ronen/Halide,kgnk/Halide,kgnk/Halide,ronen/Halide,ronen/Halide | |
1811f74f251b98ac03172fb5ea5b41942c1797cf | week1/gardenCost.cpp | week1/gardenCost.cpp | /*********************************************************************
** Author: Zach Colbert
** Date: 27 September 2017
** Description: A simple input/output program with mathematical operations. By prompting the user for three floats, the program will calculate and output a sum.
*************************************... | Set up the bare structure of the source | Set up the bare structure of the source
| C++ | mit | colbertz2/cs161 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.