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
c43633be3fc9745de801dac02bf3475672677069
chrome/app/chrome_exe_main_gtk.cc
chrome/app/chrome_exe_main_gtk.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 "build/build_config.h" #include "chrome/browser/first_run/upgrade_util.h" // The entry point for all invocations of Chromium, browser and re...
// 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 "build/build_config.h" #include "chrome/browser/first_run/upgrade_util.h" // The entry point for all invocations of Chromium, browser and re...
Set the default ASan options for the Official Chrome build.
Set the default ASan options for the Official Chrome build. Review URL: https://chromiumcodereview.appspot.com/10823038 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@153652 0039d316-1c4b-4281-b951-d872f2087c98
C++
bsd-3-clause
hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,axinging/ch...
503945dc540cff1807f80bd093266cb3092d7392
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
mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot
900152bf88c2d6e55010050ba04c379021b8ed0b
test/LLVMC/C++/just-compile.cpp
test/LLVMC/C++/just-compile.cpp
// Test that the -c flag works. // RUN: llvmc -c %s -o %t.o // RUN: llvmc --linker=c++ %t.o -o %t // RUN: %abs_tmp | grep hello // XFAIL: vg #include <iostream> int main() { std::cout << "hello" << '\n'; }
Add a test for the -c flag.
llvmc: Add a test for the -c flag. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@116611 91177308-0d34-0410-b5e6-96231b3b80d8
C++
bsd-2-clause
chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,llv...
37350d09c3e08bdb13016d7af18d5b87d8897f28
cpp/019_Remove_Nth_Node_From_End_of_List.cpp
cpp/019_Remove_Nth_Node_From_End_of_List.cpp
// 19. Remove Nth Node From End of List /** * Given a linked list, remove the nth node from the end of list and return its head. * * For example, * * Given linked list: 1->2->3->4->5, and n = 2. * * After removing the second node from the end, the linked list becomes 1->2->3->5. * * Note: * Given n will a...
Add Solution for 019 Remove Nth Node From End of List
Add Solution for 019 Remove Nth Node From End of List
C++
mit
kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode
4a38cb9d5beb669c83adcf46ba9072d4932f8a84
ui/base/touch/touch_device_win.cc
ui/base/touch/touch_device_win.cc
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/base/touch/touch_device.h" #include "base/win/windows_version.h" #include <windows.h> namespace ui { bool IsTouchDevicePresent() { in...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/base/touch/touch_device.h" #include "base/win/windows_version.h" #include <windows.h> namespace ui { bool IsTouchDevicePresent() { in...
Enable touch on external touch devices.
Enable touch on external touch devices. BUG=176058 Review URL: https://chromiumcodereview.appspot.com/22264009 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@216433 0039d316-1c4b-4281-b951-d872f2087c98
C++
bsd-3-clause
dednal/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,m...
e26695e5dc411864f5cba82f1529e5225ee0dbc5
tree/450.cc
tree/450.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...
Delete Node in a BST
Delete Node in a BST
C++
apache-2.0
MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode
4a2011215773cc7145dda1af6ac9bcc764dfa559
tree/701.cc
tree/701.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...
Insert into a Binary Search Tree
Insert into a Binary Search Tree
C++
apache-2.0
MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode
3cc12a53ce8681158f90367a80ed7908f861ba46
f80789_9a.cpp
f80789_9a.cpp
#include <cstdio> using namespace std; const int N = 1 << 10; int a[N][N], m; int INF = 1 << 20; int n = 0; void input() { for (int i = 0; i < m; i++) { int u, v, d; scanf("%d%d%d", &u, &v, &d); a[u][v] = d; if (u > n) n = u; if (v > n) n = v; } } void floyd() { for (int i = 1; i <= n; i...
Add a solution for task 9a
Add a solution for task 9a
C++
mit
ralcho/AdvancedProgrammingNBU
a6942dd68de692ac1a76dec7e8f043ba893c65ae
rl.cpp
rl.cpp
//kinda-sorta functional code from Real Life (tm): // The operator<() will sort this vector by version in descending order, // placing pure AutoCAD first in respective sequence of matching versions. std::sort (values.begin (), values.end ()); // The operator==() will eliminate adjacent elements with matching version ...
Add an example C++ code from real life
Add an example C++ code from real life In case someone will be eager to poke their eyes out... :-)
C++
mit
rtfb/nma-nida,rtfb/nma-nida,rtfb/nma-nida,rtfb/nma-nida
b2f171d7f87b2210c75fdf330f02d7e30ddff82a
src/private/TestHumanoidParser.cpp
src/private/TestHumanoidParser.cpp
#include "HSHumanoidNodeParser.hpp" namespace dynamicsJRLJapan { namespace HumanoidSpecificitiesData { namespace fusion = boost::fusion; namespace phoenix = boost::phoenix; namespace qi = boost::spirit::qi; namespace ascii = boost::spirit::ascii; int ReadXMLData3(std::string &aFile...
Add test during development for parser.
Add test during development for parser.
C++
isc
jrl-umi3218/jrl-dynamics,jrl-umi3218/jrl-dynamics
a71a4724118270c727360d0fc9813b2a6e5c7c8f
angry_children.cpp
angry_children.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int unfairness(vector<int> &a, int k) { sort(a.begin(), a.end()); int unfairness = a[k - 1] - a[0]; for (int i = 1; i <= a.size() - k; i++) { if (a[i + k - 1] - a[i] < unfairness) { unfairness = a[i + k - 1] - a[i]; } } return ...
Add the solution to "Angry Children".
Add the solution to "Angry Children".
C++
mit
clasnake/hackerrank,clasnake/hackerrank
ebc666e155b6a86ec2aa78fb180d802c74c893ba
lib/ExecutionEngine/Orc/RPCUtils.cpp
lib/ExecutionEngine/Orc/RPCUtils.cpp
//===--------------- RPCUtils.cpp - RPCUtils implementation ---------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add missing file from r300155.
[ORC] Add missing file from r300155. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@300157 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Dri...
8b2d77dc174dfe3fe75ef6708b21203d90668db4
has_cycle.cpp
has_cycle.cpp
#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; struct Node { int data; Node* next; }; int HasCycle(Node* head) { Node* slow = head; Node* fast = head; while (fast != NULL && fast->next != NULL) { slow = slow->next; fast = fast->next->next; if (slow == fa...
Add the solution to determine whether there's a cycle in a linked list.
Add the solution to determine whether there's a cycle in a linked list.
C++
mit
clasnake/hackerrank,clasnake/hackerrank
41274dea2121899816ee7c063c3440bd90e6114c
sa.cpp
sa.cpp
// // main.c // SequentialSA // // Created by Vincent Ramdhanie on 11/27/14. // Copyright (c) 2014 Vincent Ramdhanie. All rights reserved. // #include <time.h> #include <iostream> #include <fstream> #include <iostream> #include "generator.h" #include "generator.cpp" int cost(); //cost function calculates the cost...
Write the main structure of the algorithm
Write the main structure of the algorithm
C++
mit
vramdhanie/sequentialsa,vramdhanie/sequentialsa
260e0af9672ef4d3c297c411d697bf6d523e1230
week11/solutions/problem1/shapes.cpp
week11/solutions/problem1/shapes.cpp
#include <iostream> #include <cmath> using std::cout; using std::cin; class Shape { public: virtual double perimeter() const = 0; virtual double area() const = 0; virtual void print() const = 0; }; class Rectangle: public Shape { protected: double a; double b; public: Rectangle(double _a, double _b): ...
Add solution to week 11 Shapes problem
Add solution to week 11 Shapes problem
C++
mit
dimitaruzunov/oop-practicum-2015-16
a4e5ccd15c6d16f53155ecf20f84e17b10657952
subtle_summation.cpp
subtle_summation.cpp
#include <iostream> #include <algorithm> using namespace std; bool zero(int *a, int n) { int *b = new int[n]; b[0] = a[0]; if (a[0] == 0) { return true; } for (int i = 1; i < n; i++) { b[i] = b[i - 1] + a[i]; } sort(b, b + n); for (int i = 1; i < n; i++) { if (b[0] == 0) { return true; } if (b[i]...
Add the solution to "Subtle Summation".
Add the solution to "Subtle Summation".
C++
mit
clasnake/hackermeter,clasnake/hackermeter
f64511270d3196c6b1482479dc4f9860d4ef0119
test/opengl/user_state_check.cpp
test/opengl/user_state_check.cpp
#include <csetjmp> #include <unistd.h> #if defined(__APPLE__) #include <OpenGL/gl.h> #else #include <GL/gl.h> #endif #include "Halide.h" #include "HalideRuntimeOpenGL.h" std::string error_message; /* ** Don't rely on func.set_error_handler() mechanism, it doesn't seem to catch ** the user OpenGL state errors. That ...
Add (failing) test that halide reports user error when called with OpenGL in bad state
Add (failing) test that halide reports user error when called with OpenGL in bad state Former-commit-id: 13abd3bb083e4133aecc5d6ad0fbadab8abfe085
C++
mit
darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide
36eaae88e0a651f800f361245c4e8daec065f5d1
tests/CSSLayoutDirtyMarkingTest.cpp
tests/CSSLayoutDirtyMarkingTest.cpp
/** * Copyright (c) 2014-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 tests for dirty propagation
Add tests for dirty propagation Summary: Previous test for dirty propagation (last test in CSSLayoutTest.cpp) only tested one specific case. This tests much more of the bahavior to ensure that a vital optimization in css-layout is applied correctly. Reviewed By: lucasr Differential Revision: D3790968 fbshipit-sourc...
C++
bsd-3-clause
rmarinho/yoga,yihuang/css-layout,rmarinho/yoga,yihuang/css-layout,facebook/css-layout,facebook/yoga,yihuang/css-layout,facebook/css-layout,facebook/yoga,rmarinho/yoga,rmarinho/yoga,facebook/yoga,rmarinho/yoga,yihuang/css-layout,facebook/yoga,facebook/css-layout,yihuang/css-layout,yihuang/css-layout,yihuang/css-layout,r...
93b869726a78f0c5e156cb9358019893c1dadb9e
chapter25/chapter25_ex11.cpp
chapter25/chapter25_ex11.cpp
// Chapter 25, exercise 11: like exercise 10, but keep the bits in a bitset<32> #include<iostream> #include<bitset> using namespace std; int main() { bitset<32> bs; bs = 15121<<10; // PFN bs |= 6<<4; // CCA bs[3] = 1; // nonreachable bs[0] = 1; // global cout << "Using a bit...
Add Chapter 25, exercise 11
Add Chapter 25, exercise 11
C++
mit
bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp
cfada826221677c3e6ec239cc6e8244d0a9bd341
gtest.cpp
gtest.cpp
#include "gfakluge.hpp" int main() { gfak::GFAKluge og; og.set_version(1); gfak::sequence_elem s; s.sequence = "ACCTT"; s.name = "11"; gfak::sequence_elem t; t.sequence = "TCAAGG"; t.name = "12"; gfak::sequence_elem u; u.sequence = "CTTGATT"; u.name = "13"; gfak::li...
Add a small test case
Add a small test case
C++
mit
edawson/gfakluge,edawson/gfakluge,edawson/gfakluge,edawson/gfakluge
d313a456f4fdec2d6a2593f87c255938330a340c
cpp/test/GetJulianDayNumber_test.cc
cpp/test/GetJulianDayNumber_test.cc
#include <iomanip> #include <iostream> #include "TimeUtil.h" int main() { std::cout << std::setprecision(10) << TimeUtil::GetJulianDayNumber() << '\n'; return 0; }
Test harness for the new TimeUtil::GetJulianDayNumber() function.
Test harness for the new TimeUtil::GetJulianDayNumber() function.
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
fd569c7c28cd63c02015ce48f559dff817e91281
164_maximum_gap.cc
164_maximum_gap.cc
// Naive solution would first sort the numbers, then find the maximum gap. // But there is a better solution: use the pigeonhole principle. // Suppose the sorted sequence of arguments are a1, a2, ..., an. // There are n-1 gaps and the accumulated gap is an-a1. The average gap is // (an-a1)/(n-1). By the pigeonhole prin...
Add a solution for problem 164: Maximum Gap.
Add a solution for problem 164: Maximum Gap.
C++
apache-2.0
shen-yang/leetcode_solutions,shen-yang/leetcode_solutions,shen-yang/leetcode_solutions
03ee122524bfd2fdc8f3b7951bac54ad87aa328e
src/jsonv-tests/functional_tests.cpp
src/jsonv-tests/functional_tests.cpp
/** \file * * Copyright (c) 2015 by Travis Gockel. All rights reserved. * * This program is free software: you can redistribute it and/or modify it under the terms of the Apache License * as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later * version...
Add some basic unit tests for the value functors.
Algorithm: Add some basic unit tests for the value functors.
C++
apache-2.0
venediktov/json-voorhees,tgockel/json-voorhees,venediktov/json-voorhees,tgockel/json-voorhees
890c69d721d53c17a0b287a987320b8a06022582
test17_11_12_13.cpp
test17_11_12_13.cpp
#include <iostream> #include <bitset> #include <vector> using namespace std; template <unsigned N> class TestResult { template <unsigned M> friend ostream& operator<<(ostream&, TestResult<M>&); public: TestResult() = default; TestResult(unsigned long long u) : ans(u) { } TestResult(...
Add solution for chapter 17 test 11, 12, 13
Add solution for chapter 17 test 11, 12, 13
C++
apache-2.0
chenshiyang/CPP--Primer-5ed-solution
35f70f319585f3b8d3f7d2aa9789e4f5c79ea389
IncomingConnectionValidator.cpp
IncomingConnectionValidator.cpp
#include "IncomingConnectionValidator.hpp" #include <boost/algorithm/string.hpp> using namespace std; sip::IncomingConnectionValidator::IncomingConnectionValidator(std::string validUriExpression) : validUriExpression(validUriExpression), logger(log4cpp::Category::getInstance("IncomingConnectionVali...
#include "IncomingConnectionValidator.hpp" #include <boost/algorithm/string.hpp> using namespace std; sip::IncomingConnectionValidator::IncomingConnectionValidator(std::string validUriExpression) : validUriExpression(validUriExpression), logger(log4cpp::Category::getInstance("IncomingConnectionVali...
Update URI validation regex to be more generic.
Update URI validation regex to be more generic.
C++
apache-2.0
slomkowski/mumsi
d223c0b6dded489c42eb3fde7b69ad6b59d3d96f
Sequences/IsFibo.cpp
Sequences/IsFibo.cpp
#include <bits/stdc++.h> using namespace std; bool isPerfectSquare(int x){ int s = sqrt(x); return (s*s == x); } bool isFibonacci(int n){ // n is Fibinacci if one of 5*n*n + 4 or 5*n*n - 4 or both // is a perferct square, this is deduced of the discriminant //of binnets formule return isPerfectSquar...
Add algorithm to check if a number belong to fibo series.
Add algorithm to check if a number belong to fibo series.
C++
mit
xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book
4eda05855012deeed85ce6eb6b443d12e6159a27
test/C++Frontend/2007-08-01-RestrictMethod.cpp
test/C++Frontend/2007-08-01-RestrictMethod.cpp
// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias class foo { int member[4]; void bar(int * a); }; void foo::bar(int * a) __restrict { member[3] = *a; }
Clean up C++ restrict test cases and add a test for restrict qualified methods.
Clean up C++ restrict test cases and add a test for restrict qualified methods. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@40681 91177308-0d34-0410-b5e6-96231b3b80d8
C++
bsd-2-clause
dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap...
cc92b0aaf8c5939d9c12278a3f1d3d6abd1ea92a
cpp/066_Plus_One.cpp
cpp/066_Plus_One.cpp
// 66. Plus One /** * Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. * * You may assume the integer do not contain any leading zero, except the number 0 itself. * * The digits are stored such that the most significant digit is at the head of the list. * * Sub...
Add Solution for 066 Plus One
Add Solution for 066 Plus One
C++
mit
kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode
0136daefb63c1a1dca9d7537606a293a806fe758
test18_22.cpp
test18_22.cpp
#include <iostream> using namespace std; class A { public: A() { cout << "A()" << endl; } }; class B : public A { public: B() { cout << "B()" << endl; } }; class C : public B { public: C() { cout << "C()" << endl; } }; class X { public: ...
Add solution for chapter 18, test 22
Add solution for chapter 18, test 22
C++
apache-2.0
chenshiyang/CPP--Primer-5ed-solution
328584e9eddf0ff388b0700b1e865ae046a30a9c
test/CodeGenCXX/debug-info-union.cpp
test/CodeGenCXX/debug-info-union.cpp
// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin -std=c++11 %s -o - | FileCheck %s union E { int a; float b; int bb() { return a;} float aa() { return b;} E() { a = 0; } }; E e; // CHECK: metadata !{i32 {{.*}}, null, metadata !"E", metadata !6, i32 3, i64 32, i64 32, i64 0, i32 0, null, metadat...
Add a testcase for C++11 union support.
Add a testcase for C++11 union support. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@157952 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-cl...
061a146412aa64802d029feacabc32c06fb6e633
8/hw/2/bfs.cpp
8/hw/2/bfs.cpp
#include <vector> #include <queue> #include <unordered_set> #include <iostream> using namespace std; void bfs(int S, const vector<vector<int>>& adjLists, vector<int>& results) { queue<int> toTraverse; toTraverse.push(S); unordered_set<int> traversed; traversed.emplace(S); while (!toTraverse.empty()) { ...
Add solution to second homework
Add solution to second homework
C++
mit
rgeorgiev583/dsp-practicum-2015-16,rgeorgiev583/dsp-practicum-2015-16,rgeorgiev583/dsp-practicum-2015-16
786050c5b9fae7d1b47938d81c7e6d7116d00a93
FxDSP/test/src/TestOptocoupler.cpp
FxDSP/test/src/TestOptocoupler.cpp
// // TestOptocoupler.cpp // FxDSP // // Created by Hamilton Kibbe on 5/3/15. // Copyright (c) 2015 Hamilton Kibbe. All rights reserved. // #include "Optocoupler.h" #include <math.h> #include <gtest/gtest.h> TEST(OptocouplerSingle, Smoketest) { const Opto_t types[2] = {OPTO_LDR, OPTO_PHOTOTRANSISTOR}; f...
Add initial opto model tests
Add initial opto model tests
C++
mit
hamiltonkibbe/FxDSP,hamiltonkibbe/FxDSP
0133a95a036b28d521c560cf0b54acc4a008f2ce
cantranslator/usbutil.cpp
cantranslator/usbutil.cpp
#include "usbutil.h" USBDevice USB_DEVICE(usbCallback); USB_HANDLE USB_INPUT_HANDLE = 0; void send_message(uint8_t* message, int message_size) { int currentByte = 0; Serial.print("sending message: "); Serial.println((char*)message); while(currentByte <= message_size) { while(USB_DEVICE.Handle...
#include "usbutil.h" USBDevice USB_DEVICE(usbCallback); USB_HANDLE USB_INPUT_HANDLE = 0; void send_message(uint8_t* message, int message_size) { int nextByteIndex = 0; Serial.print("sending message: "); Serial.println((char*)message); while(nextByteIndex < message_size) { while(USB_DEVICE.Han...
Fix an off by one error when sending messages over USB.
Fix an off by one error when sending messages over USB.
C++
bsd-3-clause
mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,openxc/vi-firmware
60be292b143c67096d747627a6c28713243ee27d
component/empty/src/entry/windll.cpp
component/empty/src/entry/windll.cpp
#ifdef _WINDOWS /* * NOTE: Some macros must be defined in project options of Visual Studio. * - NOMINMAX * To use std::min(), std::max(). * NOTE: Suppress some warnings of Visual Studio. * - C4251 */ #include <windows.h> BOOL APIENTRY DllMain( HMODULE hModule, DWORD ...
Enable to build empty components for Windows.
Enable to build empty components for Windows.
C++
apache-2.0
katsuster/omxil-mf,katsuster/omxil-mf,katsuster/omxil-mf,katsuster/omxil-mf
82badefaf779ac2baaf67217213a576c06ff0062
ui/aura/window_observer.cc
ui/aura/window_observer.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 "ui/aura/window_observer.h" #include "base/logging.h" #include "ui/aura/window.h" namespace aura { WindowObserver::WindowObserver() : observin...
// 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 "ui/aura/window_observer.h" #include "base/logging.h" #include "ui/aura/window.h" namespace aura { WindowObserver::WindowObserver() : observin...
Remove TODO to remove 0 observed window checks on WindowObserver.
Remove TODO to remove 0 observed window checks on WindowObserver. BUG=426143 Review URL: https://codereview.chromium.org/768763005 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#306843}
C++
bsd-3-clause
Fireblend/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,Fireblend/chromium-crosswalk,chuan9/chromi...
407a3321aa938a2d6280d4482ad06df897bf10d4
tests/unit/linalg/test_hypre_vector.cpp
tests/unit/linalg/test_hypre_vector.cpp
// Copyright (c) 2010-2021, 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 HypreParVector::Read
Add unit test for HypreParVector::Read
C++
bsd-3-clause
mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem,mfem/mfem
5f9e941b995f415598b7b37ca97f9a0657aa8e42
C++/143_Reorder_List.cpp
C++/143_Reorder_List.cpp
// 143_Reorder_List.cpp : Defines the entry point for the console application. /** * Given a singly linked list L: L0->L1->->Ln-1->Ln, * reorder it to: L0->Ln->L1->Ln-1->L2->Ln-2-> * * You must do this in-place without altering the nodes' values. * * For example, * Given {1,2,3,4}, reorder it to {1,4,2,3}. * *...
Add Solution for Problem 143
Add Solution for Problem 143
C++
mit
FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res
bb0388692d4aca26431f7eec5d566780343c8cb9
cpp/p003.cpp
cpp/p003.cpp
/* * Largest prime factor * * The prime factors of 13'195 are 5, 7, 13 and 29. * * What is the largest prime factor of the number 600'851'475'143? */ #include <algorithm> #include <cmath> #include <cstddef> #include <iostream> #include <vector> #include "sieve.hpp" constexpr Long number = 600'851'475'143; int...
Add solution to problem 3.
Add solution to problem 3.
C++
mit
PeterFeicht/euler
d040f9add33ff329280b7df65cd1842aab291c32
unittests/template_structs_minimal.cpp
unittests/template_structs_minimal.cpp
/* Copyright (c) 2014, Randolph Voorhies, Shane Grant All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this l...
Add serialization of minimal template unit-test that is broken
Add serialization of minimal template unit-test that is broken
C++
bsd-3-clause
sschaetz/cereal,sschaetz/cereal
2cd3d62878ce85b855392f4320c9e8030cc54379
cpp/simple_xml_parser_test.cc
cpp/simple_xml_parser_test.cc
/** \brief Test harness for the SimpleXmlParser class. * \author Dr. Johannes Ruscheinski (johannes.ruscheinski@uni-tuebingen.de) * * \copyright 2015 Universitätsbiblothek Tübingen. All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU A...
Test harness for the new SimpleXMLParser class.
Test harness for the new SimpleXMLParser 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
aac8278160507f86ab21b816dc4a8f6c0c67b7a4
src/keyShiftCypher.cpp
src/keyShiftCypher.cpp
/***************************************************************************** * File: keyShiftCypher.cpp * * Description: Take an encrypted text string, shift it by the input key, and * print the decrypted string. * * Author: Tim Troxler * * Created: 1/5/2015 * ************************...
Add a program to take an encrypted text string, shift it by the input key, and print the decrypted string.
Add a program to take an encrypted text string, shift it by the input key, and print the decrypted string.
C++
apache-2.0
troxology/ghostSolver
20529ff17358d81ac2d12cac8c7df22e093d7bec
test/CerealTest.cpp
test/CerealTest.cpp
#include "UnitTest++/UnitTest++.h" #include <fstream> #include <cereal/archives/binary.hpp> SUITE( CerealTest ) { TEST( basicSaveAndLoad ) { const std::string saveFileName = "CerealTest"; const int expectedData = 42; int actualData = 666; { std::ofstream file( save...
Test cereal for a basic save and load operation
Test cereal for a basic save and load operation
C++
unlicense
WebF0x/StrongAI,WebF0x/StrongAI,WebF0x/StrongAI
d3cd9b253b9e06596378eff0f22fc1c48950e5e3
cpp/203_Remove_Linked_List_Elements.cpp
cpp/203_Remove_Linked_List_Elements.cpp
// 203. Remove Linked List Elements /** * Remove all elements from a linked list of integers that have value val. * * Example * Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 * Return: 1 --> 2 --> 3 --> 4 --> 5 * * Tags: Linked List * * Similar Problems: (E) Remove Element (E) Delete Node in a Linked...
Add Solution for 203 Remove Linked List Elements
Add Solution for 203 Remove Linked List Elements
C++
mit
kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode
70bbcd23dbd14542e631fbea5b412291db34e3f7
week1/problem2/main.cpp
week1/problem2/main.cpp
#include <iostream> using namespace std; int powLastFourDigits(int number, long long unsigned power) { number %= 10000; if (power == 0) return 1; return (powLastFourDigits(number, power - 1) * number) % 10000; } int powIterLastFourDigits(int number, long long unsigned power) { int result = 1...
Add solution to the power problem
Add solution to the power problem
C++
mit
dimitaruzunov/oop-practicum-2015-16
d6f4afcf64b0062561ddfb4d793394321b74edf7
Binary_Search.cpp
Binary_Search.cpp
// To find an element in increasing seq. of values #include <bits/stdc++.h> using namespace std; int arr[100]; int binary(int l,int r,int key) // Code template for Binary Search { while(l<=r) { int mid = (l+r)/2; if(arr[mid] == key) // key is the element to find { return mid; } else if( arr[mid] > ke...
Advance Program for Binary Search
Advance Program for Binary Search
C++
cc0-1.0
ZoranPandovski/al-go-rithms,Deepak345/al-go-rithms,Deepak345/al-go-rithms,Deepak345/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak345/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-g...
7054f817fc7fd8fbd82ff69a67ed24d903b0c494
hashtable/1338.cc
hashtable/1338.cc
class Solution { public: int minSetSize(vector<int>& arr) { std::unordered_map<int, int> m; for (const auto& num : arr) { auto iter = m.find(num); if (iter == m.end()) { m[num] = 1; } else { ++m[num]; } } ...
Reduce Array Size to The Half
Reduce Array Size to The Half
C++
apache-2.0
MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode
17d19bab6778433053884d69c8ebdbeed570a33a
test/Index/Store/record-hash-crash-invalid-name.cpp
test/Index/Store/record-hash-crash-invalid-name.cpp
// Makes sure it doesn't crash. // XFAIL: linux // RUN: rm -rf %t // RUN: not %clang_cc1 %s -index-store-path %t/idx -std=c++14 // RUN: c-index-test core -print-record %t/idx | FileCheck %s namespace rdar32474406 { void foo(); typedef void (*Func_t)(); // CHECK: [[@LINE+4]]:1 | type-alias/C | c:record-hash-crash-inv...
Add a test for a crash with unnamed NamedDecls
[index] Add a test for a crash with unnamed NamedDecls Previously this would crash during record hashing. rdar://problem/32474406
C++
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
7d58365aa3e4f99a3aa9b94b17fef21dff790c3c
flipping_the_matrix.cc
flipping_the_matrix.cc
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; // Enunciado: https://www.hackerrank.com/challenges/flipping-the-matrix int main() { unsigned q, n; cin >> q; for (int cq = 0; cq < q; ++cq) { cin >> n; // Cada elemento tie...
Add problem: Flipping the matrix
Add problem: Flipping the matrix
C++
mit
fdavidcl/misc-problems,fdavidcl/misc-problems
83e9a18bde16933b644392b244e759ec5f191638
test/unit/SFCGAL/io/SerializationTest.cpp
test/unit/SFCGAL/io/SerializationTest.cpp
#include <memory> #include <string> #include <SFCGAL/all.h> #include <SFCGAL/Kernel.h> #include <SFCGAL/io/Serialization.h> #include <boost/test/unit_test.hpp> using namespace boost::unit_test ; using namespace SFCGAL ; BOOST_AUTO_TEST_SUITE( SFCGAL_io_WktReaderTest ) BOOST_AUTO_TEST_CASE( textTest ) { Kernel::Po...
Add a unit test for serialization
Add a unit test for serialization
C++
lgpl-2.1
strk/SFCGAL,strk/SFCGAL,strk/SFCGAL
5f178cd3ac713ce85ebfb6d7cc7029d3d76862e2
Haxe/Templates/Source/HaxeRuntime/Private/VariantPtr.cpp
Haxe/Templates/Source/HaxeRuntime/Private/VariantPtr.cpp
#include "HaxeRuntime.h" #include "VariantPtr.h" #include "CoreMinimal.h" #include "HaxeInit.h" void unreal::VariantPtr::badAlignmentAssert(UIntPtr value) { UE_LOG(HaxeLog, Fatal, TEXT("The pointer %llx was not aligned and is not supported by Unreal.hx"), value); }
Update to latest perforce change Change 21906 by waneck@wnk-razer on 2018/07/20 09:33:21
[CL-21906] Update to latest perforce change Change 21906 by waneck@wnk-razer on 2018/07/20 09:33:21 [unreal.hx] submit missing file
C++
mit
proletariatgames/unreal.hx,proletariatgames/unreal.hx,proletariatgames/unreal.hx
e9f3b858148ac4b1bde0e06698861cae7c6cd7eb
mojo/common/user_agent.cc
mojo/common/user_agent.cc
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "mojo/common/user_agent.h" namespace mojo { namespace common { std::string GetUserAgent() { // TODO(jam): change depending on OS return "Mo...
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "mojo/common/user_agent.h" #include "build/build_config.h" namespace mojo { namespace common { std::string GetUserAgent() { // TODO(jam): ch...
Use a different User-Agent for Android build.
Use a different User-Agent for Android build. It is hard to use desktop version website to debug html_viewer on Andoid, so change the User-Agent to get the mobile version website on Android. BUG=None TBR=ben@chromium.org Review URL: https://codereview.chromium.org/1213403003 Cr-Commit-Position: 972c6d2dc6dd5efdad13...
C++
bsd-3-clause
hgl888/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledh...
b92dc7ac0bd4109411851d7d3684ed3aa7108086
bench/EncoderBench.cpp
bench/EncoderBench.cpp
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "Benchmark.h" #include "Resources.h" #include "SkBitmap.h" #include "SkData.h" #include "SkImageEncoder.h" class EncodeBench : public Benchmark { public: EncodeB...
Add bench for image encodes
Add bench for image encodes BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1890643003 Review URL: https://codereview.chromium.org/1890643003
C++
bsd-3-clause
google/skia,tmpvar/skia.cc,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,google/skia,HalCanary/skia-hc,tmpvar/skia.cc,HalCanary/skia-hc,tmpvar/skia.cc,tmpvar/skia.cc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,tmpvar/skia.cc,rubenvb/skia,google/skia,...
5a62576c82bfb6e183f4f5296944f94dc821ae89
week8/solutions/problem2/pizza.cpp
week8/solutions/problem2/pizza.cpp
#include <iostream> using namespace std; class Pizza { char name[30]; double price; public: Pizza(const char _name[] = "", double _price = 0): price(_price) { strcpy(name, _name); } double getPrice() { return price; } }; class Order { Pizza pizzas[20]; int pizzasCount; public: Order():...
Add solution to the second problem of the first test
Add solution to the second problem of the first test
C++
mit
dimitaruzunov/oop-practicum-2015-16
56918c82dea63c801667efeba5cb8ffd24f07387
test/DebugInfo/2006-11-30-NoCompileUnit.cpp
test/DebugInfo/2006-11-30-NoCompileUnit.cpp
// This is a regression test on debug info to make sure we don't hit a compile unit size // issue with gdb. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc --disable-fp-elim -o Output/NoCompileUnit.s -f // RUN: as Output/NoCompileUnit.s -o Output/NoCompileUnit.o // RUN: g++ Output/NoCompileUnit.o -o Output/NoCompile...
Add compile unit size test
Add compile unit size test git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@32040 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-ll...
c4debd6c9f9d11dcf6589e707857345c6b1b9397
Tests/UnitTests/Actions/GenericTests.cpp
Tests/UnitTests/Actions/GenericTests.cpp
// Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon // We are making my contributions/submissions to this project solely in our // personal capacity and are not conveying any rights to any intellectual // property of any third parties. #include "gtest/gtest.h" #include <Rosetta/Actions/Generic.hpp> #incl...
Add unit test for Generic::GetZone() function
test: Add unit test for Generic::GetZone() function
C++
mit
Hearthstonepp/Hearthstonepp,Hearthstonepp/Hearthstonepp
65bba4ab277e3d06270b41048f0d9aef6e1709d0
DataStructures/Arrays/symmetric_matrix.cpp
DataStructures/Arrays/symmetric_matrix.cpp
#include <iostream> using namespace std; int main() { int N = 4; char items[] = {'a', 'b', 'c', 'd'}; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout<<items[i^j]<<" "; } cout<<endl; } return 0; }
Implement algorithm to print symmetrix matrix
Implement algorithm to print symmetrix matrix Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
C++
apache-2.0
WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace
9a6c18e58bd9618cee2aab9c1ed5d5352ad2db0a
tests/compiler/vaarg.cpp
tests/compiler/vaarg.cpp
#include "Output.h" Output output; void varArgFunc(int numParams, ...) { __builtin_va_list ap; __builtin_va_start(ap, numParams); for (int i = 0; i < numParams; i++) output << __builtin_va_arg(ap, int); __builtin_va_end(ap); } int main() { varArgFunc(4, 0xaaaaaaaa, 0xbbbbbbbb, 0xcccccccc, 0xdddddddd); //...
Add test for variadic functions.
Add test for variadic functions.
C++
apache-2.0
hoangt/NyuziProcessor,hoangt/NyuziProcessor,FulcronZ/NyuziProcessor,hoangt/NyuziProcessor,jbush001/NyuziProcessor,FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,jbush001/NyuziProcessor,hoangt/NyuziProcessor,jbush001/NyuziProcessor,jbush001/NyuziProcessor,FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,FulcronZ/NyuziPr...
1b5d332e9309f7fc83c5c779d5828199360dd184
unit_tests/data_structures/coordinate.cpp
unit_tests/data_structures/coordinate.cpp
#include <osrm/coordinate.hpp> #include <boost/test/unit_test.hpp> // Regression test for bug captured in #1347 BOOST_AUTO_TEST_CASE(regression_test_1347) { FixedPointCoordinate u(10 * COORDINATE_PRECISION, -100 * COORDINATE_PRECISION); FixedPointCoordinate v(10.001 * COORDINATE_PRECISION, -100.002 * COORDINA...
Add regression test for FixedpointCoordinate
Add regression test for FixedpointCoordinate
C++
bsd-2-clause
KnockSoftware/osrm-backend,yuryleb/osrm-backend,bitsteller/osrm-backend,ammeurer/osrm-backend,raymond0/osrm-backend,Conggge/osrm-backend,tkhaxton/osrm-backend,atsuyim/osrm-backend,hydrays/osrm-backend,Project-OSRM/osrm-backend,neilbu/osrm-backend,duizendnegen/osrm-backend,chaupow/osrm-backend,skyborla/osrm-backend,duiz...
298d476cc7a8f3e1e6b4310b8ba56f7b64c92f43
week4/solutions/problem1/bank_account.cpp
week4/solutions/problem1/bank_account.cpp
#include <iostream> using namespace std; class BankAccount { char clientName[23]; char id[15]; double account; public: BankAccount(const char _clientName[], const char _id[], double _account) { strcpy(clientName, _clientName); strcpy(id, _id); account = _account; } void print() { cout <...
Add solution to first problem
Add solution to first problem
C++
mit
dimitaruzunov/oop-practicum-2015-16
cf0741389162707c379f75b2f7c68be57e66d2e0
Snippets/freeopen.cpp
Snippets/freeopen.cpp
#include <iostream> #include <stdio.h> using namespace std; int main (){ freopen("data.in", "r", stdin); freopen("data.out", "w", stdout); return 0; }
Insert useful script for windows computers, standard input output.
Insert useful script for windows computers, standard input output.
C++
mit
xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book
8c55a1ffa6edd1f48fd2ee6de8ff65c83b522834
lib/tsan/lit_tests/write_in_reader_lock.cc
lib/tsan/lit_tests/write_in_reader_lock.cc
// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s #include <pthread.h> #include <unistd.h> pthread_rwlock_t rwlock; int GLOB; void *Thread1(void *p) { (void)p; pthread_rwlock_rdlock(&rwlock); // Write under reader lock. usleep(100); GLOB++; pthread_rwlock_unlock(&rwlock); return 0; } int mai...
Add output test for write under reader lock
[TSan] Add output test for write under reader lock git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@167833 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
73f14a078d97ea8adec188c09ba47271366b8cb4
inverted_index.cc
inverted_index.cc
#include <fstream> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> bool is_whitespace(char c) { return c == ' ' || c == '\t' || c == '\n'; } void add_words(std::vector<std::string> &dest, const std::string &s) { char *begin, *end; char t; end = begin = (char*)s.c_str(); ...
Add basic inverted index implementation in C++
Add basic inverted index implementation in C++
C++
mit
uluyol/misc,uluyol/misc,uluyol/misc,uluyol/misc,uluyol/misc,uluyol/misc
d213074ed8e03b35a871014ee4e697fb94cfef3f
test/correctness/iterate_over_circle.cpp
test/correctness/iterate_over_circle.cpp
#include <Halide.h> #include <stdio.h> using namespace Halide; int count = 0; int my_trace(void *user_context, const halide_trace_event *ev) { if (ev->event == halide_trace_load) { count++; } return 0; } int main(int argc, char **argv) { Func f; Var x, y; Func in; in(x, y) = x +...
Add test that uses likely intrinsic to iterate over a circlular domain!
Add test that uses likely intrinsic to iterate over a circlular domain! The parts outside the circle simplify away to no-ops, and are removed. Former-commit-id: 82f3bba407daa149088e18ab0893a0cc51c76ce2
C++
mit
Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide
3975f93f7ca74154ea782cafff59abf533a0f7d9
chrome/browser/extensions/api/automation/automation_apitest.cc
chrome/browser/extensions/api/automation/automation_apitest.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 "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #include "testing/gtest/include/gtest/gtest.h" namesp...
// 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 "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #include "testing/gtest/include/gtest/gtest.h" namesp...
Disable new flaky test. BUG=353039 TBR=dtseng
Disable new flaky test. BUG=353039 TBR=dtseng git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@257383 0039d316-1c4b-4281-b951-d872f2087c98
C++
bsd-3-clause
jaruba/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,jaruba/chromi...
6a34f95d6c36f60f6baa73e9956ab6239c2b86d3
tests/ws_chat_server.cc
tests/ws_chat_server.cc
#include <silicon/api.hh> #include <silicon/remote_api.hh> #include <silicon/websocketpp.hh> using websocketpp::connection_hdl; struct session { static session* instantiate(connection_hdl c) { auto it = sessions.find(c); if (it != sessions.end()) return &(it->second); else { std::unique_loc...
Add a chat websocket test.
Add a chat websocket test.
C++
mit
byzhang/silicon,matt-42/silicon,gale320/silicon,byzhang/silicon,byzhang/silicon,matt-42/silicon,gale320/silicon,gale320/silicon,matt-42/silicon
3dfa5fd568362f7eac65d3ba28afb03531606518
problems/closed-loops/closed-loops.cpp
problems/closed-loops/closed-loops.cpp
#include <iostream> //Function to find the number of closed loops in a given number. int closed_loops(int n){ int counter = 0; while(n!=0){ int r = n%10; if ((r==6) || (r==9) || (r==0)) counter++; if (r==8) counter+=2; n=n/10; } return counter; } ...
Add a C++ solution to the closed loops problem.
Add a C++ solution to the closed loops problem.
C++
mit
mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-interview,mre/the-coding-inter...
839046a8c5f890f172b0a172ed6ec9e7d0275f2e
test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s namespace StdExample { constexpr int f(void *) { return 0; } constexpr int f(...) { return 1; } constexpr int g1() { return f(0); } constexpr int g2(int n) { return f(n); } constexpr int g3(int n) { return f(n*0); } namespace N { constexpr int c = 5; constex...
Add test missed from r143234.
Add test missed from r143234. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@143257 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl...
4c98ece2eced5736cf1adda98f806d70c470d157
C++/016_3Sum_Closest.cpp
C++/016_3Sum_Closest.cpp
// 016. 3Sum Closest /** * Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. * Return the sum of the three integers. You may assume that each input would have exactly one solution. * * For example, given array S = {-1 2 1 -4}, and target = 1. * ...
Add Solution for Problem 016
Add Solution for Problem 016
C++
mit
bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res
b79d03b9229fb39254f01e233336f631fded549b
c++/src/problem_26.cpp
c++/src/problem_26.cpp
// Copyright 2016 Mitchell Kember. Subject to the MIT License. // Project Euler: Problem 26 // Reciprocal cycles #include <vector> namespace problem_26 { long recurring_cycle_len(const long n) { long dividend = 10; std::vector<long> remainders; while (dividend > 0) { // Check if the next remainder has ocurred b...
Solve problem 26 in C++
Solve problem 26 in C++
C++
mit
mk12/euler,mk12/euler
b52813f4d254fac8d81bcb9c6dd874521b1b51c1
unit_tests/creator.cpp
unit_tests/creator.cpp
/* * bacteria-core, core for cellular automaton * Copyright (C) 2016 Pavel Dolgov * * See the LICENSE file for terms of use. */ #include <boost/test/unit_test.hpp> #include "CoreConstants.hpp" #include "CoreGlobals.hpp" #include "Creator.hpp" BOOST_AUTO_TEST_CASE (create_model_test) { ModelPtr model = Creat...
Add Creator's first unit test: create_model_test
Add Creator's first unit test: create_model_test
C++
mit
zer0main/bacteria-core,zer0main/bacteria-core,zer0main/bacteria-core
55f860c06fc716f9c7d1506c540784e7cb0021ef
src/widgets/abstractfieldwidgetfactory.cpp
src/widgets/abstractfieldwidgetfactory.cpp
#include "abstractfieldwidgetfactory.h" using namespace KPeople; AbstractFieldWidgetFactory::AbstractFieldWidgetFactory(QObject *parent): QObject(parent) { } AbstractFieldWidgetFactory::~AbstractFieldWidgetFactory() { }
Add missing file from last commit
Add missing file from last commit
C++
lgpl-2.1
detrout/libkpeople-debian,detrout/libkpeople-debian,detrout/libkpeople-debian
7f1ff0834e2fdd494d679b78ae372b2c043e8fc8
examples/paging_view.cpp
examples/paging_view.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 paging view
Add example for paging view
C++
apache-2.0
otris/ews-cpp,m-Schlitzer/ews-cpp,otris/ews-cpp,otris/ews-cpp,bkircher/ews-cpp,otris/ews-cpp,bkircher/ews-cpp,bkircher/ews-cpp,m-Schlitzer/ews-cpp,m-Schlitzer/ews-cpp
206c7d029dd3444aa2fb3f4526e2fc729e6f5465
test/C++Frontend/EH/function_try_block.cpp
test/C++Frontend/EH/function_try_block.cpp
#include <stdio.h> static unsigned NumAs = 0; struct A { unsigned ANum; A() : ANum(NumAs++) { printf("Created A #%d\n", ANum); } A(const A &a) : ANum(NumAs++) { printf("Copy Created A #%d\n", ANum); } ~A() { printf("Destroyed A #%d\n", ANum); } }; static bool ShouldThrow = false; int throws() try { if ...
Add test for the last chapter of our C++ exception handling odyssey. llvmg++ now fully supports all C++ exception handling functionality.
Add test for the last chapter of our C++ exception handling odyssey. llvmg++ now fully supports all C++ exception handling functionality. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@8185 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Dr...
25074320ebb2cb293ddebc3d74c814ada3605b12
examples/hello_world.cpp
examples/hello_world.cpp
#include <agency/execution_policy.hpp> #include <iostream> void hello(agency::sequential_agent& self) { std::cout << "Hello, world from agent " << self.index() << std::endl; } int main() { // create 10 sequential_agents to execute the hello() task in bulk agency::bulk_invoke(agency::seq(10), hello); return 0...
Add hello world example program
Add hello world example program
C++
bsd-3-clause
egaburov/agency,egaburov/agency
47ab7087427b03607418d9c4ab0580def4290d8c
test/asan/TestCases/use-after-delete.cc
test/asan/TestCases/use-after-delete.cc
// RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK // RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-...
Add a test for stack unwinding in new and delete.
[asan] Add a test for stack unwinding in new and delete. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@201511 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
a9d177b7d6f7ab17be421bbed7975b5cb4ba5f50
OOP-INF-2015/sollutions/homework1/main.cpp
OOP-INF-2015/sollutions/homework1/main.cpp
#include <iostream> #include <fstream> using namespace std; struct CarInfo { const char * name; int hp; }; const CarInfo CARS[] = { { "Lambordgini Murcielago", 670 }, { "Mercedes - AMG", 503 }, { "Pagani Zonda R", 740}, { "Bugatti Veyron", 1020} }; struct CarRecord { char name[24]; i...
Add partial sollution to hw1 oop-inf-2015
Add partial sollution to hw1 oop-inf-2015
C++
mit
poseidon4o/fmi-res,poseidon4o/fmi-res,poseidon4o/fmi-res
1e190da97c75e63c95e51946f9dc223d0c2c61b7
lib/msan/lit_tests/sync_lock_set_and_test.cc
lib/msan/lit_tests/sync_lock_set_and_test.cc
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t int main(void) { int i; __sync_lock_test_and_set(&i, 0); return i; }
Test for atomic handling in MSan.
[msan] Test for atomic handling in MSan. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@191288 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
1618bc9556c198a581e82c72b44bfde59f214de1
example/unix_domain_socket_experimental.cc
example/unix_domain_socket_experimental.cc
#include <iostream> #include <thread> #include <glog/logging.h> #include "base/concurrent/wait_group.h" #include "base/strings/string_piece.h" #include "net/socket/socket_factory.h" #include "net/socket/unix_domain_client_socket.h" #include "net/socket/unix_domain_server_socket.h" using namespace std; const char* c...
Add more unix domain socket experimental program.
Add more unix domain socket experimental program.
C++
mit
mayah/base,mayah/base,mayah/base,mayah/base
6cf35dbcb8269dcc8d76c47841de8cf563583654
libraries/tests/mbed/can_interrupt/main.cpp
libraries/tests/mbed/can_interrupt/main.cpp
#include "mbed.h" Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); CAN can1(p9, p10); CAN can2(p30, p29); char counter = 0; void printmsg(char *title, CANMessage *msg) { printf("%s [%03X]", title, msg->id); for(char i = 0; i < msg->len; i++) { printf(" %02X", msg->data[i]); } ...
#include "mbed.h" Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); CAN can1(p9, p10); CAN can2(p30, p29); char counter = 0; void printmsg(char *title, CANMessage *msg) { printf("%s [%03X]", title, msg->id); for(char i = 0; i < msg->len; i++) { printf(" %02X", msg->data[i]); } ...
Fix CAN Interrupt Test (MBED_31)
Fix CAN Interrupt Test (MBED_31)
C++
apache-2.0
adustm/mbed,karsev/mbed-os,svogl/mbed-os,jrjang/mbed,pbrook/mbed,jamesadevine/mbed,arostm/mbed-os,jrjang/mbed,EmuxEvans/mbed,logost/mbed,NordicSemiconductor/mbed,geky/mbed,rosterloh/mbed,pradeep-gr/mbed-os5-onsemi,masaohamanaka/mbed,brstew/MBED-BUILD,Archcady/mbed-os,kpurusho/mbed,pi19404/mbed,Sweet-Peas/mbed,nRFMesh/m...
e647a90c3b2e913b16315188da72bd195fbeea38
test/correctness/gpu_non_contiguous_copy.cpp
test/correctness/gpu_non_contiguous_copy.cpp
#include <Halide.h> #include <stdio.h> using namespace Halide; int main(int argc, char **argv) { Var x, y; Image<int> full = lambda(x, y, x * y).realize(800, 600); buffer_t cropped = {0}; cropped.host = (uint8_t *)(&full(40, 80)); cropped.host_dirty = true; cropped.elem_size = 4; cropped....
Add test for non-contiguous gpu copy
Add test for non-contiguous gpu copy Former-commit-id: e339667968980e44fceca7421d2916ca3663e4bb
C++
mit
Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide
41ced7c873562cd11119167cc2c0f30e98652abd
chrome/browser/extensions/api/feedback_private/feedback_private_apitest.cc
chrome/browser/extensions/api/feedback_private/feedback_private_apitest.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/message_loop/message_loop.h" #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" #include "chrome/browser/exte...
// 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/message_loop/message_loop.h" #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" #include "chrome/browser/exte...
Disable FeedbackApiTest.Basic on Win & Linux
Disable FeedbackApiTest.Basic on Win & Linux The test fails on some Win and Linux bots, more info on the bug. BUG=408917 NOTREECHECKS=true NOTRY=true TBR=rkc@chromium.org Review URL: https://codereview.chromium.org/517953002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#292585}
C++
bsd-3-clause
PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,krie...
226f7c66952b602b82d8ab381d5cd97a61102c8c
Snippets/toBin.cpp
Snippets/toBin.cpp
#include <bits/stdc++.h> using namespace std; void toBin(int x){ for (int i =31; i>=0; --i){ cout << ((x&(1LL<<i))!=0); } } int main (){ toBin(10); return 0; }
Add useful algorithm to bin in c++.
Add useful algorithm to bin in c++.
C++
mit
xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book
8884f803f03dd422c151638277e31ec9826e5439
top_level.cpp
top_level.cpp
#include hand_XXX_driver.h // No memory allocation outside init main{ /// This function will do all the necessary work to set up the hand: /// - Scan bus for slaves /// - If there's a hand of type XXX then /// - initialize hand [p0-m1] /// - configure hand /// Configurations for the...
Add pseudocode for top level file
Add pseudocode for top level file
C++
bsd-3-clause
shadow-robot/ethercat_driver
be4d9d89916642a2222cc3c9910aaf5e7f34f2fd
chapter03/chapter03_ex02.cpp
chapter03/chapter03_ex02.cpp
// 3.2 - design a stack with push, pop, peek and min, all in O(1) // improvement: only push to aux stack if new value is <= current minimum; only // pop from aux stack if value being popped is == current minimum - saves space // if many values are not the minimum. // alternative: define data structure to hold int plu...
Add Chapter 3, exercise 2 (using stack in stack approach)
Add Chapter 3, exercise 2 (using stack in stack approach)
C++
mit
bewuethr/ctci
f109afdc0a36f835470e8c48bdf71a88c4130882
test/Lexer/cxx0x_raw_string_directives.cpp
test/Lexer/cxx0x_raw_string_directives.cpp
// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s // RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s // expected-error@8 {{in c++98 only}} #if 0 R"( #else #error in c++98 only)" #endif
Add raw string literal versus C preprocessor test, suggested by James Dennett.
Add raw string literal versus C preprocessor test, suggested by James Dennett. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@172660 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-cl...
0ec03dd4d0b2ea333889db6a02077b733abcf3cb
Problem-Solutions/convert-timeinmillis-hhmmss.cpp
Problem-Solutions/convert-timeinmillis-hhmmss.cpp
#include <stdio.h> using namespace std; // converts the time in millis to // human readable format in hh:mm:ss // I/P: 901000 // O/P: 00:15:01 void convertTime(int timeInMillis) { // convert millisecs into secs int secs = timeInMillis/1000; // convert secs into minutes and round off if it reaches 60 i...
Convert time in millisecs to hh:mm:ss
Convert time in millisecs to hh:mm:ss Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
C++
apache-2.0
WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace,WajahatSiddiqui/Workspace
219c341d8a3a466fdfd053080ece990e793bca5c
cpp/143_Reorder_List.cpp
cpp/143_Reorder_List.cpp
// 143. Reorder List /** * Given a singly linked list L: L0->L1->...->Ln-1->Ln, * reorder it to: L0->Ln->L1->Ln-1->L2->Ln-2->... * * You must do this in-place without altering the nodes' values. * * For example, * Given {1,2,3,4}, reorder it to {1,4,2,3}. * * Tags: Linked List * * Author: Kuang Qin */ ...
Add Solution for 143 Reorder List
Add Solution for 143 Reorder List
C++
mit
kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode
18717425d76cf4ba7a7bfdb5daf856ef817ba009
gnelib/src/gneintern.cpp
gnelib/src/gneintern.cpp
/* GNE - Game Networking Engine, a portable multithreaded networking library. * Copyright (C) 2001 Jason Winnebeck (gillius@mail.rit.edu) * Project website: http://www.rit.edu/~jpw9607/ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public *...
Set up PCH for MSVC.NET
Set up PCH for MSVC.NET
C++
lgpl-2.1
gillius/gnelib,gillius/gnelib
9e4139a3269c9f925a10c7b419655fa3dd62979b
test/testTypedefs.cpp
test/testTypedefs.cpp
/* * Copyright (c) 2016 Kartik Kumar, Dinamica Srl (me@kartikkumar.com) * Distributed under the MIT License. * See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT */ #include <map> #include <typeinfo> #include <vector> #include <catch.hpp> #include "rvdsim/typedefs.hpp" namespace rvds...
Add unit tests for typedefs.
Add unit tests for typedefs.
C++
mit
openastro/rvdsim,openastro/rvdsim,openastro/rvdsim
366176ff1bf74e8fe330cdc5b712845b94650078
test/xray/TestCases/Linux/arg1-arg0-logging.cc
test/xray/TestCases/Linux/arg1-arg0-logging.cc
// Allow having both the no-arg and arg1 logging implementation live together, // and be called in the correct cases. // // RUN: rm arg0-arg1-logging-* || true // RUN: %clangxx_xray -std=c++11 %s -o %t // RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_logfile_base=arg0-arg1-logging-" %run %t // // TODO: Support...
Add a test for both arg1 and arg0 handling in the same binary
[XRay][compiler-rt][NFC] Add a test for both arg1 and arg0 handling in the same binary This test makes sure we can handle both arg0 and arg1 handling in the same binary, and making sure that the XRay runtime calls the correct trampoline when handlers for both of these cases are installed. git-svn-id: c199f293c43da692...
C++
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
cb71400763c965e6929ddbc3be09374e6c52c9f4
test/FormatTest.cpp
test/FormatTest.cpp
#include <boost/test/unit_test.hpp> #include <ygo/deck/Format.h> #include <ygo/deck/DB.h> struct Format_Fixture { Format_Fixture() { ygo::deck::DB::get().path("test/card.db"); } }; BOOST_FIXTURE_TEST_SUITE(Format, Format_Fixture) BOOST_AUTO_TEST_CASE(Create) { auto formatDates = ygo::deck::Fo...
Add unit tests for ygo::deck::Format
Add unit tests for ygo::deck::Format
C++
mit
DeonPoncini/ygodeck,DeonPoncini/ygodeck,DeonPoncini/ygodeck
459180b1eb2a8db03cc996bc33e320e5ee44daca
test/CXX/temp/temp.spec/temp.expl.spec/p6.cpp
test/CXX/temp/temp.spec/temp.expl.spec/p6.cpp
// RUN: clang-cc -fsyntax-only -verify %s template<typename T> struct X0 { void f(); template<typename U> void g(U); struct Nested { }; static T member; }; int &use_X0_int(X0<int> x0i, // expected-note{{implicit instantiation first required here}} int i) { x0i.f(); // expected-...
Add test for last commit
Add test for last commit git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@83893 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,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/cl...
386cdb7c257a4a04439f7c5b72d29bdd3e155520
test/asan/TestCases/Windows/user-exception.cc
test/asan/TestCases/Windows/user-exception.cc
// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: env ASAN_OPTIONS=handle_segv=0 %run %t 2>&1 | FileCheck %s --check-prefix=USER // RUN: env ASAN_OPTIONS=handle_segv=1 not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN // Test the default. // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN // This test exits zero ...
Add Windows test for handle_segv and SetUnhandledExceptionFilter
[asan] Add Windows test for handle_segv and SetUnhandledExceptionFilter git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@335087 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
f7237bb08632a92886ef6e97467098f97d1d7f6f
659.cpp
659.cpp
class Solution { public: bool isPossible(vector<int>& nums) { int st=0; for(int i=1; i<nums.size(); i++){ if(nums[i]-nums[i-1]>1){ if(!work(nums,st,i-1)) return false; st = i; } } return work(nums,st,nums.size()-1); } b...
Split Array into Consecutive Subsequences
Split Array into Consecutive Subsequences
C++
mit
zfang399/LeetCode-Problems
3d51d0eae48dc3b526de6e9eddefa2f90d65fd24
code/data-structures/convex_hull_trick_dynamic.cpp
code/data-structures/convex_hull_trick_dynamic.cpp
const ll is_query = -(1LL<<62); struct Line { ll m, b; mutable function<const Line*()> succ; bool operator<(const Line& rhs) const { if (rhs.b != is_query) return m < rhs.m; const Line* s = succ(); if (!s) return 0; ll x = rhs.m; return b - s->b < (s->m - m) * x; ...
Add dynamic convex hull trick, stolen from niklasb
Add dynamic convex hull trick, stolen from niklasb
C++
mit
SuprDewd/CompetitiveProgramming,SuprDewd/CompetitiveProgramming,SuprDewd/CompetitiveProgramming,SuprDewd/CompetitiveProgramming
cfc05dfc2c4b8900879672728425d6fd0acf25aa
src/sockets/stdinout.cpp
src/sockets/stdinout.cpp
#include "sockets.h" class StandardInputOutput : public Socket { public: StandardInputOutput(); unsigned int apiVersion() { return 3000; } std::string receive(); void sendData(const std::string& data); }; StandardInputOutput::StandardInputOutput() : connected(true) {} std::string StandardInputOutput::receiv...
Make a standard input/output socket module mostly for testing purposes.
Make a standard input/output socket module mostly for testing purposes.
C++
mit
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
529eea934e64b8aae2d5dacb671f3463733da8c3
tests/unit/classifier/svm/SVMOcas_unittest.cc
tests/unit/classifier/svm/SVMOcas_unittest.cc
#include <shogun/classifier/svm/SVMOcas.h> #include <shogun/features/DataGenerator.h> #include <shogun/features/DenseFeatures.h> #include <shogun/evaluation/ROCEvaluation.h> #include <gtest/gtest.h> #include <iostream> using namespace shogun; TEST(SVMOcasTest,train) { index_t num_samples = 100, dim = 10; float64_t...
Add unit test for SVMOcas
Add unit test for SVMOcas
C++
bsd-3-clause
shogun-toolbox/shogun,besser82/shogun,shogun-toolbox/shogun,geektoni/shogun,geektoni/shogun,Saurabh7/shogun,geektoni/shogun,geektoni/shogun,lambday/shogun,Saurabh7/shogun,lisitsyn/shogun,Saurabh7/shogun,besser82/shogun,shogun-toolbox/shogun,besser82/shogun,Saurabh7/shogun,karlnapf/shogun,geektoni/shogun,besser82/shogun...
6f008a8a2549658b737e4c20ebd9c3cf0b46f496
skiplist/C/main.cc
skiplist/C/main.cc
#include "skiplist.hh" #include <vector> #include <thread> #include <iostream> static unsigned int seed; void insert(Skiplist *s, int n) { for (int x=0; x < n; x++) { unsigned r = rand_r(&seed); int *v = (int *) skiplist_malloc(sizeof(int)); *v = r; Item *itm = newItem(v, sizeof(in...
Add simple c++ insert test
skiplist: Add simple c++ insert test
C++
apache-2.0
t3rm1n4l/nitro,t3rm1n4l/nitro,t3rm1n4l/nitro
0414e65b92224c8508e58943790eecd5ab8ffa06
CheckIntPalindrome.cpp
CheckIntPalindrome.cpp
/* Given a number, return the number of set bits of the number if binary representation of the number is a palindrome, else return ­1. Condition : You can’t use array or any other data structure. Eg . Input 37 Output ­1 Input 165 Output 4 */ #include <iostream> #include <string> #incl...
Return number of set bits if int is palindrome. Question commented inside.
Return number of set bits if int is palindrome. Question commented inside.
C++
mit
therainmak3r/dirty-laundry
def30044f804433cf05bd7ca6444557292329c93
test/ubsan/TestCases/Misc/Linux/ubsan_options.cc
test/ubsan/TestCases/Misc/Linux/ubsan_options.cc
// RUN: %clangxx -fsanitize=integer -fsanitize-recover=integer %s -o %t // RUN: not %t 2>&1 | FileCheck %s // __ubsan_default_options() doesn't work on Darwin. // XFAIL: darwin #include <stdint.h> extern "C" const char *__ubsan_default_options() { return "halt_on_error=1"; } int main() { (void)(uint64_t(1000000...
Add a testcase for __ubsan_default_options() function.
[UBSan] Add a testcase for __ubsan_default_options() function. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@236151 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