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 |
|---|---|---|---|---|---|---|---|---|---|
9174ad3d9ba14ad29f7038f5c37dd57ad6e313c4 | sketchbook/TrafficLight/LightModel.cpp | sketchbook/TrafficLight/LightModel.cpp | #include "Arduino.h"
#include "LightModel.h"
const byte LightModel::RED_ON = 0x1;
const byte LightModel::AMBER_ON = 0x2;
const byte LightModel::GREEN_ON = 0x4;
LightModel::LightModel()
: state(0)
{
}
// typical AMBER light is 5 seconds
void LightModel::setup()
{
// Set digital pins 3, 4, and 5 to be output.
... | #include "Arduino.h"
#include "LightModel.h"
const byte LightModel::RED_ON = 0x1;
const byte LightModel::AMBER_ON = 0x2;
const byte LightModel::GREEN_ON = 0x4;
LightModel::LightModel()
: state(0)
{
}
// typical AMBER light is 5 seconds
void LightModel::setup()
{
// Set digital pins 4, 5, 6, and 7 to be output
... | Change code to match expectations of SeeedStudio's relaysheld v1.3 | Change code to match expectations of SeeedStudio's relaysheld v1.3
| C++ | bsd-2-clause | ktgeek/arduino |
24862ac391e6df0cc5dce32606b84b9ee036eec6 | media/base/run_all_unittests.cc | media/base/run_all_unittests.cc | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/test/test_suite.h"
#include "media/base/media.h"
int main(int argc, char** argv) {
base::TestSuite suite(argc, argv);
media::Init... | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/test/test_suite.h"
#include "media/base/media.h"
cl... | Initialize logging early enough to see VLOGs emitted by InitializeMediaLibraryForTesting(). (specifically, this makes ffmpeg_stubs.cc VLOGs actually get emitted if -v=1 is specified) | Initialize logging early enough to see VLOGs emitted by InitializeMediaLibraryForTesting().
(specifically, this makes ffmpeg_stubs.cc VLOGs actually get emitted if -v=1 is specified)
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/9320048
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120345 003... | C++ | bsd-3-clause | fujunwei/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,rogerwang/chromium,M4sse/chromium.src,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,littlstar/c... |
623c20c65bad497eac1b29ebc2a93b601910b19d | main.cpp | main.cpp | #include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//These things are used by QSettings to set up setting storage
a.setOrganizationName("EVTV");
a.setApplicationName("SavvyCAN");
a.setOrganizationDomain("evtv.me");
QSettings::setDefau... | #include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//Add a local path for Qt extensions, to allow for per-application extensions.
a.addLibraryPath("plugins");
//These things are used by QSettings to set up setting storage
a.setOrganizati... | Enable support for local plugins | Enable support for local plugins
| C++ | mit | collin80/SavvyCAN,collin80/SavvyCAN,collin80/SavvyCAN,collin80/SavvyCAN,collin80/SavvyCAN |
4db1349104fee2476825616013fdf6e5e75aa4b2 | chrome/browser/extensions/extension_storage_apitest.cc | chrome/browser/extensions/extension_storage_apitest.cc | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Storage) {
ASSERT_TRUE(RunExtensionTest("storage"... | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
#if defined(OS_LINUX)
// See http://crbug.com/42943.
#define MAYBE_Storage FLAKY_Storage
#el... | Mark ExtensionApiTest.Storage as flaky. BUG=42943 TEST=none TBR=rafaelw | [Linux] Mark ExtensionApiTest.Storage as flaky.
BUG=42943
TEST=none
TBR=rafaelw
Review URL: http://codereview.chromium.org/1810012
git-svn-id: http://src.chromium.org/svn/trunk/src@46083 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: d24d18b9e3f4f98bd820ae1f25a7c9b5c5fac0f3 | C++ | bsd-3-clause | meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u... |
961d8ba3e631d3fbbbb6de91e98f63d5a9a7bbb5 | opencog/atoms/core/Checkers.cc | opencog/atoms/core/Checkers.cc | /*
* opencog/atoms/core/Checkers.cc
*
* Copyright (C) 2017 Linas Vepstas
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* ... | /*
* opencog/atoms/core/Checkers.cc
*
* Copyright (C) 2017 Linas Vepstas
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* ... | Add type checking for boolean link types. | Add type checking for boolean link types.
| C++ | agpl-3.0 | misgeatgit/atomspace,AmeBel/atomspace,misgeatgit/atomspace,rTreutlein/atomspace,AmeBel/atomspace,misgeatgit/atomspace,misgeatgit/atomspace,rTreutlein/atomspace,misgeatgit/atomspace,AmeBel/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,rTreutlein/atomspace |
a29e58ba5dee4b6cf5ef5401c3c15816fe1446c5 | Wangscape/noise/module/codecs/CylindersWrapperCodec.cpp | Wangscape/noise/module/codecs/CylindersWrapperCodec.cpp | #pragma once
#include "CylindersWrapperCodec.h"
namespace spotify
{
namespace json
{
using CylindersWrapper = noise::module::Wrapper<noise::module::Cylinders>;
codec::object_t<CylindersWrapper> default_codec_t<CylindersWrapper>::codec()
{
auto codec = codec::object<CylindersWrapper>();
codec.req... | #pragma once
#include "CylindersWrapperCodec.h"
namespace spotify
{
namespace json
{
using CylindersWrapper = noise::module::Wrapper<noise::module::Cylinders>;
codec::object_t<CylindersWrapper> default_codec_t<CylindersWrapper>::codec()
{
auto codec = codec::object<CylindersWrapper>();
codec.req... | Remove spurious required field from Cylinders codec | Remove spurious required field from Cylinders codec
| C++ | mit | serin-delaunay/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape |
0af6ade0faaa8d855aeef905877080e8dd1d6f52 | src/Types.cpp | src/Types.cpp | //=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=====================================================... | //=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=====================================================... | Use an array to store the size of the types | Use an array to store the size of the types
| C++ | mit | wichtounet/eddic,vogelsgesang/eddic,vogelsgesang/eddic,vogelsgesang/eddic,wichtounet/eddic,wichtounet/eddic |
780c861733efa4533a77aa41d02af95920cfd0a4 | lib/CodeGen/DwarfWriter.cpp | lib/CodeGen/DwarfWriter.cpp | //===-- llvm/CodeGen/DwarfWriter.cpp - Dwarf Framework ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by James M. Laskey and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... | //===-- llvm/CodeGen/DwarfWriter.cpp - Dwarf Framework ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by James M. Laskey and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... | Add an eol at the end to shut gcc sup. | Add an eol at the end to shut gcc sup.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@24926 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,llvm... |
c8e19578f2e32df9c64a9f0be0bb2d90d9489154 | test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp | test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | //===----------------------------------------------------------------------===//
//
// 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
//
//===---------------------------... | Mark lock_guard nodiscard test as unsupported in C++03 | [libc++] Mark lock_guard nodiscard test as unsupported in C++03
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@369672 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx |
9585daed3e56f495731aedcf097eda9fd108cadd | src/video_recorder_controller.cpp | src/video_recorder_controller.cpp | #include "./video_recorder_controller.h"
#include <QDateTime>
#include "./video_recorder.h"
VideoRecorderController::VideoRecorderController(
std::shared_ptr<VideoRecorder> videoRecorder)
: videoRecorder(videoRecorder)
{
connect(this, SIGNAL(toggleRecording()), this,
SLOT(toggleRecordingInMainThread(... | #include "./video_recorder_controller.h"
#include <QDateTime>
#include "./video_recorder.h"
VideoRecorderController::VideoRecorderController(
std::shared_ptr<VideoRecorder> videoRecorder)
: videoRecorder(videoRecorder)
{
connect(this, SIGNAL(toggleRecording()), this,
SLOT(toggleRecordingInMainThread(... | Fix toggle text after first video recording start. | Fix toggle text after first video recording start.
| C++ | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller |
52ebf19a9ba98bd2db5b89772db6eafee8c0a9b0 | plugin/components.cpp | plugin/components.cpp | /*
* Copyright 2011 Intel Corporation.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* http://www.apache.org/licenses/LICENSE-2.0
*/
#include <glib-object.h>
#include <QDir>
#include "components.h"
#include "launcher.... | /*
* Copyright 2011 Intel Corporation.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* http://www.apache.org/licenses/LICENSE-2.0
*/
#include <glib-object.h>
#include <QDir>
#include "components.h"
#include "launcher.... | Remove the unused ZoomArea from the elements | [Components] Remove the unused ZoomArea from the elements
| C++ | apache-2.0 | meego-tablet-ux/meego-app-camera |
a5d8b8fba8a8215a026dfa115a5461549c6adaad | Tests/testmain.cpp | Tests/testmain.cpp | #include <QApplication>
#include "gtest/gtest.h"
int main(int argc, char** argv)
{
QApplication app(argc, argv);
::testing::InitGoogleTest(&argc, argv);
int returnValue = RUN_ALL_TESTS();
return returnValue;
}
| #include <QCoreApplication>
#include "gtest/gtest.h"
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
::testing::InitGoogleTest(&argc, argv);
int returnValue = RUN_ALL_TESTS();
return returnValue;
}
| Use QCoreApplication for unit tests as it should not depend on GUI stuff. | Use QCoreApplication for unit tests as it should not depend on GUI stuff.
| C++ | agpl-3.0 | UCSolarCarTeam/Epsilon-Hermes,UCSolarCarTeam/Epsilon-Hermes |
ae234b2217d3317148f86804e6bdc95c506bccea | removeElement.cpp | removeElement.cpp | #include<iostream>
using namespace std;
int removeElement(int A[], int n, int elem) {
int length = n-1;
for(int i = 0; i <= length; ++i) {
if(A[i] == elem) {
while (A[length] != elem) {
length--;
}
A[i] = A[length--];
}
}
return leng... | #include<iostream>
using namespace std;
int removeElement(int A[], int n, int elem) {
if (n == 0) {
return n;
}
if (n == 1 && A[0] == elem) {
return 0;
}
if (n == 1 && A[0] != elem) {
return n;
}
int tail = n - 1;
int i = 0;
while (i <= tail) {
i... | Remove an element from a list completed | Remove an element from a list completed
| C++ | mit | srijanshetty/code |
f33660aaabb468d6847abb7f36d31b0251e6e167 | open_spiel/libtorch/torch_integration_test.cc | open_spiel/libtorch/torch_integration_test.cc | // Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless require... | // Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless require... | Fix includes in integration test example. | Fix includes in integration test example.
| C++ | apache-2.0 | deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel |
ff0b43015bd0067d9f1bcdd55d2baa99abfba646 | tests/test-getusername.cpp | tests/test-getusername.cpp | #include <unistd.h>
#include <gtest/gtest.h>
#include "getusername.h"
TEST(GetUserName,simple)
{
// allocate a WCHAR_T buffer to receive username
DWORD lpnSize = 64;
WCHAR_T lpBuffer[lpnSize];
BOOL result = GetUserName(lpBuffer, &lpnSize);
// GetUserName returns 1 on success
ASSERT_EQ(1, result);
// get expe... | #include <string>
#include <vector>
#include <unistd.h>
#include <gtest/gtest.h>
#include <scxcorelib/scxstrencodingconv.h>
#include "getusername.h"
using std::string;
using std::vector;
using SCXCoreLib::Utf16leToUtf8;
TEST(GetUserName,simple)
{
// allocate a WCHAR_T buffer to receive username
DWORD lpnSize = 64;
... | Test UTF-16 output of GetUserName | Test UTF-16 output of GetUserName
| C++ | mit | bingbing8/PowerShell,bingbing8/PowerShell,PaulHigin/PowerShell,TravisEz13/PowerShell,KarolKaczmarek/PowerShell,KarolKaczmarek/PowerShell,kmosher/PowerShell,PaulHigin/PowerShell,bingbing8/PowerShell,KarolKaczmarek/PowerShell,JamesWTruher/PowerShell-1,kmosher/PowerShell,bingbing8/PowerShell,daxian-dbw/PowerShell,bmanikm/... |
689af30a551f113c26c624ed9639444094c29204 | kernel/src/bs_log_scribers.cpp | kernel/src/bs_log_scribers.cpp | /**
* \file bs_log_scribers.cpp
* \brief
* \author Sergey Miryanov
* \date 07.07.2009
* */
#include "bs_log_scribers.h"
using namespace std;
namespace blue_sky {
namespace log {
namespace detail {
void cout_scriber::write(const std::string &str) const {
//#ifdef _DEBUG
// TODO: miryanov
static bool is_... | /**
* \file bs_log_scribers.cpp
* \brief
* \author Sergey Miryanov
* \date 07.07.2009
* */
#include "bs_log_scribers.h"
using namespace std;
namespace blue_sky {
namespace log {
namespace detail {
void cout_scriber::write(const std::string &str) const {
#ifndef _DEBUG
static bool is_buffer_installed = fals... | Enable output buffer in log only for Release | Edit: Enable output buffer in log only for Release
| C++ | mpl-2.0 | uentity/bluesky,uentity/bluesky,uentity/bluesky,uentity/bluesky,uentity/bluesky |
d88a1b19b2204a6b16511c2a81c71fb334e49da6 | src/prng_user.cpp | src/prng_user.cpp | #include "prng_user.hpp"
PrngUser::PrngUser(std::shared_ptr<std::mt19937> generator)
: generator_{generator}
{
}
std::shared_ptr<std::mt19937> PrngUser::getGenerator() const
{
return generator_;
}
void PrngUser::setGenerator(std::shared_ptr<std::mt19937> generator)
{
generator_ = generator;
}
| /* Copyright 2014 Juhani Numminen
*
* 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 ... | Add a missing license header | Add a missing license header
| C++ | apache-2.0 | jnumm/pong--11 |
958976186e8a3702852805e446039b1dddaeff10 | netlib/test/resolver_test.cpp | netlib/test/resolver_test.cpp | #include "net/resolver.h"
#include <string>
#include <gtest/gtest.h>
using namespace net;
TEST(LookupAddress, Localhost) {
{
std::string addr;
error err = LookupAddress("localhost", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
{
std::string ad... | #include "net/resolver.h"
#include <string>
#include <gtest/gtest.h>
using namespace net;
TEST(LookupAddress, Localhost) {
std::string addr;
error err = LookupAddress("localhost", &addr);
EXPECT_EQ(error::nil, err);
EXPECT_EQ("127.0.0.1", addr);
}
TEST(LookupAddress, LocalIPv4) {
std::string add... | Refactor the resolver test code | refactor/test: Refactor the resolver test code
| C++ | mit | yksz/netlib,yksz/netlib |
ad8e0033011f34ad3ea779f0b14accb82530c68a | examples/example_qi_signature_instance.cpp | examples/example_qi_signature_instance.cpp | #include <string>
#include <vector>
#include <map>
#include <iostream>
#include <qitype/signature.hpp>
//sample foo function to take the signature from
int foo(int a, int b)
{
return a + b + 42;
}
int main()
{
typedef std::map<std::string , std::string> StringMap;
typedef std::vector<int> In... | #include <string>
#include <vector>
#include <map>
#include <iostream>
#include <qitype/signature.hpp>
//sample foo function to take the signature from
int foo(int a, int b)
{
return a + b + 42;
}
int main()
{
typedef std::map<std::string , std::string> StringMap;
typedef std::vector<int> In... | Fix unused variable on outdated example | Fix unused variable on outdated example
Change-Id: I9e257c3123b68044b34531cd71837db9a9ef2bc8
| C++ | bsd-3-clause | aldebaran/libqi,bsautron/libqi,aldebaran/libqi,aldebaran/libqi-java,aldebaran/libqi-java,aldebaran/libqi,aldebaran/libqi-java,vbarbaresi/libqi |
ee358aa9c1eef83b9cd0a74be002f6da171d4ce9 | unimplemented.cc | unimplemented.cc | /*
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
#include <unordered_map>
#include "unimplemented.hh"
#include "core/sstring.hh"
#include "core/enum.hh"
namespace unimplemented {
static std::unordered_map<cause, bool> _warnings;
std::ostream& operator<<(std::ostream& out, cause c) {
switch(c) {
case ... | /*
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
#include <unordered_map>
#include "unimplemented.hh"
#include "core/sstring.hh"
#include "core/enum.hh"
namespace unimplemented {
static thread_local std::unordered_map<cause, bool> _warnings;
std::ostream& operator<<(std::ostream& out, cause c) {
switch(c) {
... | Fix warnings map to be thread-local | Fix warnings map to be thread-local
The map is mutated so it should be thread-local. This will make the
warnings printed once per core, but I guess it's not a big deal.
| C++ | agpl-3.0 | rluta/scylla,dwdm/scylla,kangkot/scylla,capturePointer/scylla,justintung/scylla,scylladb/scylla,shaunstanislaus/scylla,glommer/scylla,kjniemi/scylla,phonkee/scylla,acbellini/scylla,eklitzke/scylla,wildinto/scylla,victorbriz/scylla,gwicke/scylla,shaunstanislaus/scylla,victorbriz/scylla,avikivity/scylla,capturePointer/sc... |
b512deeae3cb91ab50ad120e189252c4b802c006 | Assignment_1/localsearch.cpp | Assignment_1/localsearch.cpp | /* localsearch.cpp
Ian Westrope
Evolutionary Computation
Spring 2015
*/
#include <iostream>
#include <cstdlib>
#include "bitHelpers.h"
#include "rand.h"
using namespace std;
int main() {
cout << "Test makefile" << endl;
}
| /* localsearch.cpp
Ian Westrope
Evolutionary Computation
Spring 2015
*/
#include <iostream>
#include <cstdlib>
#include "bitHelpers.h"
#include "rand.h"
using namespace std;
int main( int argc, char* argv[] ) {
// variables for command line arguments
int grayFlag = 0; // Gray code
int binaryFl... | Add command line argument support | Add command line argument support
| C++ | mit | westrope/Evo-Comp,westrope/Evo-Comp |
914adfe5fe72dfe45be2d1f377899b72dbd9837e | zg01/zg01_fsm.cpp | zg01/zg01_fsm.cpp | #include "zg01_fsm.h"
// max time between ZG01 bits, until a new frame is assumed to have started
#define ZG01_MAX_MS 3
// all of the state of the FSM
typedef struct {
uint8_t *buffer;
int num_bits;
int prev_ms;
} fsm_t;
static fsm_t fsm;
static fsm_t *s = &fsm;
// resets the FSM
static void fsm_reset(... | #include "zg01_fsm.h"
// max time between ZG01 bits, until a new frame is assumed to have started
#define ZG01_MAX_MS 3
// all of the state of the FSM
typedef struct {
uint8_t *buffer;
int num_bits;
unsigned long prev_ms;
} fsm_t;
static fsm_t fsm;
static fsm_t *s = &fsm;
// resets the FSM
static void ... | Fix timer overflow on 16-bit int (milliseconds is an unsigned long) | Fix timer overflow on 16-bit int (milliseconds is an unsigned long)
| C++ | mit | vvzvlad/co2sensor_esp8266,revspace/co2sensor,vvzvlad/co2sensor_esp8266,revspace/co2sensor |
6312500fc13f6d82cf761cfc0fb5132ea5d03fa7 | src/server/WebBackendSlots.cpp | src/server/WebBackendSlots.cpp | // ===============================
// Slots for long running Library Tasks
// Available under the 3-clause BSD License
// Written by: Kris Moore <kris@pcbsd.org> FEB 2016
// =================================
#include <WebSocket.h>
#define DEBUG 0
// Iohyve Fetch is done
void WebSocket::slotIohyveFetchDone(QString id,... | // ===============================
// Slots for long running Library Tasks
// Available under the 3-clause BSD License
// Written by: Kris Moore <kris@pcbsd.org> FEB 2016
// =================================
#include <WebSocket.h>
#define DEBUG 0
// Iohyve Fetch is done
void WebSocket::slotIohyveFetchDone(QString id,... | Add couple of debug statements | Add couple of debug statements
| C++ | bsd-2-clause | c3d2/sysadm,pcbsd/sysadm,pcbsd/sysadm,pcbsd/sysadm,pcbsd/sysadm,pcbsd/sysadm,c3d2/sysadm,c3d2/sysadm,c3d2/sysadm |
a1873afd1c4d5bf42dd2f3dc573c66add6c129c0 | src/grcrestarter.cpp | src/grcrestarter.cpp | #include <string>
#include "grcrestarter.h"
// Old VB based NeuralNet.
double qtPushGridcoinDiagnosticData(std::string data);
int RestartClient();
bool CheckForUpgrade();
void UpgradeClient();
int DownloadBlocks();
int ReindexWallet();
int CreateRestorePoint();
// While transitioning to dotnet the NeuralNet implementa... | #include <string>
#include "grcrestarter.h"
// Old VB based NeuralNet.
double qtPushGridcoinDiagnosticData(std::string data);
int RestartClient();
bool CheckForUpgrade();
void UpgradeClient();
int DownloadBlocks();
int ReindexWallet();
int CreateRestorePoint();
// While transitioning to dotnet the NeuralNet implementa... | Change invalid signature of DownloadGridcoinBlocks. | Change invalid signature of DownloadGridcoinBlocks.
| C++ | mit | caraka/gridcoinresearch,tomasbrod/Gridcoin-Research,theMarix/Gridcoin-Research,theMarix/Gridcoin-Research,caraka/gridcoinresearch,caraka/gridcoinresearch,gridcoin/Gridcoin-Research,gridcoin/Gridcoin-Research,TheCharlatan/Gridcoin-Research,Git-Jiro/Gridcoin-Research,tomasbrod/Gridcoin-Research,TheCharlatan/Gridcoin-Rese... |
bd60ab0f8f407b078ba9373a78ee7beecf305fdb | src/structures/vroom/break.cpp | src/structures/vroom/break.cpp | /*
This file is part of VROOM.
Copyright (c) 2015-2022, Julien Coupey.
All rights reserved (see LICENSE).
*/
#include "structures/vroom/break.h"
#include "utils/helpers.h"
namespace vroom {
Break::Break(Id id,
const std::vector<TimeWindow>& tws,
Duration service,
const std::... | /*
This file is part of VROOM.
Copyright (c) 2015-2022, Julien Coupey.
All rights reserved (see LICENSE).
*/
#include "structures/vroom/break.h"
#include "utils/helpers.h"
namespace vroom {
Break::Break(Id id,
const std::vector<TimeWindow>& tws,
Duration service,
const std::... | Scale internal times for Break objects. | Scale internal times for Break objects.
| C++ | bsd-2-clause | VROOM-Project/vroom,VROOM-Project/vroom,VROOM-Project/vroom |
867ca8caffffa2bb643f07a943249b95d0cc3770 | src/csv2isd-main.cc | src/csv2isd-main.cc | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- vim:set ts=4 sw=4 sts=4 noet: */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "csv/export.h"
using namespace flint;
namespace {
void usage()
{
std::cer... | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- vim:set ts=4 sw=4 sts=4 noet: */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "csv/export.h"
using namespace flint;
namespace {
void usage()
{
std::cer... | Fix csv2isd to exit with 0 at --help | Fix csv2isd to exit with 0 at --help
| C++ | mit | flintproject/Flint,flintproject/Flint |
fbe636910ca3659dab70743433e6526124657326 | src/sampling/serialize.cpp | src/sampling/serialize.cpp | /*
This file is part of Groho, a simulator for inter-planetary travel and warfare.
Copyright (c) 2020 by Kaushik Ghose. Some rights reserved, see LICENSE
*/
#include <exception>
#include <string>
#include "serialize.hpp"
namespace groho {
Serialize::Serialize(
double dt, const std::vector<NAIFbody>& objects, fs... | /*
This file is part of Groho, a simulator for inter-planetary travel and warfare.
Copyright (c) 2020 by Kaushik Ghose. Some rights reserved, see LICENSE
*/
#include <exception>
#include <string>
#include "serialize.hpp"
namespace groho {
Serialize::Serialize(
double dt, const std::vector<NAIFbody>& objects, fs... | Change naming scheme for files | Change naming scheme for files
| C++ | mit | kghose/groho |
0beed80fab8bfa27201e6e5892f34637db47abaa | project/src/system/Locale.cpp | project/src/system/Locale.cpp | #include <system/Locale.h>
#if defined(HX_WINDOWS)
#include <windows.h>
#elif defined(HX_LINUX)
#include <stdlib.h>
#include <string.h>
#include <clocale>
#endif
namespace lime {
std::string* Locale::GetSystemLocale () {
#if defined(HX_WINDOWS)
char locale[8];
int length = GetLocaleInfo (GetSystemDe... | #include <system/Locale.h>
#if defined(HX_WINDOWS)
#include <windows.h>
#elif defined(HX_LINUX)
#include <stdlib.h>
#include <string.h>
#include <clocale>
#endif
namespace lime {
std::string* Locale::GetSystemLocale () {
#if defined(HX_WINDOWS)
char language[5] = {0};
char country[5] = {0};
Get... | Update locale handling on Windows | Update locale handling on Windows
| C++ | mit | MinoGames/lime,MinoGames/lime,openfl/lime,MinoGames/lime,madrazo/lime-1,madrazo/lime-1,MinoGames/lime,MinoGames/lime,player-03/lime,openfl/lime,madrazo/lime-1,player-03/lime,MinoGames/lime,MinoGames/lime,player-03/lime,openfl/lime,madrazo/lime-1,madrazo/lime-1,openfl/lime,madrazo/lime-1,player-03/lime,openfl/lime,madra... |
ee9364354742a40f183d61b09580cb3f865e7e2e | src/unittest/timer_test.cc | src/unittest/timer_test.cc | // Copyright 2010-2014 RethinkDB, all rights reserved.
#include "unittest/gtest.hpp"
#include "arch/timing.hpp"
#include "concurrency/pmap.hpp"
#include "unittest/unittest_utils.hpp"
#include "utils.hpp"
namespace unittest {
int wait_array[2][10] = { { 1, 1, 2, 3, 5, 13, 20, 30, 40, 8 },
{ ... | // Copyright 2010-2014 RethinkDB, all rights reserved.
#include "unittest/gtest.hpp"
#include "arch/timing.hpp"
#include "concurrency/pmap.hpp"
#include "unittest/unittest_utils.hpp"
#include "utils.hpp"
namespace unittest {
int wait_array[2][10] = { { 1, 1, 2, 3, 5, 13, 20, 30, 40, 8 },
{ ... | Decrease sensitivity of timer test. | Decrease sensitivity of timer test.
| C++ | apache-2.0 | 4talesa/rethinkdb,eliangidoni/rethinkdb,yakovenkodenis/rethinkdb,victorbriz/rethinkdb,wkennington/rethinkdb,rrampage/rethinkdb,grandquista/rethinkdb,bpradipt/rethinkdb,victorbriz/rethinkdb,sebadiaz/rethinkdb,sbusso/rethinkdb,mquandalle/rethinkdb,yaolinz/rethinkdb,4talesa/rethinkdb,dparnell/rethinkdb,dparnell/rethinkdb,... |
4e56a62f720282a083b2f8481b8250453dfc739f | src/qt/test/test_main.cpp | src/qt/test/test_main.cpp | #include <QTest>
#include <QObject>
#include "uritests.h"
// This is all you need to run all the tests
int main(int argc, char *argv[])
{
URITests test1;
QTest::qExec(&test1);
}
| #include <QTest>
#include <QObject>
#include "uritests.h"
// This is all you need to run all the tests
int main(int argc, char *argv[])
{
bool fInvalid = false;
URITests test1;
if (QTest::qExec(&test1) != 0)
fInvalid = true;
return fInvalid;
}
| Return !0 when qt tests fail. | Return !0 when qt tests fail.
| C++ | mit | ghostlander/Testcoin,ghostlander/Testcoin,ghostlander/Testcoin,jlay11/sharecoin,jlay11/sharecoin,jlay11/sharecoin,jlay11/sharecoin,jlay11/sharecoin,ghostlander/Testcoin,jlay11/sharecoin |
100bc306dd15532dbbb2b353170aea47e8173a13 | testbed/windows/runner/main.cpp | testbed/windows/runner/main.cpp | #include <flutter/dart_project.h>
#include <flutter/flutter_view_controller.h>
#include <windows.h>
#include <vector>
#include "flutter_window.h"
#include "run_loop.h"
#include "window_configuration.h"
int APIENTRY wWinMain(_In_ HINSTANCE instance,
_In_opt_ HINSTANCE prev,
... | #include <flutter/dart_project.h>
#include <flutter/flutter_view_controller.h>
#include <windows.h>
#include <vector>
#include "flutter_window.h"
#include "run_loop.h"
#include "window_configuration.h"
int APIENTRY wWinMain(_In_ HINSTANCE instance,
_In_opt_ HINSTANCE prev,
... | Update Windows runner from template | Update Windows runner from template
Picks up the recently add CoInitialize fix.
| C++ | apache-2.0 | google/flutter-desktop-embedding,google/flutter-desktop-embedding,google/flutter-desktop-embedding,google/flutter-desktop-embedding,google/flutter-desktop-embedding |
ee0ab620fe0ba2ed7b6ea1f831eeaade0ad43820 | src/api/windll.cpp | src/api/windll.cpp | #ifdef _WINDOWS
/*
* NOTE: Some macros must be defined in project options of Visual Studio.
* - _CRT_SECURE_NO_WARNINGS
* To use strncpy().
* - NOMINMAX
* To use std::min(), std::max().
*/
#include <windows.h>
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID l... | #ifdef _WINDOWS
/*
* NOTE: Some macros must be defined in project options of Visual Studio.
* - _CRT_SECURE_NO_WARNINGS
* To use strncpy().
* - NOMINMAX
* To use std::min(), std::max().
* NOTE: Suppress some warnings of Visual Studio.
* - C4251
*/
#include <windows.h>
BOOL A... | Add comment about suppress the warning C4251 of Visual Studio. | Add comment about suppress the warning C4251 of Visual Studio.
| C++ | apache-2.0 | katsuster/omxil-mf,katsuster/omxil-mf,katsuster/omxil-mf,katsuster/omxil-mf |
00ddc6493e5f6d2940807fa23b6e267aecfb10c9 | content/shell/shell_content_client.cc | content/shell/shell_content_client.cc | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/shell/shell_content_client.h"
#include "base/string_piece.h"
namespace content {
ShellContentClient::~ShellContentClient() {
}
v... | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/shell/shell_content_client.h"
#include "base/string_piece.h"
#include "webkit/glue/user_agent.h"
namespace content {
ShellContent... | Use Chrome's user agent string for content_shell, since some sites (i.e. Gmail) give a degraded experience otherwise. | Use Chrome's user agent string for content_shell, since some sites (i.e. Gmail) give a degraded experience otherwise.
BUG=90445
Review URL: http://codereview.chromium.org/7980044
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@102172 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | rogerwang/chromium,hgl888/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chro... |
ce8b9c231405b95d1664dc3548044d6757af516d | ext/pdfium_ruby/pdfium_ruby.cpp | ext/pdfium_ruby/pdfium_ruby.cpp | #include "pdfium_ruby.h"
void Init_pdfium_ruby (void) {
VALUE rb_PDFium = rb_define_module("PDFium");
// Define `Document` and `Page` classes
Define_Document();
Define_Page();
Define_PageSet();
}
| #include "pdfium_ruby.h"
extern "C"
void Init_pdfium_ruby (void) {
// Define `PDFium` module as a namespace for all of our other objects
VALUE rb_PDFium = rb_define_module("PDFium");
// Define `Document` and `Page` classes
Define_Document();
//Define_Page();
//Define_PageSet();
}
| Fix main file's init function for C++, and comment out unimplemented functions. | Fix main file's init function for C++, and comment out unimplemented functions. | C++ | mit | documentcloud/pdfshaver,documentcloud/pdfshaver,documentcloud/pdfshaver |
e3e0a2432c587ee06e469c37ffae133b7ac55c77 | src/bench/rpc_blockchain.cpp | src/bench/rpc_blockchain.cpp | // Copyright (c) 2016-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <bench/bench.h>
#include <bench/data.h>
#include <rpc/blockchain.h>
#include <streams.h>
#include <test/util/setup_... | // Copyright (c) 2016-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <bench/bench.h>
#include <bench/data.h>
#include <rpc/blockchain.h>
#include <streams.h>
#include <test/util/setup_... | Add benchmark to write JSON into a string | Add benchmark to write JSON into a string
The benchmark BlockToJsonVerbose only tests generating (and destroying)
the JSON data structure, but serializing into a string is also a
performance critical aspect of the RPC calls.
Also, use ankerl::nanobench::doNotOptimizeAway to make sure the compiler
can't optimize the r... | C++ | mit | sipsorcery/bitcoin,namecoin/namecoin-core,namecoin/namecore,yenliangl/bitcoin,jlopp/statoshi,Xekyo/bitcoin,prusnak/bitcoin,MeshCollider/bitcoin,jlopp/statoshi,sipsorcery/bitcoin,pataquets/namecoin-core,lateminer/bitcoin,particl/particl-core,kallewoof/bitcoin,mm-s/bitcoin,ajtowns/bitcoin,instagibbs/bitcoin,fanquake/bitc... |
d0cb04504c1267ab23778e639af235ff86da413c | src/gui/src/theme-loader.cpp | src/gui/src/theme-loader.cpp | #include "theme-loader.h"
#include <QApplication>
#include <QDir>
#include <QFile>
ThemeLoader::ThemeLoader(QString path, QObject *parent)
: QObject(parent), m_path(std::move(path))
{
connect(&m_watcher, &QFileSystemWatcher::fileChanged, this, &ThemeLoader::themeFileChanged);
}
QStringList ThemeLoader::getAllTheme... | #include "theme-loader.h"
#include <QApplication>
#include <QDir>
#include <QFile>
ThemeLoader::ThemeLoader(QString path, QObject *parent)
: QObject(parent), m_path(std::move(path))
{
connect(&m_watcher, &QFileSystemWatcher::fileChanged, this, &ThemeLoader::themeFileChanged);
}
QStringList ThemeLoader::getAllTheme... | Fix warning on startup from theme watcher | Fix warning on startup from theme watcher
| C++ | apache-2.0 | Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber |
2264f3ca992da900dab0976a470306208a5a0ea2 | src/Rndm.cc | src/Rndm.cc | #include "Rndm.h"
using namespace std;
Rndm::Rndm() : _mt(_rd())
{
}
Rndm & Rndm::rndm()
{
static Rndm rndm;
return rndm;
}
std::mt19937 & Rndm::mt()
{
return Rndm::rndm()._mt;
}
int Rndm::number(int from, int to)
{
uniform_int_distribution<int> num(from, to);
return num(Rndm::mt());
}
| #include "Rndm.h"
Rndm::Rndm() : _mt(_rd())
{
}
Rndm & Rndm::rndm()
{
static Rndm rndm;
return rndm;
}
std::mt19937 & Rndm::mt()
{
return Rndm::rndm()._mt;
}
int Rndm::number(int from, int to)
{
std::uniform_int_distribution<int> num(from, to);
return num(Rndm::mt());
}
| Remove use of std namespace | Remove use of std namespace
| C++ | mit | czeckd/ElimSim |
b549b20d2c4803029df1978fc2679186eaf622d9 | atom/browser/node_debugger.cc | atom/browser/node_debugger.cc | // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/node_debugger.h"
#include "base/command_line.h"
#include "libplatform/libplatform.h"
namespace atom {
NodeDebugger::NodeDebugger(node::Environment* env) : env... | // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/node_debugger.h"
#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "libplatform/libplatform.h"
namespace atom {
NodeDeb... | Convert arg string to utf8 on Windows | Convert arg string to utf8 on Windows
| C++ | mit | Floato/electron,Floato/electron,tonyganch/electron,seanchas116/electron,rajatsingla28/electron,gerhardberger/electron,electron/electron,miniak/electron,miniak/electron,thomsonreuters/electron,thomsonreuters/electron,Floato/electron,the-ress/electron,miniak/electron,bpasero/electron,gerhardberger/electron,rajatsingla28/... |
5885e7fde7e8d8b41317eb08367b298bfe7d1486 | activemq-c/src/main/c/cms.cpp | activemq-c/src/main/c/cms.cpp | /*
* 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"); you may ... | /*
* 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"); you may ... | Add the code to init the ActiveMQ-CPP library and shut it down when finished. | Add the code to init the ActiveMQ-CPP library and shut it down when finished.
git-svn-id: 0fb8a5a922afe2085ae9a967a0cf0864fe09ecff@1005248 13f79535-47bb-0310-9956-ffa450edef68
| C++ | apache-2.0 | apache/activemq-cpp,apache/activemq-cpp,apache/activemq-cpp,apache/activemq-cpp |
df2a6b92e54bb542cb7e2023f5c5f30f931b7eff | threadpool.cpp | threadpool.cpp | #include "threadpool.h"
ThreadPool::ThreadPool(size_t size)
{
for (auto i=0; i<size; ++i) {
workers.emplace_back([this] {
for (;;) {
std::unique_lock<std::mutex> lock(this->queue_mutex);
while (!this->m_stop && this->tasks.empty())
this->condi... | #include "threadpool.h"
ThreadPool::ThreadPool(size_t size)
{
for (size_t i=0; i<size; ++i) {
workers.emplace_back([this] {
for (;;) {
std::unique_lock<std::mutex> lock(this->queue_mutex);
while (!this->m_stop && this->tasks.empty())
this->con... | Fix compilation warning caused by use of "auto" | Fix compilation warning caused by use of "auto"
| C++ | bsd-3-clause | png85/dsnutil,png85/dsnutil |
024a3e6df98b36042b1586ef140b18c7913b2311 | R2Bot/src/UltrasoundSensor.cpp | R2Bot/src/UltrasoundSensor.cpp | #include "Sensor/UltrasoundSensor.h"
#include "Data/UltrasoundData.h"
UltrasoundSensor::UltrasoundSensor(string port, int baudrate) : Sensor("Ultrasound Sensor"), conn(std::make_shared<SerialPort>(port, baudrate)) {
}
UltrasoundSensor::~UltrasoundSensor() {
}
bool UltrasoundSensor::ping() {
return conn->isConnected... | #include "Sensor/UltrasoundSensor.h"
#include "Data/UltrasoundData.h"
UltrasoundSensor::UltrasoundSensor(string port, int baudrate) : Sensor("Ultrasound Sensor"), conn(std::make_shared<SerialPort>(port, baudrate)) {
}
UltrasoundSensor::~UltrasoundSensor() {
}
bool UltrasoundSensor::ping() {
return conn->isConnected... | Add check in ultrasound sensor when reading from the serial port | Add check in ultrasound sensor when reading from the serial port
| C++ | mit | cornell-cup/cs-r2bot2,cornell-cup/cs-r2bot2,cornell-cup/cs-r2bot2,cornell-cup/cs-r2bot2,cornell-cup/cs-r2bot2 |
28d79483359429bbf65b59c0cf2103752cd6647e | src/jni/File.cpp | src/jni/File.cpp | /*
* File.cpp
*
* Created on: Jun 24, 2015
* Author: gatanasov
*/
#include "File.h"
#include <sstream>
using namespace std;
namespace tns
{
string File::ReadText(const string& filePath)
{
int len;
bool isNew;
const char *content = ReadText(filePath, len, isNew);
string s(content, len);
if(is... | /*
* File.cpp
*
* Created on: Jun 24, 2015
* Author: gatanasov
*/
#include "File.h"
#include <sstream>
using namespace std;
namespace tns
{
string File::ReadText(const string& filePath)
{
int len;
bool isNew;
const char *content = ReadText(filePath, len, isNew);
string s(content, len);
if(is... | Remove erroneous check for reference params. | Remove erroneous check for reference params.
| C++ | apache-2.0 | NativeScript/android-runtime,NativeScript/android-runtime,NativeScript/android-runtime,NativeScript/android-runtime,NativeScript/android-runtime,NativeScript/android-runtime,NativeScript/android-runtime |
dac6753d6ce9f759539fbb65cc43d7369b3d1770 | src/miniMAT/checker/Checker.cpp | src/miniMAT/checker/Checker.cpp | #include <memory>
#include <miniMAT/checker/Checker.hpp>
#include <iostream>
namespace miniMAT {
namespace checker {
Checker::Checker(std::shared_ptr<std::map<std::string, Matrix>> vars,
std::shared_ptr<reporter::ErrorReporter> reporter) {
this->vars = vars;
... | #include <memory>
#include <miniMAT/checker/Checker.hpp>
#include <iostream>
namespace miniMAT {
namespace checker {
Checker::Checker(std::shared_ptr<std::map<std::string, Matrix>> vars,
std::shared_ptr<reporter::ErrorReporter> reporter) {
this->vars = vars;
... | Change catch statement to catch by reference | Change catch statement to catch by reference
| C++ | mit | fmenozzi/miniMAT,fmenozzi/miniMAT |
57b4cb9434be7756909b0e2cfdbd8882f0c4ec2b | server.cpp | server.cpp | #include <iostream>
#include "server.h"
Server::Server(unsigned short port) {
// logging settings
bottleserve.set_access_channels(websocketpp::log::alevel::all);
bottleserve.clear_access_channels(websocketpp::log::alevel::frame_payload);
bottleserve.init_asio();
bottleserve.set_message_handler([this] (websocke... | #include <iostream>
#include <sstream>
#include "server.h"
using namespace std;
/*
* Splits a string based on a delimiter character
*
* Won't split into more than 'max' strings. Returns the number of strings that were added
*/
template<typename Iter>
size_t split(const string& str, char val, size_t max, Iter out... | Add a simple login feature | Add a simple login feature
| C++ | agpl-3.0 | jaarky/bottleship,jaarky/bottleship |
946967806a449488a91d74e2693295a2413a2835 | test/SemaCXX/cxx98-compat.cpp | test/SemaCXX/cxx98-compat.cpp | // RUN: %clang_cc1 -fsyntax-only -std=c++0x -Wc++98-compat -verify %s
template<typename ...T> // expected-warning {{variadic templates are incompatible with C++98}}
class Variadic1 {};
template<template<typename> class ...T> // expected-warning {{variadic templates are incompatible with C++98}}
class Variadic2 {};
... | // RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s
template<typename ...T> // expected-warning {{variadic templates are incompatible with C++98}}
class Variadic1 {};
template<template<typename> class ...T> // expected-warning {{variadic templates are incompatible with C++98}}
class Variadic2 {};
... | Convert newly-added test from -std=c++0x to -std=c++11. | Convert newly-added test from -std=c++0x to -std=c++11.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@141904 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | 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,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/cl... |
68348038142b1cb0fdc5c969cacc3099c6dc07ed | lib/libbbn-ni-r.cpp | lib/libbbn-ni-r.cpp | #include "libbbn-ni-r.h"
//global to hold on to session handle
NiFpga_Session session;
bool isOpen = false;
//Initialize FPGA on loading the library -- constructor hook in header
void init() {
NiFpga_Status status = NiFpga_Initialize();
}
//Cleanup NI library -- destructor hook in header
void cleanup(){
if (isOp... | #include "libbbn-ni-r.h"
//global to hold on to session handle
NiFpga_Session session;
bool isOpen = false;
//Initialize FPGA on loading the library -- constructor hook in header
void init() {
NiFpga_Status status = NiFpga_Initialize();
}
//Cleanup NI library -- destructor hook in header
void cleanup(){
if (isOp... | Fix relative location of bitfile | Fix relative location of bitfile
| C++ | mit | BBN-Q/NI-RSeries,BBN-Q/NI-RSeries |
69b9c2b4822f0d1f279e03e9a8206d8f513f232d | cxx/core/ast/PlainPrinter.cpp | cxx/core/ast/PlainPrinter.cpp | #include "PlainPrinter.h"
PlainPrinterAction::PlainPrinterAction(const llvm::StringRef &filename) :
ASTAction<PlainPrinterAction>() {
OutputFile = std::make_shared<std::fstream>();
OutputFile->open(filename, std::fstream::out);
}
PlainPrinterAction::~PlainPrinterAction() {
OutputFile->close();
}
std::fstream... | #include "PlainPrinter.h"
PlainPrinterAction::PlainPrinterAction(const llvm::StringRef &filename) :
ASTAction<PlainPrinterAction>(),
OutputFile(std::make_shared<std::fstream>()) {
OutputFile->open(filename, std::fstream::out);
}
PlainPrinterAction::~PlainPrinterAction() {
OutputFile->close();
}
std::fstream ... | Change constructor to set OutputFile. | Change constructor to set OutputFile.
| C++ | mit | SavchenkoValeriy/rooster,SavchenkoValeriy/rooster,SavchenkoValeriy/rooster |
e8fb48684147d54f5088194d644a1966c5421b86 | src/insert_mode.cc | src/insert_mode.cc | #include <ncurses.h>
#include "../../../src/contents.hh"
#include "../../../src/key_aliases.hh"
#include "../../vick-move/src/move.hh"
void enter_insert_mode(contents& contents, boost::optional<int>) {
char ch;
while((ch = getch()) != _escape) {
contents.cont[contents.y].insert(contents.x, 1, ch);
... | #include <ncurses.h>
#include "../../../src/contents.hh"
#include "../../../src/key_aliases.hh"
#include "../../vick-move/src/move.hh"
void enter_insert_mode(contents& contents, boost::optional<int>) {
char ch;
contents.is_inserting = true;
while((ch = getch()) != _escape) {
contents.cont[contents... | Edit ``contents.is_inserting`` in insert modes | Edit ``contents.is_inserting`` in insert modes
| C++ | mpl-2.0 | czipperz/vick-insert-mode |
27921a4f6bba74ba1945c6b3f362b1c27797913f | wvtftpd.cc | wvtftpd.cc | #include "wvtftps.h"
int main()
{
WvTFTPs tftps("/tftpboot", 30*1000);
while (tftps.isok())
{
if (tftps.select(0))
tftps.callback();
}
wvcon->print("TFTPs is not okay; aborting.\n");
}
| #include "wvtftps.h"
int main()
{
WvTFTPs tftps("/tftpboot", 30, 30);
while (tftps.isok())
{
if (tftps.select(0))
tftps.callback();
}
wvcon->print("TFTPs is not okay; aborting.\n");
}
| Support for blksize option (RFC 2348). | Support for blksize option (RFC 2348).
git-svn-id: 4a4e6d3f3969003d0af9593019da3e8c357e24a8@300 6619c942-59fa-0310-bf43-a07aaa81d9ac
| C++ | lgpl-2.1 | wlach/wvtftpd |
151880b020e33e12a0286612ec450051bd16f8e8 | lib/Support/ManagedStatic.cpp | lib/Support/ManagedStatic.cpp | //===-- ManagedStatic.cpp - Static Global wrapper -------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===--------------------... | //===-- ManagedStatic.cpp - Static Global wrapper -------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===--------------------... | Define this in the correct n/s | Define this in the correct n/s
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@30671 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers... |
5289dd600b30fd4efea0ecdaedc51d892ecff135 | test/grisu-test.cc | test/grisu-test.cc | // Formatting library for C++ - Grisu tests
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#define FMT_USE_GRISU std::numeric_limits<double>::is_iec559
#include "fmt/format.h"
#include "gtest.h"
bool reported_skipped;
#undef TEST
#def... | // Formatting library for C++ - Grisu tests
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#define FMT_USE_GRISU std::numeric_limits<double>::is_iec559
#include "fmt/format.h"
#include "gtest.h"
bool reported_skipped;
#undef TEST
#def... | Test formatting of special numbers | Test formatting of special numbers
| C++ | bsd-2-clause | alabuzhev/fmt,cppformat/cppformat,cppformat/cppformat,alabuzhev/fmt,alabuzhev/fmt,cppformat/cppformat |
8daaa13d808a11026d30938093675c82c43d2a1c | test/lang/cpp/wchar_t/main.cpp | test/lang/cpp/wchar_t/main.cpp | //===-- main.c --------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- main.c --------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | Fix compile error in TestCxxWCharT on Linux | Fix compile error in TestCxxWCharT on Linux
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@239830 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb |
858273bc89e620fad7c18e477c6739a6e0598e4f | libevmjit/Runtime.cpp | libevmjit/Runtime.cpp |
#include "Runtime.h"
#include <llvm/IR/GlobalVariable.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/IntrinsicInst.h>
namespace dev
{
namespace eth
{
namespace jit
{
Runtime::Runtime(RuntimeData* _data, Env* _env) :
m_data(*_data),
m_env(*_env),
m_currJmpBuf(m_jmpBuf)
{}
bytes Runtime::getReturnData() const... |
#include "Runtime.h"
#include <llvm/IR/GlobalVariable.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/IntrinsicInst.h>
namespace dev
{
namespace eth
{
namespace jit
{
Runtime::Runtime(RuntimeData* _data, Env* _env) :
m_data(*_data),
m_env(*_env),
m_currJmpBuf(m_jmpBuf)
{}
bytes Runtime::getReturnData() const... | Handle return memory of size 0 and large offset | Handle return memory of size 0 and large offset
| C++ | mit | expanse-project/cpp-expanse,vaporry/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,smartbitcoin/cpp-ethereum,smartbitcoin/cpp-ethereum,gluk256/cpp-ethereum,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,joeldo/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,anthony-cros/cpp-ethereum,... |
f4cd4c0822cf29a2d9b933c4dfe000bef46ea88c | test/sanitizer_common/TestCases/Linux/assert.cc | test/sanitizer_common/TestCases/Linux/assert.cc | // Test the handle_abort option.
// clang-format off
// RUN: %clangxx %s -o %t
// RUN: not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s
// RUN: %env_tool_opts=handle_abort=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s
// RUN: %env_tool_opts=handle_abort=1 not... | // Test the handle_abort option.
// clang-format off
// RUN: %clangxx %s -o %t
// RUN: not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s
// RUN: %env_tool_opts=handle_abort=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s
// RUN: %env_tool_opts=handle_abort=1 not... | Simplify stack check in accert.cc Somehow on arm bots stack does not include main. | [sanitizer] Simplify stack check in accert.cc
Somehow on arm bots stack does not include main.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@318002 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
ce2892fe9db9fd95b650193a30c3e5bbf3e42ebc | examples/main.cpp | examples/main.cpp | #include <im_str/im_str.hpp>
#include <cstring>
#include <string>
#include <iostream>
int c_api_func(const char* str) {
return std::strlen( str );
}
int main() {
using namespace std::string_literals;
mba::im_str str1 = "Hello ";
auto greeting = mba::concat( str1, "World"s, "!" );
std::cout << greeting << std... | #include <im_str/im_str.hpp>
#include <cstring>
#include <string>
#include <iostream>
std::size_t c_api_func(const char* str) {
return std::strlen( str );
}
int main() {
using namespace std::string_literals;
mba::im_str str1 = "Hello ";
auto greeting = mba::concat( str1, "World"s, "!" );
std::cout << greetin... | Fix return type in c_api_func | [examples] Fix return type in c_api_func
| C++ | mit | tum-ei-rcs/mart-common,tum-ei-rcs/mart-common |
59c9643dd327db9c32b5a85702edf943cebcab2f | src/utils/dukbind_validation.cpp | src/utils/dukbind_validation.cpp | #include "dukbind_validation.h"
#include <regex>
namespace dukbind
{
namespace validation
{
static std::regex identifer_regex( "[a-zA-Z$_][a-zA-Z0-9$_]*" );
bool IsValidIdentifier( const char * identifier )
{
return std::regex_match( identifier, identifer_regex );
}... | #include "dukbind_validation.h"
#include <regex>
namespace dukbind
{
namespace validation
{
const std::regex & getIndentifierRegex()
{
static std::regex identifer_regex( "[a-zA-Z$_][a-zA-Z0-9$_]*" );
return identifer_regex;
}
bool IsValidIdentifier( con... | Fix issue with static order creation | Fix issue with static order creation
| C++ | mit | crazyjul/dukbind,crazyjul/dukbind |
7b73108fb7dc8bec6dd5edd2c370d18ac33a1475 | src/wrappers/ncurses/session.cpp | src/wrappers/ncurses/session.cpp | #include "session.h"
#include <ncurses.h>
namespace ncurses
{
std::shared_ptr < Panel > Session::panel;
void Session::init ()
{
// Standard ncurses init methods
initscr ();
cbreak ();
noecho ();
start_color ();
use_default_colors ();
refresh ();
... | #include "session.h"
#include <ncurses.h>
namespace ncurses
{
std::shared_ptr < Panel > Session::panel;
void Session::init ()
{
// Standard ncurses init methods
initscr ();
// Update every 2.5 seconds
halfdelay ( 25 );
noecho ();
start_color ();
use... | Implement automatic refreshing in ncurses::Session using halfdelay | Implement automatic refreshing in ncurses::Session using halfdelay
| C++ | mit | froozen/s-torrent,froozen/s-torrent,froozen/s-torrent |
fdbb481733e9101d053a282f6a46b268552a965f | variants/platforms/aerial_v3/usart_platform.cpp | variants/platforms/aerial_v3/usart_platform.cpp | #include "variant/usart_platform.hpp"
#include "hal.h"
// USART1 configuration
static const SerialConfig usart1_config = {
115200,
0,
USART_CR2_STOP1_BITS | USART_CR2_LINEN,
0
};
// USART3 configuration
static const SerialConfig usart3_config = {
115200,
0,
USART_CR2_STOP1_BITS | USART_CR2_LINEN,
0
}... | #include "variant/usart_platform.hpp"
#include "hal.h"
// USART1 configuration
static const SerialConfig usart1_config = {
38400,
0,
USART_CR2_STOP1_BITS | USART_CR2_LINEN,
0
};
// USART3 configuration
static const SerialConfig usart3_config = {
38400,
0,
USART_CR2_STOP1_BITS | USART_CR2_LINEN,
0
};
... | Reconfigure zeus for 38400 baud operation on USART1 and 3. | Reconfigure zeus for 38400 baud operation on USART1 and 3.
| C++ | mit | OSURoboticsClub/aerial_control,OSURoboticsClub/aerial_control,OSURoboticsClub/aerial_control |
3e9ac33cc52f272cb7e4a6f63f7ed27530ba48c9 | Sources/Rosetta/Enchants/Aura.cpp | Sources/Rosetta/Enchants/Aura.cpp | // This code is based on Sabberstone project.
// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
// RosettaStone is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
#include <Rosetta/Enchants/Aura.hpp>
#include <Rosetta/Models/... | // This code is based on Sabberstone project.
// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
// RosettaStone is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
#include <Rosetta/Enchants/Aura.hpp>
#include <Rosetta/Games/G... | Add code to add aura to game and battlefield | feat(card-impl): Add code to add aura to game and battlefield
| C++ | mit | Hearthstonepp/Hearthstonepp,Hearthstonepp/Hearthstonepp |
c5a362b4d3d7f73c643ef485105e6e3d274da78a | cmake/std_regex.cpp | cmake/std_regex.cpp | #include <regex>
#include <string>
int main() {
const std::string str = "test0159";
const std::regex re(
"^[a-z]+[0-9]+$",
std::regex_constants::extended | std::regex_constants::nosubs);
return std::regex_search(str, re) ? 0 : -1;
}
| #include <regex>
#include <string>
int main() {
const std::string str = "test0159";
std::regex re;
re = std::regex("^[a-z]+[0-9]+$",
std::regex_constants::extended | std::regex_constants::nosubs);
return std::regex_search(str, re) ? 0 : -1;
}
| Change std::regex detection test to detect bug in libstdc++. | Change std::regex detection test to detect bug in libstdc++.
libstdc++'s std::regex has (or had) a bug in std::regex::operator=(...) that
caused undefined behaviour. Clang will detect this and compile the function so
that it crashes at runtime. This patch tried to detect that bug during
configuration.
| C++ | apache-2.0 | chemhack/benchmark,bowlofstew/benchmark,chandlerc/benchmark,nickhutchinson/benchmark-cxx03,nickhutchinson/benchmark,xlqian/benchmark,disconnect3d/benchmark,fuchsia-mirror/third_party-benchmark,xlqian/benchmark,LepelTsmok/benchmark,fuchsia-mirror/third_party-benchmark,nickhutchinson/benchmark-cxx03,everbase/benchmark,go... |
17af928e976d38fc250c40fd01477eb6a34c1666 | vm/capi/file.cpp | vm/capi/file.cpp | #include "vm.hpp"
#include "vm/object_utils.hpp"
#include "capi/capi.hpp"
#include "capi/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
extern "C" {
VALUE rb_file_open(const char* name, const char* mode) {
NativeMethodEnvironment* env = NativeMethodEnvironment::get();
VALUE n = e... | #include "vm.hpp"
#include "vm/object_utils.hpp"
#include "capi/capi.hpp"
#include "capi/18/include/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
extern "C" {
VALUE rb_file_open(const char* name, const char* mode) {
NativeMethodEnvironment* env = NativeMethodEnvironment::get();
VALUE n ... | Fix wrong reference to header | Fix wrong reference to header
| C++ | bsd-3-clause | heftig/rubinius,kachick/rubinius,Azizou/rubinius,Azizou/rubinius,ngpestelos/rubinius,kachick/rubinius,slawosz/rubinius,heftig/rubinius,Azizou/rubinius,mlarraz/rubinius,travis-repos/rubinius,jsyeo/rubinius,jsyeo/rubinius,Wirachmat/rubinius,ngpestelos/rubinius,mlarraz/rubinius,kachick/rubinius,travis-repos/rubinius,slawo... |
f5dc8516d86078680cd55a909ab8ff295c795e38 | src/python/swarm.cpp | src/python/swarm.cpp | #include "../Swarm.h"
#include <Eigen/Core>
#include <pybind11/eigen.h>
#include <pybind11/functional.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace MetaOpt
{
namespace Python {
namespace py = pybind11;
void init_swarm(py::module &m) {
py::class_<Swarm>(m, "Swarm")
.def(py::init<const... | #include "../Swarm.h"
#include <Eigen/Core>
#include <pybind11/eigen.h>
#include <pybind11/functional.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace MetaOpt {
namespace Python {
namespace py = pybind11;
void init_swarm(py::module &m) {
auto constructor = py::init<const ParameterSpace &, con... | Add default parameters for constructor | Add default parameters for constructor
| C++ | mit | samueljackson92/optima,samueljackson92/metaopt,samueljackson92/optima,samueljackson92/metaopt |
49d9f64fda666abd7b0400deb89bd591e8579c9e | Math/NumberTheory/divisors.cpp | Math/NumberTheory/divisors.cpp | #include <algorithm>
#include <set>
using namespace std;
typedef set<int> si;
/* Get the divisors of a number */
si divisores(int n) {
vi d;
int r = sqrt(n);
for(int i = 1; i <= r; i++) {
if(n % i == 0) {
d.insert(i);
d.insert(n / i);
}
}
return d;
}
int ma... | #include <algorithm>
#include <math.h>
#include <set>
#include <stdio.h>
using namespace std;
typedef set<int> si;
/* Get the divisors of a number */
si divisores(int n) {
si d;
int r = sqrt(n);
for(int i = 1; i <= r; i++) {
if(n % i == 0) {
d.insert(i);
d.insert(n / i);
... | Solve some silly problems with the algorithm. | Solve some silly problems with the algorithm.
| C++ | mit | xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book |
d63995248cdbc28dfe5e3f59d884e5b25839fc60 | dependency_tree.cpp | dependency_tree.cpp | #include "dependency_tree.hpp"
#include "osal.hpp"
#include "file_exist.hpp"
#include "resolver.hpp"
#include <algorithm>
Resolver *DependencyTree::addTarget(const std::string &fileName)
{
auto &&res = tree.insert(std::make_pair(fileName, std::make_unique<Resolver>()));
if (!res.second)
throw std::runtime_err... | #include "dependency_tree.hpp"
#include "osal.hpp"
#include "file_exist.hpp"
#include "resolver.hpp"
#include <algorithm>
Resolver *DependencyTree::addTarget(const std::string &fileName)
{
auto &&res = tree.insert(std::make_pair(fileName, std::make_unique<Resolver>()));
if (!res.second)
throw std::runtime_err... | Fix multiple compilations for one file | Fix multiple compilations for one file | C++ | mit | antonte/coddle,antonte/coddle |
5c38f36f39dff4a4603a93bc470ad2401599998d | process_posix.cpp | process_posix.cpp | #ifndef PIPED_PROCESS_CPP
#define PIPED_PROCESS_CPP
#include<iostream>
class child_process_streambuf: public std::streambuf
{
public:
virtual int underflow()
{
}
virtual std::streamsize xsgetn(char* bufout,std::streamsize n)
{
}
virtual std::streamsize xsputn(const char* bufin,std::streamsiz... | #include<iostream>
#include<streambuf>
#include<unistd.h>
#include<cstdio>
#include<cerrno>
#include<stdexcept>
#include<system_error>
class process_streambuf_base: public std::streambuf
{
protected:
FILE* pipefile;
public:
enum ReadWriteType
{
READ_ONLY=0,
WRITE_ONLY
};
process_streambu... | Add posix process popen streambufs | Add posix process popen streambufs
| C++ | mit | Steve132/vidio,Steve132/vidio |
58787c35921c215444761e36c0751b45d405aa1c | example/main.cpp | example/main.cpp | //=======================================================================
// Copyright (c) 2017 Adrian Schneider
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//=====================================================================... | //=======================================================================
// Copyright (c) 2017 Adrian Schneider
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//=====================================================================... | Apply naming rule to dataSet -> dataset | Apply naming rule to dataSet -> dataset
| C++ | mit | wichtounet/mnist |
554c4188294480229821002e95751c863c328e38 | src/main.cpp | src/main.cpp | #include <HX711.h>
#include "TimerDisplay.h"
#include "GramsDisplay.h"
#include "SmoothingFilter.h"
#define DISP_TIMER_CLK 2
#define DISP_TIMER_DIO 3
#define DISP_SCALE_CLK 8
#define DISP_SCALE_DIO 9
#define FILTER_SIZE 10
#define HYSTERESIS_SIZE 0.1
#define LOAD_CELL_DT A2
#define LOAD_CELL_SCK A1
#define SCALE_FAC... | #include <HX711.h>
#include "TimerDisplay.h"
#include "GramsDisplay.h"
#include "SmoothingFilter.h"
#define DISP_TIMER_CLK 2
#define DISP_TIMER_DIO 3
#define DISP_SCALE_CLK 8
#define DISP_SCALE_DIO 9
#define FILTER_SIZE 10
#define HYSTERESIS_SIZE 0.1
#define LOAD_CELL_DT A2
#define LOAD_CELL_SCK A1
#define SCALE_FAC... | Add 500 ms delay on boot | Add 500 ms delay on boot
Fixes #11.
| C++ | mit | mortenfyhn/coffee-scales |
e2f70c22162711169d07e641390019ece180353d | chrome/browser/extensions/webrtc_cast_apitest.cc | chrome/browser/extensions/webrtc_cast_apitest.cc | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
class WebrtcCastApiTest :... | // 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 "chrome/browser/extensions/extension_apitest.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
class WebrtcCastApiTest :... | Disable webrtc cast api test | Disable webrtc cast api test
BUG=301920
TBR=mattm@chromium.org
Review URL: https://codereview.chromium.org/58953002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@232914 0039d316-1c4b-4281-b951-d872f2087c98
| C++ | bsd-3-clause | M4sse/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,Chilledheart/chromium,ltilve/chromium,littlstar/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,anirudhSK/chromium,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,TheTypoMaster/chromium-cr... |
49e5a88be13667d5aa05457c4f5247ef2629f246 | Problem010/C++/solution_1.cpp | Problem010/C++/solution_1.cpp | /**
* C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired.
*/
#include <iostream>
#include <cstdlib>
bool is_prime(unsigned int number);
int main(int argc, char* argv[])
{
const char *num = "2000000";
if(argv[1])
num = argv[1];
else if (argv[1] == "--help")
std... | /**
* C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired.
*/
#include <iostream>
#include <cstdlib>
#include <string.h>
bool is_prime(unsigned int number);
int main(int argc, char* argv[])
{
const char *num = "2000000";
if (strcmp(argv[1],"--help") == 0){
std::ce... | Fix after @rafaelcn did blame me crying about incorrect usage of cerr | Fix after @rafaelcn did blame me crying about incorrect usage of cerr
| C++ | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... |
0f52dd2295ae6cf39324ab7693f6f48f4ed685d7 | src/dinit-main.cc | src/dinit-main.cc | #include <iostream>
// Entry point for Dinit.
int dinit_main(int argc, char **argv);
int main(int argc, char **argv)
{
try {
return dinit_main(argc, argv);
}
catch (std::bad_alloc &badalloc) {
std::cout << "dinit: Out-of-memory during initialisation" << std::endl;
return 1;
}
... | #include <iostream>
#include <system_error>
#include <new>
// Entry point for Dinit.
int dinit_main(int argc, char **argv);
int main(int argc, char **argv)
{
try {
return dinit_main(argc, argv);
}
catch (std::bad_alloc &badalloc) {
std::cout << "dinit: Out-of-memory during initialisation"... | Add some missing includes, necessary on some platforms. | Add some missing includes, necessary on some platforms.
| C++ | apache-2.0 | davmac314/dinit,davmac314/dinit,davmac314/dinit |
18b14bdf8dea7992200aa1af9598cc35305fae51 | src/core/common/math.cpp | src/core/common/math.cpp | // Standard Dependencies
#include <cmath>
#include <random>
// Module Dependencies
#include "../include/math.h"
namespace native
{
static std::default_random_engine engine;
double Math::sqrt(double value)
{
return (double)std::sqrt((long double)value);
}
long double Math::random(long double min, long double ... | #ifdef __ANDROID__
double nan(const char*);
float nanf(const char*);
long double nanl(const char*);
#endif // __ANDROID__
// Standard Dependencies
#include <cmath>
#include <random>
// Module Dependencies
#include "../include/math.h"
namespace native
{
static std::default_random_engine engine;
double Math::sqrt... | Fix for libc++ not properly declaring nan() functions. | Fix for libc++ not properly declaring nan() functions.
| C++ | mit | mitchdowd/native,mitchdowd/native,mitchdowd/native |
248cacbf068fc84ff28616cb237b851c0048bfe0 | examples/console-app/main.cpp | examples/console-app/main.cpp | #include <QCoreApplication>
#include <QDebug>
#include "ganalytics.h"
class Watcher : public QObject
{
Q_OBJECT
public slots:
void onIsSendingChanged(bool sending)
{
if (sending)
return;
QCoreApplication::instance()->quit();
}
};
int main(int argc, char* argv[])
{
QC... | #include <QCoreApplication>
#include <QDebug>
#include "ganalytics.h"
class Watcher : public QObject
{
Q_OBJECT
public slots:
void onIsSendingChanged(bool sending)
{
if (sending)
return;
QCoreApplication::instance()->quit();
}
};
int main(int argc, char* argv[])
{
QC... | Set organization name to save settings | Set organization name to save settings
| C++ | bsd-3-clause | rggjan/qt-google-analytics |
22e4870dd7dc099130cd19c41874e23f35cc9db0 | test/event_condition_test.cc | test/event_condition_test.cc |
#include "test_common.h"
#include <evpp/exp.h>
#include <evpp/libevent_headers.h>
#include <evpp/libevent_watcher.h>
#include <thread>
namespace {
static bool g_event_handler_called = false;
static void Handle(struct event_base* base) {
g_event_handler_called = true;
event_base_loopexit(base, 0);
}
static v... |
#include "test_common.h"
#include <evpp/exp.h>
#include <evpp/libevent_headers.h>
#include <evpp/libevent_watcher.h>
#include <thread>
namespace {
static bool g_event_handler_called = false;
static void Handle(struct event_base* base) {
g_event_handler_called = true;
event_base_loopexit(base, 0);
}
static v... | Fix testPipeEventWatcher test case failed | Fix testPipeEventWatcher test case failed
| C++ | bsd-3-clause | Qihoo360/evpp,Qihoo360/evpp,Qihoo360/evpp,Qihoo360/evpp,Qihoo360/evpp |
099b220de0b1e00fc2c82125522bc881417e47ed | src/model/SketchItemEllipse.cpp | src/model/SketchItemEllipse.cpp | #include "SketchItemEllipse.h"
#include <QGraphicsEllipseItem>
SketchItemEllipse::SketchItemEllipse(qreal x, qreal y)
: SketchItemBezier(x, y)
{
addPath(QPointF(30, 0), QPointF(50, 20), QPointF(50, 50));
addPath(QPointF(50, 80), QPointF(30, 100), QPointF(0, 100));
addPath(QPointF(-30, 100), QPointF(-4... | #include "SketchItemEllipse.h"
#include <QGraphicsEllipseItem>
// Constants
static const uint TOP_INDEX = 12;
static const uint RIGHT_INDEX = 3;
static const uint BOTTOM_INDEX = 6;
static const uint LEFT_INDEX = 9;
SketchItemEllipse::SketchItemEllipse(qreal x, qreal y)
: SketchItemBezier(x, y)
{
ad... | Prepare bounding box transform for Ellipse | Prepare bounding box transform for Ellipse
| C++ | apache-2.0 | neuronalmotion/blueprint |
8b23479136d9e5ed1c107a5818c3916aaf312875 | src/CacheJsonToArticleConverter.cpp | src/CacheJsonToArticleConverter.cpp | #include "CacheJsonToArticleConverter.h"
ArticleCollection& CacheJsonToArticleConverter::convertToArticle(std::string json, ArticleCollection& articleCache)
{
return articleCache;
}
| #include "CacheJsonToArticleConverter.h"
#include <json/json.h>
#include "WalkerException.h"
#include "Article.h"
ArticleCollection& CacheJsonToArticleConverter::convertToArticle(std::string json, ArticleCollection& articleCache)
{
Json::Reader reader;
Json::Value document;
bool success = reader.parse(js... | Add implementation to cache reader | Add implementation to cache reader
| C++ | mit | dueringa/WikiWalker |
aaac08d3b20e7df96a96758d8b3c01d9742aa00c | src/ox/std/test/byteswap_test.cpp | src/ox/std/test/byteswap_test.cpp | /*
* Copyright 2015 - 2017 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <iostream>
#include <map>
#include <functional>
#includ... | /*
* Copyright 2015 - 2017 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <map>
#include <ox/std/std.hpp>
using namespace std;
u... | Fix some PowerPC issues in the byteswap test | Fix some PowerPC issues in the byteswap test
| C++ | mpl-2.0 | wombatant/wfs,wombatant/ox,wombatant/wfs,wombatant/memphis,wombatant/ox |
c1a5c046cd5e4bc66875bbf97d1ec72376e82093 | src/qt/test/test_main.cpp | src/qt/test/test_main.cpp | #include <QTest>
#include <QObject>
#include "uritests.h"
// This is all you need to run all the tests
int main(int argc, char *argv[])
{
URITests test1;
QTest::qExec(&test1);
}
| #include <QTest>
#include <QObject>
#include "uritests.h"
// This is all you need to run all the tests
int main(int argc, char *argv[])
{
bool fInvalid = false;
URITests test1;
if (QTest::qExec(&test1) != 0)
fInvalid = true;
return fInvalid;
}
| Return !0 when qt tests fail. | Return !0 when qt tests fail.
| C++ | mit | MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin |
d07668eefb982820ec51f14c3a0b9cc117bd1a43 | ykman-gui/main.cpp | ykman-gui/main.cpp | #include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <stdlib.h>
#include <QtGlobal>
#include <QtWidgets>
#include <QtSingleApplication>
int main(int argc, char *argv[])
{
// Only allow a single instance running.
QtSingleApplication app(argc, argv);
if (app.sendMessage(""... | #include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <stdlib.h>
#include <QtGlobal>
#include <QtWidgets>
#include <QtSingleApplication>
int main(int argc, char *argv[])
{
// Only allow a single instance running.
QtSingleApplication app(argc, argv);
if (app.sendMessage(""... | Modify window raise on windows | Modify window raise on windows
| C++ | bsd-2-clause | Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt,Yubico/yubikey-manager-qt |
36d798aeba862da1050306265f06c54a78908ba4 | src/utils.cc | src/utils.cc | #include <algorithm>
#include <cctype>
#include <sstream>
#include "cons.h"
#include "utils.h"
namespace mclisp
{
template<typename T>
std::string ContainerToString(T items)
{
std::ostringstream oss;
for(auto item : items)
oss << item;
return oss.str();
}
template std::string ContainerToString<>(std::set<... | #include <algorithm>
#include <cctype>
#include <sstream>
#include "cons.h"
#include "utils.h"
namespace mclisp
{
template<typename T>
std::string ContainerToString(T items)
{
std::ostringstream oss;
for(auto item : items)
oss << item;
return oss.str();
}
template std::string ContainerToString<>(std::set<... | Remove comment about where to put ShouldQuit. | Remove comment about where to put ShouldQuit.
| C++ | mit | appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp,appleby/mccarthy-lisp |
dec8cbd09fbc97503d039a2546f9db441d93e4fb | src/polyChecksum.cpp | src/polyChecksum.cpp | #include "polyChecksum.h"
PolyChecksum::PolyChecksum()
{
// for all possible byte values
for (unsigned i = 0; i < 256; ++i)
{
unsigned long reg = i << 24;
// for all bits in a byte
for (int j = 0; j < 8; ++j)
{
bool topBit = (reg & 0x80000000) != 0;
reg <<= 1;
if (topBit)
reg ^= _key;
}
_t... | #include "polyChecksum.h"
PolyChecksum::PolyChecksum()
{
// for all possible byte values
for (unsigned i = 0; i < 256; ++i)
{
unsigned long reg = i << 24;
// for all bits in a byte
for (int j = 0; j < 8; ++j)
{
bool topBit = (reg & 0x80000000) != 0;
reg <<= 1;
if (topBit)
reg ^= _key;
}
_t... | Fix out of bounds error on Linux. | Fix out of bounds error on Linux.
| C++ | mit | yantor3d/polySymmetry,yantor3d/polySymmetry |
87deb7c0fa08188e2b19329d0f63e70387485609 | UWPInjector/source/MinConsole.cpp | UWPInjector/source/MinConsole.cpp | #include <MinConsole.hpp>
#include <Windows.h>
#include <mutex>
namespace MinConsole
{
void* GetOutputHandle()
{
static void* Handle = nullptr;
std::once_flag HandleCached;
std::call_once(HandleCached, [=]()
{
Handle = GetStdHandle(STD_OUTPUT_HANDLE);
});
return Handle;
}
void SetTextColor(Color NewColor)
... | #include <MinConsole.hpp>
#include <Windows.h>
#include <mutex>
namespace MinConsole
{
void* GetOutputHandle()
{
static void* Handle = nullptr;
std::once_flag HandleCached;
std::call_once(HandleCached, []()
{
Handle = GetStdHandle(STD_OUTPUT_HANDLE);
});
return Handle;
}
void SetTextColor(Color NewColor)
{... | Remove capturing lambda capturing of static variable | Remove capturing lambda capturing of static variable
| C++ | mit | Wunkolo/UWPDumper |
23b6a64621be96135516bb3c7f6c65f2e19f4751 | source/dummy.cpp | source/dummy.cpp | //dummy file, so Android Studio will 'see' these folders
| /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | Add copyright notice required for open-sourcing | Add copyright notice required for open-sourcing
Test: builds OK
Change-Id: I1f148962d506ae697bc36f31aa8824082eea4171
| C++ | apache-2.0 | google/synthmark,google/synthmark,google/synthmark,google/synthmark,google/synthmark |
af7ba3b71fcbda1ee1bef496c712da65712574d3 | logicTest.cpp | logicTest.cpp | #include "logic.cpp"
#include <iostream>
#include <cstdlib>
int main( void );
void printCoords( block* b );
int rotationTest( void );
int main( void )
{
std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n";
exit( EXIT_SUCCESS );
}
void printCoords( block *b )
{
for( int i = 0; i < 4; ++... | #include "logic.cpp"
#include <iostream>
#include <cstdlib>
int main( void );
void printCoords( block* b );
int rotationTest( void );
int main( void )
{
std::cout << "Rotation Test : " << (rotationTest())? "PASSED\n" : "FAILED\n";
exit( EXIT_SUCCESS );
}
void printCoords( block *b )
{
for( int i = 0; i < 4; ++... | Add identifying block number in rotation test | Add identifying block number in rotation test
| C++ | apache-2.0 | MarkMcCaskey/tetrinos |
783ff80506f617b36c9cd2822d121f2f7c63697d | src/unicode-utils.cc | src/unicode-utils.cc | #include "unicode-utils.h"
#include <clocale>
#include <stdlib.h>
#include <string>
int UnicodeUtils::characters_in_bytes(const char* string, int bytes) {
if (bytes == 0)
return 0;
mblen(NULL, 0);
setlocale(LC_CTYPE, "en_US.UTF-8");
int characters = 0;
while (bytes > 0) {
int characterLength = mble... | #include "unicode-utils.h"
#include <clocale>
#include <stdlib.h>
#include <string.h>
int UnicodeUtils::characters_in_bytes(const char* string, int bytes) {
if (bytes == 0)
return 0;
mblen(NULL, 0);
setlocale(LC_CTYPE, "en_US.UTF-8");
int characters = 0;
while (bytes > 0) {
int characterLength = mb... | Include string.h instead of string | Include string.h instead of string
| C++ | mit | soldair/node-oniguruma,atom/node-oniguruma,soldair/node-oniguruma,alexandrudima/node-oniguruma,ceejbot/node-oniguruma,ceejbot/node-oniguruma,atom/node-oniguruma,dimitar-asenov/node-oniguruma,bpasero/node-oniguruma,ceejbot/node-oniguruma,soldair/node-oniguruma,atom/node-oniguruma,bpasero/node-oniguruma,alexandrudima/nod... |
572367314111c27a38fbabd41e50e504bc689d67 | src/types.cpp | src/types.cpp | #include "create/types.h"
namespace create {
RobotModel::RobotModel(const ProtocolVersion version, const float axleLength, const unsigned int baud, const float maxVelocity, const float wheelDiameter):
id(nextId),
version(version),
axleLength(axleLength),
baud(baud),
maxVelocity(maxVelocity),
... | #include "create/types.h"
namespace create {
RobotModel::RobotModel(const ProtocolVersion version, const float axleLength, const unsigned int baud, const float maxVelocity, const float wheelDiameter):
id(nextId),
version(version),
axleLength(axleLength),
baud(baud),
maxVelocity(maxVelocity),
... | Update wheel diameter for Create 2 | Update wheel diameter for Create 2
Now matches the spec from iRobot.
Signed-off-by: Jacob Perron <f862f167b85d41b225785c70d70808bc7337c1fe@openrobotics.org>
| C++ | bsd-3-clause | AutonomyLab/libcreate |
bea3c327af8c032d91a9b3603ba76a04edb0627a | test/test.cpp | test/test.cpp | #include "test.h"
#include "test-job.h"
#include "test-machine.h"
#include <iostream>
int main()
{
Test::TestSuite tests(std::cout);
{ // Job
std::shared_ptr<Test::Test> jt1(new Test::JobID);
tests.register_test(jt1);
std::shared_ptr<Test::Test> jt2(new Test::JobMachineName);
... | #include "test.h"
#include "test-job.h"
#include "test-machine.h"
#include <iostream>
#include <memory>
int main()
{
Test::TestSuite tests(std::cout);
// Set up tests - class Job
tests.register_test(std::make_shared<Test::JobID>());
tests.register_test(std::make_shared<Test::JobMachineName>());
... | Convert to std::make_shared() to avoid allocation overhead | Convert to std::make_shared() to avoid allocation overhead
This also tidies up the code in main() in a way that doesn't make it
susceptible to memory leaks.
| C++ | mit | mattportas/yejong |
1185d342ce16348faf348887d6b23130d1568879 | ouzel/audio/wasapi/AudioDeviceWASAPI.cpp | ouzel/audio/wasapi/AudioDeviceWASAPI.cpp | // Copyright 2015-2018 Elviss Strazdins. All rights reserved.
#include "AudioDeviceWASAPI.hpp"
namespace ouzel
{
namespace audio
{
AudioDeviceWASAPI::AudioDeviceWASAPI(Mixer& initMixer):
AudioDevice(Driver::WASAPI, initMixer)
{
}
} // namespace audio
} // namespace ouze... | // Copyright 2015-2018 Elviss Strazdins. All rights reserved.
#include <string>
#include <Audioclient.h>
#include <mmdeviceapi.h>
#include "AudioDeviceWASAPI.hpp"
namespace ouzel
{
namespace audio
{
class WASAPIErrorCategory : public std::error_category
{
public:
const char... | Create device enumerator and get default device for WASAPI | Create device enumerator and get default device for WASAPI
| C++ | unlicense | elnormous/ouzel,elvman/ouzel,elnormous/ouzel,elvman/ouzel,elnormous/ouzel |
57cb61142dfe076b681f414efc38e8a5d862b2b9 | src/graph_writer.cc | src/graph_writer.cc | /*
* Copyright (c) 2017-2018 Tuukka Norri
* This code is licensed under MIT license (see LICENSE for details).
*/
#include <vcf2multialign/graph_writer.hh>
namespace vcf2multialign
{
// Dummy implementation.
void graph_writer_impl::init(std::size_t n_rows)
{
graph.Init(n_rows);
}
void graph_writer_impl:... | /*
* Copyright (c) 2017-2018 Tuukka Norri
* This code is licensed under MIT license (see LICENSE for details).
*/
#include <vcf2multialign/graph_writer.hh>
namespace vcf2multialign
{
// Dummy implementation.
void graph_writer_impl::init(std::size_t n_rows)
{
graph.Init(n_rows);
}
void graph_writer_impl:... | Use the GFA output format | Use the GFA output format
| C++ | mit | tsnorri/vcf2multialign,tsnorri/vcf2multialign,tsnorri/vcf2multialign,tsnorri/vcf2multialign |
a25c09a00e21ab3cc9f473333d4fa5b5349fa6d7 | networkit/cpp/io/CoverReader.cpp | networkit/cpp/io/CoverReader.cpp | #include "CoverReader.h"
#include <fstream>
NetworKit::Cover NetworKit::CoverReader::read(std::string path, NetworKit::Graph &G)
{
std::ifstream file;
file.open(path);
if (!file.good()) {
throw std::runtime_error("unable to read from file");
}
Cover communities(G.upperNodeIdBound());
std::string line;
count ... | #include "CoverReader.h"
#include <fstream>
NetworKit::Cover NetworKit::CoverReader::read(std::string path, NetworKit::Graph &G)
{
std::ifstream file;
file.open(path);
if (!file.good()) {
throw std::runtime_error("unable to read from file");
}
Cover communities(G.upperNodeIdBound());
std::string line;
count ... | Support comments in Cover files | Support comments in Cover files
| C++ | mit | fmaschler/networkit,fmaschler/networkit,fmaschler/networkit,fmaschler/networkit,fmaschler/networkit,fmaschler/networkit |
7a52478b976b7fb8090fb6c3eee106fd77a63c11 | excercise05/03.cpp | excercise05/03.cpp | #include <stdio.h>
#include "../excercise04/make_random_data/make_random_data.hpp"
#include "../excercise04/sort/quick.hpp"
int get_index_smallest(const int k, int *data, const int start, const int end)
{
if(k < 0 || k > end) return -1; /* Base case */
int p = partition(data, start, end);
if(k == 0) retu... | #include <stdio.h>
#include "../excercise04/make_random_data/make_random_data.hpp"
#include "../excercise04/sort/quicksort.hpp"
int get_index_smallest(const int k, int *data, const int start, const int end)
{
if(k < 0 || k > end) return -1; /* Base case */
int p = partition(data, start, end);
if(k == 0) ... | Fix the not matching header file path | Fix the not matching header file path
* This commit due to commit 565888f949aabba22afad22d5d9a51568accfd32
| C++ | mit | kdzlvaids/algorithm_and_practice-pknu-2016,kdzlvaids/algorithm_and_practice-pknu-2016 |
97edd533393c8f745e1b29354dac5cc40ddbc221 | src/mirplatform.cpp | src/mirplatform.cpp | /* * This file is part of Maliit framework *
*
* Copyright (C) 2014 Dinesh Manajipet <saidinesh5@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* and appea... | /* * This file is part of Maliit framework *
*
* Copyright (C) 2014 Dinesh Manajipet <saidinesh5@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* and appea... | Check that region list isn't empty before attempting to retrieve a region from it | Check that region list isn't empty before attempting to retrieve a region from it
| C++ | lgpl-2.1 | Elleo/framework,Elleo/framework |
ea4176601d50fc3ddb9448fa66d9017a2dfdf6ac | examples/source/docs/my_panic.cpp | examples/source/docs/my_panic.cpp | #define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>
#include <iostream>
inline void my_panic(sol::optional<std::string> maybe_msg) {
std::cerr << "Lua is in a panic state and will now abort() the application" << std::endl;
if (maybe_msg) {
const std::string& msg = maybe_msg.value();
std::cerr << "\terror messag... | #define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>
#include <iostream>
inline void my_panic(sol::optional<std::string> maybe_msg) {
std::cerr << "Lua is in a panic state and will now abort() the application" << std::endl;
if (maybe_msg) {
const std::string& msg = maybe_msg.value();
std::cerr << "\terror messag... | Fix typo in exception documentation | Fix typo in exception documentation | C++ | mit | OrfeasZ/sol2,ThePhD/sol2,OrfeasZ/sol2,OrfeasZ/sol2,OrfeasZ/sol2,ThePhD/sol2,ThePhD/sol2,ThePhD/sol2 |
ff8a7f29a646964deb2c3722fb2c3aacc522dd14 | Magick++/fuzz/utils.cc | Magick++/fuzz/utils.cc | #include <Magick++/ResourceLimits.h>
#include <Magick++/SecurityPolicy.h>
#ifndef FUZZ_MAX_SIZE
#define FUZZ_MAX_SIZE 2048
#endif
class FuzzingLimits {
public:
FuzzingLimits() {
Magick::SecurityPolicy::maxMemoryRequest(256000000);
Magick::ResourceLimits::memory(1000000000);
Magick::ResourceLimits::map(5... | #include <Magick++/Functions.h>
#include <Magick++/ResourceLimits.h>
#include <Magick++/SecurityPolicy.h>
#ifndef FUZZ_MAX_SIZE
#define FUZZ_MAX_SIZE 2048
#endif
class FuzzingInitializer {
public:
FuzzingInitializer() {
Magick::InitializeMagick((const char *) NULL);
Magick::SecurityPolicy::maxMemoryRequest(... | Call InitializeMagick to make sure all initializers are called. | Call InitializeMagick to make sure all initializers are called.
| C++ | apache-2.0 | Danack/ImageMagick,Danack/ImageMagick,Danack/ImageMagick,Danack/ImageMagick,Danack/ImageMagick,Danack/ImageMagick |
77cbd5f398e0bb43c0873e6990da779a5e327e30 | lib/asan/asan_preinit.cc | lib/asan/asan_preinit.cc | //===-- asan_preinit.cc ---------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- asan_preinit.cc ---------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | Switch to AsanInitFromRtl in .preinit_array. | [asan] Switch to AsanInitFromRtl in .preinit_array.
There is no functionality change due to a check in AsanActivate.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@221882 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
500397651daaaa8ca1c646cf6a7dee2eb029a3bf | tests/heaps_test.cpp | tests/heaps_test.cpp | #define NO_EXTERN
#include"variables.hpp"
#include"processes.hpp"
#include<iostream>
int main(int argc, const char* argv[]){
globals.reset(new Globals());
NILATOM = globals->lookup("nil");
TATOM = globals->lookup("t");
/*tests!*/
Process proc;
/*allocate stuff*/
//(cons t ...)
proc.stack.push(new(proc) Sym(TA... | #include"variables.hpp"
#include"processes.hpp"
#include<iostream>
int main(int argc, const char* argv[]){
variables_init();
/*tests!*/
Process proc;
/*allocate stuff*/
//(cons t ...)
proc.stack.push(new(proc) Sym(TATOM));//t
//(cons t nil)
proc.stack.push(new(proc) Sym(TATOM)); //t
proc.stack.push(new(proc)... | Test now initializes using variables_init() | Test now initializes using variables_init()
| C++ | bsd-2-clause | AmkG/snap |
b1a46af3e84c49b3f05083812a31300c4148920b | primality-test.cpp | primality-test.cpp | #include<cmath>
#include<iostream>
using namespace std;
bool isPrimeBruteForce(double x)
{
if (x < 2)
return false;
double sqroot_x = sqrt(x);
for(int i=0; i <= sqroot_x; i++) { /* If there were only factors above the square root of x, they would be bigger than x itself. */
if (x%i==0)
return false;
}
ret... | #include<math.h>
#include<stdio.h>
/*#include<iostream>
using namespace std;*/
int isPrimeBruteForce(int x)
{
if (x < 2)
return false;
double sqroot_x;
sqroot_x = sqrt (x);
for(int i=0; i <= sqroot_x; i++) { /* If there were only factors above the square root of x, they would be bigger than x itself. */
if (x... | Replace c++ libraries by c standard libraries, make working for c language too | Replace c++ libraries by c standard libraries, make working for c language too
| C++ | mit | luforst/primality-test,luforst/primality-test |
b401e07df06e88dc144a5ebb8e01ac70d84baf5c | test/CodeGenCXX/DynArrayInit.cpp | test/CodeGenCXX/DynArrayInit.cpp | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
// PR7490
int main() {
// CHECK: {{for.cond:|:4}}
// CHECK: %{{.*}} = icmp ult i64 %{{.*}}, 1133
// CHECK: {{for.body:|:6}}
// CHECK: store i8 0
// CHECK: br label %{{for.inc|7}}
// CHECK: {{for.inc:|:7}}
// CHECK: %{{.*}}... | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O3 -emit-llvm -o - %s | FileCheck %s
// PR7490
// CHECK: define signext i8 @_Z2f0v
// CHECK: ret i8 0
// CHECK: }
inline void* operator new[](unsigned long, void* __p) { return __p; }
static void f0_a(char *a) {
new (a) char[4]();
}
char f0() {
char a[4];
f0_a(a... | Rewrite test to check intent instead of implementation. | tests: Rewrite test to check intent instead of implementation.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@107024 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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/cl... |
172867e0232bb7870a00ad4090971fa423ea5a18 | ex/bm_chars.tas.cpp | ex/bm_chars.tas.cpp | #include "common.th"
#include "vga.th"
_start:
prologue
b <- 0 // indicate non-completion to testbench
call(init_display)
restart:
c <- 0
j <- @VGA_BASE
k <- (ROWS * COLS)
k <- k + j
top:
c -> [j]
c <- c + 1
c <- c & 0xff
j <- j + 1
n <- j < k
p <- @... | #include "common.th"
#include "vga.th"
_start:
prologue
b <- 0 // indicate non-completion to testbench
call(init_display)
restart:
c <- 0
j <- @VGA_BASE
k <- (ROWS * COLS)
k <- k + j
top:
c -> [j]
c <- c + 1
c <- c & 0xff
j <- j + 1
n <- j < k
p <- @... | Make bm_chars match its internal comment | Make bm_chars match its internal comment
| C++ | mit | kulp/tenyr,kulp/tenyr,kulp/tenyr |
a00817adbed520588ad03acfa0dc75ddbdb7aa82 | test/Modules/odr_hash-Friend.cpp | test/Modules/odr_hash-Friend.cpp | // RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/modules.cache \
// RUN: -I %S/Inputs/odr_hash-Friend \
// RUN: -emit-obj -o /dev/null \
// RUN: -fmodules \
// RUN: -fimplicit-module-maps \
// RUN: -fmodules-cache-path=%t/modules.cache \
// RUN: -std=c++11 -x c++ %s -verify
// UNSUPPORTED:... | // RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/modules.cache \
// RUN: -I %S/Inputs/odr_hash-Friend \
// RUN: -emit-obj -o /dev/null \
// RUN: -fmodules \
// RUN: -fimplicit-module-maps \
// RUN: -fmodules-cache-path=%t/modules.cache \
// RUN: -std=c++11 -x c++ %s -verify
// PR35939: Mic... | Add context to why test was disabled on Windows | Add context to why test was disabled on Windows
test/Modules/odr_hash-Friend.cpp triggers an assertion in MicrosoftMangle.cpp
This has been reported in PR35939
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@322593 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/cl... |
d8d7c61b39b147acf7b9909add3b934c18cd5187 | src/gptest.cpp | src/gptest.cpp | int main(int argc, char **argv)
{
return 0;
}
| #include "heap.h"
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <glibmm/error.h>
int main(int argc, char **argv)
{
VM::Heap heap;
const size_t ARR_SIZE = 128;
const size_t TEST_SIZE = 50;
size_t ptrs[ARR_SIZE] = { 0 };
srand(0);
try
{
for(size_t i = 0; i < TEST_SIZE; i ++)
{
size_t in... | Add test for allocation/freeing heap. | Add test for allocation/freeing heap.
| C++ | mit | o01eg/gfp,o01eg/gfp,o01eg/gfp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.