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 |
|---|---|---|---|---|---|---|---|---|
0294f5842c89b9f7a1c5a27e713deb1c7d6d00a4 | 793fd3c9b5caa363178a753f4857d24db7ff057e | f304646673/peleus | /src/unit_test/stl_serialization/ut_unordered_multimap_serialization.cpp | C++ | cpp | 2,096 | permissive | /*************************************************************************
> File Name: ut_unordered_multimap_serialization.cpp
> Author: fangliang
> Mail: fangliang1988@gmail.com
> Created Time: Fri 23 Mar 2018 01:16:30 AM CST
************************************************************************/
... |
3043bc5c8fe951e2e3283802762a5b0a46693a86 | f3cb6ffd55f027b358437785a4f50bfc62eda207 | marscore/hhvm | /hphp/runtime/vm/jit/meth-profile.cpp | C++ | cpp | 4,719 | permissive | /*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
+---------... |
ab61402e839a9c32044d735e69c8487076aebd9a | ef5aaf52db15b9917dce34969ea973e1e55107e8 | nv-chromium/chromium-crosswalk | /remoting/host/token_validator_factory_impl_unittest.cc | C++ | cc | 6,485 | permissive | // 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.
//
// A set of unit tests for TokenValidatorFactoryImpl
#include <string>
#include "base/json/json_writer.h"
#include "base/values.h"
#include "net/http/... |
63f4bf2f3fe1352ded3ec9558b9ada2df5e36651 | 51ab4dff9016eca621c97ca9b4eee6dfed56893d | changmu/Practice-code | /C_C++/C++/deskCalculator.cpp | C++ | cpp | 529 | no_license | #include <iostream>
#include <memory>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <functional>
using namespace std;
int add(int a, int b)
{
return a + b;
}
auto sub = [](int a, int b) {return a - b;};
class A {
public:
int operator()(int a, int b) const {
return a ... |
41dc919d96a896979acfe1d58b4a773160c217d9 | 2798952cfe776bbf591a484774313f1711d57a4f | ngthanhtrung23/CompetitiveProgramming | /codeforces/100725/K.cpp | C++ | cpp | 7,531 | no_license |
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (... |
9982916c309bd644a4f6b2fe46466fcf31b23b78 | 64026cf4b25feb8ac3d80b00e3248aba929026d8 | LargeDumpling/Programming-Contest | /OnlineJudges/Codeforces/#463 (Div. 1 + Div. 2, combined)/C.cpp | C++ | cpp | 638 | no_license | /*
Author: LargeDumpling
Email: LargeDumpling@qq.com
Edit History:
2018-02-15 File created.
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int N,A,B,x,y;
int main()
{
scanf("%d%d%d",&N,&A,&B);
for(x=0;x*A<=N;x++) if((N-x*A)%B==0... |
e6ad27515ea76b624c45106f1d2864b2dce7b523 | 7e39503f0e82f25014b171a7e25f157a130b328b | galek/Vulkan | /VKTS_Example07/src/Example.hpp | C++ | hpp | 5,055 | no_license | /**
* VKTS Examples - Examples for Vulkan using VulKan ToolS.
*
* The MIT License (MIT)
*
* Copyright (c) since 2014 Norbert Nopper
*
* 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 ... |
89a702e801116e795788d0c72a9062cf1f3f6555 | 38bc1e5973ba679844814ee6fa6bedc71edb5dd5 | C-Aniruddh/frameworks_base-1 | /tools/aapt/Resource.cpp | C++ | cpp | 120,838 | permissive | //
// Copyright 2006 The Android Open Source Project
//
// Build resource files from raw assets.
//
#include "AaptAssets.h"
#include "AaptUtil.h"
#include "AaptXml.h"
#include "CacheUpdater.h"
#include "CrunchCache.h"
#include "FileFinder.h"
#include "Images.h"
#include "IndentPrinter.h"
#include "Main.h"
#include "Res... |
155ef66fc0f3e05e3f4d346c1122b01e8f340ceb | def054b4c741470c6f038c5f10d2d20301865abd | christian-rauch/tum-ros-pkg-code | /perception/aruco_pose/src/aruco/cameraparameters.cpp | C++ | cpp | 5,758 | no_license | #include "aruco/cameraparameters.h"
#include <fstream>
#include <opencv/cv.h>
using namespace std;
namespace aruco
{
CameraParameters::CameraParameters() {
CameraMatrix=cv::Mat();
Distorsion=cv::Mat();
CamSize=cv::Size(-1,-1);
}
/**Creates the object from the info passed
* @param cameraMatrix 3x3 matrix ... |
6b60b93cbe921153cfd60191dda1f96b51e6038e | b1ee957bf65548e7866c50110d18edd5ff433d34 | niuxu18/logTracker-old | /second/download/httpd/gumtree/httpd_new_hunk_4710.cpp | C++ | cpp | 524 | no_license | {
int proposed = 0;
int is_tls = h2_h2_is_tls(c);
const char **protos = is_tls? h2_tls_protos : h2_clear_protos;
(void)s;
if (!h2_mpm_supported()) {
return DECLINED;
}
if (strcmp(AP_PROTOCOL_HTTP1, ap_get_protocol(c))) {
/* We do not know how to switch from anything... |
1a91254790a1dc3143b0fcca618e667ca18a39ea | a32ca5ca49bce418a07b2b438efdad5b1c779ae9 | mezeru/Cpp-Algos | /STL/1stnonrepeat.cpp | C++ | cpp | 554 | no_license | #include <iostream>
#include <unordered_map>
using namespace std;
char non_repeat(string s, int size)
{
unordered_map<char, int> hash;
for (int i = 0; i < size; i++)
{
hash[s[i]] = hash[s[i]] + 1;
}
for (int i = 0; i < size; i++)
{
if (hash[s[i]] == 1)
... |
c64dda19a8412fc710611986dd6251fe91ae78ac | cd2f123af7088f6a138f62724e28eb2b71cd4150 | cha63506/chromium-29 | /chrome/browser/extensions/gtk_theme_installed_infobar_delegate.cc | C++ | cc | 841 | permissive | // 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/gtk_theme_installed_infobar_delegate.h"
#include "chrome/browser/profiles/profile.h"
GtkThemeInstalledInfoBarDel... |
d47a664442e716f7b2051e21605f7a6649edaff4 | 583e8715ea037284c1cc141f91a7d58661c378ba | linorabolini/Dungeon | /src/MainMenu.cpp | C++ | cpp | 430 | no_license | #include <MainMenu.hpp>
void MainMenu::render(sf::RenderWindow *win_)
{
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (win_->isOpen())
{
sf::Event event;
while (win_->pollEvent(event))
{
if (event.type == sf::Event::Closed)
... |
9e545d6d5a068023a8deebf7a43ba0e19053611e | 1440942c7e359b17d7f50f65698027989b65cf99 | sorens/simdjson | /benchmark/bench_dom_api.cpp | C++ | cpp | 17,933 | permissive | #include <benchmark/benchmark.h>
#include "simdjson.h"
#include <sstream>
using namespace simdjson;
using namespace benchmark;
using namespace std;
const padded_string EMPTY_ARRAY("[]", 2);
const char *TWITTER_JSON = SIMDJSON_BENCHMARK_DATA_DIR "twitter.json";
const char *NUMBERS_JSON = SIMDJSON_BENCHMARK_DATA_DIR "... |
ac306f5677f1cd43d25ab2d0582c275f52fb0c46 | c2301d0c3a618ee9d3271bb054581b8b2ceaff2d | git-Charlie/ARK-SDK | /SDK/ARKSurvivalEvolved_Ceiling_Door_Tek_parameters.hpp | C++ | hpp | 832 | permissive | #pragma once
// ARKSurvivalEvolved (329.9) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_Ceiling_Door_Tek_classes.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Parameters
//-----------------------------------------------------... |
a2f8e2b9a598849c5ce4656bd02c514271fae4d1 | 5e9cb9f1ef7c4d9f37897f84d9e14ff4981130f5 | ahuang1900/steffect | /app500test/src/main/jni/stmobile_sticker_jni.cpp | C++ | cpp | 11,598 | no_license | #include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include "st_mobile_license.h"
#include "st_mobile_sticker.h"
#include "stmobile_sound_play_jni.h"
#include "utils.h"
#include "jvmutil.h"
#define LOG_TAG "STMobileSticker"
extern "C" {
JNIEXPORT jstring JNICALL Java_com_sensetime_stmobile_STMobileStickerN... |
16855dba9c825a21c8b2e1e61db6e2fc8fbb6388 | 302a9d26b98f6a35074236e118ca0dda077cf453 | shareone2/POj | /3349SnowflakeSnowSnowflakes.cpp | C++ | cpp | 2,249 | no_license | #include <iostream>
#include <cstdio>
#define MAX 100007
using namespace std;
int snow_head[MAX], next[MAX], node[MAX][10], cnt = 1;
int read();
void combine(int *base, int sum);
bool judge(int *base, int sum);
int main() {
int n = read(); //数据量
while (n--) { //输入
int base[10], sum = 0; //ba... |
f7454a81b77de5c3986e191e4c754c9f08fa4e31 | c427821efe2cff0d27c0eeaa7c35bc8fd76bd6b4 | Sarthakdtu/C-Codes | /Others/max sum subarray.cpp | C++ | cpp | 471 | no_license | #include<iostream>
using namespace std;
int maxSumSubarray(int *arr, int n)
{
int current_sum = 0;
int best_sum = INT_MIN;
for(int i =0;i<n;i++)
{
current_sum += arr[i];
if(current_sum>best_sum)
{
best_sum = current_sum;
}
if(current_sum<0)
{
current_sum =0;
}
}
... |
fbf0e51623cfd240546e45d5d6e3eec4e24eef8a | e5be89b35e1ab9a48c45e9cea70ce51a7c0b80e7 | agooddaytowork/DieuKhienDaiPhunNuoc | /tcppackager.cpp | C++ | cpp | 8,900 | no_license | #include "tcppackager.h"
#include <QDebug>
tcpPackager::tcpPackager()
{
}
QString tcpPackager::m_clientId = tcpPackager::generateClientId();
QByteArray tcpPackager::m_scecretKey = "fountainController";
void tcpPackager::setSecretKey(const QByteArray &newKey)
{
m_scecretKey = newKey;
qDebug() << " new Secr... |
4091321a643cc359dbe2b013e6488cd99c4fbece | 0a44374353bd0768b7766e38af5b8b3afbab6549 | markdroth/grpc | /test/core/backoff/backoff_test.cc | C++ | cc | 6,092 | permissive | /*
*
* Copyright 2016 gRPC 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 agree... |
3472e0578f3126f438fc08b2ddbf4daec944377b | 1eb08976ed0943369c1a5310f3dfbd9c552065e9 | shurshun/ClickHouse | /dbms/src/Storages/StorageMySQL.cpp | C++ | cpp | 7,983 | permissive | #include "StorageMySQL.h"
#if USE_MYSQL
#include <Storages/StorageFactory.h>
#include <Storages/transformQueryForExternalDatabase.h>
#include <Formats/MySQLBlockInputStream.h>
#include <Interpreters/evaluateConstantExpression.h>
#include <Core/Settings.h>
#include <Interpreters/Context.h>
#include <DataStreams/IBlock... |
3d00b61c07d94f020dbeed6d458167cd47f75b07 | ed43ea9405a9730ad1e233c6e38d7609f2a9c4fc | jorgediazjr/dials-dev20191018 | /modules/ccp4io/ssm/ssm_superpose.cpp | C++ | cpp | 73,285 | permissive | // $Id: ssm_superpose.cpp $
// =================================================================
//
// CCP4 SSM Library: Protein structure superposition based on
// SSM algorithm: E. Krissinel & K. Henrick (2004) Acta Cryst. D60,
// 2256-2268.
//
// Copyright (C) Eugene Krissinel 2002-2013.
//
// This librar... |
9f2f9bb5c437fee330bb4d21db3248c605afb04b | 25091c718954e587ec8c569a428bca00e0d955e6 | karatemir/duckdb | /src/planner/expression_binder.cpp | C++ | cpp | 8,488 | permissive | #include "duckdb/planner/expression_binder.hpp"
#include "duckdb/parser/expression/columnref_expression.hpp"
#include "duckdb/parser/expression/positional_reference_expression.hpp"
#include "duckdb/parser/expression/subquery_expression.hpp"
#include "duckdb/parser/parsed_expression_iterator.hpp"
#include "duckdb/plann... |
932916194ca8f0f36be0c9597bb7a25d03c20c04 | 712409500093f82c52ffaef0a8291d818ba1193a | RolphWoggom/shr.tar | /Simpsons Hit&Run/game/libs/radcore/src/radmemory/twowayallocator.cpp | C++ | cpp | 7,104 | no_license | //=============================================================================
// Copyright (c) 2002 Radical Games Ltd. All rights reserved.
//=============================================================================
//=============================================================================
//
// Fi... |
d1db5cca91781c9b8895b0b513daf5c81a28b341 | 9d3e580d6d623d99d18ec435e4e9edec9142cc21 | fextivity/codeforces-submissions | /codeforces/1389/A.cpp | C++ | cpp | 3,291 | no_license | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// Optimization
//#pragma GCC optimize("O3")
#define endl '\n'
// Shortcut
#define int long long
#define eb emplace_back
#define pb push_back
#define pob pop_back
#d... |
b02265ecbcaf5ca91f39b1886f9e197d2f670bbc | b88a24551af89259d26e61960a0d9b3df02a04ef | brstudio/coil_calc | /coilcalc/mainwindow.cpp | C++ | cpp | 1,683 | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include "about.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
//MainWindow::ui->frame->hide();
setWindowState(Qt::WindowMaximized);
}
MainWindow::~MainWindow()
{
... |
8644f22559c135978d1c43666112d2065bc7f27a | 04a01955558b47fbb0def503384d7b83c8626e40 | gojimi/gtablet_platform_frameworks_base | /libs/ui/FramebufferNativeWindow.cpp | C++ | cpp | 9,266 | permissive | /*
**
** Copyright 2007 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 ap... |
6b49512f1ac32ba6c7f01372c0088c1aaf76aee9 | 8f6d6d3b998aaf519adb64b8e84cdbe517a386c6 | gabstv/godot-go | /cgodeps/godot_engine/servers/display_server.cpp | C++ | cpp | 31,370 | permissive | /*************************************************************************/
/* display_server.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... |
f7058ee03a73898dba621dcd0cdec1f3ca0be87e | 99247a652ad93c99c61f80dcf690e4ca196a15e1 | strategist614/ACM-Code | /刷题比赛/LUOGU/P1603斯诺登密码.cpp | C++ | cpp | 1,218 | no_license | #include<bits/stdc++.h>
using namespace std;
map<string,int> mp;
int main ()
{
mp["zero"] = 999;
mp["one"] = 1;
mp["two"] = 4;
mp["three"] = 9;
mp["four"] = 16;
mp["five"] = 25;
mp["six"] = 36;
mp["seven"] = 49;
mp["eight"] = 64;
mp["nine"] = 81;
mp["ten"] = 9999;
mp["eleven"] = 21;
mp["twelve"] = 44... |
9a64e7e66fa53fcd51216bf67403b49a3e8386ca | c03d38beff8cdb05bec292d1965083ff4f33b8a0 | linchendev/kernel | /Kernel_Linux/ss/src/gateway_server/server/VestibuleRunSink.cpp | C++ | cpp | 935 | no_license | #include "VestibuleRunSink.h"
#include "GateWayServiceMgr.h"
#include "ConnectSinkMgr.h"
#include "IConnectSink.h"
#include "ILog.h"
CVestibuleRunSink g_VestibuleRunSink;
CVestibuleRunSink::CVestibuleRunSink(void)
{
}
CVestibuleRunSink::~CVestibuleRunSink(void)
{
}
void CVestibuleRunSink::OnRet(s32 nIndex, s32 nR... |
c02826d9d1b52cef36649c96d539d96bdd47c81a | 51bd1c60d2a9ef9b0b7b7107287f9bc333fa5b86 | PingooLP/ElGA | /implementation/src/streamer.cpp | C++ | cpp | 15,593 | permissive | /**
* ElGA streamer
*
* This command is responsible for running a streamer, which will either
* proxy incoming network data or read from an edge list and forward
* appropriately into ElGA.
*
* Authors: Kaan Sancak, Kasimir Gabert, Yusuf Ozkaya
*
* Copyright 2021 National Technology & Engineering Solutions of S... |
08b2208fef0102457a5bcc7433871b1f85e22b21 | cd471178776eed0d874a16e9761821c8b24a3a53 | not522/CompetitiveProgramming | /old2/include/dp/unbounded_knapsack.hpp | C++ | hpp | 1,453 | permissive | #pragma once
#include "vector.hpp"
template <typename Weight, typename Value, bool strict = false>
Value unboundedKnapsack(Weight maxWeight, const Vector<Weight> &weight,
const Vector<Value> &value) {
Vector<Value> dp(maxWeight + 1);
if (strict) {
fill(dp.begin() + 1, dp.end(), -inf<Val... |
87676be28107ff4ed7c77a977f115aa8ad82d418 | 4ee6c6a52a055a4daed99f9a894b0ff0dd46d00a | jby1/motion-matrix | /Source/RobotMotion.cpp | C++ | cpp | 56,484 | no_license | // RobotMotion.cpp : OpenGL application.
/**
The code is a openGL code that renders a 3D robot based on the input from the Xsens IMU sensors attached to the users body
**/
#include"XsensConnection.h"
#include <math.h>
#include <stdio.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <vtkQuaternion.h>
using namesp... |
ebe5216b6c6a414f7aafeea88e7221d37264ce68 | bf73f05c77e7d7f013b3ce245db326d2f84c178d | beer119/simpleStuff2 | /src/GameObject/SDLGameObject.cpp | C++ | cpp | 1,103 | no_license | #include "Player.h"
#include "SDLGameObject.h"
#include "../Game.h"
#include "../TextureManager.h"
#include "GameObject.h"
SDLGameObject::SDLGameObject()
{
}
void SDLGameObject::load(const LoaderParams* pParams)
{
m_position = Vector2D(pParams->getX(),pParams->getY());
m_velocity = Vector2D(0,0);
m_acceleration = V... |
7f501a476ea0e5d902e25c299183edfacd965fad | b6d81d477eb858e47c7cd519dd342ec0f0f5583f | NiltonGMJunior/neps-tecnicas | /tecnicas_intermediarias/eu_aprendi_o_mergesort/main.cpp | C++ | cpp | 1,570 | no_license | #include <iostream>
#include <vector>
#define INF -1000000001
void merge_sort(std::vector<int> & v)
{
// Vetor tem até um elemento, portanto já está ordenado
if (v.size() <= 1) return;
// Divide o vetor original em dois
std::vector<int> u1, u2;
// Preenche os novos vetores
for (unsigned int ... |
0f6e0cd262ef441206774418eb3d9621e6a89484 | 9d5de38153e1662b405bd35fe6ceb760a46a9839 | 1907931256/acsvision | /AcsVision/OPCClient/ConnectionPoint.cpp | C++ | cpp | 3,554 | no_license | //**************************************************************************
//
// Copyright (c) FactorySoft, INC. 1996-1998, All Rights Reserved
//
//**************************************************************************
//
// Filename : ConnectionPoint.cpp
// $Author : Jim Hansen
//
// Description: Ca... |
2a08e0fccd8211a7b3d71a22b6605df5e0bfa9fc | 466cf111e247925c00a816c6eb2d62199c8ed59a | genome/diagnose_dups | /test/testing/TestBamRecords.hpp | C++ | hpp | 1,340 | permissive | #pragma once
#include "TestData.hpp"
#include <sam.h>
#include <gtest/gtest.h>
#include <stdexcept>
#include <iostream>
using namespace std;
struct TestBamRecords {
bam1_t *record;
bam1_t *record2;
bam1_t *record3;
bam_hdr_t *header;
TestBamRecords() {
htsFile *f... |
dce54a3207b950c764eead626330a3e10f472917 | 9491d98f69f7a3732580152d21ffe61f8b9434de | tittaya/lab13_2561_2 | /lab13_2.cpp | C++ | cpp | 947 | no_license | #include<iostream>
using namespace std;
const int N = 5;
void inputMatrix(double [][N]);
void findLocalMax(const double [][N], bool [][N]);
void showMatrix(const bool [][N]);
int main(){
double A[N][N];
bool B[N][N];
cout << "Input the matrix.....\n";
inputMatrix(A);
findLocalMax(A,B);
cout << "Result is \... |
7eee55b2ac767a2309b3ff7005243466f3584b78 | 3ba2c395b57d28a71d6e7381ddd04a3f5617ccb3 | limas0/Univox | /Univox/World/Chunk/ChunkMesh.cpp | C++ | cpp | 475 | no_license | #include "ChunkMesh.h"
ChunkMesh::ChunkMesh()
{
}
ChunkMesh::~ChunkMesh()
{
}
void ChunkMesh::create(Vec2i index)
{
m_index = index;
boundingBox.create({ 0.f, 0.f, 0.f }, { float(Consts::CHUNK_SIZE), float(Consts::CHUNK_HEIGHT), float(Consts::CHUNK_SIZE) });
Mesh::create();
}
void ChunkMesh::destroy()
{
Mesh::d... |
f54b89a93f590ba78870fd61c2ade35b63ccc0a2 | 4633698e9d3f553b9b9c6ed3d868e5fafdebb72c | readyalid/Tellion | /src/spork.cpp | C++ | cpp | 6,875 | permissive | // Copyright (c) 2015 The TLL developers
// Copyright (c) 2009-2012 The Darkcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bignum.h"
#include "sync.h"
#include "net.h"
#include "key.h"
#include "u... |
787bf1d63c69134fff44230fb5d733e5948ddd9f | 9622c30e5a95afff6377754b38cec72e657abf97 | AgSmith95/exercises | /interview/templates/expression_templates/expr_temp.hpp | C++ | hpp | 1,778 | no_license | #ifndef PPP_INHERITANCE_EXPR_TEMP_HPP
#define PPP_INHERITANCE_EXPR_TEMP_HPP
// to reduce the amount of temporary copies created by i.e.operator+
// usually inside some linear algebra libraries
#include <vector>
template <typename E>
class VecExpression {
public:
double operator[](size_t i) const { return stati... |
75536a8721811250a15950f6f03caf9c6ba6f6ec | e2af8d6386fe06fe3ea2b3328150244685f11b2b | oxidecomputer/openapi-generator | /samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp | C++ | cpp | 2,862 | permissive | /**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openap... |
4971a3d3aa6927fae2d9f02097c74997f4e1eac7 | ebb6e30381f79dba6f717e63d8576417b2217b2d | Andrewsher/Leetcode | /63_Unique_Paths_II.cpp | C++ | cpp | 1,539 | no_license | class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int result = 0;
int m = obstacleGrid.size();
if(m <= 0) return 0;
int n = obstacleGrid[0].size();
if(n <= 0) return 0;
// array[i][j] 表示位置(i, j)到目标的路径数目
int*... |
5cac0f87a16e825b633a66cf156b0cf3378c85a4 | eebe772a1e821e0185755da2b6a37dc397cd9801 | justwowwow/wow | /test/netbase_tests.cpp | C++ | cpp | 4,051 | no_license | #include <boost/test/unit_test.hpp>
#include <string>
#include <vector>
#include "netbase.h"
using namespace std;
BOOST_AUTO_TEST_SUITE(netbase_tests)
BOOST_AUTO_TEST_CASE(netbase_networks)
{
BOOST_CHECK(CNetAddr("127.0.0.1").GetNetwork() == NET_UNROUTABLE);
BOOST_CHECK(CNetAdd... |
f92173180a70c57235ca370593ea72bbefab9f6e | a8061884d80bb03c51fefd2f20626e0ce9d73616 | mexhippie/MondragonEmely_CSC5_Section40137 | /Hmwrk/Assignment 3/Homework 3b Savitch/Q2 Savitch_9thEd_Chap3_PracProb4_CompatibleSigns/Q2 Savitch/main.cpp | C++ | cpp | 1,153 | no_license | /*
* File: main.cpp
* Author: Dr. Mark E. Lehr
* Created on January 2, 2019, 12:36 PM
* Purpose: Horoscope Signs of the same Element are most compatible.
* There are 4 Elements in astrology, and 3 Signs in each:
* FIRE (Aries, Leo, Sagittarius),
* EARTH (Taurus, Virgo, Capricorn),
* AIR (Gemini, Libra, ... |
b6085f9b9ad33310d59a7ab463c839dbb6495328 | d9f20ec95d27d65a13c52a74bf80341410e27784 | Sharad24/acts-framework | /Algorithms/Generators/ACTFW/Generators/MultiplicityGenerators.hpp | C++ | hpp | 782 | no_license | // This file is part of the Acts project.
//
// Copyright (C) 2019 Acts project team
//
// 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/.
/// @file
/// @date 2018-03-1... |
bcd3db4a5c4564e3cfc08aa5a7f0928d6f1028a5 | 77dabd274bef3db8f2bef7d5ea039c4e62ed661a | Heartbroken/bikini-iii | /bikini/private/source/system/ticker.cpp | C++ | cpp | 1,037 | no_license | /*---------------------------------------------------------------------------------------------*//*
Binary Kinematics 3 - C++ Game Programming Library
Copyright (C) 2008 Viktor Reutzky
reutzky@bitchingames.com
*//*---------------------------------------------------------------------------------------------*/... |
f171e8ccbdc1d7ce74f2c1470bc7e117b575501b | 666a6c0df3a2992746c1aa2938cb68208dad3f4b | Smiling-Robotics/EasyDriver | /EasyDriver/EasyDriver.cpp | C++ | cpp | 3,403 | no_license | #include "EasyDriver.h"
EasyDriver::EasyDriver(int stp, int dir, int MS1, int MS2, int en) {
_stp = stp;
_dir = dir;
_MS1 = MS1;
_MS2 = MS2;
_en = en;
}
void EasyDriver::begin()
{
pinMode(_stp, OUTPUT);
pinMode(_dir, OUTPUT);
pinMode(_MS1, OUTPUT);
pinMode(_MS2, OUTPUT);
pinMode(_en, OUTPUT);
}
/... |
ea0decd0f1d7749033d53afaa9cbd2e4379fa07c | 5e015d82d15edfb4bd82bd3f7592f70f4042b0e7 | kritirikhi/DataStructuresAndAlgorithms | /SumOfLenOfSubarrWidUniqueEle.cpp | C++ | cpp | 439 | no_license | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
unordered_map<int,bool> mp;
int j=0;
int ans=0;
for(int i=0;i<n;i++){
while(j<n && mp[a[j]]==false ){
mp[a[j]]=tru... |
151bd58a905190d5af4e0f4ffff2673c29c4479e | 16923fef058b2980cdc408fb0561667be8c3feca | zhaonaiy/MaxDB_GPL_Releases | /7.6.00.37/V76_00_37/MaxDB_ORG/sys/src/SAPDB/DBProc/Proc_SessionListContextInterface.cpp | C++ | cpp | 1,739 | no_license | /*!*********************************************************************
@file Proc_SessionListContextInterface.cpp
@author DanielD
@brief
\if EMIT_LICENCE
========== licence begin GPL
Copyright (c) 2004-2005 SAP AG
This program is free software; you can redistribute it and/o... |
060c811759c76321046375a4c499266a0c72b9b4 | 7177ef0f42c533cba6dd487e8c28ce06e500d924 | j00v/NestEGG | /src/genwit.cpp | C++ | cpp | 1,882 | permissive | //
// Copyright (c) 2015-2018 The NESTEGG developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <iostream>
#include "genwit.h"
#include "chainparams.h"
#include "util.h"
CGenWit::CGenWit() : accWitValue(0) {}
CGe... |
7d382703b51669945b94eeb446eca9e42301b08c | 8f3556c3631dcdc36296b01dbe3af624ac81ace9 | FTN-E2-materials/ObjektnoOrijentisanoProgramiranje | /05/Resenja/1/student.hpp | C++ | hpp | 644 | no_license | #ifndef STUDENT_DEF
#define STUDENT_DEF
#include "osoba.hpp"
class Student : public Osoba
{
protected:
int brojIndeksa;
public:
Student(const char* s1 = "", const char* s2 = "", int i = 0) : Osoba(s1, s2), brojIndeksa(i) { }
Student(const DinString& ds1, const DinString& ds2, int i) : Osoba(ds1... |
fc35dcb706485571ccc5119c6f7d544f0d495b65 | dba4df4c0f6eda211584a92c2bdb7a4e64132527 | cwmagnus/bsf | /Source/Foundation/bsfEngine/GUI/BsGUIProgressBar.cpp | C++ | cpp | 3,144 | permissive | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
#include "GUI/BsGUIProgressBar.h"
#include "GUI/BsGUIWidget.h"
#includ... |
778c23c71bd75c731575e7f3cbb2bc590422e149 | 60b5d8d6a77897a2a053acf7a7b66fa93a4e7600 | kungs8/OpenCVAlgorithmRefinement | /OpenCV算法精解-代码/第5章:图像平滑/5.3/fastMeanBlur.cpp | C++ | cpp | 1,683 | no_license | #include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
using namespace cv;
//快速均值平滑:输入图像的数据类型为浮点型
Mat fastMeanBlur(Mat img, Size winSize, int borderType, Scalar value=Scalar())
{
//判断窗口的宽高是奇数
int hei = winSize.height;
int wid = winSize.width;
CV_Assert(hei % 2 ==... |
2fc1a0db49ee8fc4052430aa6c95a9528952dfaf | 9616bde013ad9f56751993e428ffc78e7102d7b5 | RamiAwar/RoutePlanner | /src/route_model.cpp | C++ | cpp | 2,586 | no_license | #include "route_model.h"
#include <iostream>
RouteModel::RouteModel(const std::vector<std::byte> &xml) : Model(xml) {
// Create RouteModel nodes.
int counter = 0;
for (Model::Node node : this->Nodes()) {
m_Nodes.emplace_back(Node(counter, this, node));
counter++;
}
CreateNodeToRoadH... |
c7c1c1d8bdba9d3723d346b6345b3ac7179c970f | 846352010300021e23cba68879f96fd9a574d4d8 | RaduM84/paradoxGameConverters | /common_items/ParadoxParserUTF8.cpp | C++ | cpp | 14,852 | no_license | /*Copyright (c) 2017 The Paradox Game Converters Project
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 use, copy, modify, merge, p... |
85b8edd956c211c787fd65bb7a2f4d56ebeb69b6 | 98221385742356e83704240970b2a6aa0a69bf6f | anexation/menda-plasma-next | /menda/menda/kstyle/animations/mendaanimation.cpp | C++ | cpp | 1,380 | no_license | /*************************************************************************
* Copyright (C) 2014 by Hugo Pereira Da Costa <hugo.pereira@free.fr> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the term... |
bd24ffc488a643d81040b99451d0519f976a77ff | 264fa247fbcbca93051e4610b7f5f6337055a640 | coeux/lingyu-meisha-jp | /server/godssenki/scene/sc_battle.cpp | C++ | cpp | 26,796 | no_license | #include "sc_battle.h"
#include "sc_battle_record.h"
#include "repo_def.h"
#include "random.h"
#include "sc_guwu.h"
#include <math.h>
#define USE_RECORD 0
#define KNIGHT_DMG_PER (0.8f)
#define MIN_DMG_PER (0.95f)
#define MAX_DMG_PER (1.00f)
#define CRIT_MLT (1.5f)
#define FRAME_TIME 100 //ms
#define MAX_FR... |
ce73e86a82f39531a9443c7221ede20cf41228bc | 02d8a0df65cfff7407bbacea83b93f7ed2185f56 | gnoliyil/fuchsia | /src/media/audio/tools/virtual_audio_util/virtual_audio.cc | C++ | cc | 40,308 | permissive | // Copyright 2019 The Fuchsia 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/media/audio/drivers/virtual_audio/virtual_audio.h"
#include <fuchsia/virtualaudio/cpp/fidl.h>
#include <lib/async-loop/cpp/loop.h>
#include <li... |
26efbf2c6b587fe185c4d50c89979ce15f641128 | 53c6d3aae5a5f83d6b7c1033c3ae37a5a41109cd | xKarfi/wyra-enia-regularne | /main.cpp | C++ | cpp | 793 | no_license | #include <iostream>
#include <regex>
#include <fstream>
using namespace std;
class kod_pocztowy
{
ifstream pl1;
ofstream pl2;
public:
void otworz()
{
pl1.open("pl1.txt");
pl2.open("pl2.txt");
}
void sprawdz()
{
bool czy_jest = true;
string word;
regex ko... |
fe864ef5d94aca16707760078586945ee1f86fc6 | 7358b4d4cf040465afb61d099c05aa52b699f55d | madnessw/thesnow | /Code/CPP/ClassicShell/ClassicStartMenu/ClassicStartMenu.cpp | C++ | cpp | 7,424 | permissive | // Classic Shell (c) 2009-2011, Ivo Beltchev
// The sources for Classic Shell are distributed under the MIT open source license
#include <windows.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
#include <atlstr.h>
#include <commctrl.h>
#include <shlobj.h>
#include <dbghelp.h>
#include "Strin... |
b508a58859e73970ba4e02d3b39fe3eda02713bc | 395a1d93319dba2db905838f21bdc84945d218bb | Dead3612/2020-203 | /loginovvv.cpp | C++ | cpp | 3,571 | no_license | #include "loginovvv.h"
/**
* Введение в дисциплину
*/
void loginovvv::lab1()
{
cout << "hello world!" << endl;
}
/**
* Метод Гаусса с выбором главного элемента
*/
void loginovvv::lab2()
{
//cout << "hello world!" << endl;
/////приводим к треугольнику
int z;
for (int i = 0; i < N; i++)
{
z = i;
//ишим... |
9af734ffb5bb5fcece6f766fa84157c9e443eace | 27b62c46db89f15422f57fbe1decd03f87836009 | corinnegroth/HELICS | /tests/helics/application_api/PrimaryTypeConversionTests.cpp | C++ | cpp | 10,203 | permissive | /*
Copyright (c) 2017-2020,
Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC. See
the top-level NOTICE for additional details. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
*/
#include <complex>
#include <gtest/gtest.h>
#include <list>
#include ... |
aa81645ec448151c5f34f26b3ed8c17ead20cfd8 | f902b54de264c3b73349332641b61c31c44d6086 | yuri410/rpg | /external/DirectXShaderCompiler/external/SPIRV-Tools/source/opt/folding_rules.cpp | C++ | cpp | 98,456 | permissive | // Copyright (c) 2018 Google LLC
//
// 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 ag... |
8e94d58cca341ac6f06eb66801fa9f196ac3c22a | 73626262e83ce03c6dec92c77af0c8c899180d80 | elix22/Rose | /apps-src/apps/studio/gui/dialogs/build.hpp | C++ | hpp | 1,567 | no_license | #ifndef GUI_DIALOGS_BUILD_HPP_INCLUDED
#define GUI_DIALOGS_BUILD_HPP_INCLUDED
#include "gui/dialogs/dialog.hpp"
#include "editor.hpp"
#include "thread.hpp"
class display;
namespace gui2 {
class ttrack;
class tbuild
{
public:
tbuild();
virtual ~tbuild();
void do_build_internal();
struct tbuild_ctx {
enum {sto... |
c014ccfd6cbf9417f772ab21717216d7d5b357dc | a3d66f2d619620ff53fcb217b011edde2fcc6cbb | Artanidos/FlatSiteBuilder | /main.cpp | C++ | cpp | 3,033 | no_license | /****************************************************************************
** Copyright (C) 2017 Olaf Japp
**
** This file is part of FlatSiteBuilder.
**
** FlatSiteBuilder 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 S... |
e3903af76a7f62ddc3fa701ff16b04ff2bc3857d | 9ad5418183ca898ee9cc851cfaf7324744f60308 | ChuyX3/angsys | /trunk/libs/graphics/source/d3d11/d3d11_driver.cpp | C++ | cpp | 25,485 | permissive | #include "pch.h"
#include "d3d11/d3d11_driver.h"
#if DIRECTX_SUPPORT
using namespace ang;
using namespace ang::graphics;
using namespace ang::graphics::d3d11;
namespace ang
{
namespace graphics
{
namespace d3d11
{
inline bool sdk_layers_available()
{
HRESULT hr = D3D11CreateDevice(
nullptr,
... |
ed39f3bf99a2f0f082fb2565e81e7c21f0735531 | c68b334a3cfd2c236c742af1a37dbdd49b764a62 | lxsang/antd-lua-plugin | /lib/ann/fann/tests/fann_test_train.cpp | C++ | cpp | 1,032 | permissive | #include "fann_test_train.h"
using namespace std;
void FannTestTrain::SetUp() {
FannTest::SetUp();
}
void FannTestTrain::TearDown() {
FannTest::TearDown();
}
TEST_F(FannTestTrain, TrainOnDateSimpleXor) {
neural_net net(LAYER, 3, 2, 3, 1);
data.set_train_data(4, 2, xorInput, 1, xorOutput);
net.... |
27d148c019a05f69966a4dda851b8c2d4d40103b | 7764c1212e048143f084e3e390d81cf4f1561be5 | sarthakgarg/programming-challenges | /Contests/zerocool-team-notebook/conv_hull_trick_dynamic.cpp | C++ | cpp | 3,901 | no_license | // This is a fully dynamic variant of the convex hull problem. The search range is 0 to INF
// The search is > 0
// lines added by the add function, min envelope value searched by the query function.
#include<stdio.h>
#include"iostream"
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#inclu... |
b35c37f815d3f1b785f7efb3088a617de9a0b2bb | 5e81a79d3b4c3f5eb324798a1ec62a9d5785e445 | sunyanbao/- | /WindField/Particle.cpp | C++ | cpp | 1,372 | no_license | #include "stdafx.h"
#include "Particle.h"
#include "GetData.h"
Particle::Particle()
{
lla_pos_ = Vector3d::s_zero;
//age_ = 40;
}
Particle::Particle(const Vector3d& pos,int age)
{
lla_pos_ = pos;
// age_ = age;
}
DeepEye::Vector3d Particle::CaclNextFramePos(float interval,const Vector2f& speed,f... |
7515f177b1249c323cedd717c395b0a87088ba2b | c485fdf2138c8511b878b581501fd470e0b15103 | xormor2/OmegaTranslationToFinnish | /src/newrand.cpp | C++ | cpp | 3,762 | no_license | /* A C-program for MT19937: Integer version */
/* genrand() generates one pseudorandom unsigned integer (32bit) */
/* which is uniformly distributed among 0 to 2^32-1 for each */
/* call. sgenrand(seed) set initial values to the working area */
/* of 624 words. Before genrand(), sgenrand(... |
2c679346a600180bed602d1f7f52497e0dfba0f7 | 56cdd1c3ba3fe4b844ca97241638247ad6c4eaec | Poscowekh/Project | /oxygine-framework/oxygine/src/oxygine/core/Object.cpp | C++ | cpp | 6,737 | permissive | #include "Object.h"
#include "Mutex.h"
#include "log.h"
#include "../utils/stringUtils.h"
#include "../winnie_alloc/winnie_alloc.h"
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <typeinfo>
#include "../EventDispatcher.h"
namespace oxygine
{
extern Mutex mutexAlloc;
void* fa... |
cac229c8cc3957ac652f24cc20f24524285b993d | 6b6c1ee1680d908842e24d3034fb156d2ffa200d | google/orbit | /src/DataViews/DataViewUtils.cpp | C++ | cpp | 388 | permissive | // Copyright (c) 2021 The Orbit 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 "DataViewUtils.h"
namespace orbit_data_views {
std::string FormatShortDatetime(absl::Time time) {
return absl::FormatTime("%m/%d/%Y %H:%M %p... |
4681302d386f8d1afd4cebb3368bc885bdcab69e | 978d73cf9d979236f7ec62ba4a1511117f8a7cbf | hyzor/ThreadsAndLocks_Assignment1 | /ThreadsAndLocks_Assignment1/Exercise3/person.hpp | C++ | hpp | 2,513 | no_license | #ifndef PERSON_HPP_
#define PERSON_HPP_
#include<chrono>
#include<random>
#include<thread>
/* time is represented using doubles */
using simulation_time_t = double;
/* some random number generators for creating persons */
std::random_device rd;
std::default_random_engine generator(rd());
std::exponential_distributio... |
a95d558436c1bc00608f5b1fb19373d3aa094d34 | 2991e899318a023177b885a368a6f6e54139d036 | nomadbyte/qtcreator-plugin-fossil | /src/plugins/fossil/pullorpushdialog.cpp | C++ | cpp | 3,547 | permissive | /**************************************************************************
** This file is part of Fossil VCS plugin for Qt Creator
**
** Copyright (c) 2013 - 2020, Artur Shepilko, <qtc-fossil@nomadbyte.com>.
**
** Based on Bazaar VCS plugin for Qt Creator by Hugues Delorme.
**
** Permission is hereby granted, fre... |
17682c9020acca2d2fbb1aa427cc1c12f08b7a79 | 6f74547713b3777c64bce6e365d0a9a4c8494ae8 | andronov04/chromium | /ui/views/controls/button/button.cc | C++ | cc | 22,957 | permissive | // 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 "ui/views/controls/button/button.h"
#include <utility>
#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_enums... |
db537edc8a4564ad1e329c8656985b3be9bc6454 | 7f48e776d816a28990f22f9a2bf4d5418407e16d | bat1024996/2021 | /test_3_28/test_3_28/test.cpp | C++ | cpp | 1,245 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
//
//int main()
//{
// int a = 5 & (-5);
// int ret = a&(a - 1);
// cout <<a<<endl;
// cout << ret << endl;
//
// return 0;
//}
//int mySqrt(int x){
// //sqrt(x)<x/2+1
// int i = 0;
// for (i = 0; i<x / 2 + 2; ++i)
// {
// if (i*i == x)
/... |
e51f09e85b2cc9680e2149c85fc76a7cff34e993 | 643abc9d96dae423d7294883efb38d92c57c187b | Medghofran/opengl_docker | /src/main.cpp | C++ | cpp | 8,253 | permissive | #include "shader.hpp"
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GL/glew.h>
#include <GL/glxew.h>
#include <cmath>
#include <iostream>
// display device configuration attributes
constexpr EGLint configAttribs[] = {EGL_SURFACE_TYPE,
EGL_PBUFFER_BIT,
... |
b9b77bcd60f1ca3c5cdddfdfe9cf51e46accd581 | 0bb7336d1d4b90045b285078c9c6627011573437 | gcexits/db_demo | /root/src_code/codec/H264Decoder.cpp | C++ | cpp | 7,822 | no_license | #include "H264Decoder.h"
#include <cassert>
#include "../display/MediaState.h"
bool H264Decode::Decode(uint8_t *buf, uint32_t size) {
AVPacket pkt;
av_init_packet(&pkt);
pkt.data = buf;
pkt.size = size;
auto ret = context.Send(&pkt);
if (ret < 0) {
return false;
}
if (context.U... |
fc2f1eb6ecc902375234fbb1936949ac9a5caa59 | f0ceef307890f1ab20aeec0c20401819d77a9b14 | zenoalbisser/chromium | /media/cast/net/rtcp/rtcp_defines.cc | C++ | cc | 1,628 | permissive | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/cast/net/rtcp/rtcp_defines.h"
#include "media/cast/logging/logging_defines.h"
namespace media {
namespace cast {
RtcpCastMessage::RtcpC... |
e9c4962f27588c886b4188e7beaca96f43c26293 | 2cd8183e342cf0c54d4d04296a59577ebec8782a | moutard/learn | /codeEval/closest_pair.cpp | C++ | cpp | 4,743 | no_license | #include <string>
#include <iostream>
#include <fstream> // std::ifstream
#include <sstream> // std::stringstream
#include <stdlib.h>// atoi
#include <vector>
#include <math.h>
#include <algorithm>
#include <cfloat>
#include <iomanip>
class Point {
public:
Point(unsigned int x, unsigned int y);
std::ostream& ... |
41f52cdf18642a497719d4175e2417117ea97d59 | e93211cf67967427e80427e6e7d48afaf4673aad | LePelicaN/EntrainementJaponais | /src/legacy/fenetrePrincipale.cpp | C++ | cpp | 33,168 | no_license | #include "fenetrePrincipale.h"
#include <rechercheMot/chercheurMot.hpp>
namespace {
QTextEdit * FabriqueTextEdit()
{
QTextEdit * textEdit = new QTextEdit();
textEdit->setTabChangesFocus( true );
textEdit->setFontPointSize( 16 );
textEdit->setFixedHeight( 36 );
return textEdit;
}
} // unnamed namespac... |
aad4936c5d2f9cb48a12ca3bc43025a7313ce58d | b151389eac719ab7ec4ec91cb9d68cfb864f0b26 | rnyholm/iris | /laborations/tft7Inch/RA8875-bd53a9e165a1/TextDisplay.cpp | C++ | cpp | 2,621 | permissive | /* mbed TextDisplay Display Library Base Class
* Copyright (c) 2007-2009 sford
* Released under the MIT License: http://mbed.org/license/mit
*/
#include "TextDisplay.h"
#define DEBUG "Text"
// ...
// INFO("Stuff to show %d", var); // new-line is automatically appended
//
#if (defined(DEBUG) && !defined(... |
be627d965e886231b0685351c4c2475cbb30c273 | b1e371e674dc59aeb7ad9ff86aebc60cbacab319 | inuse918/Cpp_Practice_2 | /190516/newMemory04.cpp | C++ | cpp | 572 | no_license | #include <iostream>
using namespace std;
class TestC
{
int iData;
public:
TestC() { cout << "TestC::TestC()" << endl; }
~TestC() { cout << "TestC::~TestC()" << endl; }
};
int main()
{
// 배열로 new 연산을 수행할 수 있음.
cout << "main begin" << endl;
TestC* ptr = new TestC[3];
// heap 영역에 객체가 배열형태로 메모리 할당
// 배열로 생성된 것은 반... |
b92173c0ccc1af630270d6b61dd07879c2037ec4 | fbdb9af01d1b2e64a9c41c4169b273d5a11c29a9 | Finalcheat/leetcode | /src/cpp/Peeking-Iterator.cpp | C++ | cpp | 2,449 | no_license | /**
* @file Peeking-Iterator.cpp
* @brief 顶端迭代器(https://leetcode.com/problems/peeking-iterator/description/)
* @author Finalcheat
* @date 2018-10-27
*/
/**
* Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it essent... |
08c53e5476b81a66b38780859f3df5a4e4511aa0 | ccf66a057110f5c05b0a7125d794f9c24e5e1d1b | crosslore/moos-ivp-aro | /releases/moos-ivp-15.5.1beta/MOOS_ThinkingAug2815/MOOSCore/Core/libMOOS/Utils/CommandLineParser.cpp | C++ | cpp | 4,856 | no_license | /**
///////////////////////////////////////////////////////////////////////////
//
// This file is part of the MOOS project
//
// MOOS : Mission Oriented Operating Suite A suit of
// Applications and Libraries for Mobile Robotics Research
// Copyright (C) Paul Newman
//
// This software was written by P... |
d09d1fe37cda0ec0669283f08326c924e9170321 | 06c226fdbfba70b135f98bfbd3c9ba6e1cb90985 | RPirvu/MPP-Labs | /TemaLab2/TemaLab2/TemaLab2.cpp | C++ | cpp | 2,959 | no_license |
// TemaLab2.cpp : Defines the class behaviors for the application.
//
#include "pch.h"
#include "framework.h"
#include "TemaLab2.h"
#include "TemaLab2Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CTemaLab2App
BEGIN_MESSAGE_MAP(CTemaLab2App, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
... |
4b197488b7957746c146fac363a5de09f04af164 | 4083e82176cf1cc02731ce69c8cd98fdac9cce75 | zuokun23/leetcode | /0080-Remove-Duplicates2.cpp | C++ | cpp | 2,188 | no_license | //80:给定一个排序数组,你需要在原地删除重复出现的元素,使得每个元素最多出现两次,返回移除后数组的新长度。
//不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完成。
//1
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if(nums.size() == 0)
return 0;
int i = 1 , j = 0;//[0,j]是安全区
int flag = true;//记录出现次数
fo... |
5ab632d9f86cefa93b720011e0be584bc37aff93 | 150cef033e61539ede03d4c3824f632750b8ee6c | zackmarks/lab05_zackmarks | /dataAQ.cpp | C++ | cpp | 7,065 | no_license | //Zack Marks
//cs32 Lab05 Prof. Wood W21
#include "dataAQ.h"
#include "demogData.h"
#include "psData.h"
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
dataAQ::dataAQ() {}
//for later
string makeKeyExample(shared_ptr<demogData> theData){
string theKey = "Key";
if(theData->getPercB... |
8668e2378a2cac8b2559ceb303814999b0c36ed4 | b1b59282751d3f480dcd010957aaccec50b1ec6b | liang0/chromium | /media/capture/video/chromeos/camera_hal_delegate_unittest.cc | C++ | cc | 10,534 | 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 "media/capture/video/chromeos/camera_hal_delegate.h"
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <utility>
#include "ba... |
0b5943728602a8d21a229294e11022d9f2d1dde1 | 2d952280c2cd5c85f3f0addf90d91a25622f960f | sculpordwarf/iceoryx | /iceoryx_posh/source/runtime/message_queue_interface.cpp | C++ | cpp | 15,158 | permissive | // Copyright (c) 2019 by Robert Bosch GmbH. 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... |
edf776ea850549a5354517a4fefecab1a570726d | 3e02054127d2ad5be5119bb99cccebda9c97e2e3 | skidne/piscine_cpp | /rush00/src/Enemy.cpp | C++ | cpp | 1,792 | no_license | #include "Enemy.hpp"
Enemy::Enemy()
{
this->die();
}
Enemy::Enemy(Enemy & en)
{
this->x1 = en.x1;
this->x2 = en.x2;
this->y1 = en.y1;
this->y2 = en.y2;
this->lives = en.lives;
this->type = en.type;
}
Enemy::~Enemy() {}
Enemy & Enemy::operator=(Enemy & en)
{
this->x1 = en.x1;
this->x2 = en.x2;
this->y1 = ... |
a1ed364572e91381fe1ddcbd64047d3de9160df9 | 1993e161a581b4f0d9389c647e95b5ddaca79e90 | webb-3w/chromium-src | /media/test/pipeline_integration_test_base.cc | C++ | cc | 24,283 | permissive | // 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 "media/test/pipeline_integration_test_base.h"
#include <memory>
#include <utility>
#include "base/bind.h"
#include "base/callback.h"
#inclu... |
d25afc8c757da08800f42066626ce8afbfe1e2d0 | 104d44a48356d04654db3c88528b2a7da1711139 | cs15b047/CF | /Contests/3/3.cpp | C++ | cpp | 974 | no_license | #include <bits/stdc++.h>
using namespace std ;
int main(int argc, char const *argv[])
{
int n;cin>>n;
vector<long long int> a(n) ;
for(int i=0;i<n;i++)cin>>a[i] ;
map<long long int,int>m;
for (int i = 0; i < n; ++i)
{
if (m.find(a[i]) == m.end())
{
m[a[i]] = 1 ;
}else m[a[i]]++ ;
}
int ans = 0 ;... |
bb090a91043594cb9a65a756fdc3b6221a3d35ee | fab65221fe1555470b6de3766a8b224c78b44748 | yang2019901/allCode | /能量机关击打/MillHiter.hpp | C++ | hpp | 5,914 | no_license | /*
* namespace "millhiter" mainly contains MillHiter class and designed to fulfill mill-hitting ability as its name goes.
* It is deprived from Mill.hpp, thus independent, and focused on mill-hitting, the ability part.
* Due to its independency, it can be relatively easy to add functions to this class and namespace... |
87f09ae5f115d4edb39f64f4e886b74b2c7120f6 | fd9c384b7df249beb7fe90fb3a9a6325aad8f33a | menucha-de/Util.Modbus | /src/main/cpp/common/Exception.cpp | C++ | cpp | 2,794 | permissive | #include "Exception.h"
#include <stddef.h> // NULL
#include <stdio.h> // asprintf
#include <malloc.h> // free
namespace CommonNamespace {
class ExceptionPrivate {
friend class Exception;
private:
std::string message;
std::string file;
int line;
Exception* cause;
... |
81cc1a7a5ab1f7f4f491efc4e1f3999601817d59 | b5699120364fa2ee2786ec980d5f7e63f279960e | crertel/onizuka-oculus-client | /include/ZSTL/ZBasicString.hpp | C++ | hpp | 22,060 | no_license | /*
ZBasicString.hpp
Author: James Russell <jcrussell@762studios.com>
Created: 12/25/2011
Purpose:
Basic ASCII string implementation.
License:
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of... |
5e3b949671a021b5b5dff9d3881f18dc2e401eeb | 146851cb6effbb6e70574fbbd56dfdf4b56230e2 | luminositydev/xum | /src/rpcrawtransaction.cpp | C++ | cpp | 24,428 | 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 <boost/assign/list_of.hpp>
#include "base58.h"
#include "bitcoinrpc.h"
#inclu... |
d7872bdf0e01850d306fee3d85f6a9b210e9dcba | b33827f658de20a024ebde09f92a0a22d7f2236e | wanghongsheng01/Dubhe | /oneflow-master-zj/oneflow/user/kernels/model_update_kernels.cpp | C++ | cpp | 42,844 | permissive | /*
Copyright 2020 The OneFlow Authors. 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 agre... |
a21954c3b4b64fc19dd1f0075bd3d3cb47f3af0a | 35b4974aff05892c14c601e2a2ca7309e0d17052 | umr-dbs/mapping-core | /src/util/gdal.cpp | C++ | cpp | 2,888 | permissive |
#include "datatypes/raster.h"
#include "util/gdal.h"
#include "util/log.h"
#include "util/CrsDirectory.h"
#include <mutex>
#include <gdal_alg.h>
#include <ogr_spatialref.h>
namespace GDAL {
static std::once_flag gdal_init_once;
static void MyGDALErrorHandler(CPLErr eErrClass, int err_no, const char *msg) {
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.