doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
091682ae-1a38-4ca8-a63d-be533c20e986 | {
"language": "C++"
} | ```c++
```
Add error test for memoizing a Func with compute and storage at different levels. | ```c++
#include <Halide.h>
#include <stdio.h>
using namespace Halide;
int main(int argc, char **argv) {
Param<float> val;
Func f, g;
Var x, y;
f(x, y) = val + cast<uint8_t>(x);
g(x, y) = f(x, y) + f(x - 1, y) + f(x + 1, y);
g.split(y, y, _, 16);
f.store_root();
f.compute_at(g, y).me... |
65ead8e5-23c6-4710-a668-5e9fd0dd210d | {
"language": "C++"
} | ```c++
```
Patch for HARMONY-3677 "[classlib][awt] Results of running checker tool" | ```c++
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License... |
21869bef-a785-4894-8144-c26563940c73 | {
"language": "C++"
} | ```c++
```
Add simplest exception example from lesson | ```c++
/**
Очень простой вводный пример на демонстрацию исключений
*/
#include <iostream>
#include <exception>
#include <string>
struct MyError
{
std::string msg;
};
class Test
{
public:
~Test()
{
std::cout << "Вызван деструктор\n";
}
};
double sin_by_sharnin(double x)
{
const size_t... |
8ca7930c-4160-471c-a17e-10f8003e09a4 | {
"language": "C++"
} | ```c++
```
Add a bench for measuring drawBitmap anti-aliasing overhead | ```c++
/*
* Copyright 2015 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 "SkCanvas.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkString.h"
/**
* This bench measures the rendering time of SkCanvas:... |
8946b420-8dc2-4a5b-b783-33979a620169 | {
"language": "C++"
} | ```c++
```
Add file missing from r313583 | ```c++
//===-- ubsan_init_standalone_preinit.cc
//------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===--------------------------------------... |
bc4c65da-8963-43d7-bfdc-883dc756af67 | {
"language": "C++"
} | ```c++
```
Add solution to the dictionary task | ```c++
#include <iostream>
#include <cstring>
using namespace std;
struct WordTranslation {
char word[100], translation[100];
WordTranslation(const char _word[] = "", const char _translation[] = "") {
strcpy(word, _word);
strcpy(translation, _translation);
}
};
class Dictionary {
int ... |
92080471-daec-407c-8fda-d0a77079e713 | {
"language": "C++"
} | ```c++
```
Add rule of zero sample | ```c++
// The rule of zero
#include <memory>
class shallow
{
private:
std::shared_ptr<int> p = std::make_shared<int>(5);
};
class deep
{
public:
deep() = default;
deep(deep const& other)
: p{std::make_unique<int>(*other.p)}
{ }
private:
std::unique_ptr<int> p = std::make_unique<int>(5);
};
// Use ... |
30570a85-65e9-4733-baea-2d27d2b4c7bb | {
"language": "C++"
} | ```c++
```
Add a trivially simple pass to delete unreachable blocks from the CFG. This pass is required to paper over problems in the code generator (primarily live variables and its clients) which doesn't really have any well defined semantics for unreachable code. | ```c++
//===-- UnreachableBlockElim.cpp - Remove unreachable blocks for codegen --===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===-... |
46a571d4-5e99-4151-83b3-02e901c9422a | {
"language": "C++"
} | ```c++
```
Add missing file to fix the build. | ```c++
/*-----------------------------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2015-2018 OSRE ( Open Source Render Engine ) by Kim Kulling
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated document... |
1448bcce-c2d2-4450-8b1c-06312389123d | {
"language": "C++"
} | ```c++
```
Add Chapter 20, exercise 5 | ```c++
// Chapter 20, Exercise 05: Define an input and an output operator (>> and <<)
// for vector.
#include "../lib_files/std_lib_facilities.h"
template<class T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
os << "{ ";
for (int i = 0; i<v.size(); ++i) {
os << v[i];
if (i+1<v.size()... |
d10708b2-4060-4eea-a05f-5e4c045c3f26 | {
"language": "C++"
} | ```c++
```
Add flag to remove common certs | ```c++
// Copyright (c) 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 "net/third_party/quiche/src/quic/core/crypto/common_cert_set.h"
#include <cstddef>
#include "net/third_party/quiche/src/quic/core/qu... |
91b313b6-b3d1-459f-8dee-44ec5a359c43 | {
"language": "C++"
} | ```c++
```
Test that LargeAllocator unpoisons memory before releasing it to the OS. | ```c++
// Test that LargeAllocator unpoisons memory before releasing it to the OS.
// RUN: %clangxx_asan %s -o %t
// RUN: ASAN_OPTIONS=quarantine_size=1 %t
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
int main() {
void *p = malloc(1024 * 1024);
free(p);
char *q = (char *)mm... |
feaa5e2c-a041-4181-9b22-9cd0a9e1d021 | {
"language": "C++"
} | ```c++
```
Add test for type properties of std::reference_wrapper | ```c++
//===----------------------------------------------------------------------===//
//
// 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.
//
//===---------------------------------... |
d363bb66-fab3-4398-a85c-dcf9cad8e408 | {
"language": "C++"
} | ```c++
```
Add code to delete node in circular linked list | ```c++
#include<iostream>
#include<cstdlib>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(){}
Node(int d){
data=d;
next=this;
}
Node *insertNode(Node *head, int d){
Node *np=new Node(d);
Node *t=head;
... |
84ddc7c7-b2bc-4cb2-a600-c5de9c6fa712 | {
"language": "C++"
} | ```c++
```
Add test case for method to reverse null terminated string | ```c++
/*
This programtests class reverse_str
*/
#include "reverse_str.h"
#include<iostream>
void test_single(char* s){
// avoid printing nullpointer
if(s!=nullptr)
std::cout<<"\nString: "<<s;
else
std::cout<<"\nnull";
std::cout<<"\nLength: "<<Reverse_str::get_length(s);
Reverse_str::reverse(s);
// ... |
e4c26b88-6ade-4283-9f8e-049bd7579525 | {
"language": "C++"
} | ```c++
```
Add Chapter 20, exercise 7 | ```c++
// Chapter 20, Exercise 07: find the lexicographical last string in an unsorted
// vector<string>. Beware that "lexicographical" is not the same as "alphabeti-
// cal", as "Zzzz"<"aaa" (uppercase letters are lexicographically before lower-
// case letters).
#include "../lib_files/std_lib_facilities.h"
// retur... |
249ce182-f5e8-45be-9c67-1387f7193e36 | {
"language": "C++"
} | ```c++
```
Implement a program to do base64 encoding | ```c++
/*
* Website:
* https://github.com/wo3kie/dojo
*
* Author:
* Lukasz Czerwinski
*
* Compilation:
* g++ --std=c++11 base64.encode.cpp -o base64.encode
*
* Usage:
* $ ./base64.encode "Hello World"
* SGVsbG8gV29ybGQ
*/
#include <iostream>
#include <string>
#include <boost/ar... |
d4eb6043-c10f-4940-9e4e-be2d56415125 | {
"language": "C++"
} | ```c++
```
Copy the existing regression test for remove-cstr-calls from the tooling branch to preserve its history. It's not yet functional. | ```c++
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ -c %t/test.cpp","file":"%t/test.cpp"}]' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: remove-cstr-calls "%t" "%t/test.cpp"
// RUN: cat "%t/test.cpp" | FileCheck %s
// FIXME: implement a mode for refactoring t... |
08a30e4f-368d-48df-8fba-7d3e40953ee2 | {
"language": "C++"
} | ```c++
```
Add Chapter 20, exercise 13 | ```c++
// Chapter 20, Exercise 13: modify exercise 12 to use 0 to represent the one
// past the last element (end()) instead of allocating a real Link
#include "../lib_files/std_lib_facilities.h"
template<class Elem> struct Link {
Link(const Elem& v = Elem(), Link* p = 0, Link* s = 0)
:prev(p), succ(s), v... |
18f080f0-356f-46da-9fac-71eae94339aa | {
"language": "C++"
} | ```c++
```
Add chap8, ex2 + ex3 | ```c++
#include <iostream>
#include <vector>
#include <stdexcept>
using namespace std;
/*Ex8.2:
Write a function print() that prints a vector of ints to cout. Give it
two arguments: a string for “labeling” the output and a vector.
*/
void print(string label, vector<int> v){
cout << label << ": " << endl;
for ... |
c8b3eabf-ba7c-4eb5-a854-db35070594b3 | {
"language": "C++"
} | ```c++
```
Add memmove tests to app_suite | ```c++
/* **********************************************************
* Copyright (c) 2011 Google, Inc. All rights reserved.
* **********************************************************/
/* Dr. Memory: the memory debugger
*
* This library is free software; you can redistribute it and/or
* modify it under t... |
bde4b1e5-73d7-41c1-8c97-d0583d91ecfc | {
"language": "C++"
} | ```c++
```
Add test program for mergesort | ```c++
/*
This program tests merge sort
*/
#include<iostream>
#include<vector>
#include "mergesort.h" // My implementation of merge sort
// Displays vector
void printVector(std::vector<int> A){
for(auto x: A){
std::cout<<x<<" ";
}
std::cout<<std::endl;
}
// Tests merge sort on vector A
void testMergeSort(... |
32afe3ac-fd01-44f0-b891-9617adfe81d4 | {
"language": "C++"
} | ```c++
```
Remove Duplicates from Sorted Array II | ```c++
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if(nums.size()<3) return nums.size();
int f=0,r=1;
while(r<nums.size()){
if(nums[f]==nums[r]){
if(r-f>1) nums.erase(nums.begin()+r,nums.begin()+r+1);
else r++;
}e... |
7f29af07-3299-45d7-8dce-5ad590d9fe75 | {
"language": "C++"
} | ```c++
```
Add c++ solution to the hello World problem | ```c++
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
// Declare a variable named 'input_string' to hold our input.
string input_string;
// Read a full line of input from stdin (cin) and save it to our variable, input_st... |
7ebfbeb3-375e-42a3-a39f-a940a7f1b492 | {
"language": "C++"
} | ```c++
```
Add unit tests for format c bindings | ```c++
#include <boost/test/unit_test.hpp>
#include <ygo/deck/c/Format.h>
#include <ygo/deck/c/DB.h>
struct Format_Fixture
{
Format_Fixture()
{
DB_NAME(set_path)("test/card.db");
}
};
BOOST_FIXTURE_TEST_SUITE(Format, Format_Fixture)
BOOST_AUTO_TEST_CASE(Create)
{
int count;
auto formatDat... |
46bf66c6-b711-4cca-a16e-b6628d5aab5d | {
"language": "C++"
} | ```c++
```
Add job with SCIP support disabled | ```c++
name: SCIP Disabled
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=... |
4b62c2d1-f22e-435b-94ab-1fd13f6302db | {
"language": "C++"
} | ```c++
```
Check whether given tree is sum tree. | ```c++
#include <stdio.h>
typedef struct _NODE {
int data;
_NODE* left;
_NODE* right;
} NODE;
NODE* newNode(int data) {
NODE* node = new NODE();
node->data = data;
node->left = nullptr;
node->right = nullptr;
return node;
}
int sum(NODE* root) {
if (root == nullptr) return 0;
return (sum(root->l... |
ce25053f-16b4-4be4-a629-e29c4f479b40 | {
"language": "C++"
} | ```c++
```
Add Chapter 23, exercise 14 | ```c++
// Chapter 23, exercise 14: like the sample program from 23.8.7, but read input
// from file into memory and experiment with patterns including '\n'
#include<regex>
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
int main()
{
string ifname = "pics_and_txt/chapter23_ex12_in.txt";... |
bd07f259-6d8f-40b1-9439-99c35c171f6a | {
"language": "C++"
} | ```c++
```
Add faster algorithm for working with sorting. | ```c++
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector < ll > vl;
int main(){
vl data = {234234LL, 2322LL,1LL, -1LL, 3454LL};
sort(data.begin(), data.end());
for (int i=0; i< data.size(); i++)
printf("%lld ", data[i]);
return 0;
}
``` |
a39f3875-b7a4-4bb9-8165-8d6482976885 | {
"language": "C++"
} | ```c++
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1... | ```c++
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1... |
3d3e41ca-76bb-482e-ae7c-eedcf27e7351 | {
"language": "C++"
} | ```c++
```
Prepare exercise 6 from chapter 10. | ```c++
// 10.exercise.06.cpp
//
// Define a Roman_int class for holding Roman numerals (as ints) with a << and
// >>. Provide Roman_int with an as_int() member that returns the int value,
// so that if r is a Roman_int, we can write cout << "Roman" << r << "equals"
// << r.as_int() << '\n';.
int main()
try
{
... |
0a5ea1bd-398d-49c2-82e8-146b140dc659 | {
"language": "C++"
} | ```c++
```
Add the first codeforces problem | ```c++
/*
* Copyright (C) 2015 Pavel Dolgov
*
* See the LICENSE file for terms of use.
*/
/* http://codeforces.com/contest/527/submission/11525645 */
#include <iostream>
int main() {
long long int a, b;
std::cin >> a >> b;
long long int ans = 0;
while (b > 0) {
ans += a / b;
a = a... |
6673da71-8df2-4571-890c-301b7beb4ee8 | {
"language": "C++"
} | ```c++
```
Implement rod cutting to maximize profit using DP | ```c++
/**
* Rod Cutting
* Given a length of rod, sample lengths and its
* corresponding profits find the maximum profit
* that can be made given the length.
* @Author: wajahat siddiqui
*/
#include <iostream>
using namespace std;
inline unsigned int max(unsigned int a, unsigned int b) {
return (a > b) ? a : b;... |
e8bd55ee-89f2-4a3b-a269-4b756e917d37 | {
"language": "C++"
} | ```c++
```
Add algorithm for Inverse FFT | ```c++
/*
* @author Abhishek Datta
* @github_id abdatta
* @since 15th October, 2017
*
* The following algroithm takes complex coeeficients
* and calculates its inverse discrete fourier transform
*/
#include <complex>
#include <iostream>
#include <iomanip>
#include <valarray>
const double PI = std::acos(-1);
typede... |
f6d5a536-226d-4234-82ab-00cf96185a77 | {
"language": "C++"
} | ```c++
// 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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
#if defined... | ```c++
// 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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
#if defined... |
5ad7dc36-c5dc-43c5-9acd-869e885052cb | {
"language": "C++"
} | ```c++
// 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/i18n/timezone.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
#if d... | ```c++
// 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/i18n/timezone.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
#if defined(OS_ANDROID)
// icu's tim... |
b1e6a272-0a9d-45a3-b89a-dfbb3d1aea92 | {
"language": "C++"
} | ```c++
```
Add unit test for ROCEvaluation as currently this little example fails | ```c++
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2013 Viktor Gal
*/
#include <shogun/ba... |
b9c41a75-b3bd-43a0-a9ae-24681967f75d | {
"language": "C++"
} | ```c++
```
Add oss-fuzz entrypoint for Polyutils fuzz | ```c++
/*
* Copyright 2018 Google, LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "../Fuzz.h"
void fuzz_PolyUtils(Fuzz* f);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
auto fuzz = Fuzz(SkData::MakeWithoutC... |
b61707d8-8504-4a09-b2d4-c571cd413635 | {
"language": "C++"
} | ```c++
```
Add Chapter 20, exercise 12 | ```c++
// Chapter 20, Exercise 12: complete the definition of list from 20.4.1-2 and
// get the high() example to run. Allocate a Link to represent one past the end.
#include "../lib_files/std_lib_facilities.h"
template<class Elem> struct Link {
Link(const Elem& v = Elem(), Link* p = 0, Link* s = 0)
:prev... |
33d4fc18-aa89-4b05-b2a1-965ccdb1f982 | {
"language": "C++"
} | ```c++
```
Add test file missed from r223561. | ```c++
// RUN: not %clang_cc1 -fmodules -fmodule-map-file=does-not-exist.modulemap -verify %s 2>&1 | FileCheck %s
// CHECK: module map file 'does-not-exist.modulemap' not found
``` |
d1cff8bc-f3fa-44fd-b249-ec407b55f0a0 | {
"language": "C++"
} | ```c++
```
Add solution to third part of first problem. Replace the structure with class with getters and setters | ```c++
#include <iostream>
#include <cmath>
using namespace std;
class Point2D {
double x;
double y;
public:
double getX() {
return x;
}
double getY() {
return y;
}
void setX(double newX) {
x = newX;
}
void setY(double newY) {
y = newY;
}
void translate(double dx, double dy... |
3ddb71a2-7cae-4c33-a6eb-85815eb512a6 | {
"language": "C++"
} | ```c++
```
Add Solution for 167. Two Sum II - Input array is sorted | ```c++
167. Two Sum II - Input array is sorted
/**
* Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
*
* The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be le... |
4033d27f-040f-463d-a873-fb978d92c639 | {
"language": "C++"
} | ```c++
```
Implement minimum stack that will return the minimum element from the entire stack in O(1) time | ```c++
/**
* To implement minimum stack that returns minimum element in O(1) time
*/
#include <iostream>
#include <stack>
using namespace std;
class MinStack {
private:
stack<int> min;
stack<int> s;
public:
void push(int data) {
if (min.empty()) {
min.push(data);
} else if (data < min.top()) {
... |
da2d5cea-7ee1-4ece-80d1-64efc5e93e05 | {
"language": "C++"
} | ```c++
```
Add dequeue min task solution | ```c++
#include <iostream>
#include <queue>
using std::cout;
using std::queue;
int dequeue_min(queue<int>& q) {
unsigned long queue_size = q.size();
int min = q.front();
q.pop();
for (int i = 1; i < queue_size; ++i) {
int front = q.front();
q.pop();
if (front < min) {
q.push(min);
m... |
eb81f1fc-a6eb-4272-9b6f-be048d03c981 | {
"language": "C++"
} | ```c++
```
Add period length of 1/n | ```c++
/*
* Copyright 2010, NagaChaitanya Vellanki
*
* Author NagaChaitanya Vellanki
*
* Print length of the period of decimal representation of 1/n for n > 1
*/
#include <inttypes.h>
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
int32_t n = 0;
cout << "Enter n(n > 1)" << endl;
... |
e00c1578-6bc6-4ba5-85ac-cc7f5f18e9af | {
"language": "C++"
} | ```c++
```
Add solution for chapter 18, test 26, 27 | ```c++
#include <iostream>
#include <vector>
#include <string>
using namespace std;
struct Base1 {
void print(int i) const {
cout << "Base1::print(int)" << endl;
}
protected:
int ival;
double dval;
char cval;
private:
int *id;
};
struct Base2 {
void print(doub... |
9ec23e56-a2d5-42ec-984c-d1e43dd61598 | {
"language": "C++"
} | ```c++
```
Add "write class type objects" sample | ```c++
// Write class type objects to a stream
#include <iostream>
class foo
{
public:
foo(int x)
: x(x)
{ }
friend std::ostream& operator<<(std::ostream& stream,
foo const& f);
private:
int x;
};
std::ostream& operator<<(std::ostream& stream,
... |
49fadb68-01e0-4cdb-b744-9a57c092ce2f | {
"language": "C++"
} | ```c++
#include <iostream>
// yaml-cpp includes
#include "yaml-cpp/yaml.h"
int main()
{
YAML::Emitter out;
out << "Hello, World!";
std::cout << "Here's the output YAML:\n" << out.c_str();
return 0;
}
```
Remove comment. Just a trigger for a new build. | ```c++
#include <iostream>
#include <yaml-cpp/yaml.h>
int main()
{
YAML::Emitter out;
out << "Hello, World!";
std::cout << "Here's the output YAML:\n" << out.c_str();
return 0;
}
``` |
da405641-0f1d-45ac-abb8-8bd972061629 | {
"language": "C++"
} | ```c++
```
Add toy example showing use of the interface | ```c++
#include <cmath>
#include <memory>
#include <vector>
#include <parfil/robot.h>
#include <parfil/filter.h>
void TestCase1(std::vector<parfil::Motion>& motions, std::vector<parfil::Measurement>& measurements) {
// fill in motions
int num_motions = 8;
motions.resize(num_motions);
for (int i=0; i<num_motion... |
2704a5a2-83f5-4fb0-920c-d82ad1210d87 | {
"language": "C++"
} | ```c++
```
Add missing file from the previous commit. | ```c++
#include "cvd/internal/load_and_save.h"
#include "cvd/internal/io/bmp.h"
#include <vector>
using namespace std;
using namespace CVD;
namespace CVD{
namespace BMP{
void writeBMPHeader(unsigned int width, unsigned int height, unsigned int channels, std::ostream& out);
class WritePimpl
{
public:
WritePimpl(o... |
cb354fdd-d1d8-450a-bc45-1d4840b4018c | {
"language": "C++"
} | ```c++
```
Add test for using declaration in classes. | ```c++
// RUN: %clang_cc1 -x c++ -fmodules -fmodules-local-submodule-visibility -fmodules-cache-path=%t %s -verify
// RUN: %clang_cc1 -x c++ -fmodules -fmodules-cache-path=%t %s -verify
// expected-no-diagnostics
#pragma clang module build A
module A { }
#pragma clang module contents
#pragma clang module begin A
st... |
1d8cad6e-d59b-471d-9fbe-1fc3ec6b5d06 | {
"language": "C++"
} | ```c++
```
Add a test for thread-safe malloc | ```c++
#include "mbed.h"
#include "test_env.h"
#include "rtos.h"
#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif
#define NUM_THREADS 5
#define THREAD_STACK_SIZE 256
DigitalOut led1(LED1);
volatile bool should_exit = false;
volatile bool allocation_failure = false;
v... |
c54250d0-aa4e-4aa6-b58f-0b6a6959f1db | {
"language": "C++"
} | ```c++
```
Add test failing on hexagon. | ```c++
#include <stdio.h>
#include "Halide.h"
using namespace Halide;
int main(int argc, char **argv) {
//int W = 64*3, H = 64*3;
const int W = 128, H = 48;
Image<uint16_t> in(W, H, 2);
for (int c = 0; c < 2; c++) {
for (int y = 0; y < H; y++) {
for (int x = 0; x < W; x++) {
... |
12ece7ea-9df6-42d6-85a8-44ed3fb72893 | {
"language": "C++"
} | ```c++
```
Add string generator for war | ```c++
#ifndef MAIN_CPP
#define MAIN_CPP
#include <algorithm>
#include <vector>
#include <iostream>
int main() {
std::vector<char> cards = {'1','1','1','1','2','2','2','2','3','3','3','3','4','4','4','4','5','5','5','5','6','6','6','6','7','7','7','7','8','8','8','8','9','9','9','9','T','T','T','T','J','J','J','J','... |
144b145d-2b8b-43a6-82aa-8117773a165f | {
"language": "C++"
} | ```c++
```
Add explanation about auto and arrays. | ```c++
#include <array>
// C++17 only
// requires template argument deduction for class templates
namespace std
{
template <typename... T>
array(T... t) -> array<std::common_type_t<T...>, sizeof...(t)>;
}
int main()
{
int a[] = {1,2,3};
int b[] {4,5,6};
// See: https://stackoverflow.com/q/7107606... |
b60ae2a9-3e23-4eb2-a38d-e37b58aa2606 | {
"language": "C++"
} | ```c++
```
Add 199 Binary Tree Right Side View | ```c++
#include <stddef.h>
// 199 Binary Tree Right Side View
/**
* Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
*
* For example:
* Given the following binary tree,
* 1 <---
* / \
* 2 3 <---
*... |
e6b0ae22-e271-4b3f-a316-2f7cb2ebefda | {
"language": "C++"
} | ```c++
```
Add tests from the Itanium C++ ABI spec. | ```c++
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts 2>&1 | FileCheck %s
/// Examples from the Itanium C++ ABI specification.
/// http://www.codesourcery.com/public/cxx-abi/
namespace Test1 {
// This is from http://www.codesourcery.com/public/cxx-abi/cxx-vtable-ex.html
... |
7bc94c87-36c8-4c7e-8ffe-2712ad323bb7 | {
"language": "C++"
} | ```c++
```
Add failing opengl test using an inline reduction | ```c++
#include "Halide.h"
using namespace Halide;
int main() {
// This test must be run with an OpenGL target
const Target &target = get_jit_target_from_environment();
if (!target.has_feature(Target::OpenGL)) {
fprintf(stderr, "ERROR: This test must be run with an OpenGL target, e.g. by setting ... |
f59d157b-c110-4204-9aaf-a97e06da73c4 | {
"language": "C++"
} | ```c++
```
Add an example of iteration over (some) variables in a cell with boost::mpl. | ```c++
/*
Example of iterating over cell's variables using boost::mpl.
Copyright 2015 Ilja Honkonen
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 abov... |
c1379f02-2553-4028-9b6e-72721a239dfe | {
"language": "C++"
} | ```c++
```
Add SmallString unit test. - Patch by Ryan Flynn! | ```c++
//===- llvm/unittest/ADT/SmallStringTest.cpp ------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
8e6fc056-dabd-47a9-a360-4c916c9661db | {
"language": "C++"
} | ```c++
```
Add unit tests for alfons | ```c++
#include "catch.hpp"
#include "tangram.h"
#include "style/textStyle.h"
#include "alfons/textBatch.h"
#include "alfons/textShaper.h"
#include "alfons/atlas.h"
#include "alfons/alfons.h"
#include "alfons/fontManager.h"
#include "text/lineWrapper.h"
#include <memory>
namespace Tangram {
struct ScratchBuffer : ... |
a5f981e4-778e-45ae-90ea-ae6ee504f0e1 | {
"language": "C++"
} | ```c++
```
Add example for MoveItem operation | ```c++
// 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 appli... |
20c281e4-83dc-431f-8e51-a473d59468b5 | {
"language": "C++"
} | ```c++
```
Test whether element generator template works | ```c++
#include <boost/test/unit_test.hpp>
#include "../unittest_config.h"
#include "test_element.h"
#include "clotho/mutation/element_generator.hpp"
typedef clotho::powersets::element_key_of< test_element >::key_type key_type;
struct test_key_generator {
key_type operator()( key_type & k ) { return k;... |
042d902d-cf88-4409-bcc8-dd98187b8095 | {
"language": "C++"
} | ```c++
//---------------------------------------------------------------------------
// $Id$
// Version: $Name$
//
// Copyright (C) 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// to the file deal.I... | ```c++
//---------------------------------------------------------------------------
// $Id$
// Version: $Name$
//
// Copyright (C) 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// to the file deal.I... |
17f346ba-b03e-419d-a30f-bbd81fcb8b04 | {
"language": "C++"
} | ```c++
```
Add a test that prints out the current build type | ```c++
// Copyright (c) 2011 Timur Iskhodzhanov and MIPT students. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gtest/gtest.h"
#include "base/common.h"
TEST(CommonTest, DebugOrRelease) {
#ifdef NDEBUG
printf("NDEBUG defined, ... |
b1d6f2af-3396-4aa2-b928-1be3a987bf6d | {
"language": "C++"
} | ```c++
```
Add Sema test case for exception-specifiers implicitly added to destructors. | ```c++
// RUN: %clang_cc1 -fexceptions -verify %s
struct A { };
struct B { };
struct X0 {
virtual ~X0() throw(A); // expected-note{{overridden virtual function is here}}
};
struct X1 {
virtual ~X1() throw(B); // expected-note{{overridden virtual function is here}}
};
struct X2 : public X0, public X1 { }; // ex... |
5c9544b6-9209-4681-8303-021d2ca58f4a | {
"language": "C++"
} | ```c++
```
Add missing test case for constructor-initializer code completions | ```c++
// The run lines are below, because this test is line- and
// column-number sensitive.
template<typename T>
struct X {
X(T);
};
struct Virt { };
struct Y : virtual Virt { };
struct Z : public X<int>, public Y {
Z();
int a, b, c;
};
Z::Z() : ::X<int>(0), Virt(), a() { }
// RUN: c-index-test -code-comp... |
e6831476-d187-4739-8102-569948e146cd | {
"language": "C++"
} | ```c++
```
Add a Example Integrations with SFML graphics library | ```c++
#include <SFML\Graphics.hpp>
#include "Vector2d.h"
int main()
{
sf::CircleShape object(15, 3);
sf::Vector2f vector2f; //original compatible vector2f object from SFML
Vector2d vector2d; //vector from Vector2d class, if you want to compute vector first you must create vector object, becouse it have float ty... |
2cae0156-48b6-4574-bdf9-02c45f439553 | {
"language": "C++"
} | ```c++
```
Add framework for source file | ```c++
#include "fish_detector/common/species_dialog.h"
#include "ui_species_dialog.h"
namespace fish_detector {
SpeciesDialog::SpeciesDialog(QWidget *parent)
: QDialog(parent)
, ui_(new Ui::SpeciesDialog) {
ui_->setupUi(this);
}
void SpeciesDialog::on_ok_clicked() {
}
void SpeciesDialog::on_cancel_clicked()... |
141e2f7f-900a-41e3-bf82-8b7fc5bbe8d7 | {
"language": "C++"
} | ```c++
```
Add Example 11.34 from Aho'72 | ```c++
// Attempting to replicate the CFG from Figure 11.25 of Aho and Ullman 1972.
#include <iostream>
int main() {
unsigned n;
std::cin >> n;
int *A = new int[n];
int i = -1;
int sum = 0;
_2:
++i;
_3:
if (A[i] % 2 == 0) {
goto _4;
}
_7:
sum += A[i];
goto _2;
_4:
if (i < n && A[i] % 3 == 0... |
b460d4bb-db69-42f3-a53d-6bf1f5d417a9 | {
"language": "C++"
} | ```c++
```
Add a C++20 version of the existing turing machine test. | ```c++
// RUN: %clang_cc1 -verify -std=c++2a %s
// expected-no-diagnostics
const unsigned halt = (unsigned)-1;
enum Dir { L, R };
struct Action {
bool tape;
Dir dir;
unsigned next;
};
using State = Action[2];
// An infinite tape!
struct Tape {
constexpr Tape() = default;
constexpr ~Tape() {
if (l) { l-... |
2f2136c4-7c15-4c48-b676-c91db9070927 | {
"language": "C++"
} | ```c++
// 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/message_center/message_center.h"
#include "base/observer_list.h"
#include "ui/message_center/message_center_impl.h"
namespace me... | ```c++
// 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/message_center/message_center.h"
#include "base/observer_list.h"
#include "ui/message_center/message_center_impl.h"
namespace me... |
0786bb74-33ab-4b37-bbc4-4e35fdf3dd5d | {
"language": "C++"
} | ```c++
```
Check in avx2 internals in new directory | ```c++
// Copyright 2014 Irfan Hamid
//
// 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 to ... |
77c79ea5-7f2d-4902-ae5c-a1aaa5f63e32 | {
"language": "C++"
} | ```c++
```
Add a test for invalid assumptions on the alignment of exceptions | ```c++
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... |
57397d1b-31e3-4387-9827-a461d2998121 | {
"language": "C++"
} | ```c++
```
Add PCCA summer camp practice | ```c++
/*************************************************************************
> File Name: PA.cpp
> Author: Gavin Lee
> School: National Chiao Tung University
> Team: NCTU_Ragnorok
> Mail: sz110010@gmail.com
> Created Time: Mon 04 Apr 2016 10:33:00 PM CST
*****************************************************... |
8d4d6fdf-2974-44cf-9a21-2efff8070527 | {
"language": "C++"
} | ```c++
```
Add solution to same prime factors problem | ```c++
#include <iostream>
using std::cout;
using std::boolalpha;
bool is_factor(int factor, int number) {
return number % factor == 0;
}
bool is_prime(int number) {
if (number == 2) {
return true;
}
for (int i = 2; i < number; ++i) {
if (is_factor(i, number)) {
return false;
}
}
retu... |
fb5d57d0-d385-419d-a89e-5130fe3114a8 | {
"language": "C++"
} | ```c++
```
Remove Duplicates from Sorted List II. | ```c++
/**
* Remove Duplicates from Sorted List II
*
* cpselvis(cpselvis@gmail.com)
* Oct 9th, 2016
*/
#include<iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
i... |
6f37c031-55b9-456f-8787-1e2363533ccc | {
"language": "C++"
} | ```c++
```
Add test which detects bugs undetectable before r288563 | ```c++
// RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
struct IntHolder {
const IntHolder& Self() const {
return *this;
}
int val = 3;
};
const IntHolder *saved;
int main(int argc, char *argv[]) {
saved = &IntHolder().Self(... |
06d853ff-4f36-4fc2-970f-5347ed3a573b | {
"language": "C++"
} | ```c++
```
Check if Binary String Has at Most One Segment of Ones | ```c++
class Solution {
public:
bool checkOnesSegment(string s) {
bool flag = false;
bool cont_flag = false;
for (const auto &c : s) {
if (c == '1') {
if (flag && !cont_flag) {
return false;
}
flag = true;
... |
91103452-1a40-4f0d-99d6-f4cf4ad809c7 | {
"language": "C++"
} | ```c++
```
Add secondary frag data test | ```c++
#include "utils/GLFWApp.h"
#include <string>
#include "utils/Shader.h"
class UniformOrder: public GLFWApp {
public:
void Init(GLFWwindow*) override {
const std::string vs =
R"(in vec4 a_position;
void main(){
gl_Position = a_position;... |
801faf92-98ff-47ad-a5ea-bbef19806747 | {
"language": "C++"
} | ```c++
```
Add folder for storage the problem with primes. | ```c++
#include <iostream>
#include <math.h>
using namespace std;
typedef long long ll;
bool is_prime(ll n){
if (n<=1) return false;
if (n==2) return true;
if (n%2==0) return false;
ll root = sqrt(n);
for (int i=3; i<= root; i+=2){
if(n%i == 0 )
return false;
}
return ... |
922b4cc8-4ca8-4646-b8fa-b51d2185d2fa | {
"language": "C++"
} | ```c++
```
Add test for locate and traverse of linklist | ```c++
///////////////////////////////////////
/// file: linklist_test.cpp
///////////////////////////////////////
#include <iostream>
#include "linklist.h"
using namespace std;
///
/// 打印链表
///
template<typename T>
void PrintList(LinkList<T> L)
{
cout << "(";
auto p = L->next;
while(p) {
cout << ... |
f2b1db26-e8e5-43ee-b93b-0e399f8914c9 | {
"language": "C++"
} | ```c++
```
Add request posture cpp, and figure of req factory | ```c++
#include "impl_request_posture.hpp"
static RequsetPosture* pattern = new PatternRequestPosture;
static RequestPosture* torajectoy = new TorajectoryRequestPosture;
std::map<std::string, RequestPosture*> RequestPostureFactory::reqs = {{"pattern", pattern},
... |
3eb74b3f-51eb-405c-ba00-6a472a507f87 | {
"language": "C++"
} | ```c++
```
Add the `lexer::tokenize()` function with exceptions: cover it with tests | ```c++
#include "../../source/thewizardplusplus/wizard_parser/lexer/tokenize.hpp"
#include "../../source/thewizardplusplus/wizard_parser/lexer/token.hpp"
#include "../vendor/catch/catch.hpp"
#include <regex>
TEST_CASE("lexer::tokenize() function with exceptions", "[lexer]") {
using namespace thewizardplusplus::wizard... |
1b2d6618-96e4-4417-9fb3-bb51109d0f1d | {
"language": "C++"
} | ```c++
```
Add 96 Unique Binary Search Trees | ```c++
// 96 Unique Binary Search Trees
/**
* Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
*
* For example,
* Given n = 3, there are a total of 5 unique BST's.
*
* 1 3 3 2 1
* \ / / / \ \
* 3 2 1 1 3 ... |
d350628e-7dfd-46c3-ac1b-2a83ebe265b7 | {
"language": "C++"
} | ```c++
```
Add another C++14 constexpr test case. | ```c++
// RUN: %clang_cc1 -std=c++1y -verify %s
// expected-no-diagnostics
constexpr void copy(const char *from, unsigned long count, char *to) {
unsigned long n = (count + 7) / 8;
switch(count % 8) {
case 0: do { *to++ = *from++;
case 7: *to++ = *from++;
case 6: ... |
1619b1bd-9396-411b-a8d0-f001b0422ef0 | {
"language": "C++"
} | ```c++
```
Test for generate terms was added | ```c++
/*
* Copyright (C) 2015 deipi.com LLC and contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation th... |
2d3800d5-e9dc-40d6-b01a-b518bd83e387 | {
"language": "C++"
} | ```c++
```
Add (failing) unit test to demonstrate CGSolver bug with indefinite preconditioner. | ```c++
// Copyright (c) 2010-2020, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
// This file is part of the MFEM library. For more information and source code
// availability v... |
73e80539-3dee-413a-81da-e114c14ce499 | {
"language": "C++"
} | ```c++
```
Add the missing test case for folder view. | ```c++
#include <QApplication>
#include <QMainWindow>
#include <QToolBar>
#include <QDir>
#include <QDebug>
#include "../core/folder.h"
#include "../foldermodel.h"
#include "../folderview.h"
#include "../cachedfoldermodel.h"
#include "../proxyfoldermodel.h"
#include "../pathedit.h"
int main(int argc, char** argv) {
... |
25d45b77-e1a8-4243-8460-57001619e007 | {
"language": "C++"
} | ```c++
```
Add unit test for Map class -User Story 8 | ```c++
#include <gtest/gtest.h>
#include <array>
#include <memory>
#include "Map.hpp"
struct MapTest : public :: testing :: Test{
std::shared_ptr<Map> setmap = std::make_shared<Map>();
};
TEST_F(MapTest, LoadMapSwitchTest) {
EXPECT_EQ(10,(setmap->getGridmap(1)).size());
EXPECT_FALSE((setmap->getGridmap(1)).... |
7e62a4be-ca8d-40fb-838f-5e2b5d8048d8 | {
"language": "C++"
} | ```c++
```
Add another failing use-after-scope test | ```c++
// RUN: %clangxx_asan -O1 -mllvm -asan-use-after-scope=1 %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
// XFAIL: *
// FIXME: This works only for arraysize <= 8.
char *p = 0;
int main() {
{
char x[1024] = {};
p = x;
}
return *p; // BOOM
}
``` |
4d72e17e-4a70-4471-a0e9-632f800cecec | {
"language": "C++"
} | ```c++
```
Fix build for boost 1.66 | ```c++
--- src/rpcclient.cpp.orig 2017-05-18 01:39:08 UTC
+++ src/rpcclient.cpp
@@ -39,7 +39,7 @@ Object CallRPC(const string& strMethod,
// Connect to localhost
bool fUseSSL = GetBoolArg("-rpcssl", false);
asio::io_service io_service;
- ssl::context context(io_service, ssl::context::sslv23);
+ ss... |
d014fe5c-c0b7-40e4-b261-639f5defb948 | {
"language": "C++"
} | ```c++
```
Add tests for generalized lambda capture (C++14). NFC. | ```c++
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -verify %s
int clang_analyzer_eval(int);
void generalizedCapture() {
int v = 7;
auto lambda = [x=v]() {
return x;
};
int result = lambda();
clang_analyzer_eval(result == 7); // expected-warn... |
063a8de8-dd65-4ec7-96fd-512a70003e74 | {
"language": "C++"
} | ```c++
```
Implement Knight in Tours problem | ```c++
#include <iostream>
#define N 8
using namespace std;
// A utility function to check the valid indexes
// of N*N chess board
bool isSafe(int x, int y, int sol[N][N]) {
return (x >= 0
&& y >= 0
&& x < N
&& y < N
&& sol[x][y] == -1);
}
/**
* Print the solution
*/
void printSolution(int sol[N][N]) {
... |
14babbb7-201b-427b-ae78-08f4a442c3f8 | {
"language": "C++"
} | ```c++
```
Add a basic testcase for the "variable is not needed" warning and one that regressed in r168519. | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
namespace test1 {
static int abc = 42; // expected-warning {{variable 'abc' is not needed and will not be emitted}}
template <typename T>
int foo(void) {
return abc;
}
}
namespace test2 {
struct bah {
};
namespace {
struct foo : bah {
... |
b00d7314-6e15-475a-92e2-0e551f6671cd | {
"language": "C++"
} | ```c++
```
Add numeric integration using Simpson's method. | ```c++
double integrate(double (*f)(double), double a, double b, double delta = 1) {
if(abs(a - b) < delta) {
return (b-a)/6 * (f(a) + 4 * f((a+b)/2) + f(b));
}
return integrate(f, a, (a+b)/2, delta) + integrate(f, (a+b)/2, b, delta);
}
``` |
3880d400-2bf5-4ff4-9cc9-78dbf136bac1 | {
"language": "C++"
} | ```c++
```
Create initial file version for AVR instruccions parser | ```c++
#inlude <bits/stdc++.h>
using namespace std;
void parse_cmd(string str, string cmd) {
// Clear whatever cmd contains
cmd = "";
}
void execute_cmd(string cmd) {
}
int main() {
string hexLine;
string parsedCmd;
int err = 0;
while( !err ) {
// Read each line from .hex file
getline(cin, hexLine);
... |
60b4862f-6078-42f3-89d4-1e56c8f41390 | {
"language": "C++"
} | ```c++
```
Edit distance between two strings | ```c++
#include<iostream>
using namespace std;
int main()
{
string s1,s2;
cout<<"Enter the two strings:";
cin>>s1>>s2;
int l1=s1.length();
int l2=s2.length();
int d[l1+1][l2+1];
for(int i=0;i<=l1;i++)
for(int j=0;j<=l2;j++){
if(i==0)
d[0][j]=j;
else if(j==0)
d[i][0]=i;
else if(s1[i-1]==s... |
02d4d058-f4ce-4981-a339-b7efac702280 | {
"language": "C++"
} | ```c++
```
Add a simple C++ example. | ```c++
#include <iostream>
#include <string>
#include "ucl++.h"
int main(int argc, char **argv)
{
std::string input, err;
input.assign((std::istreambuf_iterator<char>(std::cin)),
std::istreambuf_iterator<char>());
auto obj = ucl::Ucl::parse(input, err);
if (obj) {
std::cout << obj.dump(UCL_EMIT_CONFIG) << s... |
e3d05acb-120b-4b2a-9612-cce8ba26986c | {
"language": "C++"
} | ```c++
```
Add solution for 191. Number of 1 Bits. | ```c++
/**
* link: https://leetcode.com/problems/number-of-1-bits/
*/
class Solution {
public:
int hammingWeight(uint32_t n) {
int res = 0;
while(n)
{
res += (n & 1);
n >>= 1;
}
return res;
}
};
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.