blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
0fd58e59368e12220f1bac8f5ef6feddd1fa69b7 | 60e9fb3c606381cf508ca561b953f8ddee9047c9 | pondus314/random | /lsksp201718/dfs/leaves.cpp | C++ | cpp | 403 | no_license | #include<bits/stdc++.h>
using namespace std;
int main() {
int n, x, y;
cin>>n;
vector<vector<int> > hrany(n);
for(int i = 0; i < n-1; i++) {
cin>>x>>y;
hrany[x-1].push_back(y-1);
hrany[y-1].push_back(x-1);
}
int ans = 0;
for(int i = 0; i < n; i++) {
if (hrany... |
f20821974a904cc80a746bbd69c591256e4848df | a9a39743e09ea0155ec61f7e52185580f29edbf0 | manadsawi/geant4-tutorial | /009/source/MyDetector.cpp | C++ | cpp | 5,710 | permissive | #include "MyDetector.h"
#include "G4Box.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4SubtractionSolid.hh"
#include "G4OpticalSurface.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4VisAttributes.hh"... |
4c56de827121740cf1913b25382fd617b95d6022 | 7e69fdab6cd653f692e06660c858bdbb22c2a262 | jaivrat/c-algo | /max_drawdown.cpp | C++ | cpp | 1,264 | no_license | //
// max_drawdown.cpp
//
//
// Created by Jai Vrat Singh
//
#include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
#include <random>
#include <numeric>
template<typename T>
void printContents(std::vector<T>& v, const char* sep= " ")
{
std::cout << std::endl;
std::copy(v.begin(), v.end(... |
95ac34204541b419aa50e1c395f74694fba6aae1 | 5983848dd582d17d89f66e42e8997ce3cfc6bd2e | nonstop/financier | /FinDatabase.cpp | C++ | cpp | 11,912 | no_license |
#include <QtSql>
#include <QDebug>
#include "common.h"
#include "FinDatabase.h"
#include <QTreeWidget>
FinDatabase::FinDatabase()
{}
FinDatabase::~FinDatabase()
{
closeDatabase();
}
FinDatabase *FinDatabase::Instance()
{
static FinDatabase *fd = NULL;
if (!fd)
fd = new FinDatabase;
retur... |
76908fba93ed6edb3f1a819cce3d2ba593fa4374 | 68de48013c067fd2ba63ad42196ecb0c8a9168c9 | sqfasd/asch-node | /deps/v8/test/compiler-unittests/change-lowering-unittest.cc | C++ | cc | 8,894 | permissive | // Copyright 2014 the V8 project 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 "src/compiler/change-lowering.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/node-properti... |
e4bca77df185df6754d56f3649922093e41c9409 | ed5f5216a73707210fa001643764452829bbbbb7 | sunshine1997/C-program-2016spring | /assignment2/大奇小偶之差值.cpp | C++ | cpp | 463 | no_license | #include<iostream>
using namespace std;
int main()
{
int a[6];
for (int i=0;i<6;i++){
cin>>a[i];}
for (int i=0;i<5;i++){
for(int j=1;j<6-i;j++){
bool leftiseven = a[j-1]%2==0;
bool rightiseven = a[j]%2==0;
if((!leftiseven&&rightiseven)||
(a[j-1]>a[j]&&(leftiseven==rightiseven)))
{
int temp =a[... |
adb9a6ed504494657e45bb2b4689d1d5752b2f1e | 588602a1ec84a54dc0d35dc41cbbe2027f8e2153 | andriibugaiov/cpp_Data_Structures | /Node/ABNodeKeyValue.cpp | C++ | cpp | 1,828 | permissive | //
// ABNodeKeyValue.cpp
// workplace
//
// Created by Andrii Bugaiov on 2015-02-27.
// Copyright (c) 2015 Andrii Bugaiov. All rights reserved.
//
#include "ABNodeKeyValue.h"
#include "ABEdge.h"
#include "ABVertex.h"
template <typename T>
ABNodeKeyValue<T>::ABNodeKeyValue(int aKey) : ABNode<T>(), _key(aKey)
{
... |
c334c978d30cabc86ce19cd3eb7ae41751126d69 | c48c984415263bfe02f41585b0e2dd025be77f41 | MichelfrancisBustillos/CIS111---C-Programming | /C-A02/C-A02/Source.cpp | C++ | cpp | 1,776 | no_license | // Preprocessor Directives
#pragma warning(disable:4996) // To enable deprecated scanf()
#include <stdio.h>
#include <math.h>
void main() {
// Declare Variables
int menuOption = 0;
// Prompts
printf("1.) Centimeters To Inches\n");
printf("2.) 2D Distance Formula\n");
printf("3.) Pyramid Surface Area\n");
print... |
d2d7a2287938914147f70c37fed14d2986e7231a | 3d90c7e7a55604c4678295bec1ef786ff56b2600 | aplqo/exercises | /others/2020.07/2020.07.06-Exam/T137406-Matrix.cpp | C++ | cpp | 2,270 | no_license | #ifdef APTEST
#include "debug_tools/program.h"
#endif
#include <algorithm>
#include <iostream>
#include <iterator>
using namespace std;
const unsigned int maxn = 100000;
constexpr unsigned long long mod = 1e9 + 7;
class Number {
public:
constexpr Number() = default;
constexpr Number(const unsigned long long v) : ... |
53e4c751978fd673046e7392fbb9a15fc9b932a5 | 077f28b81933c03514b307212284693d4d7b457a | spinicist/riesling | /src/filter.cpp | C++ | cpp | 2,905 | permissive | #include "filter.hpp"
#include "log.hpp"
#include "tensorOps.hpp"
#include "threads.hpp"
#include <functional>
namespace rl {
inline float Tukey(float const &r, float const &sw, float const &ew, float const &eh)
{
if (r > ew) {
return 0.f;
} else if (r > sw) {
return (0.5f * ((1 + eh) + (1 - eh) * cos((M... |
a68fb08dd3e39bb324451381964c23b39b337bac | 0a52e7d209454067999679f5e0914c2a56ada9a5 | aws/aws-sdk-cpp | /generated/src/aws-cpp-sdk-servicecatalog-appregistry/source/model/ResourceInfo.cpp | C++ | cpp | 2,052 | permissive | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/servicecatalog-appregistry/model/ResourceInfo.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
names... |
cf32c27c4c664642606599da8ab53d8656e5d6ba | b90d33a7a47d006744f0fb9ea462299026063f6d | 2bite/ARK-SDK | /SDK/ARKSurvivalEvolved_DinoDropInventoryComponent_Carnivore_Huge_MegaFireWyvern_classes.hpp | C++ | hpp | 1,076 | permissive | #pragma once
// ARKSurvivalEvolved (332.8) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_DinoDropInventoryComponent_Carnivore_Huge_MegaFireWyvern_structs.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Classes
//----------------... |
89c52eb0d3b5f31ca795afce73f4b2bcf5345546 | 0c0ad7bb0c7a985f2c61efc70cc0fd02d1a4ec08 | elCrespo16/JutgeProblems | /P17179.cc | C++ | cc | 520 | no_license | #include <iostream>
using namespace std;
void max_min(int b) {
cout.setf(ios::fixed);
cout.precision(4);
double max, min, n, med;
cin >> n;
max = n;
min = n;
med = n;
for(int i = 1;i < b;++i) {
cin >> n;
if (n > max) max = n;
if (n < min) min = n;
med = med + n;
}
cout << m... |
2888a38f282ce9078c92a7422cc687057c358e23 | e36ac1d570d29cb13c7c147a9c98da15ca0f6c93 | SREERAGI18/chromium | /chromeos/services/secure_channel/fake_file_payload_listener.cc | C++ | cc | 1,304 | permissive | // Copyright 2021 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 "chromeos/services/secure_channel/fake_file_payload_listener.h"
#include <vector>
#include "base/bind.h"
#include "chromeos/services/secure_cha... |
cf182467f4e2b7e0520654b1d67c1c12aa19be79 | 06ebb341cb1185543a7d77c81b4049d38b674669 | LuDuda/ot-br-posix | /src/backbone_router/backbone_agent.hpp | C++ | hpp | 4,743 | permissive | /*
* Copyright (c) 2020, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* n... |
9c0facb6bbe83f3b1ca54104d55d2462331fc86b | 912479d688795b7bfc571dfdd30b94fe1eb7e4c1 | Orygin/BisounoursParty | /src/game/shared/hl2mp/weapon_hl2mpbase.cpp | C++ | cpp | 7,656 | no_license | //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "in_buttons.h"
#include "takedamageinfo.h"
#include "ammodef.h"
#include "hl2mp_ga... |
7feb649523793fe6e0509f127dcbe9cbd2a967d5 | ec235758907ecf6835460c85810b9c8a5fc8753e | ondravondra/adobo-ie | /magpie/SalsitaContentApi.cpp | C++ | cpp | 4,903 | no_license | #include "stdafx.h"
#include "SalsitaContentApi.h"
#include <vector>
CSalsitaContentApi::CSalsitaContentApi() : m_PopupIndexSeq(0)
{
}
HRESULT CSalsitaContentApi::Create(IDispatch *& pRet, LPUNKNOWN pClientSite)
{
CComObject<CSalsitaContentApi> *newObject = NULL;
IF_FAILED_RET(CComObject<CSalsitaConten... |
26f5e18de1daaca93e1784f13df4f52645d9f7e6 | 6c323459aa42046f565b69aa52a8ee75095293f0 | arielm/chronotext-cross | /core/src/chr/win/system/SystemManager.cpp | C++ | cpp | 641 | permissive | #include "chr/win/system/SystemManager.h"
#include "chr/cross/Context.h"
using namespace std;
namespace chr
{
namespace system
{
void Manager::setup(const InitInfo &initInfo)
{
updateInfo();
LOGI << "SYSTEM INFO: " << info << endl; // LOG: VERBOSE
}
// ---
void Manager::updateIn... |
0fd5632c55fc4e7aa57eae3f16cc40b11b3dc4b3 | d9fc9633e7c5bf14b3851d276c65b9f257b295cd | kohyatoh/contests | /codeforces/problemset/83E/83E.cpp | C++ | cpp | 982 | no_license | #include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define INF (1<<28)
inline void cmin(int &a, int b) { if(a>b) a = b; }
int n, L;
vector<int> dp[21];
char s[32];
int to_i(char *p) {
int a = 0;
while(*p) a = a*2+*p++-'0';
return a... |
c9b626ba55fed06bd6b25f20592cda63842c3107 | 9d2a90f941e2de485aa4dc2eb75f0253ab715849 | dpharris/openmrn-1 | /applications/io_board/targets/freertos.armv7m.ek-tm4c1294xl/config.hxx | C++ | hxx | 2,927 | permissive | #ifndef _APPLICATIONS_IO_BOARD_TARGET_CONFIG_HXX_
#define _APPLICATIONS_IO_BOARD_TARGET_CONFIG_HXX_
#include "nmranet/ConfiguredConsumer.hxx"
#include "nmranet/ConfiguredProducer.hxx"
#include "nmranet/ConfigRepresentation.hxx"
#include "nmranet/MemoryConfig.hxx"
namespace nmranet
{
/// Defines the identification in... |
70b31dea66b1ba25869b7f9726a146a1043fc844 | d9232e04d27587fbe40a3552e954cec35d7b943c | mukulsinghal407/e-box-UTA018 | /6.ExceptionHandling/i-Design/Q3/InvalidDateException.cpp | C++ | cpp | 235 | no_license | #include <exception>
using namespace std;
class InvalidDateException: public exception{
public:
InvalidDateException(){}
const char* what()
{
return "InvalidDateException:Please enter the date again";
}
};
|
3bbd214ceaca622088779602555b94b4438b65fd | c901622a8f4546960b3e76ea71002138566ceabe | kinllon2/LEARN_PAT | /PAT_Test/1021 Deepest Root(25分)/Deepest_Root/Deepest_Root/main.cpp | C++ | cpp | 1,454 | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<vector<int>> rect;
bool visit[10002];
int comments=0;
void dfs(int rootindex, int level, int &height)
{
visit[rootindex] = true;
if (height < level)
{
height = level;
}
for (int i = 0; i < rect[rootindex].size(); i++)
{
int... |
4f1abafb42b3cfffa2fd8599072ba0e33358f171 | e419abcdc24f7890aa2c361126e835bdd915e4be | jonipham/WZanalysis_release21 | /XAMPPbase/Root/TruthDecorations.cxx | C++ | cxx | 1,073 | no_license | #include <XAMPPbase/AnalysisUtils.h>
#include <XAMPPbase/TruthDecorations.h>
namespace XAMPP {
TruthDecorations::TruthDecorations() :
ParticleDecorations(),
charge("charge"),
pt_orig("pt_orig"),
eta_orig("eta_orig"),
phi_orig("phi_orig"),
m_orig("m_orig"),
pt... |
729d89736a9afc34d35349d67001cfc326f8a4b9 | fbfc4881e70d0c368d1a165d821dab5569e98b03 | JadeGeek/Halide | /src/CodeGen_X86.cpp | C++ | cpp | 27,658 | permissive | #include "CodeGen_Posix.h"
#include "ConciseCasts.h"
#include "Debug.h"
#include "IRMatch.h"
#include "IRMutator.h"
#include "IROperator.h"
#include "LLVM_Headers.h"
#include "Simplify.h"
#include "Util.h"
namespace Halide {
namespace Internal {
using std::string;
using std::vector;
using namespace Halide::ConciseCa... |
18e4d2caf5cbd0a7184433f8b66cc3ba04da2113 | dc14fbda244e63663a10ae4ccaaed40296e468b3 | tlindsay/UNA | /CS255/Lab10-Hashing Table/Source Files/show10.cpp | C++ | cpp | 300 | no_license | // show10.cpp: contains implementation of the HashTable showStructure function
//template <typename DataType, typename KeyType>
//void HashTable<DataType, KeyType>::showStructure() const {
// for (int i = 0; i < tableSize; ++i) {
// cout << i << ": ";
// dataTable[i].writeKeys();
// }
//}
//
|
ba457319c698ecf33be38cbcaa345ed3780642dd | 28213b43f26b4976173cf0a49d8617b041d419b2 | Mentos-/Mordhau_SDK | /SDK/Mordhau_BP_Mace_InvaderHead_functions.cpp | C++ | cpp | 3,383 | no_license | // Mordhau (Dumped by Hinnie) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "../SDK.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Functions
//---------------------------------------------------------------------------
// Function BP... |
d2bbb9723711a9f10c785d0efd284ec33d941696 | 2ce166610fc8a2e7437d97eed7cc443a6dbe11e4 | JadenDurnford/GooseProject | /gooseEscapeMain.cpp | C++ | cpp | 6,083 | no_license | /*
gooseEscapeMain.cpp
Jaden Durnford and Dennis Li
*/
#include <BearLibTerminal.h>
#include <cmath>
#include <ctime>
#include <iostream> // Debugging tip: You can still use cout to put debug messages on the regular console window
using namespace std;
#include "gooseEscapeUtil.hpp"
#include "gooseEscapeActor.hpp"
#in... |
81bf1c98e84292cd215faddba2ea09145c4fb660 | f959d68cddfbec030026fa9442c8761ef5332899 | MukundVaradarajan/hpx | /libs/logging/include/hpx/logging/format/formatter/spacer.hpp | C++ | hpp | 7,198 | permissive | // spacer.hpp
// Boost Logging library
//
// Author: John Torjo, www.torjo.com
//
// Copyright (C) 2007 John Torjo (see www.torjo.com for email)
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http... |
50c89c3c529f9f9f45995a402524cb9f59da3fb6 | 8bcc64a2bb124fed42637140dcdb539390223de9 | JuanMeloSerrano/Trabajos-de-programacion | /Gutierrez_Hidalfo/Matrices/prueba.cpp | C++ | cpp | 1,717 | no_license |
//Suma de dos matrices, debe coincidir i=fila; j=columna
#include <stdio.h>
int main()
{int m,n,f,c,i,j,k;
float A[100][100],B[100][100],C[100][100];
printf("\n---------------------------------------------------\n");
printf("\nINGRESE LA FILA Y COLUMNA DE LA PRIMERA MATRIZ\n");
scanf("%d",&m);
scanf("%d",&n);
printf("... |
c72d6b3bd8bf1da0bb7cee8532bf7a134463933c | 403b5a942eeb59fbbf6024554bded052d7742e76 | tarini92/AlgoDS | /fibonaccitwist.cpp | C++ | cpp | 480 | no_license | #include<iostream>
#include<ctime>
#include<sys/time.h>
using namespace std;
int fibo(int);
int main()
{
int n = 38;
//timespec ts;
clock_t begin = clock();
//clock_gettime(CLOCK_REALTIME, &ts);
cout<<fibo(n)<<endl;
clock_t end = clock();
cout<<(double)(end-begin)/CLOCKS_PER_SEC;
// clock_gettime(CLOCK_... |
f6d59ce5795a8dd3ea64fd2be6a6db7862c83165 | 3d06bffba05be4b4d370228c077151398a355504 | jimmysue/playground | /main.cpp | C++ | cpp | 209 | no_license | #include <iostream>
#include <nlohmann/json.hpp>
#include <fmt/format.h>
using json = nlohmann::json;
int main(int, char **)
{
std::cout << "Hello, world!\n";
json v = {"key", "value"};
fmt
}
|
17d8654887776ad9ab6a2e15b39f7ff62b326864 | c46dbfb4a03bfe5bff66f3a7b5787ebce84d8b13 | pauls-gh/adventofcode_2020 | /adventofcode_2020/day3.cpp | C++ | cpp | 1,531 | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <stdint.h>
using namespace std;
void printmap(vector<vector<int>> &map)
{
for (size_t i = 0; i < map.size(); i++) {
for (size_t j = 0; j < map[i].size(); j++) {
cout << map[i][j];
}
cout << endl;
}
}
int getnumtrees(int x... |
acef09e29dc48e8fc9d148a879471cc3f5883427 | 8747d83d7e7182e9d86506f84a9e69209c10e680 | mkevac/rocksdb | /table/block_based_table_reader.cc | C++ | cc | 54,189 | permissive | // Copyright (c) 2013, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
// Copyright (c) 2011 The... |
32dffdd8ad96db4bdfcdb7e300e73ca545705ed1 | ead26a8d796f5003a05cd666bb3424bc3ccc27c6 | LaCulotte/chinko_bot | /chinko_bot/types/game/context/roleplay/HumanOptionGuild.cpp | C++ | cpp | 369 | no_license | #include "HumanOptionGuild.h"
bool HumanOptionGuild::serialize(sp<MessageDataBuffer> output) {
HumanOption::serialize(output);
guildInformations.serialize(output);
return true;
}
bool HumanOptionGuild::deserialize(sp<MessageDataBuffer> input) {
HumanOption::deserialize(input);
if(!guildInformations.deseria... |
e7dd260859d80abc366d2a2de9c4f394c35c6079 | 19db5cf843fe8dc5f78966eb6df02f102017a856 | wazedxwxx/saras | /lib/force/buoyantForce.cc | C++ | cc | 3,013 | permissive | /********************************************************************************************************************************************
* Saras
*
* Copyright (C) 2019, Mahendra K. Verma
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are pe... |
4440e7e13b536bf555b184a4608f5f7dff88608f | e38bdd85997a6e4196ee1dd02246aed12844959f | phernst/ctl | /modules/src/gui/widgets/extensionchainwidget.cpp | C++ | cpp | 7,177 | permissive | #include "extensionchainwidget.h"
#include "ui_extensionchainwidget.h"
static QString firstLine()
{
return QStringLiteral("auto myProjector = CTL::makeProjector<CTL::OCL::RayCasterProjector>()");
}
namespace CTL {
namespace gui {
ExtensionChainWidget::ExtensionChainWidget(QWidget* parent)
: QWidg... |
a8fb69c9163ff4f7449c38b5ccd5c39197cb4e1c | a2a72953f8107a8dd75051d34872c1f838af489e | misterupkeep/functional-concepts | /include/functional/pair/functor.hpp | C++ | hpp | 270 | no_license | #pragma once
#include <functor.hpp>
#include <utility>
template<typename A, typename Function, typename B>
auto
fmap(Function&& fun, std::pair<A, B> functor)
{
return std::pair<invoke_return_t<Function, A>, B>
{ fun(std::get<0>(functor)), std::get<1>(functor) };
}
|
02423c270091e8eedaffca659d270a258e291941 | f00cd1c34cecb115adc289ca7303ed21c2a1ae09 | kyx0r/FA_Patcher | /boost_lib/boost/format/alt_sstream.hpp | C++ | hpp | 6,110 | permissive | // ----------------------------------------------------------------------------
// alt_sstream.hpp : alternative stringstream
// ----------------------------------------------------------------------------
// Copyright Samuel Krempp 2003. Use, modification, and distribution are
// subject to the Boost Software Lice... |
692085746889aca30aea3bd3908fc41b114eff83 | e7f81bd8fce35988a0e470d048530432addb965c | yamanmalkoc/Auto-Image-Filler | /testFills.cpp | C++ | cpp | 6,431 | no_license | #define CATCH_CONFIG_MAIN
#include "cs221util/catch.hpp"
#include <limits.h>
#include <vector>
#include <sys/stat.h>
#include <iostream>
#include "cs221util/PNG.h"
#include "cs221util/HSLAPixel.h"
#include "filler.h"
#include "stripeColorPicker.h"
#include "rainbowColorPicker.h"
#include "borderColorPicker.h"
using na... |
30e3c815f287cf3e589c4716c46688298121768d | 2ae92850dc45aa97561d0116238a7aadccce9c1b | Znigneering/CSCI-3154 | /graph-tool-2.27/src/graph/correlations/graph_correlations.hh | C++ | hh | 5,528 | permissive | // graph-tool -- a general graph modification and manipulation thingy
//
// Copyright (C) 2006-2018 Tiago de Paula Peixoto <tiago@skewed.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation;... |
03a9520278b770f70443320160157bbffecc567b | f469852cf1623cd5b21b62947c2c5a83e6d493c3 | BelmY/IOT_TheThingsNetwork_esp32 | /src/TTN_esp32.cpp | C++ | cpp | 28,642 | no_license | //
//
//
#include "TTN_esp32.h"
#include "ByteArrayUtils.h"
#include "NVSHandler.h"
#include "esp_log.h"
#include "esp_system.h"
#include "helper.h"
#include "lmic/hal/hal.h"
#include "lmic/lmic/lmic.h"
#define LOOP_TTN_MS 1
/// The last sent sequence number we know, stored in RTC memory
RTC_DATA_ATTR uint32_t seq... |
23a917c2d9cecf9c443e7a3ce7dd9475269b4c87 | af6d6009f77674f22bfd9a0f087b51ebb348e387 | skelstar/ComputerController | /test/comms/test_comms.cpp | C++ | cpp | 1,095 | no_license | #include <Arduino.h>
#include <unity.h>
#define DEBUG_OUT Serial
#define PRINTSTREAM_FALLBACK
#include "Debug.hpp"
#include <Arduino.h>
#include <VescData.h>
#include <elapsedMillis.h>
#include <RF24Network.h>
#include <NRF24L01Lib.h>
#define SPI_CE 33
#define SPI_CS 26
//-----------------------------------------... |
18b40a5b9669f56003ebe723c9decb14e1a6d903 | b4b390d34f96fcb5f349dc68de430dd13803aa3f | jesusmoraleda/competitive-programming | /acepta-el-reto/0321.cpp | C++ | cpp | 1,071 | no_license | #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <algorithm> // max...
#include <utility> // pair
#include <complex>
#include <climits> // int, ll...
#include <limits> // double...
#i... |
fe52f96dd660d44fa05739f02b257d008bf711a3 | 32d7d635aa5f4fabc123cee15b53a9a987768dea | niuxu18/logTracker-old | /second/download/git/gumtree/git_function_297.cpp | C++ | cpp | 1,864 | no_license | static int check_preimage(struct apply_state *state,
struct patch *patch,
struct cache_entry **ce,
struct stat *st)
{
const char *old_name = patch->old_name;
struct patch *previous = NULL;
int stat_ret = 0, status;
unsigned st_mode = 0;
if (!old_name)
return 0;
assert(patch->is_new <= 0);
prev... |
89b9a5a81cfc923b83e49420352f6dfc0ef99a1e | c5646ef8b2526c8794ade23765882144dad38f3b | lineCode/NrScript | /NrScriptBuilder/GtkMain.cpp | C++ | cpp | 283 | no_license | #include <gtk/gtk.h>
#include "NrBuilderApp.h"
int main(int argc, char** argv) {
::setlocale(LC_ALL, "");
gtk_init(&argc, &argv);
NrBuilderApp* app = new NrBuilderApp();
if (!app) {
return -1;
}
app->initialize();
gtk_main();
return 0;
} |
9f83a21e482f4d92d3942fe6ad7602d5f712a0d5 | 354bf9c2c30726707e5ddc69c4b8bfd67807757b | Biggig/C_and_C_plus_test | /getline_try.cpp | C++ | cpp | 239 | no_license | #include<iostream>
#include<sstream>
using namespace std;
int main()
{
string line;
getline(cin,line);
istringstream iss(line);
while(iss)
{
string str;
iss >> str;
cout << str << endl;
}
return 0;
}
|
7e63c087387eb8cc957db3d0d9a62f07d705b625 | 7563c6e81de1da4b581065e5909619420a64100e | yohannesm/frctl | /plant.cpp | C++ | cpp | 5,949 | no_license | /*
* plant.cpp
* ---------
* Contains function callbacks and bookkeeping used by glut. Starter code
* for Project 2.
*
* Group Members: <FILL IN>
*/
#ifdef _WIN32
#include <windows.h>
#endif
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#in... |
12bf8ad466eab4cb1d6f5d18d33ee395c559ed55 | f947344232fb1ecd20640d3dc8820c81f0f5091d | ellynhan/challenge100-codingtest-study | /hall_of_fame/jaewon/1707_bipartiteGraph.cpp | C++ | cpp | 1,544 | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
bool bfs(int start, map<int,vector<int>>& rel, map<int, int>& colored){
queue<int> q;
q.push(start);
colored[start]=1;
bool possi = true;
while(!q.empty()&&possi){
int curr = q.front();
q.pop()... |
28bf91998e089689a663921cb84f6f206f034401 | 84b713fe77fad765bf34a675fa9dd0bef8ab41a8 | mk1057493329/CEP | /cosim/bareMetalTests/csrTest/c_dispatch.cc | C++ | cc | 3,331 | permissive | //************************************************************************
// Copyright (C) 2020 Massachusetts Institute of Technology
// SPDX short identifier: BSD-2-Clause
//
// File Name:
// Program: Common Evaluation Platform (CEP)
// Description:
// Notes:
//
//**************************... |
770102bddbd5ac746d7bb698fea5b9c7ebf94321 | 234d6121d618b7b64368772e917827d58d54d970 | whz20024117/Cycling_Fit_Analyzer | /lib/fitsdk/fit_pad_mesg.hpp | C++ | hpp | 1,367 | no_license | ////////////////////////////////////////////////////////////////////////////////
// The following FIT Protocol software provided may be used with FIT protocol
// devices only and remains the copyrighted property of Garmin Canada Inc.
// The software is being provided on an "as-is" basis and as an accommodation,
// and ... |
ab0bc981b10dd808cf463f74e4ddbc0f255bbf01 | 9950b00a9e149497b4267642bc0bf066223517f0 | TheFakeCake/Tetris-Clone | /src/Figure.cpp | C++ | cpp | 6,000 | permissive | /////////////////////////////////////////////////
/// \file Figure.cpp
/// \brief Implementation of the Figure class.
/// \author Benjamin Ganty
/// \date 23rd November 2011
/// \version 1.0
/////////////////////////////////////////////////
#include "Figure.hpp"
#include "BlockMap.hpp"
//////////////////////////////... |
8e2c5df3bf29a778249958651cc7e420f76f228c | 62b73db47cc80fedb19244a5cb1cbda3cf885fae | Sephiroth1s/lib_cpp | /src/include/HermesOptional.hpp | C++ | hpp | 3,653 | permissive | /***********************************************************************
Copyright 2018 ASM Assembly Systems GmbH & Co. KG
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/... |
a5beb6e0220d79ac780c622d78628c846d3f5134 | b5a7bb2ba0dab77cbbf14e60ae06b1ec54be9d58 | fangpan2018/Algorithm-Camp | /169-majority-element.cpp | C++ | cpp | 600 | no_license | //
//
// 先数数,后比较。
//
//
class Solution {
public:
unordered_map<int, int> re;
int majorityElement(vector<int>& nums) {
count(nums);
pair <int, int> res(0,0);
for(auto i:re){
if(i.second>res.second){
res = i;
// cout<<res.first<<res.second<<... |
a9e2ede6f6513fb77b115312514c42f9158170d7 | d3f4402c6999e5d28335ac296fb96f436d131da1 | prateek64/FM-Synthesis---Ghost-Music-and-Much-More-- | /Source/Main.cpp | C++ | cpp | 3,669 | no_license | // Music 256a / CS 476a | fall 2016
// CCRMA, Stanford University
//
// Author: Romain Michon (rmichonATccrmaDOTstanfordDOTedu)
// Description: Simple JUCE FM synthesizer
#include "../JuceLibraryCode/JuceHeader.h"
Component* createMainContentComponent();
//============================================================... |
384f3b616b432f87dfd11d32c42ca04ec37f862c | ee90dec6dfd971d1ee3d9db534399c7f68d7061e | asgerf/engine | /runtime/dart_controller.cc | C++ | cc | 6,032 | permissive | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/runtime/dart_controller.h"
#include <utility>
#include "dart/runtime/include/dart_tools_api.h"
#include "flutter/common/settings.h"
#i... |
1d78b7a4af1425e1a58159ec91943906f7782e50 | 4a7d0c98fd5f4a0da5d5f82f22da8a69f3004cbc | younters/QDriverStation | /src/main.cpp | C++ | cpp | 6,771 | permissive | /*
* Copyright (c) 2015-2016 WinT 3794 <http://wint3794.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to us... |
a949a53a658be64f14e482f8f42ad79c6e02ab35 | 764393b9a869b90f9d2a3473df11394f971537ca | Csineneo/Vivaldi | /chromium/components/viz/common/surfaces/surface_id.cc | C++ | cc | 1,403 | permissive | // Copyright 2016 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 <algorithm>
#include "components/viz/common/surfaces/surface_id.h"
#include "components/viz/common/surfaces/surface_range.h"
#include "base/str... |
ad7fb85e463dd19a59606956fd24457349b2a9f3 | 35ce1e225a05037fd3f1c6b4151af44a9ec1dc47 | ghelfter/Utilities | /c++/vector_library/ghelfter_vector.cpp | C++ | cpp | 6,548 | no_license | /* -------------------- Galen Helfter -------------------- */
/* -------------------- ghelfter_vector.cpp -------------------- */
/* -------------------- ghelfter@gmail.com -------------------- */
#include <iomanip>
#include "ghelfter_vector.h"
/*
* Constructors
*/
Matrix::Vector3::Vector3()
{
... |
a4741993e9f901457169cdd4b13135b79feefaef | afdf0785b12a2d89c6b44c1298283a070003b080 | chunyou128/explorerxp | /ExplorerXP/FolderStateManager.cpp | C++ | cpp | 8,320 | permissive | /* Copyright 2002-2020 Nikolay Avrionov. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or... |
5bc89773856f0b207c9b345a41b441a002902233 | 8535999209f094bbc8bdc95e9bb19a87f454e153 | cha63506/chromium-29 | /chrome_frame/com_message_event.cc | C++ | cc | 5,334 | permissive | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome_frame/com_message_event.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf... |
94a0569227a298034f2c2786f03343256ab31f0c | 1834a25f7f47050889068c442585fdc203a737d7 | kmhk/SparkD | /SparkD/Engine/cvlibbase/Src/imagecodec/CoImageJ2K.cpp | C++ | cpp | 8,224 | no_license |
/*!
* \file CoImageJ2K.cpp
* \ingroup base
* \brief Jasper
* \author
*/
#include "CoImageJ2K.h"
#ifdef _MSC_VER
#include <windows.h>
#endif
#ifndef CVLIB_IMG_NOCODEC
#if CVLIB_IMG_SUPPORT_J2K
#include "XFile.h"
#include "XFileDisk.h"
extern "C"
{
#include "openjpeg.h"
#include "j2k.h"
#include "opj_includ... |
41eb761095091e4e3f27266fd0d8a4a35d60a5ae | 3deec242e7289820a998dad4a68172f6f243b85f | OisinDavey/AtCoder | /Virtual/abc203/B.cpp | C++ | cpp | 1,322 | no_license | //
// ~oisín~ C++ Template
//
#include <bits/stdc++.h>
#define MX_N 5001
#define mp make_pair
#define mod7 1000000007
#define modpi 314159
#define PI 3.141592653589793238
#define pb push_back
#define FastIO ios_base::sync_wi... |
40822628d44e9aeeb28c9dfe8e7a0e14ff7aea24 | 609ddb5256c622f304afa7ed01a043135955af5b | blusno1/chromium-1 | /chrome/browser/android/metrics/launch_metrics.cc | C++ | cc | 5,676 | permissive | // Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_string.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "chrome/browser/android/shortcut_... |
22c7f07ba5aa06dbf81d937bdb2d3a9cf7acc499 | 732c3376623ed635f05a00a0d05948e0bad0503a | mrazimi99/Monitor | /main.cpp | C++ | cpp | 788 | no_license | #include "commons.h"
int main()
{
vector<Edge> edges;
map<string, int> pathes;
vector<thread> cars;
srand(time(NULL));
parse_input("input.in", edges, pathes);
int car_number = 0;
int path_number = 0;
for (auto const& path : pathes)
{
vector<Edge*> this_edges;
for (int index = 1; index < path.first.lengt... |
77f69e3f945f383506a9bff03cbe5b4591b4eb02 | b0da9ec0f505df1904969dba2e267b1cacb74247 | mperez32/IVALib | /modules/ActiveSurfaces/src/Kappa.cpp | C++ | cpp | 2,003 | no_license | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* cpp file containing most methods for the Kappa class
* Copyright (C) 2012 Matias Perez
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the LGPL
************************************... |
991ffa96d967c496569cbd2eb0dcfe45c663becf | dfd27701cfa25792baee5395fa7c662072e81aa4 | JoHyukJun/algorithm-analysis | /src/cpp/CardNumber.cpp | C++ | cpp | 942 | permissive | //
// main.cpp
//
// Created by Jo Hyuk Jun on 2020.
// Copyright © 2020 Jo Hyuk Jun. All rights reserved.
//
#include <iostream>
#include <string.h>
#include <algorithm>
#define MAX 500001
using namespace std;
int n, m;
int arr[MAX];
int j_binary_serach(int in_term) {
int output = 0;
int head = 0;
int tai... |
b3ae829a84a5bb78c37783119978cf24ba30f1d7 | e16af6e9ce5fa9283282218185b6188fa3472c76 | AlexBestoso/Opengl_Analog_Clock_Linux | /clock.cc | C++ | cc | 4,442 | no_license | #include <GL/glut.h>
#include <GL/freeglut.h>
#include <math.h>
#include <string>
#include <stdio.h>
#include <ctime>
#include <sstream>
#include <iostream>
#include <unistd.h>
//global
time_t rawTime;
struct tm *timeInfo;
class GLClock{
private:
GLfloat clockBody_X = 0.0;
GLfloat clockBody_Y = 0.0;
GLfloat clockB... |
dc0ea456d3273034752b3c04796d976b5c8da202 | e3c5b814cd992ac2d2c9934426f119ec1f0c00cd | wcysai/CodeLibrary | /Codechef/Long Challenge/18Nov/HMAPPY1.cpp | C++ | cpp | 1,950 | no_license | /*************************************************************************
> File Name: HMAPPY1.cpp
> Author: Roundgod
> Mail: wcysai@foxmail.com
> Created Time: 2018-11-07 08:11:45
************************************************************************/
#pragma GCC optimize(3)
#include<bits/stdc++.... |
dc8062b352d61c3e6a5b70368b7179b75bb90915 | 7aa325898b46ffdf73e9e8c3de9c003e0a4d6364 | LordTardquaad69/tardcoin | /src/bitcoinrpc.cpp | C++ | cpp | 48,788 | permissive | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "init.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#includ... |
9ff95ba5efc9574aaa582275aa7e8bfdc6e7245f | 2cb1c5ca4cfe94b058f323e7dad4db82ba176ac7 | kittusairam/C_RnD | /linked_list/src/numberToLinkedList.cpp | C++ | cpp | 1,053 | no_license | /*
OVERVIEW: Given a number convert that to single linked list (each digit as a node).
E.g.: Input: 234, Output: 2->3->4.
INPUTS: A number.
OUTPUT: Create linked list from given number, each digit as a node.
ERROR CASES:
NOTES: For negative numbers ignore negative sign.
*/
#include <stdio.h>
#inclu... |
15af2c38019606f8e71d56d0bca4cba5371170ff | 944d525a0bed7cfd576b95b64918e1ea59bcf41b | unnamedMaple/LintCode | /LintCode/isInterleave.cpp | C++ | cpp | 559 | no_license |
#include "Header.h"
bool isInterleave(string &s1, string &s2, string &s3) {
// write your code here
if (s1.length() + s2.length() != s3.length()){
return false;
}
if (s1.empty() && s2.empty() && s3.empty()){
return true;
}
if (s3[0] == s1[0] && s3[0] == s2[0]){
return (isInterleave(s1.substr(1), s2, s3.sub... |
9d560172a24b70494526da71564b9a148f3962e4 | 5a301a8390936d62a419bc854c06e8927d9a532f | erich0929/SAXParser | /SimpleAPIForXml/xml_parser.cpp | C++ | cpp | 3,179 | no_license | #include "stdafx.h"
#include <cassert>
#include <sstream>
#include "xml_scanner.h"
#include "xml_buffer.h"
#include "xml_parser.h"
#include "xml_cdata.h"
#include "xml_chardata.h"
#include "xml_comment.h"
#include "xml_decl.h"
#include "xml_emptytag.h"
#include "xml_etag.h"
#include "xml_reference.h"
#include "xml_stag... |
29fb2fab88680fc9b8dcfe7deb8616596aef82d8 | 603fb194285eec139138306d39e393d7fa2d0828 | gkagm2/ProblemSolving | /Algorithm/Free/Implementation/5565.cpp | C++ | cpp | 296 | no_license | #include <iostream>
using namespace std;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int totalCost = 0;
int curCost;
cin >> curCost;
for (int i = 0; i < 9; ++i) {
int bookCost;
cin >> bookCost;
totalCost += bookCost;
}
cout << curCost - totalCost;
return 0;
} |
e5524de2c58e996df478335a844e88e677f7f0bc | bfc54c28322c07a2efd369ac3713b6a6371dd707 | wpmyj/PM310_LED | /HDLIB/CMyDM9000_bak.cpp | C++ | cpp | 4,814 | no_license | #include <Main.h>
//#ifndef BASEADDR
void CMyDM9000::SetProperty(DWORD dwBaseAddr,WORD wSpeedMode)
{
m_dwBaseAddr = dwBaseAddr;
m_wSpeedMode = wSpeedMode;
}
//#endif
void CMyDM9000::OnTimer10ms(void)
{
if(m_wTimeout)
{
m_wTimeout--;
if(m_wTimeout<3000) m_wStatus = ETSTATUS_SWREST;
if(m_wTimeout==0)m_wStatus... |
caf36c8599158444e305a049879e12fc128132e4 | db82b884e1d42d1b40f68f8effdce89cb992b5fd | m3nf1s/Modern-Cplusplus | /Yellow Belt/Week_5/Task_4/Task_4.cpp | C++ | cpp | 2,914 | no_license | /*
В данном задании вам предстоит изменить код таким образом, чтобы он соответствовал изложенным в курсе принципам.
Представьте, что этот код вам достался в наследство от коллеги и теперь вам предстоит поддерживать его и улучшать.
Первое, что вы решили сделать — это провести рефакторинг.
Конечные цели рефактор... |
b233cdcddf9b59e6e2f4d0c0b54b650c5a90b282 | 679ac901e58d42b78b88228d99295e63e0b20017 | lv-zheng/dblvzheng | /test/test_hash.cpp | C++ | cpp | 363 | no_license | #include <cassert>
#include <iostream>
#include <string>
#include <dblvzheng/hash.hpp>
using namespace lvzheng;
int main(int argc, char **argv)
{
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " <string>" << std::endl;
return 1;
}
auto h = db::create_hash({"djb64", 33ULL << 32 | 5381});
std::cout <<... |
e43d1871f6830b42d4222e11426233ec6f9eb084 | 2481c1488866d90eb51bca8a5849de446cd754fb | Luckily777/C- | /C++Two051705.cpp | C++ | cpp | 1,093 | no_license | //C++struct: 可以定义数据和函数
//C++定义类的方式:
// 1. struct + 类名 + {} + ";"
// 2. class + 类名 + {} + ";"
#include <stdio.h>
#include <iostream>
#include <string.h>
struct Student
{
void display()
{}
void setId(int id)
{
_id = id;
}
void setNumber(int number)
{
_number = number;
}
int _number;
int _id;
char name[1... |
44f1318c82a426951cb6dc94383966b1a25bf926 | cb97030b160c4e0cb1fd74b6ff5af68d161b7562 | icenaive/CppPrimer5Answer | /ch03/ex3_41.cpp | C++ | cpp | 273 | no_license | #include <vector>
#include <iostream>
using namespace std;
int main() {
int arr[4] = { 0, 1, 2, 3};
// vector<int> vec(begin(arr), end(arr));
vector<int> vec(arr, arr + 4);
int arr_copy[4];
for(auto v : vec)
for(auto v : vec) cout << v << endl;
} |
d67922cf02b8881e727fabd83dbec4963f531dd2 | b6ff71b73276640caf8cd7dcba47914ec750ae9d | miranas11/algos_-_datasStructures | /Sorting Techniques/Counting_sort.cpp | C++ | cpp | 702 | no_license | /****************
*Counting Sort
****************/
#include<iostream>
#include<algorithm>
using namespace std;
void countingsort(int a[],int n,int maxx)
{
int freq[maxx]={0};
for(int i=0;i<n;i++)
{
freq[a[i]]++;
}
int j=0;
for(int i=0;i<=maxx;i++)
{
whil... |
c79767b52c11cbfe9c3ceb9e3cf9688612977d34 | 839a6e47b35eb5e6f7a6f6b651a3c98853c357d1 | eng-arvind/Hackerearth-problem | /pallindrom.cpp | C++ | cpp | 262 | no_license | #include<iostream>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
string s1=s;
reverse(s.begin(),s.end());
if(s1.compare(s)==0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}
|
e360e9df5295d500a0c5beccfe74be9e25a6e052 | f75efc38201faaf859ce7a96e8565516c3994924 | CodeIsLie/CompetitiveProgramming | /Train1/qualification/brackets.cpp | C++ | cpp | 689 | no_license | //
// Created by admin on 12.09.2018.
//
#include <iostream>
#include <vector>
#include <set>
using namespace std;
void brackets(){
long long n, k;
string impossible = "Impossible";
string s;
cin >> n >> k;
if (n*(n-1)/2 < k){
cout << impossible << endl;
return;
}
long ... |
5b7fdc0477a6c8db38d5c36b7a36e16232d9ad4d | 2226a85ebd556527b77f065325e9db6d53f5de49 | google/xls | /xls/solvers/z3_lec_test.cc | C++ | cc | 17,407 | permissive | // Copyright 2020 The XLS Authors
//
// 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 t... |
faf71e773f8a28bcc3419034f7cd3ed6ed1ecedf | 995fbcac5db33683ac2e506c4a184f21d3c68bb4 | afew/2009-wiz-project | /dge20_wiz/apd/7gl_blend/Main.cpp | C++ | cpp | 8,314 | no_license | // Implementation of the CMain class.
//
////////////////////////////////////////////////////////////////////////////////
#include "_StdAfx.h"
#define MEDIA_DIR "../../media/"
#define NUM 50
/* Twinkling stars */
INT twinkle=DGE_FALSE;
/* Define the star structure */
typedef struct
{
int r, g, b; /* Sta... |
d8360803e5e92a41d38141bfe6d252b598f2b0e0 | 6f06bc3e9853521eb0d9272e92ac58e671b9d2e8 | minhaz044/Data-Structure-And-Algorithm | /max.sub.array.cpp | C++ | cpp | 1,694 | no_license | // A Divide and Conquer based program for maximum subarray sum problem
#include <stdio.h>
#include <limits.h>
int max(int a, int b) { return (a > b)? a : b; }
int max(int a, int b, int c) { return max(max(a, b), c); }
int maxCrossingSum(int arr[], int l, int m, int h)
{
// Include elements on left of mid... |
e1e21f9c6955f404fdd7d89c07359b22e3c68019 | f5bc250b29a66fc00b73ef183257eb743ab99f4d | ddkn/spirit | /VFRendering/include/shaders/glyphs.frag.glsl.hxx | C++ | hxx | 718 | permissive | #ifndef ARROWS_FRAG_GLSL_HXX
#define ARROWS_FRAG_GLSL_HXX
static const std::string ARROWS_FRAG_GLSL = R"LITERAL(
#version 330
uniform vec3 uLightPosition;
in vec3 vfPosition;
in vec3 vfNormal;
in vec3 vfColor;
out vec4 fo_FragColor;
void main(void) {
vec3 cameraLocation = vec3(0, 0, 0);
vec3 normal = normalize(vf... |
df91a89ae58719ef701800e46f70f0233e6c2645 | baaccc77405289ff175580924bc3b704893eca1d | tjtaill/ShadowMapping | /ShadowMapping/Program.cpp | C++ | cpp | 1,563 | no_license | #include "stdafx.h"
#include "Program.h"
#include <algorithm>
using namespace std;
Program::Program(){
_active = false;
_glprogram = glCreateProgram();
}
bool Program::active()
{
return _active;
}
Program::~Program(){
glDeleteProgram(_glprogram);
// detach shaders
list<GLuint>::iterator it = _shaders.begi... |
9224812bc9a1ad3d98c6b731277e5b164baf28b4 | 2f81f847282ba688654e277b8f44ab44da1917b6 | thegamer1907/Code_Analysis | /DP/2682.cpp | C++ | cpp | 609 | no_license | #include<stdio.h>
#include<stdlib.h>
char s1[15], s2[15];
double er[15] = {1,2,4,8,16,32,64,128,256,512,1024};
int C(int n, int m)
{
int i, ans;
ans = 1;
for(i=1;i<=m;i++)
ans = ans*(n-i+1)/i;
return ans;
}
int main(void)
{
int i, now, x;
scanf("%s%s", s1+1, s2+1);
now = x = 0;
... |
491c8711668bf9813bbfd2b3ef13892313c1ce2f | 04a2a051e21ab2ef5f8ea66460bc297d7c28777d | jjkotni/gem5-master | /src/arch/arm/tracers/tarmac_parser.cc | C++ | cc | 43,255 | permissive | /*
* Copyright (c) 2011,2017-2018 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
* not be construed as granting a license to any other intellectual
* property including but not limited to intellectual property relating
* to a hardware implementation of... |
6d830dd3c91b1ac65616a602a99c2593c3396d18 | 2e981b08fc11d899c83cb9d66083662d234e3653 | iamsuryakant/100-days-of-code | /C++/pairwiseSwap/method2.cpp | C++ | cpp | 961 | permissive | #include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* next;
Node(int x){
data=x;
next=NULL;
}
};
void printlist(Node *head){
Node *curr=head;
while(curr!=NULL){
cout<<curr->data<<" ";
curr=curr->next;
}cout<<endl;
}
Node *pairwiseSwap(N... |
975c35ba3d3d7a71b5bcb4263dfad46edcb43549 | f2413719311d24782debd8f248193d54299ea804 | BayKIRMIZI/6--Linked-Lists | /İki_Bağlı_Listeden_Ortak_Eleman_Arama.cpp | C++ | cpp | 1,183 | no_license | #include<stdio.h>
#include<conio.h>
int dizi1[]={9,1,3,11,72,55,91,5,13,25,32};
int dizi2[]={11,55,93,27,35,7,1,8,17,63,9};
typedef struct Liste{
int veri;
struct Liste *sonra;
}L;
L *kok1,*gcc1,*kok2,*gcc2;
void Ortak_Bul(L *ilk1,L*ilk2)
{
gcc1=ilk1;
gcc2=ilk2;
if(gcc1 != NULL)
{
if(gcc2 != ... |
373fbad3c9382d915b592b3f3ab7bbd9387feed9 | 3b77ee567e553dc920ec9914e49707ca6135a4ff | memo-p/weighted_projection | /bench/src/utils.hpp | C++ | hpp | 1,086 | no_license | /*
* Copyright (C) 2020 Guillaume Perez
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is di... |
f09843d1c3e31b5d3e14bb9e27cbdfe999d5f542 | 5f2858602097cad10ff183e2dfbff29e241c41ae | OpenLEAD/drivers-orogen-rosa_dfki_ucontroller | /tasks/Task.cpp | C++ | cpp | 2,417 | no_license | /* Generated from orogen/lib/orogen/templates/tasks/Task.cpp */
#include "Task.hpp"
using namespace rosa_dfki_ucontroller;
const double bar2meter = 10.1972;
Task::Task(std::string const& name)
: TaskBase(name)
{
}
Task::Task(std::string const& name, RTT::ExecutionEngine* engine)
: TaskBase(name, engine)
{
... |
1737d27726c2c0dc4cd5b903276ae19d70bc9bc4 | bb04cd56b662b1819c89db6c7bf25c76adfec321 | skyformat99/file_monitor | /source/file_monitor/factory.cpp | C++ | cpp | 797 | permissive | #include "factory.hpp"
#include "debouncer.hpp"
#ifdef FILE_MONITOR_PLATFORM_MACOS
#include "mac_monitor.hpp"
#endif
#ifdef FILE_MONITOR_PLATFORM_WIN32
#include "win_monitor.hpp"
#endif
#ifdef FILE_MONITOR_PLATFORM_LINUX
#include "linux_monitor.hpp"
#endif
std::shared_ptr<file_monitor::monitor> file_monitor::make_p... |
818c774217407c34fafe9c6f685cc99c1fe23699 | 7a577e2089a917f95cac6be05d5fba433c80fcf1 | villevoutilainen/bde | /groups/btl/btlso/btlso_defaulteventmanager_devpoll.t.cpp | C++ | cpp | 67,307 | permissive | // btlso_defaulteventmanager_devpoll.t.cpp -*-C++-*-
// ----------------------------------------------------------------------------
// NOTICE
//
// This component is not up to date with current BDE coding standards, and
// should not be used as an example f... |
c4dc0fa99b858e779217b5b7e0eeeba5774d5c24 | 84ce2074199397a6cb01038a97a2eba12699402c | ryanlockman333/UCDenver_School_Projects | /hashchainSetTree/HW1-Ac++/hw1functionstem.cpp | C++ | cpp | 3,123 | no_license | /*
* Ryan Lockman
* Homework 1
* CSCI 3320
* ./hw1functions.tem
* Description: hw1functions implementations
*
*/
// Headers
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
template <typename Container>
int fillArray(const char *path, Container &x, Container &y) {... |
98a32ea952c3a015418b54812be11d6ca966afd2 | 82a49a3dfbc6080c1014a6343c1c0fbd652e62c8 | BrianV1981/arma3mercenaries | /modules/cfgBuyables.hpp | C++ | hpp | 661 | no_license | class CfgGradBuymenu {
tracking = 1;
trackingTag = "GRAD_menuTracking";
#include "mercenaryStoreMenu_1.hpp"
#include "mercenaryStoreMenu_2.hpp"
#include "vehicleStoreMenu_1.hpp"
#include "nukeStoreMenu_1.hpp"
#include "weaponStoreMenu.hpp"
#include "itemStoreMenu.hpp"
#include "fortificationStoreMenu_1.... |
2083e33c1b9ea72792a493d047a86e47e262725f | b5ca3b9f1d808d34b84d9030798e728d6487c3cb | creep06/competitive-programming | /AtCoder/codeFlyerOpen/B.cpp | C++ | cpp | 2,786 | no_license | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v)... |
6a9a9068c764a7aa25928097f008dd3ed5f9411c | 8ab10cd8452ead3bcf71f6a9f74afc3ead3e9095 | DongjaeJang/lexical | /lexical.cpp | C++ | cpp | 9,320 | no_license | #include "lexical.h"
// TYPE
bool isType(const string& str)
{
const vector<string> types{ "int", "float", "char", "bool" };
for (const auto& type : types)
if (type == str)
return true;
return false;
}
// INTEGER
bool isInteger(const string& str)
{
if (str.size() == 1)
{
... |
376bf93e6f73b82d0f29b8aa2814c45a03d504f1 | 36d217c93ab12da830b390ef0d4de675039f429e | javafreak88/lobster | /dev/src/audio.cpp | C++ | cpp | 1,497 | permissive | // Copyright 2014 Wouter van Oortmerssen. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required b... |
248093d3a4feb940433479fc4aa7ca439de36476 | af3ef302d6e766883327807a573b2b52d00f2cbc | tersers/Jewel3D | /Engine/Jewel3D/Application/Logging.cpp | C++ | cpp | 5,834 | permissive | // Copyright (c) 2017 Emilian Cioca
#include "Jewel3D/Precompiled.h"
#include "Logging.h"
#include "Jewel3D/Utilities/String.h"
#include <iostream>
#include <fstream>
#include <Windows.h>
namespace
{
static std::ofstream logOutput;
static HANDLE stdOutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
}
namespace Jwl
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.