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 |
|---|---|---|---|---|---|---|---|---|---|
0916a16c2c96bc809b18264c732b189b0bb10115 | linkedlist/1290.cc | linkedlist/1290.cc | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
int getDecimalValue(L... | Convert Binary Number in a Linked List to Integer | Convert Binary Number in a Linked List to Integer
| C++ | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | |
78016c7c5467c6180a9b577392d4cc709572da7f | C++/004_Median_of_Two_Sorted_Array.cpp | C++/004_Median_of_Two_Sorted_Array.cpp | // 4 Median of Two Sorted Array
/**
* There are two sorted arrays nums1 and nums2 of size m and n respectively.
* Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
*
* Tag: Divide and Conquer, Array, Binary Search
*
* Author: Yanbin Lu
*/
#include <stddef.h>
#inclu... | Add 004 Median of Two Sorted Array | Add 004 Median of Two Sorted Array
| C++ | mit | bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res | |
130d04585904c50f3532bc1a250b0263e557e33c | Strings/LCI.cpp | Strings/LCI.cpp | #include <bits/stdc++.h>
using namespace std;
//Compute the largest increasing subsequence
int lis( int arr[], int n ){
int *lis, i, j, max = 0;
lis = (int*) malloc ( sizeof( int ) * n );
for (i = 0; i < n; i++ )
lis[i] = 1;
for (i = 1; i < n; i++ )
for (j = 0; j < i; j++ )
if ( arr[i] > arr[j] && lis[i] < l... | Implement solution Longest increasing subsequence. | Implement solution Longest increasing subsequence.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book | |
3e756259d55f5fc1e56a2427c8bdf85afdb953e2 | src/condor_contrib/plumage/src/ODSNegotiatorPlugin.cpp | src/condor_contrib/plumage/src/ODSNegotiatorPlugin.cpp | /*
* Copyright 2009-2011 Red Hat, 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 agr... | Add negotiator plugin prototype for ODS contrib | Add negotiator plugin prototype for ODS contrib
| C++ | apache-2.0 | djw8605/condor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/condor,htcondor/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,djw8605/condor,djw8605/htcondor,neurodebian/h... | |
b859d505f99379eebed40367aa09788b93fca443 | test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp | test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp | // RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o - %s | FileCheck %s
namespace std {
typedef decltype(sizeof(int)) size_t;
// libc++'s implementation with __size_ replaced by __end_
template <class _E>
class initializer_list
{
const _E* __begin_;
const _E* __end_;
initializer_list(const _E* __b, ... | Add a testcase for start+end implementations of std::initializer_list. | Add a testcase for start+end implementations of std::initializer_list.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@150923 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
4e341edfd414fb413ecc015fad33e65a31a84d27 | chapter25/chapter25_ex08.cpp | chapter25/chapter25_ex08.cpp | // Chapter 25, exercise 8: write out the numerical values of each character on
// your keyboard
#include<iostream>
using namespace std;
void print(char ch)
{
cout << ch << ": " << int(ch) << '\t';
}
int main()
{
print('');
print('+');
print('"');
print('*');
print('');
print('%');
pr... | Add Chapter 25, exercise 8 | Add Chapter 25, exercise 8
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
a682f6a52eedb6ec5a0f3c9dd82d481d391e76d9 | chapter23/chapter23_ex13.cpp | chapter23/chapter23_ex13.cpp | // Chapter 23, exercise 13: test if the reuglar expression '.' matches the
// newline character '\n'
#include<iostream>
//#include<string>
#include<regex>
using namespace std;
int main()
{
string s = "\n";
regex pat(".");
smatch matches;
if (regex_match(s,matches,pat))
cout << "'.' matches '\... | Add Chapter 23, exercise 13 | Add Chapter 23, exercise 13
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
7b6dda6db3c14df673c6f2403af6369e0630fc1f | test/SemaTemplate/instantiation-depth-default.cpp | test/SemaTemplate/instantiation-depth-default.cpp | // RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-backtrace-limit 2 %s
template<int N, typename T> struct X : X<N+1, T*> {};
// expected-error-re@3 {{recursive template instantiation exceeded maximum depth of 1024{{$}}}}
// expected-note@3 {{instantiation of template class}}
// expected-note@3 {{skipping 1023 contex... | Add test missed from r278983. | Add test missed from r278983.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@278984 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... | |
5b970f265b33d6cdd0bb1c10b149c333b2ff54ef | Trees/connect-nodes-at-same-level.cpp | Trees/connect-nodes-at-same-level.cpp | /*******************************************************************************
Connect nodes at same level
===========================
Ref - http://www.geeksforgeeks.org/connect-nodes-at-same-level/
--------------------------------------------------------------------------------
Problem
=======
Connect a child no... | Connect nodes at same level | Connect nodes at same level
| C++ | mit | divyanshu013/algorithm-journey | |
3457a11c9811191cebbedb32fce26e7d6af19e51 | karum/insertNode.cpp | karum/insertNode.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(){}
Node(int d){
data=d;
next=NULL;
}
Node *insertElement(Node *head,int d){
Node *np=new Node(d);
Node *tmp=head;
if(head==NULL)
return np;
else
while(tmp->next)
tmp=tmp->next;
t... | Add code to insert node in linked list | Add code to insert node in linked list
| C++ | mit | shivan1b/codes | |
4ea147409fb66aacd7bcccbae40e6ab3f5df3b63 | test/CodeGenCXX/exceptions-cxx-ehsc.cpp | test/CodeGenCXX/exceptions-cxx-ehsc.cpp | // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fexceptions -fcxx-exceptions -fexternc-nounwind | FileCheck %s
namespace test1 {
struct Cleanup { ~Cleanup(); };
extern "C" void never_throws();
void may_throw();
void caller() {
Cleanup x;
never_throws();
may_throw();
}
}
// CHECK-LABEL: define void ... | Add a test for r261425. | Add a test for r261425.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@261534 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... | |
154a0fc9e00365500995f6f697f65396120d79c8 | setZeroes.cpp | setZeroes.cpp | #include <iostream>
#include <set>
#include <vector>
using namespace std;
void setZeroes(vector<vector<int> > &matrix) {
set<int> rows;
set<int> columns;
int noRows = matrix.size();
int noColumns = matrix.at(0).size();
for (int i = 0; i < noRows; ++i) {
for (int j = 0; j < noColumns; ++j... | Set Zeroes in a Matrix | Set Zeroes in a Matrix
| C++ | mit | srijanshetty/code | |
a5502424c9fae2d1506b4097f2cb03580a8f4b67 | chap8/ex8_5.cpp | chap8/ex8_5.cpp | /*
Ex 8.5:
Write two functions that reverse the order of elements in a vector<int>. For
example, 1, 3, 5, 7, 9 becomes 9, 7, 5, 3, 1. The first reverse function should
produce a new vector with the reversed sequence, leaving its original vector
unchanged. The other reverse function should reverse the elements of its ve... | Add ex8.5 and result of performance testing | Add ex8.5 and result of performance testing
| C++ | mit | ksvbka/pppuc | |
2f51fdf13beb0626ccbcd746693c5d4e50d98ba6 | quick-sort/testQuickSort.cpp | quick-sort/testQuickSort.cpp | /*
This program tests Quick sort
*/
#include<iostream>
#include<vector>
#include "quicksort.h" // My implementation of Quick sort
// Displays vector
void printVector(std::vector<int> A){
for(auto x: A){
std::cout<<x<<" ";
}
std::cout<<std::endl;
}
// Tests Quick sort on vector A
void testQuickSort(std::ve... | Add program to test quicksort | Add program to test quicksort
| C++ | mit | rohitkhilnani/cpp-And-Me | |
50ac56356fe9b34b2fc394505e8d0ea1b90ed1b9 | mha/libmha/src/mha_parser_unit_tests.cpp | mha/libmha/src/mha_parser_unit_tests.cpp | // This file is part of the HörTech Open Master Hearing Aid (openMHA)
// Copyright © 2020 HörTech gGmbH
//
// openMHA is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// op... | Add unit test to ensure that inserting the same name twice raises an error | Add unit test to ensure that inserting the same name twice raises an error
Summary:
Add unit test for MHAParser::parser_t that checks that inserting a parser
entry with the same name as an already existing parser entry raises an
error.
Ref T897. This should help improving D284.
Test Plan: Let Jenkins execute on all ... | C++ | agpl-3.0 | HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA,HoerTech-gGmbH/openMHA | |
72614c42f55d1a2aa8e23a04067945ecae125ac9 | tests/user_tracking_mhd.cc | tests/user_tracking_mhd.cc | #include <thread>
#include <iostream>
#include <silicon/mhd_serve.hh>
#include <silicon/api.hh>
#include <silicon/client.hh>
using namespace sl;
int main()
{
auto api = make_api(
@my_tracking_id = [] (tracking_cookie c) {
return D(@id = c.id());
}
);
// Start server.
std::thread t([&] (... | Add and test cookie tracking to microhttpd. | Add and test cookie tracking to microhttpd.
| C++ | mit | byzhang/silicon,byzhang/silicon,gale320/silicon,matt-42/silicon,gale320/silicon,gale320/silicon,byzhang/silicon,matt-42/silicon,matt-42/silicon | |
4b04bd164cce66aabda4ce118a492f72e6735e68 | 23_merge_k_sorted_lists.cc | 23_merge_k_sorted_lists.cc | // Naive solution would iterate all lists to take the smallest head every time to
// add to the merged list. Actually we have a efficient data structure to retrieve
// the smallest element from a bunch of elements. That is a "min heap".
// In the implementation below, I created a wrapper for list so that we could use
... | Add a solution for problem 23: Merge k Sorted Lists. | Add a solution for problem 23: Merge k Sorted Lists.
| C++ | apache-2.0 | shen-yang/leetcode_solutions,shen-yang/leetcode_solutions,shen-yang/leetcode_solutions | |
872df152e57fe8ba6ebf668531147e482ca4f73f | content/app/mojo/mojo_init.cc | content/app/mojo/mojo_init.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/app/mojo/mojo_init.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/simple_pl... | // 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/app/mojo/mojo_init.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/edk/embedder/configuration.h"
#include "mojo/edk/embedder/embe... | Raise the message size limit. | Mojo: Raise the message size limit.
The default message size limit 4MB is too small for Chrome IPC.
TEST=Layout Tests with a flag on
BUG=377980
R=viettrungluu@chromium.org, jam@chromium.org, nasko@chromium.org
Review URL: https://codereview.chromium.org/741813002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03e... | C++ | bsd-3-clause | ltilve/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,... |
f15e71fc5e07508ba5b3e408faa565098cc1c0f1 | kozichki1.cpp | kozichki1.cpp | #include<iostream>
int main()
{
unsigned N,K;
unsigned Ai[1000],VarAi[1000];
unsigned max=0,capacity,varIndx,v_capacity;
unsigned big,hasMoreValues,flag=1;
do
{
std::cin>>N;
}while(N<1 || N>1000);
do
{
std::cin>>K;
}while(K<1 || K>1000);
for(int i=... | Add fixed solution to fast tast "Kozichki" | Add fixed solution to fast tast "Kozichki" | C++ | mit | RadoslavGYordanov/hackerschool,RadoslavGYordanov/hackerschool,RadoslavGYordanov/hackerschool,RadoslavGYordanov/hackerschool,RadoslavGYordanov/hackerschool | |
11139a09a343774e4d526beee848aec6080daaef | qsort_c++11.cpp | qsort_c++11.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <random>
using namespace std;
int main() {
vector<int> vec(10000);
generate(vec.begin(), vec.end(), rand);
sort(vec.begin(), vec.end(), [](int a, int b) -> bool { return a > b; });
for (auto &a : vec) {
cout << a << " ";
}
cout << endl;
... | Add qsort with lambda function in c++11 standard. | Add qsort with lambda function in c++11 standard.
| C++ | apache-2.0 | tisma/ctorious,tisma/ctorious | |
dae5916ae1eeed9e878a4f675257dd8c5464eb44 | PFunction.cc | PFunction.cc | #include "PTask.h"
PFunction::PFunction(svector<PWire*>*p, Statement*s)
: ports_(p), statement_(s)
{
}
PFunction::~PFunction()
{
}
| Add functions up to elaboration (Ed Carter) | Add functions up to elaboration (Ed Carter)
| C++ | lgpl-2.1 | CastMi/iverilog,themperek/iverilog,CastMi/iverilog,CastMi/iverilog,themperek/iverilog,themperek/iverilog | |
3cb80cd91960b3a4b5a5c7a900a0e9d9bea7a003 | server/opencv/stdin_stream_sample.cpp | server/opencv/stdin_stream_sample.cpp | #include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
#if defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
|| defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
# include <io.h>
# include <fcntl.h>
# define SET_BINARY_MODE(handle) ... | Enable to pass mjpeg stream from node to c++ | Enable to pass mjpeg stream from node to c++
| C++ | mit | jphacks/TK_20,jphacks/TK_20,jphacks/TK_20,jphacks/TK_20,jphacks/TK_20 | |
1350f05bd8730ef1b15f0c7626e2d9c3d607e5e8 | f80789_4a.cpp | f80789_4a.cpp | #include <cstdio>
#include <cctype>
using namespace std;
int a[10];
void print_number(int a[])
{
for (int i = 9; i >= 0; i--)
{
while (a[i] > 0)
{
printf("%d", i);
a[i]--;
}
}
printf("\n");
}
int main()
{
char x;
while (scanf("%c", &x) != EOF)
{
if (x == ' ')
{
p... | Add a solution for task 4a | Add a solution for task 4a
| C++ | mit | ralcho/AdvancedProgrammingNBU | |
751511c24b1e1c26d51754d627f013c2089c18f8 | C++/005_Longest_Palindromic_Substring.cpp | C++/005_Longest_Palindromic_Substring.cpp | // 005. Longest Palindromic Substring
/**
* Given a string S, find the longest palindromic substring in S.
* You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
*
* Tags: String
*
* Author: Kuang Qin
*/
#include "stdafx.h"
#include <string>
#include <... | Add Solution for Problem 005 | Add Solution for Problem 005
| C++ | mit | bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res | |
d34dd3ffd5b37c26598b78567acaa68ac6a4cd92 | tests/PictureUtilsTest.cpp | tests/PictureUtilsTest.cpp | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Test.h"
#include "picture_utils.h"
#include "SkString.h"
static void test_filepath_creation(skiatest::Reporter* reporter) {
SkString result;
SkString filenam... | Allow specific files and multiple inputs for picture testing tools. | Allow specific files and multiple inputs for picture testing tools.
Changed the render_pictures, bench_pictures and test_pictures.py so that multiple inputs can be given. Furthermore, specific files can also be specified.
Unit tests have also been added for picture_utils.cpp.
Committed http://code.google.com/p/skia/... | C++ | bsd-3-clause | hbwhlklive/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,Frankie-666/color-emoji.skia,Frankie-666/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia,hbwhlklive/color-emoji.skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,Hankuo/color-emo... | |
569d5beafdfedd4ae5ca9e8084012321a818d171 | cpp/459_Repeated_Substring_Pattern.cpp | cpp/459_Repeated_Substring_Pattern.cpp | // 459. Repeated Substring Pattern
/**
* Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.
* You may assume the given string consists of lowercase English letters only and its length will not exceed 10000.
*
* Example 1:
*... | Add Solution for 459 Repeated Substring Pattern | Add Solution for 459 Repeated Substring Pattern
| C++ | mit | kuangami/LeetCode,kuangami/LeetCode,kuangami/LeetCode | |
d224345530e3a35ee6938c666e39b57af59329ee | test/SemaCXX/cxx14-compat.cpp | test/SemaCXX/cxx14-compat.cpp | // RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++14-compat-pedantic -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++14-compat-pedantic -verify %s
#if __cplusplus < 201402L
// expected-no-diagnostics
// FIXME: C++11 features removed or changed in C++14?
#else
static_assert(true); // expected-warning {{in... | Add test file missed from r341097. | Add test file missed from r341097.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@341099 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/cl... | |
9980f312b6216fb29a7ec981306ed47ce92aa98e | athena/content/content_activity_factory.cc | athena/content/content_activity_factory.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 "athena/content/content_activity_factory.h"
#include "athena/activity/public/activity_manager.h"
#include "athena/content/app_activity.h"
#inclu... | // 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 "athena/content/content_activity_factory.h"
#include "athena/activity/public/activity_manager.h"
#include "athena/content/app_activity.h"
#inclu... | Set window name to activities | Set window name to activities
BUG=None
TBR=skuhne@chromium.org
Review URL: https://codereview.chromium.org/641803002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#298893}
| C++ | bsd-3-clause | jaruba/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Pluto-tv/chromium-cros... |
208ca2fbad6d68f6d55b7c4454345b3bd6f3cd5a | test17_28.cpp | test17_28.cpp | #include <iostream>
#include <random>
using namespace std;
int generate_random_number(const int a = 0, const int b = 9) {
static default_random_engine e;
static uniform_int_distribution<unsigned> u(a, b);
return u(e);
}
int main() {
for(int i = 0; i != 20; ++ i) {
cout << gener... | Add solution for chapter 17 test 28 | Add solution for chapter 17 test 28 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
93bf1a0892cf560dee15919a2e65f4a87960646a | test/test_shared_ptr.cpp | test/test_shared_ptr.cpp | // Copyright Daniel Wallin 2009. Use, modification and distribution is
// subject to the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include <luabind/luabind.hpp>
#include <luabind/detail/shared_ptr_converter.hpp>
... | // Copyright Daniel Wallin 2009. Use, modification and distribution is
// subject to the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include <luabind/luabind.hpp>
#include <luabind/shared_ptr_converter.hpp>
struct... | Test object identity with shared_ptr_converter. | Test object identity with shared_ptr_converter.
| C++ | mit | grafi-tt/luabind,luabind/luabind,rpavlik/luabind,Oberon00/luabind,davidar/luabind,galek/luabind-deboostified,mapbox/luabind,rpavlik/luabind,rpavlik/luabind,ltjax/luabind-deboostified,alex85k/luabind,Wohlhabend-Networks/luabind-deboostified,luabind/luabind,alex85k/luabind,rpavlik/luabind,mdave88/luabind,alex85k/luabind,... |
956c54009b0b04444038cdc855ecb701f1b91b0f | Strings/substr_rotation.cpp | Strings/substr_rotation.cpp | /*
Assume you have a method isSubstring which checks
if one word is a substring of another string.
Given two strings s1, and s2. write code to check
if s2 is a rotation of s1 using only one call to
isSubstring (i.e., “waterbottle” is a rotation of “erbottlewat”).
*/
# include <iostream>
using namespace std;
bool i... | Call substr only once to check isRotation of strings | Call substr only once to check isRotation of strings
| C++ | mit | CuriousLearner/Algorithms,CuriousLearner/Algorithms | |
589e3d41fa58a88fadbac13b69abbce1dc159475 | chrome/common/chrome_version_info_android.cc | chrome/common/chrome_version_info_android.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 "chrome/common/chrome_version_info.h"
#include "base/android/build_info.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
... | // 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 "chrome/common/chrome_version_info.h"
#include "base/android/build_info.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
... | Fix VersionInfo::GetChannel for Android canary. | Fix VersionInfo::GetChannel for Android canary.
BUG=354106
Review URL: https://codereview.chromium.org/204953002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@258225 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | ltilve/chromium,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,axinging/chr... |
6e38e982ec31ef0755b947cafc00b17f58a005b1 | test/PCH/dllexport-default-arg-closure.cpp | test/PCH/dllexport-default-arg-closure.cpp | // Make sure we emit the MS ABI default ctor closure with PCH.
//
// Test this without pch.
// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -include %s -emit-llvm -o - %s | FileCheck %s
// Test with pch.
// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc -std=c++11 -emit-pch -o %t... | Add dllexport default ctor closure PCH regression test for PR31121 | Add dllexport default ctor closure PCH regression test for PR31121
Follow up to r287774
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@287793 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,apple/swift-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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
0680f26d6652f7c92bbf8cecc9b5201fef0dbecb | chapter19/chapter19_ex10.cpp | chapter19/chapter19_ex10.cpp | // Chapter 19, exercise 10: implement a simple auto_ptr supporting only a
// constructor, destructor, ->, * and release() - don't try assignment or copy
// constructor
#include "../lib_files/std_lib_facilities.h"
//------------------------------------------------------------------------------
struct Tracer {
Tra... | Add Chapter 19, exercise 10 | Add Chapter 19, exercise 10
| C++ | mit | bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp | |
090434827fb21b094cecb3138288f33a58583bd8 | lib/Rinex3/UnitTests/CTtoDayTimeTest.cpp | lib/Rinex3/UnitTests/CTtoDayTimeTest.cpp | #include "DayTime.hpp"
#include "CommonTime.hpp"
#include <iostream>
using namespace gpstk;
using namespace std;
int main()
{
CommonTime common = CommonTime();
DayTime day = DayTime();
day = common;
common = day;
day = CommonTime();
common = DayTime();
return 0;
}
| Test case to check CommonTime and DayTime compatability | Test case to check CommonTime and DayTime compatability
git-svn-id: 6625e4d6743179724b113c04fbf297d122273a36@1474 108fab2b-820f-0410-9f2c-e5cc2c41d7be
| C++ | lgpl-2.1 | ianmartin/GPSTk,ianmartin/GPSTk,ianmartin/GPSTk,ianmartin/GPSTk,ianmartin/GPSTk,ianmartin/GPSTk | |
84206757573bb9f3c91a48cebf800e3fb6c48301 | test/CodeGenCXX/virt-canonical-decl.cpp | test/CodeGenCXX/virt-canonical-decl.cpp | // RUN: clang-cc %s -emit-llvm-only
class Base {
public:
virtual ~Base();
};
Base::~Base()
{
}
class Foo : public Base {
public:
virtual ~Foo();
};
Foo::~Foo()
{
}
| Test for non-canonical decl and vtables. | Test for non-canonical decl and vtables.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@90541 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... | |
5f05360d045129f5f8198fdf7d4cd5a5a7b64c79 | 219_contains_duplicate_ii.cc | 219_contains_duplicate_ii.cc | // https://leetcode.com/problems/contains-duplicate-ii/
// Compared to 'contains duplicate i', now we also need to know the index of number for
// query. So we use a number to index map.
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_map<int, size_t> value_inde... | Add a solution for problem 219: Contains Duplicate II. | Add a solution for problem 219: Contains Duplicate II.
| C++ | apache-2.0 | shen-yang/leetcode_solutions,shen-yang/leetcode_solutions,shen-yang/leetcode_solutions | |
271ee357ddf91d412d2a76ef889d32d5a769d311 | phone_patterns.cpp | phone_patterns.cpp | #include <iostream>
#include <string>
#include <list>
#include <map>
using namespace std;
char convert(char x)
{
if (x >= 'A' && x <= 'P') {
return ((x - 'A') / 3 + 2) + '0';
}
if (x >= 'R' && x <= 'Y') {
return ((x - 'A' - 1) / 3 + 2) + '0';
}
else {
return x;
}
}
string mapper(string s)
{
string res = ... | Add the solution to "Phone Patterns". | Add the solution to "Phone Patterns".
| C++ | mit | clasnake/hackermeter,clasnake/hackermeter | |
b2614f8ec84a04bc7c62a460122a94646a8e41f4 | poj/3101_Astronomy_拓展欧几里得.cpp | poj/3101_Astronomy_拓展欧几里得.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned long long p[3];
unsigned long long* gcdEx(unsigned long long a, unsigned long long b, unsigned long long *p) {
if (b == 0) {
p[0] = 1, p[1] = 0, p[2] = a;
return p;
} else {
p = gcdEx(b, b%a, p);
unsigned long ... | Add 3101 astronomy cpp version, which doesn't handle the big integer and WA. JAVA was used instead to AC | Add 3101 astronomy cpp version, which doesn't handle the big integer and WA. JAVA was used instead to AC
| C++ | mit | atupal/oj,atupal/oj,atupal/oj,atupal/oj,atupal/oj,atupal/oj | |
1dda082162b3c29042dc157a3f22bd6da937d320 | C++/134_Gas_Station.cpp | C++/134_Gas_Station.cpp | // 134. Gas Station
/**
* There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
*
* You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of the gas stations... | Add Solution for Problem 134 | Add Solution for Problem 134
| C++ | mit | bssrdf/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res | |
b13334dbddf00003f21fbcb6e9205334544953dd | main.cpp | main.cpp | #include <string>
#include <cstdio>
std::string GetFilenameExt(std::string filename) {
std::string ext_name("");
std::string::size_type index = filename.rfind('.');
if(index != std::string::npos)
ext_name = filename.substr(index+1);
return ext_name;
}
int main (int argc, char *argv[]) {
for(unsigned int ... | Print the file name and file extension name of all arguments | Feature: Print the file name and file extension name of all arguments
| C++ | mit | joedavisdev/textureinfo,joedavisdev/textureinfo | |
a33289039ffd1f41a158225e193d7f9748f38453 | test16_35.cpp | test16_35.cpp | #include <iostream>
using namespace std;
template <typename T>
T calc(T a, int i) {
return a;
}
template <typename T>
T fcn(T a, T b) {
return a;
}
int main() {
double d;
float f;
char c = 'a';
calc(c, 'c');//good
calc(d, f);//good
cout << fcn(c, 'c');
// fcn(... | Add solution for chapter 16 test 35 | Add solution for chapter 16 test 35 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
16449bdd21da07d6eda12ce3feaf3303de0d73a5 | test17_20.cpp | test17_20.cpp | #include <iostream>
#include <string>
#include <regex>
using namespace std;
bool valid(const smatch &m) {
if(m[1].matched) {
return m[3].matched && (m[4].matched == 0 || m[4].str() == " ");
} else {
return m[3].matched == 0 && m[4].str() == m[6].str();
}
}
int main() {
... | Add solution for chapter 17 test 20 | Add solution for chapter 17 test 20 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
02045a0e293c7b703f9ceeafe2cfb466797de0b1 | src/Foundation.cpp | src/Foundation.cpp | // Copyright (c) 1997-2018 The CSE Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
///////////////////////////////////////////////////////////////////////////////
// Foundation.cpp -- interface to Kiva
///////////////////////////////... | Add initial foundation cpp file. | Add initial foundation cpp file.
| C++ | bsd-3-clause | cse-sim/cse,cse-sim/cse | |
4280faf352d68e16f18fe60de92b832181a00aac | f80789_3a.cpp | f80789_3a.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
int taken[22];
int n, k;
bool found = false;
vector<int> numbers;
void rec(int i)
{
if (found) return;
if (i == n)
{
int sum = 0;
for (int j = 0; j < n; j++)
{
// cout << taken[j] << " ";
... | Add a solution for task 3a | Add a solution for task 3a
| C++ | mit | ralcho/AdvancedProgrammingNBU | |
c83c6d3ae09dc562f6de6949b4c6fb2232b5ccf0 | test/UserTest.cpp | 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-c,DeonPoncini/ygodeck-c | |
6ddb0402ee416f477684c983512800a16db66a8e | test/CodeGenCXX/2010-06-21-LocalVarDbg.cpp | test/CodeGenCXX/2010-06-21-LocalVarDbg.cpp | // RUN: %clang_cc1 -g -emit-llvm %s -o - | FileCheck %s
// Do not use function name to create named metadata used to hold
// local variable info. For example. llvm.dbg.lv.~A is an invalid name.
// CHECK-NOT: llvm.dbg.lv.~A
class A {
public:
~A() { int i = 0; i++; }
};
int foo(int i) {
A a;
return 0;
}
| Migrate test from llvm/test/FrontendC++ and FileCheckize. | Migrate test from llvm/test/FrontendC++ and FileCheckize.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@137770 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-cl... | |
aada138a77de35bc1cde371192dd98a31b6fb879 | td/challenge260/InstructionParserTest.cpp | td/challenge260/InstructionParserTest.cpp | //#include "InstructionParser.h"
#include <string>
#include <stdexcept>
#include "gtest/gtest.h"
class InstructionParser
{
public:
class UnknownInstruction : public std::runtime_error
{
public:
UnknownInstruction(const std::string& msg) : std::runtime_error{msg}
{}
};
void parseInstructions(const ... | //#include "InstructionParser.h"
#include <string>
#include <stdexcept>
#include "gtest/gtest.h"
class InstructionParser
{
public:
class UnknownInstruction : public std::runtime_error
{
public:
UnknownInstruction(const std::string& msg) : std::runtime_error{msg}
{}
};
void parseInstructions(const ... | Use container to store acceptable instructions | Use container to store acceptable instructions
| C++ | mit | lukasz-m-maciejewski/papuc_exercises,NadzwyczajnaGrupaRobocza/papuc_exercises,lukasz-m-maciejewski/papuc_exercises,NadzwyczajnaGrupaRobocza/papuc_exercises |
747132911f3ea85df021f27d85db19dd14ac4cef | test/graph_node_unittest.cpp | test/graph_node_unittest.cpp | #include "graph_node.h"
#include "gtest\gtest.h"
/*
This file will includ all the test for the GraphNode class.
*/
/*
This test will check if neighbors can be added.
*/
TEST(GraphNodeTest, Add) {
//Initialize a node with some children
GraphNode<int> root1;
GraphNode<int> neighbor1;
GraphNode<i... | Add test for the graphnode. | Add test for the graphnode.
| C++ | mit | holmgr/dsa-cozy-corner,holmgr/dsa-cozy-corner,holmgr/dsa-cozy-corner | |
f3114dc02256013cf4d548ed1fea8dca145e6702 | checkIfBST.cpp | checkIfBST.cpp | // Program to check if given tree is a BST or not.
#include <iostream>
#define MAX 1000
using namespace std;
int A[MAX];
int index = 0;
struct Node{
int data;
struct Node *left;
struct Node *right;
};
struct Node *newNode(int x){
struct Node *newptr = new Node;
newptr->data = x;
newptr->left = NULL;
newptr->... | Check if given binary tree is BST or not. | Check if given binary tree is BST or not. | C++ | mit | Raghav1806/Geeks-for-Geeks-DS,Raghav1806/Geeks-for-Geeks-DS | |
673a05e5e1fa50e8912e07312bc2cdea396b04e0 | week2/homework/problem1/triangle.cpp | week2/homework/problem1/triangle.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Point3D {
double x;
double y;
double z;
public:
double getX() {
return x;
}
double getY() {
return y;
}
double getZ() {
return z;
}
void setX(double newX) {
x = newX;
}
void setY(double newY) {
y = newY;
... | Add solution to the second problem - 'Triangle' | Add solution to the second problem - 'Triangle'
| C++ | mit | dimitaruzunov/oop-practicum-2015-16 | |
d167935f8449bf3897b94d75d119f849446700b5 | Cpp/procon_min.cpp | Cpp/procon_min.cpp | #include <cstdlib>
#include <iostream>
int
main(void)
{
std::cin.tie(0);
std::ios::sync_with_stdio(false);
int n;
while (std::cin >> n) {
std::cout << n << std::endl;
}
return EXIT_SUCCESS;
}
| Add minimum template for programming contest | Add minimum template for programming contest
| C++ | mit | koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate | |
cbe20381979033e63b05abc8076b2a610882de7b | src/unity/android/logging_android.cpp | src/unity/android/logging_android.cpp | // Copyright (c) 2018 The Gulden developers
// Authored by: Malcolm MacLeod (mmacleod@webmail.co.za)
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <string>
#include <android/log.h>
void OpenDebugLog()
{
}
int LogPri... | Implement android specific logging calls | Implement android specific logging calls
| C++ | mit | nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official,nlgcoin/guldencoin-official | |
a0e6ce914c5f05fedeb3f865ad125117e4a9075a | test18_23.cpp | test18_23.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 23 | Add solution for chapter 18, test 23 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
fbd6afc580fbbfeb82f37ea3cabed0dc1a339aff | util/devel/coverity_model.cpp | util/devel/coverity_model.cpp | /**
* Coverity Scan model
*
* Manage false positives by giving coverity some hints.
*
* Updates to this file must be manually submitted by an admin to:
*
* https://scan.coverity.com/projects/1222
*
*/
// When tag is 1 or 2, let coverity know that execution is halting. Those
// tags correspond to INT_FATAL a... | Add Coverity Scan model file. | Add Coverity Scan model file.
Model files help eliminate false positives by giving coverity hints about halts
and memory (de)allocation. The only model, for now, helps coverity understand
that INT_FATAL and USR_FATAL abort execution.
r: sungeun
git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@23622 3a8e244f-b0f2... | C++ | apache-2.0 | hildeth/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,sungeunchoi/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,chizarlicious/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,su... | |
d0f25b705d32957c59d324429a573ebf40a15706 | test/CodeGenCXX/linetable-virtual-variadic.cpp | test/CodeGenCXX/linetable-virtual-variadic.cpp | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -gline-tables-only %s -o - | FileCheck %s
// Crasher for PR22929.
class Base {
virtual void VariadicFunction(...);
};
class Derived : public virtual Base {
virtual void VariadicFunction(...);
};
void Derived::VariadicFunction(...) { }
// CHECK-LABEL: defi... | Test that linetables work with variadic virtual thunks | CodeGenCXX: Test that linetables work with variadic virtual thunks
Add a frontend test for PR22929, which was fixed by LLVM r232449.
Besides the crash test, check that the `!dbg` attachment is sane since
its presence was the trigger.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@232450 91177308-0d34-0410-b5e6-... | C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/cl... | |
b3f31217c7d135ad65e6714aa67376072e7440f5 | C++/122_Best_Time_to_Buy_and_Sell_Stock_II.cpp | C++/122_Best_Time_to_Buy_and_Sell_Stock_II.cpp | // 122. Best Time to Buy and Sell Stock II
/**
* Say you have an array for which the ith element is the price of a given stock on day i.
*
* Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times).
* However, you... | Add Solution for Problem 122 | Add Solution for Problem 122
| C++ | mit | FreeTymeKiyan/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,bssrdf/LeetCode-Sol-Res,FreeTymeKiyan/LeetCode-Sol-Res | |
5ca7456f510ba1fc36afed6ff539164cae6313f4 | test16_65_66_67.cpp | test16_65_66_67.cpp | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
template <typename T>
string debug_rep(const T &t) {
ostringstream ret;
ret << t;
return ret.str();
}
template <typename T>
string debug_rep(T *p) {
ostringstream ret;
ret << "pointer: " << p;
if(p)... | Add solution for chapter 16 test 65 66 67 | Add solution for chapter 16 test 65 66 67 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
b287a90290065214adaacdcdfa5fa64ba0d9fedd | test/test2.cpp | test/test2.cpp | #include <iostream>
#include <cstdlib>
/* This is our main function */
int main() {
// print Hello world!
std::cout << "HELLO WORLD!" << std::endl;
return 1;
/* TESTING
MULTILINE
COMMENTS
YAY */
}
| Add additional test case for multiline comments | Add additional test case for multiline comments
| C++ | mit | malea/numcomments | |
c7bbb820f7682537469a42e0cfff34cebf035caf | test17_14.cpp | test17_14.cpp | #include <iostream>
#include <regex>
#include <string>
using namespace std;
int main() {
try {
//[z-a]+\\.(cpp|cxx|cc)$ code 4
//
string pattern("[[:alnum:]]+\\.cpp|cxx|cc)$", regex::icase);
regex r(pattern);
smatch results;
} catch(regex_error e) {
... | Add solution for chapter 17 test 14 | Add solution for chapter 17 test 14 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
d2ae847118d8dbbed3c03545462e4b17089645b1 | test17_27.cpp | test17_27.cpp | #include <iostream>
#include <regex>
#include <string>
using namespace std;
int main() {
string pattern("(\\d{5})(\\d{4})");
regex r(pattern);
smatch m;
string s;
string fmt = "$1-$2";
while(getline(cin, s)) {
cout << regex_replace(s, r, fmt) << endl;
}
return ... | Add solution for chapter 17 test 27 | Add solution for chapter 17 test 27 | C++ | apache-2.0 | chenshiyang/CPP--Primer-5ed-solution | |
ffe525f5e593c6eccd435e45cf5d5a06d6678c9a | Data_Structures/LinkedLists/PrintReverse/main.cc | Data_Structures/LinkedLists/PrintReverse/main.cc | /*
Print elements of a linked list in reverse order as standard output
head pointer could be NULL as well for empty list
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
void ReversePrint(Node *head)
{
if (head != NULL) {
ReversePrint(head->next);
cout << hea... | Print linked list in reverse | Print linked list in reverse
| C++ | mit | Johan37/Hackerrank,Johan37/Hackerrank | |
6b101f1be13e4b29b854a7a3bdd23783dc987898 | src/experimental/filesystem/int128_builtins.cpp | src/experimental/filesystem/int128_builtins.cpp | /*===-- int128_builtins.cpp - Implement __muloti4 --------------------------===
*
* 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 hack to allow ubsan to work w/o compiler-rt (__muloti4 is undefined) | [libc++] Add hack to allow ubsan to work w/o compiler-rt (__muloti4 is undefined)
Summary:
Using int128_t with UBSAN causes link errors unless compiler-rt is providing the runtime library.
Specifically ubsan generates calls to __muloti4 but libgcc doesn't provide a definition.
In order to avoid this, and allow users ... | C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx | |
fba6da49484816383b40c7149ec88b00d7c0bf27 | src/main.cc | src/main.cc | #include <iostream>
#include <string>
#include <clang/Tooling/Tooling.h>
#include <clang/Tooling/CommonOptionsParser.h>
#include <llvm/Support/CommandLine.h>
using namespace llvm;
using namespace clang::tooling;
using std::string;
static cl::OptionCategory OptionsCategory("Options");
int main(int argc, const char *... | #include <iostream>
#include <string>
#include <clang/Tooling/Tooling.h>
#include <clang/Tooling/CommonOptionsParser.h>
#include <clang/Frontend/FrontendActions.h>
#include <clang/AST/ASTConsumer.h>
#include <llvm/Support/CommandLine.h>
using namespace llvm;
using namespace clang;
using namespace clang::tooling;
usin... | Implement action that prints file names | Implement action that prints file names
| C++ | mit | Baltoli/skeletons,Baltoli/skeletons,Baltoli/skeletons |
fd10725688a0580fec6f74b8f48b3ea13d16e5ba | tools/evm2wasm/main.cpp | tools/evm2wasm/main.cpp | #include <string>
#include <iostream>
#include <fstream>
#include <streambuf>
#include <evm2wasm.h>
using namespace std;
int main(int argc, char **argv) {
if (argc < 2) {
cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
return 1;
}
bool wast = false;
if (argc == 3) {
... | #include <string>
#include <iostream>
#include <fstream>
#include <streambuf>
#include <algorithm>
#include <evm2wasm.h>
using namespace std;
int main(int argc, char **argv) {
if (argc < 2) {
cerr << "Usage: " << argv[0] << " <EVM file> [--wast]" << endl;
return 1;
}
bool wast = false;
... | Clean input to evm2wasm CLI from any whitespace | Clean input to evm2wasm CLI from any whitespace
| C++ | mpl-2.0 | ewasm/evm2wasm,ewasm/evm2wasm |
4848fe8da300904e6c9d7c42fbefb42100ca6bd8 | example/main.cpp | example/main.cpp | /*
* The MIT License (MIT)
*
* Copyright (c) 2014 Pavel Strakhov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to us... | /*
* The MIT License (MIT)
*
* Copyright (c) 2014 Pavel Strakhov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to us... | Fix string literal compile error that didn't show up before | Fix string literal compile error that didn't show up before
| C++ | mit | baldurk/toolwindowmanager |
9f239dcd4644e48e06927e832ff3b5d06ab15381 | src/Moves/En_Passant.cpp | src/Moves/En_Passant.cpp | #include "Moves/En_Passant.h"
#include "Moves/Direction.h"
#include "Moves/Pawn_Capture.h"
#include "Game/Board.h"
//! Create an en passant move.
//
//! \param color The color of the moving pawn.
//! \param dir The direction of the capture.
//! \param file_start The file of the square where the pawn starts.
En_Passan... | #include "Moves/En_Passant.h"
#include "Moves/Direction.h"
#include "Moves/Pawn_Capture.h"
#include "Game/Board.h"
//! Create an en passant move.
//
//! \param color The color of the moving pawn.
//! \param dir The direction of the capture.
//! \param file_start The file of the square where the pawn starts.
En_Passan... | Use immediate base class method | Use immediate base class method
| C++ | mit | MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess |
5829f2561be162e8f44a7ba2b9962c80372e153c | src/Dummy.cpp | src/Dummy.cpp | #include <iostream>
int main () {
std::cout << "Hello word!" << std::endl;
} | #include <iostream>
#include <boost/asio.hpp>
int main () {
boost::asio::io_service io_dummy;
boost::asio::deadline_timer t(io_dummy, boost::posix_time::seconds(5));
t.wait();
std::cout << "Hello word!" << std::endl;
} | Add a dummy for testing Boost dependencies within CMake | Add a dummy for testing Boost dependencies within CMake
| C++ | mit | elmo-net/router |
7fad1aff19cff758bc7df7ac09cfc45bc382948d | src/App.cpp | src/App.cpp | /*
* Copyright 2014-2015 Adrián Arroyo Calle <adrian.arroyocalle@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "App.hpp"
#include "Window.hpp"
SuperFreeCell::SuperFreeCell()
:
BApplication("application/x-vnd.adrianarroyocalle.SuperFreeCell")
{
Window* win=new W... | /*
* Copyright 2014-2015 Adrián Arroyo Calle <adrian.arroyocalle@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "App.hpp"
#include "Window.hpp"
SuperFreeCell::SuperFreeCell()
:
BApplication("application/x-vnd.adrianarroyocalle.SuperFreeCell")
{
Window* win=new W... | Change year in About Dialog | Change year in About Dialog
| C++ | mit | AdrianArroyoCalle/SuperFreeCell |
64fedd6dccca01f73c6876f84f5a38665adab9f8 | src/mpage.cpp | src/mpage.cpp | #include "mpage.h"
PageItemProxy & PageItemProxy::operator=(const uint8_t & value)
{
MemoryPage & page = reinterpret_cast<MemoryPage&>(*this);
page.m_Data[page.m_ProxyIndex] = value;
page.m_Dirty = true;
return *this;
}
PageItemProxy::operator uint8_t()
{
MemoryPage & page = reinterpret_cast<Memo... | #include "mpage.h"
PageItemProxy & PageItemProxy::operator=(const uint8_t & value)
{
MemoryPage & page = reinterpret_cast<MemoryPage&>(*this);
if (value == page.m_Data[page.m_ProxyIndex]) {
return *this;
}
page.m_Data[page.m_ProxyIndex] = value;
page.m_Dirty = true;
return *this;
}
P... | Add potential optimization check in proxy | Add potential optimization check in proxy
| C++ | mit | poseidon4o/mem-mapped |
355b729b449568d1c763a58116d02c06761f2cf4 | avogadro/rendering/scene.cpp | avogadro/rendering/scene.cpp | /******************************************************************************
This source file is part of the Avogadro project.
Copyright 2012 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
Unless required by applicable law or agreed to in writing, software
distri... | /******************************************************************************
This source file is part of the Avogadro project.
Copyright 2012 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
Unless required by applicable law or agreed to in writing, software
distri... | Add a little padding to the radius | Add a little padding to the radius
There is no need to use exact radius, pad a little for clipping.
Change-Id: I68945036be9c2c01427b14d97a149fbd10009df1
| C++ | bsd-3-clause | OpenChemistry/avogadrolibs,wadejong/avogadrolibs,ghutchis/avogadrolibs,wadejong/avogadrolibs,ghutchis/avogadrolibs,cjh1/mongochemweb-avogadrolibs,ghutchis/avogadrolibs,ghutchis/avogadrolibs,OpenChemistry/avogadrolibs,OpenChemistry/avogadrolibs,ghutchis/avogadrolibs,OpenChemistry/avogadrolibs,cjh1/mongochemweb-avogadrol... |
e887750a724710db3787859f367c94c57b2190e1 | app/main.cpp | app/main.cpp | #include "main_window.hpp"
#include <QApplication>
#include <iostream>
using namespace std;
using namespace datavis;
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
auto main_win = new MainWindow;
auto args = app.arguments();
if (args.size() > 1)
{
auto file_path = arg... | #include "main_window.hpp"
#include <QApplication>
#include <iostream>
using namespace std;
using namespace datavis;
namespace datavis {
enum File_Type
{
Unknown_File_Type,
Data_File_Type,
Project_File_Type
};
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
auto args = app.a... | Fix memory leak; Improve command-line argument handling | Main: Fix memory leak; Improve command-line argument handling
| C++ | mit | jleben/datavis,jleben/datavis |
7488438d4ae8266742c4dfe1dd0f646bd76b526d | bin/mem-compile/main.cpp | bin/mem-compile/main.cpp | #include "mem/Compiler.hpp"
int main (int argc, char** argv)
{
opt::Options opts;
opts.addStrOpt("--dump-ast-xml", "",
"Dump the Abstract Syntax Tree as XML");
opts.addStrOpt("--emit-llvm-bc", "",
"Emit LLVM bytecode");
opts.addStrOpt("--log-formatter", "",
"Set the log formatter");
o... | #include "mem/Compiler.hpp"
int main (int argc, char** argv)
{
opt::Options opts;
opts.addStrOpt("--dump-ast-xml", "",
"Dump the Abstract Syntax Tree as XML");
opts.addStrOpt("--emit-llvm-bc", "",
"Emit LLVM bytecode");
opts.addStrOpt("--log-formatter", "",
"Set the log formatter");
o... | Change exit code to 1 if build unsuccessful | Change exit code to 1 if build unsuccessful
| C++ | mit | ThQ/memc,ThQ/memc,ThQ/memc,ThQ/memc |
21383febfcc27c3aead61ecb74be6641cc7c0a04 | test/SemaTemplate/explicit-specialization-member.cpp | test/SemaTemplate/explicit-specialization-member.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
template<typename T>
struct X0 {
typedef T* type;
void f0(T);
void f1(type);
};
template<> void X0<char>::f0(char);
template<> void X0<char>::f1(type);
namespace PR6161 {
template<typename _CharT>
class numpunct : public locale::facet // expected-error{{use of ... | // RUN: %clang_cc1 -fsyntax-only -verify %s
template<typename T>
struct X0 {
typedef T* type;
void f0(T);
void f1(type);
};
template<> void X0<char>::f0(char);
template<> void X0<char>::f1(type);
namespace PR6161 {
template<typename _CharT>
class numpunct : public locale::facet // expected-error{{use of ... | Add regression test for PR12331. | Add regression test for PR12331.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@185453 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,llvm-mirror/clang,llvm-mirror/cl... |
8b5abd0c5a8b2d629660b10194b28cd5df52f070 | solutions/uri/1029/1029.cpp | solutions/uri/1029/1029.cpp | #include <cstdio>
long int f[39];
long int r[39];
long int fib(long int n) {
if (f[n] != -1)
return f[n];
if (n <= 1) {
f[n] = n;
r[n] = 0;
} else {
f[n] = fib(n - 1) + fib(n - 2);
r[n] = r[n - 1] + r[n - 2] + 2;
}
return f[n];
}
int main() {
int i, j... | #include <cstdio>
#include <cstring>
long int f[39];
long int r[39];
long int fib(long int n) {
if (f[n] != -1)
return f[n];
if (n <= 1) {
f[n] = n;
r[n] = 0;
} else {
f[n] = fib(n - 1) + fib(n - 2);
r[n] = r[n - 1] + r[n - 2] + 2;
}
return f[n];
}
int ma... | Fix undefined behavior for c++17 | Fix undefined behavior for c++17
| C++ | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... |
8020136efeaceb6e6d54fe6036446874c596e218 | src/manipulator/pattern_posture_generator/src/pattern_posture_generator_node.cpp | src/manipulator/pattern_posture_generator/src/pattern_posture_generator_node.cpp | #include "ros/ros.h"
#include "pattern_posture_generator_node.hpp"
int main(int argc, char* argv[]) {
ros::init(argc, argv, "pattern_posture_generator");
ros::NodeHandle nh;
PatternPostureGenerator ppg(nh);
ros::spin();
return 0;
}
PatternPostureGenerator::PatternPostureGenerator(){}
PatternPostureGener... | #include "ros/ros.h"
#include "pattern_posture_generator_node.hpp"
int main(int argc, char* argv[]) {
ros::init(argc, argv, "pattern_posture_generator");
ros::NodeHandle nh;
PatternPostureGenerator ppg(nh);
ROS_INFO("Ready. getPostureKey");
ros::spin();
return 0;
}
PatternPostureGenerator::PatternPostu... | Add status echo to PPG node for debug | Add status echo to PPG node for debug
| C++ | mit | agrirobo/arcsys2,agrirobo/arcsys2 |
3a9cf0360c5610ed4b63c1f24222531fe1ba7215 | src/gazebo_plugins/src/SetupWorld.cpp | src/gazebo_plugins/src/SetupWorld.cpp | #include <sdf/sdf.hh>
#include "gazebo/gazebo.hh"
#include "gazebo/common/Plugin.hh"
#include "gazebo/msgs/msgs.hh"
#include "gazebo/physics/physics.hh"
#include "gazebo/transport/transport.hh"
#include <iostream>
using namespace std;
namespace gazebo
{
class SetupWorld : public WorldPlugin
{
public: void Loa... | #include <sdf/sdf.hh>
#include "gazebo/gazebo.hh"
#include "gazebo/common/Plugin.hh"
#include "gazebo/msgs/msgs.hh"
#include "gazebo/physics/physics.hh"
#include "gazebo/transport/transport.hh"
#include <iostream>
using namespace std;
namespace gazebo
{
class SetupWorld : public WorldPlugin
{
public: void Loa... | Set gazebo to run at real time (if possible) for debugging The previous default was too fast for proper manual control of the robot | Set gazebo to run at real time (if possible) for debugging
The previous default was too fast for proper manual control of the robot
| C++ | mit | BCLab-UNM/SwarmBaseCode-ROS,BCLab-UNM/SwarmBaseCode-ROS,BCLab-UNM/SwarmBaseCode-ROS,BCLab-UNM/SwarmBaseCode-ROS,BCLab-UNM/SwarmBaseCode-ROS,BCLab-UNM/SwarmBaseCode-ROS |
f0451c645f94bdbe8ddb28a1c8fe98d2953273b5 | cpp/main.cpp | cpp/main.cpp | #include <stdexcept>
#include <iostream>
int opt_parse(int argc, char** argv) {
// implement option parsing and call the real main
// with everything ready to use
return 0;
}
int main(int argc, char** argv) {
try {
return opt_parse(argc, argv);
} catch (std::exception& e) {
std:... | #include <stdexcept>
#include <iostream>
int opt_parse(int argc, char** argv) {
// implement option parsing and call the real main
// with everything ready to use
return 0;
}
int main(int argc, char** argv) {
//unless one needs C-style I/O
std::ios_base::sync_with_stdio(false);
try {
... | Add sync_with_stdio(false), tour c++ pg132 | Add sync_with_stdio(false), tour c++ pg132
| C++ | unlicense | paolobolzoni/useful-conf,paolobolzoni/useful-conf,paolobolzoni/useful-conf |
6b0fa09d8dd5ee74e4b7d1ede99a355df5030152 | eventLib.cpp | eventLib.cpp | /*
* =========================================================================================
* Name : eventLib.cpp
* Author : Duc Dung Nguyen
* Email : nddung@hcmut.edu.vn
* Copyright : Faculty of Computer Science and Engineering - Bach Khoa University
* Description : library for Assignment ... | /*
* =========================================================================================
* Name : eventLib.cpp
* Author : Duc Dung Nguyen
* Email : nddung@hcmut.edu.vn
* Copyright : Faculty of Computer Science and Engineering - Bach Khoa University
* Description : library for Assignment ... | Fix endline character problem on Windows | Fix endline character problem on Windows
| C++ | mit | saitamandd/DSA162-A01 |
b98d65823b1ddd8dd1c698f565bcb23d8bd4700b | net/base/network_change_notifier_win.cc | net/base/network_change_notifier_win.cc | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/base/network_change_notifier_win.h"
#include <iphlpapi.h>
#include <winsock2.h>
#pragma comment(lib, "iphlpapi.lib")
namespace net {
... | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/base/network_change_notifier_win.h"
#include <iphlpapi.h>
#include <winsock2.h>
#pragma comment(lib, "iphlpapi.lib")
namespace net {
... | Fix regression where we didn't ever start watching for network address changes on Windows. | Fix regression where we didn't ever start watching for network address changes on Windows.
BUG=48204
TEST=NetworkChangeNotifier works on Windows
Review URL: http://codereview.chromium.org/2807036
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@51574 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | keishi/chromium,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,ltilve/chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,PeterW... |
4d7c668c6c1b35b636cd80164040ee0f042f616a | examples/messaging.cpp | examples/messaging.cpp | #include <bulk.hpp>
#include <iostream>
int main() {
bulk::spawn(bulk::available_processors(), [](int s, int p) {
for (int t = 0; t < p; ++t) {
bulk::send<int, int>(t, s, s);
}
bulk::sync();
if (s == 0) {
for (auto message : bulk::messages<int, int>()) {
... | #include <bulk.hpp>
#include <iostream>
int main() {
auto center = bulk::center();
center.spawn(center.available_processors(), [¢er](int s, int p) {
for (int t = 0; t < p; ++t) {
center.send<int, int>(t, s, s);
}
center.sync();
if (s == 0) {
for (au... | Update syntax for message passing example | Update syntax for message passing example
| C++ | mit | jwbuurlage/Bulk |
0d1f0ab30c69a705ee07b8235e20863a96635594 | src/playground/bindings/script_prologue.cc | src/playground/bindings/script_prologue.cc | // Copyright 2015 Las Venturas Playground. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.
#include "bindings/script_prologue.h"
namespace bindings {
// NOTE: Line breaks will be removed from these scripts before their execution in ... | // Copyright 2015 Las Venturas Playground. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.
#include "bindings/script_prologue.h"
namespace bindings {
// NOTE: Line breaks will be removed from these scripts before their execution in ... | Remove require.map() from the script prologue | Remove require.map() from the script prologue
| C++ | mit | LVPlayground/playgroundjs-plugin,LVPlayground/playgroundjs-plugin,LVPlayground/playgroundjs-plugin |
e7dc0ae64144fd3b221de8397308d7e02f5aeff4 | src/configs/Options.cpp | src/configs/Options.cpp | // Copyright © 2017 Dmitriy Khaustov
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... | // Copyright © 2017 Dmitriy Khaustov
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... | Implement getting of path to config file by argument | Implement getting of path to config file by argument
| C++ | apache-2.0 | xDimon/primitive |
2124219b372c75c2d9011514d9b845cb774150da | 237.cpp | 237.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
node->val = node->next->val;
node->next = node->next->next;
}
};
| /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
node->val = node->next->val;
node->next = node->next->next;
}
};
| Delete Node in a Linked List | Delete Node in a Linked List | C++ | mit | zfang399/LeetCode-Problems |
8444d3c18d36a4c973b13c46eb9ba5feda905fb1 | src/BeadingStrategy/OuterWallInsetBeadingStrategy.cpp | src/BeadingStrategy/OuterWallInsetBeadingStrategy.cpp | //Copyright (c) 2020 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#include "OuterWallInsetBeadingStrategy.h"
#include <algorithm>
namespace cura
{
BeadingStrategy::Beading OuterWallInsetBeadingStrategy::compute(coord_t thickness, coord_t bead_count) const
{
Beading... | //Copyright (c) 2020 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#include "OuterWallInsetBeadingStrategy.h"
#include <algorithm>
namespace cura
{
BeadingStrategy::Beading OuterWallInsetBeadingStrategy::compute(coord_t thickness, coord_t bead_count) const
{
Beading... | Fix outerwall inset for thin parts | Fix outerwall inset for thin parts
CURA-7830
| C++ | agpl-3.0 | Ultimaker/CuraEngine,Ultimaker/CuraEngine |
445fecfde68ad8c50d5bd5166d56d94c3d9a539f | jni/frames/frameGPUi.cpp | jni/frames/frameGPUi.cpp | #include "frames.h"
frameGPUi::frameGPUi (int w, int h, bool full) {
glGenTextures (1, &plane);
glBindTexture (GL_TEXTURE_2D, plane);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//glTexImage2D (GL_TEXTURE_2D, 0, full ? GL_... | #include "frames.h"
frameGPUi::frameGPUi (int w, int h, bool full) {
glGenTextures (1, &plane);
glBindTexture (GL_TEXTURE_2D, plane);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D (GL_TEXTURE_2D, 0, full ? GL_RG... | Revert "10-bit normalased internal frames" | Revert "10-bit normalased internal frames"
This reverts commit cd31198a032cbbcd1cc52e4bdcc8795ae3b1d802.
| C++ | lgpl-2.1 | vivan000/viaVR,vivan000/viaVR |
f1701198225810e44ec768b7efd8f24d4a212c4b | src/http/HttpCode.cpp | src/http/HttpCode.cpp | /*
* Part of HTTPP.
*
* Distributed under the 3-clause BSD licence (See LICENCE.TXT file at the
* project root).
*
* Copyright (c) 2013 Thomas Sanchez. All rights reserved.
*
*/
#include "httpp/http/HttpCode.hpp"
std::string HTTPP::HTTP::getDefaultMessage(HttpCode code)
{
switch (code)
{
case Ht... | /*
* Part of HTTPP.
*
* Distributed under the 3-clause BSD licence (See LICENCE.TXT file at the
* project root).
*
* Copyright (c) 2013 Thomas Sanchez. All rights reserved.
*
*/
#include "httpp/http/HttpCode.hpp"
std::string HTTPP::HTTP::getDefaultMessage(HttpCode code)
{
switch (code)
{
default... | Add default clause to switch | Add default clause to switch
| C++ | bsd-2-clause | changbiao/httpp,0x7f/httpp,changbiao/httpp,changbiao/httpp,0x7f/httpp,mlove-au/httpp,daedric/httpp,mlove-au/httpp,mlove-au/httpp,daedric/httpp,daedric/httpp,0x7f/httpp |
52cdaef3b38a624e683a43baf5b7142a243f0ec6 | src/driver/krs_servo/src/krs_servo_node.cpp | src/driver/krs_servo/src/krs_servo_node.cpp | #include "ros/ros.h"
#include "servo_msgs/KrsServoDegree.h"
#include <string>
#include "krs_servo_driver.hpp"
class KrsServoNode {
public:
KrsServoNode();
explicit KrsServoNode(ros::NodeHandle& nh, const char* path);
private:
void krsServoDegreeCallback(const servo_msgs::KrsServoDegree::ConstPtr& msg);
ros... | #include "ros/ros.h"
#include "servo_msgs/KrsServoDegree.h"
#include <string>
#include "krs_servo_driver.hpp"
class KrsServoNode {
public:
KrsServoNode();
KrsServoNode(ros::NodeHandle& nh, const char* path);
private:
void krsServoDegreeCallback(const servo_msgs::KrsServoDegree::ConstPtr& msg);
ros::Subscri... | Remove explicit by constructor has too many args. | Remove explicit by constructor has too many args.
| C++ | mit | agrirobo/arcsys2,agrirobo/arcsys2 |
1f2fff68acf7709ba585083cfdfb96bee87e92b4 | Source/core/animation/css/CSSTransitionData.cpp | Source/core/animation/css/CSSTransitionData.cpp | // 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 "config.h"
#include "core/animation/css/CSSTransitionData.h"
#include "core/animation/Timing.h"
namespace blink {
CSSTransitionData::CSSTransi... | // 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 "config.h"
#include "core/animation/css/CSSTransitionData.h"
#include "core/animation/Timing.h"
namespace blink {
CSSTransitionData::CSSTransi... | Change fill mode of transitions to backwards not both | Animations: Change fill mode of transitions to backwards not both
This change allows CSS transitions to be replayed via the AnimationPlayer
API and not prevent new transitions from being triggered.
BUG=437102
Review URL: https://codereview.chromium.org/761033002
git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@... | C++ | bsd-3-clause | primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs |
e88b7185ba483d82b529a6f44b977549cc86c393 | Homework4/webquery.cpp | Homework4/webquery.cpp | #include <iostream>
using namespace std;
int main()
{
cout << "TODO" << endl;
return -1;
}
| #include <iostream>
#include <string>
#include <fstream>
#include <array>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include "IndexHelper.hpp"
using namespace std;
const array<pair<int, string>, 3> INDEXWEIGHTS {{
{16, "titleindex"},
{4, "webindex"},
{1, "pageindex"}
}};
string getQ... | Implement ranking system based on web, title, and pageindex. | Implement ranking system based on web, title, and pageindex.
| C++ | mit | bertptrs/uni-mir,bertptrs/uni-mir,bertptrs/uni-mir,bertptrs/uni-mir,bertptrs/uni-mir |
2146d23bb969c5a8b1dec5c00d7a3964b41ddb4b | test/CodeGenCXX/linetable-virtual-variadic.cpp | test/CodeGenCXX/linetable-virtual-variadic.cpp | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s
// Crasher for PR22929.
class Base {
virtual void VariadicFunction(...);
};
class Derived : public virtual Base {
virtual void VariadicFunction(...);
};
void Derived::VariadicFunction(...) { }
// CH... | // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s
// Crasher for PR22929.
class Base {
virtual void VariadicFunction(...);
};
class Derived : public virtual Base {
virtual void VariadicFunction(...);
};
void Derived::VariadicFunction(...) { }
// CH... | Update testcase for upstream LLVM changes (r302469). | Update testcase for upstream LLVM changes (r302469).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@302577 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit b6c02e8e5ac5de00590d22161a0eac44cb9a4a8a)
| 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 |
b1a8c78833e641b5b192c6ff5857f2b1cb613098 | main.cpp | main.cpp | #include <iostream>
int main()
{
std::cout << "Hello, world!" << std::endl;
}
| #include <iostream>
int main()
{
std::cout << "Hello, world! \n";
}
| Change space 8 to 4 | Change space 8 to 4 | C++ | mit | pauis/makeplus |
8da270e644481a3ddd13f937970b3555332182c9 | test/Misc/integer-literal-printing.cpp | test/Misc/integer-literal-printing.cpp | // RUN: %clang_cc1 %s -fsyntax-only -verify
// PR11179
template <short T> class Type1 {};
template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: no known conversion from 'Type1<-42>' to 'Type1<-42> &' for 1st argument;}}
template <unsigned short T> class Type... | // RUN: %clang_cc1 %s -fsyntax-only -verify
// PR11179
template <short T> class Type1 {};
template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: no known conversion from 'Type1<-42>' to 'Type1<-42> &' for 1st argument;}}
template <unsigned short T> class Type... | Remove test with int128 printing since it breaks on some platforms. | Remove test with int128 printing since it breaks on some platforms.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@143997 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/cl... |
b3ec35c3c87f56871c53855566a777b9815fda93 | MathLib/MathLib.cpp | MathLib/MathLib.cpp | // MathLib.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <unittest.h>
int _tmain(int /*argc*/, _TCHAR* /*argv[]*/)
{
run_tests();
return 0;
}
| // MathLib.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <unittest.h>
int _tmain(int /*argc*/, _TCHAR* /*argv[]*/)
{
//test change
run_tests();
return 0;
}
| Test change to test both branch functionality and approval process | Test change to test both branch functionality and approval process
.
| C++ | apache-2.0 | nsokolnikov/mathlib,nsokolnikov/mathlib |
ca1bed91f9976758a8235eb17d90999fbfd26180 | test/Misc/ast-dump-wchar.cpp | test/Misc/ast-dump-wchar.cpp | // RUN: %clang_cc1 -std=c++11 -ast-dump %s 2>&1 | FileCheck %s
char c8[] = u8"test\0\\\"\t\a\b\234";
// CHECK: char c8[12] = (StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234")
char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234";
// CHECK: char16_t c16[13] = (StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u123... | // RUN: %clang_cc1 -std=c++11 -ast-dump %s | FileCheck %s
char c8[] = u8"test\0\\\"\t\a\b\234";
// CHECK: char c8[12] = (StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234")
char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234";
// CHECK: char16_t c16[13] = (StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u1234")
... | Remove unnecessary output redirection in a test. | Remove unnecessary output redirection in a test.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@158424 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... |
4fa6ecc8eb0c36041be5fe5774e43dabccdf67f7 | src/main.cpp | src/main.cpp | #if(GUI == 0)
#include <ace/console/eapplication.h>
#else
#include <ace/gui/eapplication.h>
#endif
#include "core/analyticfactory.h"
#include "core/datafactory.h"
using namespace std;
int main(int argc, char *argv[])
{
EApplication application(""
,"kinc"
... | #if(GUI == 0)
#include <ace/console/eapplication.h>
#else
#include <ace/gui/eapplication.h>
#endif
#include "core/analyticfactory.h"
#include "core/datafactory.h"
using namespace std;
int main(int argc, char *argv[])
{
EApplication application("SystemsGenetics"
,"kinc"
... | Set organization name to SystemsGenetics | Set organization name to SystemsGenetics
| C++ | mit | SystemsGenetics/KINC,SystemsGenetics/KINC,SystemsGenetics/KINC,SystemsGenetics/KINC,SystemsGenetics/KINC |
1f9500ac06a234a4895fc0236a01d95cff331352 | src/main.cpp | src/main.cpp | #include <ncurses.h>
#include <string>
#include "game.h"
using namespace std;
int main(int argc, char **argv) {
int initStatus = init();
if (initStatus == 0) run();
close();
printf("GAME OVER\n");
return 0;
}
| #include <ncurses.h>
#include <string>
#include "game.h"
using namespace std;
int main(int argc, char **argv) {
if (init() == 0) run();
close();
printf("GAME OVER\n");
return 0;
}
| Remove unnecessary variable assignment (is implicit return, imho) | Remove unnecessary variable assignment (is implicit return, imho)
| C++ | mit | jm-janzen/termq,jm-janzen/termq,jm-janzen/termq |
71e2dd4cd4bf56c926ae431b84e77f5c7d6a18a2 | src/main.cpp | src/main.cpp | #include "HumbugWindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
HumbugWindow w;
if (argc == 3 && QString(argv[1]) == QString("--site")) {
w.setUrl(QUrl(argv[2]));
}
w.show();
return a.exec();
}
| #include "HumbugWindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("Humbug Desktop");
a.setApplicationVersion("0.1");
HumbugWindow w;
if (argc == 3 && QString(argv[1]) == QString("--site")) {
w.setUrl(QUrl(argv[2]));
}
... | Declare an application name and version. | Declare an application name and version.
| C++ | apache-2.0 | zofuthan/zulip-desktop,zofuthan/zulip-desktop,zofuthan/zulip-desktop,zofuthan/zulip-desktop,zofuthan/zulip-desktop,zofuthan/zulip-desktop,zofuthan/zulip-desktop |
8b4f19c43ca38b6327af96ea37b42ce3dc92324b | pith/test/TestPage.cpp | pith/test/TestPage.cpp | #include <Pith/Config.hpp>
#include <Pith/Page.hpp>
#include <gtest/gtest.h>
using namespace Pith;
TEST(TestPage, stackAllocate) {
[[gnu::unused]] Page p;
}
TEST(TestPage, mapOnePage) {
Span<Page> pages{nullptr, 1};
auto result = Page::map(pages);
EXPECT_TRUE(result);
EXPECT_NE(result(), nullptr);
pages.value(... | #include <Pith/Config.hpp>
#include <Pith/Page.hpp>
#include <gtest/gtest.h>
using namespace Pith;
TEST(TestPage, pageSize) {
Process::init();
EXPECT_NE(Page::size(), std::size_t{0});
Process::kill();
}
TEST(TestPage, mapOnePage) {
Process::init();
auto size = Page::size();
auto addr = Page::map(size);
Page::... | Update the page tests to work with the new API | Update the page tests to work with the new API
Signed-off-by: Robert Young <42c59959a3f4413d6a1b4d7b4f99db457d199e49@gmail.com>
| C++ | apache-2.0 | ab-vm/ab,ab-vm/ab,ab-vm/ab,ab-vm/ab,ab-vm/ab |
8353b135e9c40f524de3ae4a238cea3581de4fd7 | framework/tests/JPetTaskLoaderTest/JPetTaskLoaderTest.cpp | framework/tests/JPetTaskLoaderTest/JPetTaskLoaderTest.cpp | #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetTaskLoaderTest
#include <boost/test/unit_test.hpp>
#define private public
#include "../../JPetTaskLoader/JPetTaskLoader.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE( my_test1 )
{
BOOST_REQUIRE(1==0);
}
BOOST_AUTO_TEST_SUITE_END()
| #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetTaskLoaderTest
#include <boost/test/unit_test.hpp>
#define private public
#include "../../JPetTaskLoader/JPetTaskLoader.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(defaultConstrutocTest)
{
/*JPetOptions::Options options = {
{"inputFile... | Change unit test for JPetTaskLoader. | Change unit test for JPetTaskLoader.
Former-commit-id: 1cbaa59c1010a96926acec93a2e313f482e62943 | C++ | apache-2.0 | kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.