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 |
|---|---|---|---|---|---|---|---|---|
09dcf28d989f8758651b17531c447c3448c788f9 | 5f3b01bcd78884f2dff6dbd0e785b1c6ffa47b29 | pdudero/usercode | /MyEDmodules/HcalDelayTuner/interface/HcalDelayTunerAlgos.hh | C++ | hh | 10,773 | no_license | #ifndef _MYEDMODULESHCALDELAYTUNERALGOS
#define _MYEDMODULESHCALDELAYTUNERALGOS
// -*- C++ -*-
//
// Package: HcalDelayTunerAlgos
// Class: HcalDelayTunerAlgos
//
/*
Description: <one line class summary>
Implementation:
<Notes on implementation>
*/
//
// Original Author: Phillip Russell DUDERO
// ... |
acbbc1f63b4442e5fe5151747feaf48e63cf9929 | 450e4f35aa8d208d9f89de0929ff1035b24c89d2 | kikisaints/react-native-windows | /vnext/IntegrationTests/TestInstance.cpp | C++ | cpp | 4,759 | permissive | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "TestInstance.h"
using namespace facebook::react;
using std::make_unique;
using std::map;
using std::move;
using std::shared_ptr;
using std::string;
namespace Microsoft::React::Test {
#pragma region TestViewManager members
TestVie... |
851aec336dbd1678187fc00c55c561a3963b5f9e | 977e83e96e01b8ff08b2bc29297ac43f946f9b23 | IsraMekki/tiramisu_code_generator | /cmake-build-debug/programs_tiling/function14376/function14376_schedule_7/function14376_schedule_7.cpp | C++ | cpp | 680 | no_license | #include <tiramisu/tiramisu.h>
using namespace tiramisu;
int main(int argc, char **argv){
tiramisu::init("function14376_schedule_7");
constant c0("c0", 256), c1("c1", 2048), c2("c2", 128);
var i0("i0", 0, c0), i1("i1", 0, c1), i2("i2", 0, c2), i01("i01"), i02("i02"), i03("i03"), i04("i04");
computa... |
8611ddaa38e0f92f6a1652be3114edbb710a9efa | d1ea4b8ff45f7f2ed4f8a83069ee25676bb5c6bd | ShadowWarden/CSCI4239-HW3 | /hw3.cpp | C++ | cpp | 297 | no_license |
#include <QApplication>
#include "hw3viewer.h"
//
// Main function
//
int main(int argc, char *argv[])
{
// Create the application
QApplication app(argc,argv);
// Create and show view widget
Hw3viewer view;
view.show();
// Main loop for application
return app.exec();
}
|
4f68b47e2857f1c8a5321712311855a9f84ddf18 | 8ca56bee292ea43c7ba4f8bd16ceaa9b9a07f6a9 | mholyoak/CircularSharedPtr | /main.cpp | C++ | cpp | 1,022 | no_license | #include <iostream>
#include <memory>
class OwnShareOne;
class OwnShareTwo;
class OwnShareOne
{
public:
OwnShareOne()
{
std::cout << "Construct OwnShareOne" << std::endl;
}
void setShare(const std::shared_ptr<OwnShareTwo>& shareTwo)
{
shareTwo_ = shareTwo;
}
~OwnShareOne(... |
9c1a2d3a13de70d7d264ef7da595dbe59bdfe792 | 70cc0f1b95e4c47765e3e6e06fd094e78f620d88 | Razorshi-Prozzwal-Talukder/ACM-Solve | /CodeforceS Submitted/Bear and Raspberry.cpp | C++ | cpp | 315 | no_license | #include<bits/stdc++.h>
using namespace std;
main()
{
int n, c;
while(cin>>n>>c)
{
int i, a[100000];
for(i=1; i<=n; i++)cin>>a[i];
int ans=0;
for(i=1; i<n; i++)
{
ans = max(ans, a[i]-a[i+1]-c);
}
cout<<ans<<endl;
}
return 0;
}
|
8b0d5e54db7d9dbcb88b77db9fe643b66912a6a0 | 4a102130e1756ba78d5486e8bfbeeb3b7f0bf720 | rianquinn/hypervisor | /kernel/src/get_current_tls.hpp | C++ | hpp | 1,656 | permissive | /// @copyright
/// Copyright (C) 2020 Assured Information Security, Inc.
///
/// @copyright
/// 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 limita... |
d08e5e57e7a6b8f71b8cf3f362b9856d1cb767f4 | 329c0232840fcb41a9e93d6b0b481b70b291b803 | hayakawa6660/chainsaw-girl-mock | /Source/ChainsawGirlMock/Private/Common/AnimationController.cpp | C++ | cpp | 218 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "Common/AnimationController.h"
AnimationController::AnimationController()
{
}
AnimationController::~AnimationController()
{
}
|
f951709e4c702ec01f6aae509376be75eb7f3bd7 | 6536c91d4231facb4723c29283fb683e570670a4 | Emungai/mpc_fiveLink | /rabbit_stepUP/gen/sim/fRightToe_vec_RightImpact.cc | C++ | cc | 4,879 | no_license | /*
* Automatically Generated from Mathematica.
* Wed 11 Dec 2019 12:21:29 GMT-05:00
*/
#ifdef MATLAB_MEX_FILE
#include <stdexcept>
#include <cmath>
#include<math.h>
/**
* Copied from Wolfram Mathematica C Definitions file mdefs.hpp
* Changed marcos to inline functions (Eric Cousineau)
*/
inline double Power(doub... |
29a6ac1eee1564b20a1cf8bb5aa351a998e99733 | d6f697a41a8339da9a580abffe815ce753164aa2 | loravocado/restaurant_finder | /lcd_image.cpp | C++ | cpp | 2,084 | no_license | /*
* Routine for drawing an image patch from the SD card to the LCD display.
*/
#include "Adafruit_GFX.h" // Core graphics library
#include "MCUFRIEND_kbv.h" // Hardware-specific library
#include <SPI.h>
#include <SD.h>
#include "lcd_image.h"
/* Draws the referenced image to the LCD screen.
*
* img ... |
7ce63d91fca7022da362bda6bc6fc08ac4350395 | 689c86fa25a14b7655ad25f930feb31fcd8162a2 | notzain/dnd | /src/KnightSword.cpp | C++ | cpp | 829 | no_license | #include "KnightSword.h"
#include "Hero.h"
#include "Monster.h"
#include <iostream>
KnightSword::KnightSword()
: Item("Knight's Sword")
{
}
const char* KnightSword::description()
{
return "A shiny sword used by a knight. (12 dmg)\n";
}
bool KnightSword::use(Hero& hero)
{
if (!m_isEquipped) {
std:... |
ae7c29c6c1fd7c421eeb6422b2c899e8bf0a5f5d | 7a93d37d8377cc360e33fc47b3f060bb37fd141c | MateuszSnamina/yaml-inputter-tk | /yaml-inputter-tk--project-dir/yaml_inputter_code_generator/include/classes_kit/read_enums.hpp | C++ | hpp | 274 | no_license | #ifndef CLASSES_KIT__READ_ENUMS_HPP
#define CLASSES_KIT__READ_ENUMS_HPP
#include<vector>
#include<memory>
#include<yaml-cpp/yaml.h>
#include<classes_kit/enum.hpp>
void read_enums(
const YAML::Node & node,
std::vector<std::shared_ptr<Enum>> &enums);
#endif |
27a74b9f6df4fd5ad45d871b8358d8039e028754 | 57f749bbd45395492da123c20552fd16ab595cbc | RolphWoggom/shr.tar | /Simpsons Hit&Run/game/libs/pure3d/tools/plugins/maya/common/src/mayaResolveName.cpp | C++ | cpp | 14,155 | no_license | //===========================================================================
// Copyright ©2002 Radical Entertainment Ltd. All rights reserved.
//
// Created: 02 December, 2002
//
// Component: mayaResolveName.cpp
//
// Description: In the case where you need to initiate a callback on
// no... |
8cb0744bd1f5b22d86f3e862207497922a858019 | 149b6f1814593a9db0c74cea80ca5b830ee9aec5 | scottScottScott/WeAreTalkingAboutPractice | /old/StarryNight.cpp | C++ | cpp | 3,194 | no_license | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <set>
#include <string>
#include <algorithm>
using namespace std;
int W, H;
set<pair<int, int>> visited;
vector<vector<int>> getShape(vector<vector<bool>> &map_input, int a, int b) {
queue<pair<int,... |
50d3836e07fc3138c825f8054a3d2ff95e647f2f | af6989e2af59b3b3b4bddbaa473726c7f68e5918 | shingchuang/intelRSD | /PSME/common/logger/include/logger/logger_factory.hpp | C++ | hpp | 3,097 | permissive | /*!
* @section LICENSE
*
* @copyright
* Copyright (c) 2015-2016 Intel Corporation
*
* @copyright
* 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
*
* @copyright
* http://www.apach... |
d8bf3343d10574d3808086b65f51aa3e7f5b780a | 65ee4642b9c63ce984117187dc5a128f73c5c4d8 | vixledger/vixal | /core/src/overlay/ItemFetcher.cpp | C++ | cpp | 4,017 | no_license | // Copyright 2014 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
#include "overlay/ItemFetcher.h"
#include "crypto/Hex.h"
#include "herder/Herder.h"
#include "a... |
32f38dea49b5d04d70ac4b3306270e1e2317e2e7 | b90ac5ae7b6788829e1ecc13531fe3b309836a9d | kk-katayama/com_pro | /Graph/Tree/EulerTour/POJ2763.cpp | C++ | cpp | 2,562 | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<typename T>
struct Tree
{
int node;
vector<vector<pair<int,T>>> edge;
vector<vector<int>> par;
vector<int> depth;
vector<boo... |
c4b0d99243bc4373f93d25090d621f8251551a06 | 311e25fa68a115d721d76be84ab8e2d13645919f | leoneed03/all | /huffman2/main.cpp | C++ | cpp | 1,019 | no_license | #include "huffman.hpp"
enum errors {v_flag_wrong_position, no_c_d_flag, too_few_arguments};
int main(int argc, char* argv[]) {
std::vector<std::string> my_argv(argc);
for (int i = 0; i < argc; ++i) {
my_argv[i] = std::string(argv[i]);
}
if ((argc < 4)) {
std::cout << "give at least 4 ar... |
35c105807914a896f1ea5880861438c7f338a0ed | 377c9e21122f9f8f6df05e0527d836f0737adf1c | zerowanghao/OpenGL-Learning | /OpenGL Tutorial/OpenGL Tutorial/VertexArray.cpp | C++ | cpp | 732 | no_license | #include "VertexArray.h"
namespace Renderer
{
VertexArray::VertexArray()
{
glGenVertexArrays(1, &mVertexArrayID);
}
VertexArray::~VertexArray()
{
glDeleteVertexArrays(1, &mVertexArrayID);
for (size_t i = 0; i < mBuffers.size(); i++)
{
delete mBuffers[i];
}
}
void VertexArray::enable() const
... |
4f039aee28d5e3ce5b8c4626fd6768ac95659185 | f2e84c1ebae374a25332291dbc832be233700c71 | Muntaha-Islam0019/URI-Online-Judge-Solutions | /Beginner/P2029.cpp | C++ | cpp | 452 | permissive | #include <bits/stdc++.h>
#define D(x) cout << #x " = " << (x) << endl
#define endl '\n'
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
double v, d;
cout << fixed << setprecision(2);
while (cin >> v >> d)
{
double r = d * 0.5;
double h = v / (... |
37c8358a1b669eb85ab2e37a37b57e627604a2a3 | a75172220033e759f44a3dc83ffca81e4845b551 | vandermerwewaj/RED4ext.SDK | /include/RED4ext/Scripting/Natives/Generated/game/events/UserEnteredCoverEvent.hpp | C++ | hpp | 687 | permissive | #pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/Scripting/Natives/Generated/WorldTransform.hpp>
#include <RED4ext/Scripting/Natives/Generated/red/Event.hpp>
namespace RED4ext
{
namespace game::ev... |
55370cb4d5fc6860f3aefbc623ab68d061d90a24 | 5d1e7b31460cf3ce0232d8a0601e77aab1283200 | Dark-Rich/libhjw | /testbed/mybwai/tmpl/aimod.cpp | C++ | cpp | 697 | no_license | #include "aimod.h"
using namespace BWAPI;
void %(AIMOD)s::onStart()
{
}
void %(AIMOD)s::onEnd(bool isWinner)
{
}
void %(AIMOD)s::onFrame()
{
}
void %(AIMOD)s::onUnitCreate(BWAPI::Unit* unit)
{
}
void %(AIMOD)s::onUnitDestroy(BWAPI::Unit* unit)
{
}
void %(AIMOD)s::onUnitMorph(BWAPI::Unit* ... |
b72b6d7ddabb07671c360815968e1a71aaab10b4 | 3e5b42be94035acec548030a388a8f5650e8e2bb | gdidomenico/CTLAB | /src/readwrite.hpp | C++ | hpp | 5,126 | no_license | /*!
* \file readwrite.hpp
* \brief This file mainly includes read and write functions called by users. The author strongly suggest the users do NOT modify any codes but you can add your own functions and classes.
* \author Rui Liu
* \version 1.0
* \date 08/24/14
*/
#pragma once
#include <string>
#include <vector>
#incl... |
519aa782f58f0441d5a6770466945e78eb42fa88 | e72b1845fa7b2afe9cfc9bc5b685737c27acfedd | ikysil/ikforth | /tools/loader/sysnt/sysio.cpp | C++ | cpp | 2,059 | permissive | #include "../sysio.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../IKFCommon.hpp"
#include "../IKFunc.hpp"
HANDLE hOut;
void sys_initIo() {
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
}
bool sys_ReadFile(HANDLE hFile, void * lpBuffer, DWORD nNumberOfBytesToRead, DWORD * lpNumberOfBytes... |
2a5b2dd588d466b021852d835746f3fd016d2457 | 16fedd0e8118ddb1df82a7aa6e8ebcee05378c48 | massnetwork/mass-browser | /components/payments/payments_validators_test.cc | C++ | cc | 11,605 | 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 "components/payments/payments_validators.h"
#include "testing/gtest/include/gtest/gtest.h"
#include <ostream> // NOLINT
namespace payments {
n... |
1edea0a5d2d1e555a683525309c92efc625297f0 | 531f851c4789c3c70ac82f254ff1af6f0ecfcf84 | palmenros/GraphicCalculator | /Interpreter/InterpreterFunction.cpp | C++ | cpp | 408 | no_license | #include "InterpreterFunction.h"
InterpreterFunction::InterpreterFunction()
: parameterNumber(0), function(nullptr)
{
}
InterpreterFunction::InterpreterFunction(const std::function<Number(const std::vector<Number>&)>& f, int parameterNumber)
: parameterNumber(parameterNumber), function(f)
{
}
Number InterpreterFu... |
4cff596420001977b09a0f5aa6d337b766be10ff | ff3d646c3e59d004c2daf6a65addd34d544a6e9a | pajeetlord/jasmine | /src/qt/transactiondescdialog.cpp | C++ | cpp | 1,083 | permissive | // Copyright (c) 2011-2013 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2017 The Jasmine developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "transactiondescdialog.h"
#in... |
be8a771e5558db73d5a776eacdbe98717de169e3 | 6cacdda2bb3ec3628ee9299709bc2c562d6859fb | zhangf2atwit/Covid-19-Vaccine-Application | /VaccineSchedule/Register.cpp | C++ | cpp | 1,242 | no_license | #include "Register.h"
Register::Register()
{
}
#ifndef REGISTER_H
#define REGISTER_H
#include <QSqlDatabase>
#include <QtSql>
#include <QSqlQuery>
#include <QObject>
class Register : public QObject{
Q_OBJECT
private:
QString firstName;
QString lastName;
QString username;
QString password;
... |
d26151a125d4655c482b6d69dcb587588aa5990b | 2358628dbf31c7dea3f3ab59d12a774625ff1d5b | xhdrkawk1/FrameWork | /FrameDirectX12/Client/Default/Client.cpp | C++ | cpp | 8,739 | no_license | // Client.cpp : 응용 프로그램에 대한 진입점을 정의합니다.
//
#include "stdafx.h"
#include "Client.h"
#include "MainApp.h"
#include "TimeMgr.h"
#include "FrameMgr.h"
#include "DirectInput.h"
#include "DirectSound.h"
#define MAX_LOADSTRING 100
// 전역 변수:
WCHAR szTitle[MAX_LOADSTRING]; // 제목 표시줄 텍스트입니다.
WCHAR szWindowCl... |
dcda16d9b62d2ca91b3d5a17a132947cf855f8f1 | c33b292b3cade48df31fb92580e5e0d4d96e0ece | Bappy38/Light-OJ-solved-Problem | /Beginner/LOJ-1020 - A Childhood Game.cpp | C++ | cpp | 3,781 | no_license | #include<bits/stdc++.h>
#define perfect int main()
#define ll long long int
#define ull unsigned long long int
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sc scanf
#define scin(x)... |
07f9ac44851fed04ed014422cf6f5b56cb56a755 | 2dbaed6ff288f6f8c3e391a3d880c1ad12487278 | LittleSophia/Agenda | /test/StorageTest.cpp | C++ | cpp | 5,412 | no_license | #include "Storage.hpp"
#include <gtest/gtest.h>
#include <list>
#include <vector>
bool operator==(const User &t_user1, const User &t_user2) {
if (t_user1.getName() == t_user2.getName() &&
t_user1.getPassword() == t_user2.getPassword() &&
t_user1.getEmail() == t_user2.getEmail() &&
t_user1.getPhone(... |
136cd27ed9fe2fa72ebb03742c019eff2cb2c692 | 7b11b5b379bd5b44b01ed607d02e7d8204bfc13c | nghiaht0411/DGP | /organized.cpp | C++ | cpp | 4,502 | no_license | #include "organized.h"
OrganizedData::OrganizedData()
{
nTrain = nTest = nSupport = 0;
nDim = nBlock = bSize = 0;
}
OrganizedData::~OrganizedData()
{
train.clear(); test.clear(); support.clear();
}
void OrganizedData::process(RawData* raw, int nBlock, double pTest, int support_per_block, int max_... |
4635510e5f5eb001e20e8b187b4b83cb3e79d0ef | 5db7cee0980580a4178e928a468214b10bc4f2e6 | foxx3r/learn_cpp | /basic_concepts/working_with_variables.cpp | C++ | cpp | 238 | permissive | #include <iostream>
using namespace std;
int main()
{
int a, b;
int sum;
cout << "Enter a number \n";
cin >> a;
cout << "Enter another number \n";
cin >> b;
sum = a + b;
cout << "Sum is: " << sum << endl;
return 0;
}
|
535d3934c834bef279c1b87c3e057fe142f0ecdc | 113a498e3736b69a80b0f5f1d16a214fa1dbd332 | Armenuhi-Qocharyan/ITC-8 | /Homework/Ruben/openCV/detect/peopledetect.cpp | C++ | cpp | 1,719 | no_license | #include <iostream>
#include <stdexcept>
#include <opencv2/objdetect.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/video.hpp>
#include <opencv2/videoio.hpp>
using namespace cv;
using namespace std;
static void detectAndDraw(const HOGDescriptor &... |
07f6fc795f2dbbc802c5e1afa1fa7771198af91f | ced4abd027c7c2a68447f3e78243f91ee2f4fba2 | ashutosh0gupta/llvm_bmc | /examples/litmus/c/run-scripts/tmp_10/MP+dmb.sy+[fr-rf]-ctrl-pos.c.cbmc.cpp | C++ | cpp | 61,447 | no_license | // Global variabls:
// 2:atom_1_X0_1:1
// 0:vars:2
// 4:atom_1_X3_0:1
// 3:atom_1_X2_2:1
// 5:atom_1_X5_0:1
// Local global variabls:
// 0:thr2:1
// 1:thr0:1
// 2:thr1:1
#define ADDRSIZE 6
#define LOCALADDRSIZE 3
#define NTHREAD 4
#define NCONTEXT 10
#define ASSUME(stmt) __CPROVER_assume(stmt)
#define ASSERT(stmt) __C... |
c41ecdb0e1df453187e69e05fc134bbd38391579 | fe7dc260c304e9682e029a77808fe6d4b29d42aa | tahanebti/tnlib | /streams/utils/Complexity.cpp | C++ | cpp | 9,647 | no_license | //
// complexity
// Created by taha nebti.
// Copyright (c) 2019. All rights reserved.
//
#include <bits/stdc++.h>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
/**
* Complexity : input >= 0
* - function do more work for move input
* - drop all constant
* - ignore low... |
090232afeb27710d2a8a98ee1c035a856d14dcb7 | 0088d9e2ec3e3c06ce226650c6c0f4bcdaccbb85 | mugur9/cpptruths | /cpp/function_try.cpp | C++ | cpp | 647 | no_license | #include <iostream>
using namespace std;
class X
{
public:
~X()
{
throw 2000;
}
};
void func (X x)
try
{
}
catch (int p)
{
std::cout << "Caught an int exception outside func" << p << std::endl;
}
int main (int argc, char *argv[])
try
{
try {
X x;
try {
int i = 2;
func ... |
93dea9ba9dfdd015e8d134a46e252b46bc9c1406 | 39d72aa6a2ebb3efb71a0f9f107951215498e90d | BlenderCN-Org/FC | /src/Shared/Framework/FCPersistentData.cpp | C++ | cpp | 7,537 | permissive | /*
Copyright (C) 2011-2012 by Martin Linklater
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, publi... |
73c1b4e7463bc6fdbfba31122b9b9bffebfbd8c2 | c2732ee97c012f8365155f59f17ecc20cadf1362 | raghavnauhria/whatmt | /pytorch/caffe2/core/net_async_task_graph.cc | C++ | cc | 3,801 | permissive | #include "caffe2/core/net_async_task_graph.h"
#include "caffe2/core/net_parallel.h"
namespace caffe2 {
AsyncTaskGraph::AsyncTaskGraph(
ExecutorHelper* helper,
const ExecutionOptions& options)
: helper_(helper), options_(options), frozen_(false) {}
bool AsyncTaskGraph::CreateNode(
int node_id,
co... |
235f38f83df544c3ea466e55bd92a410c0796ae6 | 397ce48b9cc5b4c7d14abcbea2ff865c18ea2330 | gleke/LMS | /test/test.cpp | C++ | cpp | 2,306 | no_license | #include <iostream>
#include <random>
#include "LMS.h"
#include <math.h>
void print_average_error_nd();
void print_average_error_sin();
int main() {
//print_average_error_sin();
print_average_error_nd();
return 0;
}
//输出正态分布误差
void print_average_error_nd()
{
const int FS = 10000;
double average... |
bc1eab6711c82c22793093d1f7424073a6607b3e | bdaa837ef997c823e5eda8fb927b76bf3b342d0f | pauladams8/chromium | /chrome/browser/extensions/wake_event_page_apitest.cc | C++ | cc | 7,042 | 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 <string>
#include "base/auto_reset.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/s... |
3a19a0fb3d82ab8c2537f6eb13ff1e37d5fd3127 | c406e9cbbfdb31b8c12cca925c992b5903129072 | pranoym14/Leetcode-july-challenge | /Top K Frequent Elements.cpp | C++ | cpp | 622 | no_license | class Solution {
public:
vector<int> topKFrequent(vector<int>& arr, int k) {
vector <int> o;
priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> minh;
unordered_map <int,int> m;
for(int i:arr)
m[i]++;
for(auto i=m.begin();i!=m.end();i++)
... |
7770e63ac719e8155dcf738d7e1a43b8b75d5bab | d30f75605ebd4b843a2ead5dbdf4323cc96c359b | dongfeng86/CppPrimerPlus-SourceCode | /16.8 STL8算法/useAlgorithm.cpp | C++ | cpp | 1,533 | no_license | //该文档综合使用了多种容器
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<iterator>
#include<algorithm>
#include<cctype>
using namespace std;
char toLower(char ch) { return tolower(ch); }
string & ToLower(string & st);
void display(const string & s);
int main()
{
vector<string> arWord... |
08064c930b49e8ab5f5d2622cda4ecf60a662e0a | 14df949ded63f150f2dfbf2268bcac13f2701a95 | dasfaa19/Efficient-RMCE | /PrefixFil/cliqueholder.cpp | C++ | cpp | 4,479 | no_license | #include "cliqueholder.h"
#include "gadget.h"
#include <cstdio>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
using namespace std;
extern VI lookup;
extern Graph g;
inline bool compv(int a, int b) {
return lookup[a]<lookup[b];
}
CliqueHolder::CliqueHolder() {
}
void CliqueHolder:... |
380a126398944504642bf24f949499412be186c1 | 5291c5bfae74b896c86a2c51a006652b7bbabb41 | kc991229/practice | /2020.7.3/2020.7.3/text.cpp | C++ | cpp | 2,500 | no_license | /*
居然有假币! 现在猪肉涨了,但是农民的工资却不见涨啊,没钱怎么买猪肉啊。nowcoder这就去买猪肉,
结果找来的零钱中有假币!!!可惜nowcoder 一不小心把它混进了一堆真币里面去了。
只知道假币的重量比真币的质量要轻,给你一个天平(天平两端能容纳无限个硬币),
请用最快的时间把那个可恶的假币找出来。
输入描述:
1≤n≤2^30,输入0结束程序。
输出描述:
最多要称几次一定能把那个假币找出来?
示例1
输入
3
12
0
输出
1
3
*/
#include <iostream>
#include <vector>
using namespace std;
int find_fake(int num)
{
... |
8dd4a85de0b27e11c729b87dc23d539e2d4e25d8 | 4dff5dd040e0dd3251189c6398e176fb665b1fc8 | ValtoForks/pomdog | /src/SoundSystem.OpenAL/AudioClipAL.cpp | C++ | cpp | 2,020 | permissive | // Copyright (c) 2013-2018 mogemimi. Distributed under the MIT license.
#include "AudioClipAL.hpp"
#include "ErrorCheckerAL.hpp"
#include "Pomdog/Audio/AudioClip.hpp"
#include "Pomdog/Utility/Assert.hpp"
namespace Pomdog {
namespace Detail {
namespace SoundSystem {
namespace OpenAL {
namespace {
ALenum ToFormat(Audi... |
8537ecf9c13ec99994a4bac0cf3ecbb7363b1e5d | 7861892cd941e8f5ecba6ca6dabb0e954de9d85a | RealChaser/Cpp_Lecture | /C++14_1/6_인라인함수2.cpp | C++ | cpp | 862 | no_license | #include <algorithm>
using namespace std;
// 라이브러리의 조건
// 1. 성능 : 빨라야 한다.
// 2. 유연성 : 정책 변경이 가능해야 한다.
// 변하지 않은 흐름속에서 변해야 하는 정책은 분리되어야 한다.
// 일반 함수에서는 변하는 것을 인자화 한다.
// 아래 sort
// 장점 : 정책을 변경할수 있다.
// 단점 : 느리다. (인라인 치환안됨)
void Sort(int* x, int sz, bool(*cmp)(int , int) )
{
for (int i = 0; i < sz - 1; i++)
{
f... |
156af9dc9725a4e7676889f72eb2dff803e72f39 | 47e3c108f383a358e677378e092985312449b52f | Malenczuk/visualisation-largeVis | /LargeVis/Linux/LargeVis.cpp | C++ | cpp | 18,304 | permissive | #include "LargeVis.h"
#include <map>
#include <float.h>
LargeVis::LargeVis()
{
vec = vis = prob = NULL;
knn_vec = old_knn_vec = NULL;
annoy_index = NULL;
head = alias = NULL;
neg_table = NULL;
}
const gsl_rng_type *LargeVis::gsl_T = NULL;
gsl_rng *LargeVis::gsl_r = NULL;
void LargeVis::clean_model()
{
if (... |
5b6366875c8343b3a2767d92611012769bf6a7ab | e106e595c20385103d9cd9bfed6fb2e3c92a05d5 | sokumura/xtionLightingProject | /src/testApp.cpp | C++ | cpp | 5,137 | no_license | #include "testApp.h"
//////////////////
//////GLOBAL//////
bool td = false;
float myFloat1 = 0.56;
int myInt1 = 10;
int box1 = 3;
bool randomizeButton = true;
float * value;
float myFloat2 = 0.5;
int myInt2 = 6;
bool myBool2 = false;
int box2 = 1;
float myFloat5 = 3.0;
float myFloat6 = 0.3;
float myFloat9 = 0.0054;
boo... |
7b8b63d852a9987bed5fb3e36e9cfd5d71e0ee46 | 8444c41d9912eeb5eb6ca244dc1eb48f822265a6 | eason826/Refactor | /Begin/02/sw/Movie/Customer.cpp | C++ | cpp | 250 | no_license | #include "Customer.h"
Customer::Customer(string name)
{
_name = name;
}
void Customer::addRental(Rental arg)
{
_rentals.push_back(arg);
}
string Customer::getName()
{
return _name;
}
vector<Rental> Customer::getRentals()
{
return _rentals;
}
|
00211b9db4bb029a693576172c58fd8d664ca7ba | ce5ebe943b3435cf9536653f9cc524c394c40313 | Archibald547/INFO3220 | /date/person.cpp | C++ | cpp | 526 | no_license | #include "person.h"
using namespace Week4;
void Person:: changeFirstName(std::string firstName){
m_firstName = firstName;
}
std::string Person:: getFirstName() const{
return m_firstName;
}
void Person:: changeSurname(std::string surname){
m_surname = surname;
}
std::string Person:: ... |
8614ce6a3c6e7ad283259070536485d1e1d397c9 | a104f9127e5c24e4900abbfb8c6833382a318d4a | Eloredo/Loredo_Esmeralda_CSC5_43952 | /Labs/PayCheck/main.cpp | C++ | cpp | 994 | no_license | /*
* File: main.cpp
* Author: Esmeralda Loredo
*
* Created on February 23, 2015, 9:56 AM
*/
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here!!!
int main(int argc, char** argv) {
//Declare Variables
//Inputs:
// payRa... |
9d4e2e9dc72263f80d262a6d528d5228fdffb649 | 43c6a40902bc0ad37184d575fb48cdc4c9812d72 | chen--oRanGe/HPCC-Platform | /roxie/ccd/ccdquery.cpp | C++ | cpp | 84,910 | permissive | /*##############################################################################
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
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 ... |
ba8a4b2d46890ce713abd5836c5605577642eb11 | 8c66fc49c212094fd43aea373b8074c65ce8441d | LLNL/sundials | /include/sundials/sundials_matrix.hpp | C++ | hpp | 1,217 | permissive | /* -----------------------------------------------------------------------------
* Programmer(s): Cody J. Balos @ LLNL
* -----------------------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2023, Lawrence Livermore National Security
* and Southern Methodist ... |
b24b6a9bf0f2574b7a9855be2fa300deff77442a | 21b2b8a803f4b42e9407b16942f2af2bd5b7c45e | julesrodrigues11/Domineering | /Domineering/main.cpp | C++ | cpp | 13,526 | no_license | #include <iostream>
#include <vector>
#include <Windows.h>
#include <fstream>
#include <string>
//Enumeration type, gives names to the built-in colours
enum concol
{
black = 0, dark_blue = 1, dark_green = 2, dark_cyan = 3, dark_red = 4,
dark_purple = 5, dark_yellow = 6, light_gray = 7, gray = 8, blue = 9,
green = 1... |
289117ba538de1d70385aab5ffa15587d68e3d6c | 7d48ef7d36975abb66a62006ae16a1177c15a4ba | EthanBasham/AddressBook | /header_files/MethodControl.cpp | C++ | cpp | 18,960 | no_license | #include "MethodControl.h"
using namespace error_handling;
using namespace menu;
using namespace contact;
using namespace str_manip;
using namespace std;
using namespace address_book;
namespace methods
{
Route RunRoute(Request& request)
{
switch (request.CurrRoute)
{
case MAIN: return Main(request);
case CR... |
35daa76a16a03b467f6939a190dc4172712e039a | aa804006af273d1609ffb99814a1392fc06aa42d | eiselekd/vhdl2js | /antlr4-runtime-cpp/Lexer.cpp | C++ | cpp | 8,306 | no_license | /*
* [The "BSD license"]
* Copyright (c) 2016 Mike Lischke
* Copyright (c) 2013 Terence Parr
* Copyright (c) 2013 Dan McLaughlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
... |
50e3e06968a642a3967c427a42c545a12e399659 | 331ee311d8eb667c629422dedb6d451dabc03e2c | asianjack19/Cpp | /DownloadanSoalAlgoClass/EpicGame.cpp | C++ | cpp | 592 | no_license | #include <stdio.h>
int main()
{
int T;
int num;
int count;
scanf("%d", &T);
for(int i=0; i<T; i++)
{
scanf("%d", &num);
count=0;
if(num==1 && count==0)
{
printf("Case #%d: Lili\n", i+1);
continue;
}
while(num!=1)
{
if(num==1)
{
count+=1;
break;
}
if(num%2==1... |
b13bad4c71dabbc61f546720a96279a54b86bc62 | 5b8a8d07071b941a852decbea1c992a1c28338ad | fredericyiding/cpp | /eg2.cpp | C++ | cpp | 654 | no_license | #include<iostream>
using std::cin;
using std::cout;
using std::endl;//better than "using namespace std" because you don't want to have a collision of names later. This is a general good habit.//
int main()
{
int c=0;
cout<<"enter 1 for case 1, 2 for case 2"<<endl;
cin>>c;
int a=0, b=0, temp1;//temp1 is for eg1
in... |
0338a5a6df4635960043515e57d64c1a1b8b384b | fb65aca6485cee1d355d2d1b28ac1193e194d557 | alexishughes/classes | /cars.cc | C++ | cc | 314 | no_license | #include "car.cpp"
using namespace std;
int main()
{
Car myCar("Honda","Civic",0);
Car myCar2("Ford", "Escort", 0);
cout << "Your Car is a " << myCar.getMake() << " " << myCar.getModel() << endl;
cout << "Your car is a " << myCar2.getMake() << " " << myCar2.getModel() << endl;
return 0;
} |
a94239f0ae8933712c329b702a5e33c6aa26f178 | 0dad9f92698daee864d38c988568618a9bdbf6e7 | haxxorcist/iota.lib.cpp | /test/source/crypto/checksum_test.cpp | C++ | cpp | 3,708 | permissive | //
// MIT License
//
// Copyright (c) 2017-2018 Thibault Martinez and Simon Ninon
//
// 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 r... |
a850149bb1d37f90bd49c5a99aac40008bd1f298 | 962674f5aa52db66d2bb8eb2390d9f7d3ab95b48 | niuxu18/logTracker-old | /second/download/git/gumtree/git_old_hunk_691.cpp | C++ | cpp | 617 | no_license |
rename.old = argv[1];
rename.new = argv[2];
rename.remote_branches = &remote_branches;
oldremote = remote_get(rename.old);
if (!remote_is_configured(oldremote))
die(_("No such remote: %s"), rename.old);
if (!strcmp(rename.old, rename.new) && oldremote->origin != REMOTE_CONFIG)
return migrate_file(oldremote... |
4fc132704a6d6ad0acea1599813a41813e05ffa6 | 0e78b430d99276051851c076f8b75daed20dd3ea | phoemur/simple_pool | /src/intro.cpp | C++ | cpp | 1,290 | permissive | #include "intro.h"
Intro::Intro()
: background{}, title{}, subtitle{}, f1{}, f2{}
{
f1.loadFromFile("./pool_assets/Purisa-BoldOblique.ttf", 30);
f2.loadFromFile("./pool_assets/Purisa-BoldOblique.ttf", 16);
title.loadFromRenderedText("Wellcome to Simple Pool", f1, SDL_Color{0xFF,0,0,0xFF});
subtitle... |
6031db72b4c008490d41e064d6c1c128474a74d3 | 5967f94aa49ce03d58b0d0b20620055db5d97fea | Animery/final_project_from_courses | /game_src/score.hpp | C++ | hpp | 332 | no_license | #pragma once
#include <cstddef>
namespace gameInfo
{
class score
{
public:
static score& getInstance();
score(score const&) = delete;
void operator=(score const&) = delete;
void value(size_t val);
size_t value();
private:
size_t val_score = 0;
score();
~score();
};
} // namesp... |
96690171f093d82b332debd1d9541177fd3a5aa8 | 0c2de7e0bac5479e9fd5445748e400af317d5493 | azhuoinfogs/gs | /kvbench/wrappers/couch_rocksdb.cc | C++ | cc | 15,349 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <sys/stat.h>
#include <unistd.h>
#include <iostream>
#include "stopwatch.h"
#include "rocksdb/cache.h"
#include "rocksdb/db.h"
#include "rocksdb/write_batch.h"
#include "rocksdb/table.h"
#include "rocksdb/filter... |
aab1264fc7376b75d1ecca6d491108e64766dc4d | 385ad2aca811afa911db673f1cef8e008e511cae | Jackson-Truong/DataStructures | /lib/lab05/src/queue.cpp | C++ | cpp | 1,784 | no_license | #include "queue.h"
namespace lab5{
queue::queue() {
}
queue::queue(std::string &data) {
storage_structure.append(data);
}
queue::queue(const queue &original) {
queue temp;
temp = original;
for(int i=0; i<original.queueSize();i++){
storage_structure.append(temp.top());
temp.dequeue();
}... |
48ed550f247aecb299ccddf23eec492aaa791f58 | ed49161d916bcf7cd2210c1c1ddf1a7eea807bda | Flashby2/Ubitunedec | /src/Functionality/Output.cpp | C++ | cpp | 12,885 | no_license | /*
Output.cpp : Output a segment stream
*/
#include "Pch.h"
#include <wx/progdlg.h>
#include <wx/filename.h>
#include "Functionality/Output.h"
#include "Functionality/Segment.h"
#include "Functionality/SegmentStream.h"
#include "Decoding/WaveWriter.h"
#include "Decoding/AudioStream.h"
#include "Decodi... |
fa7a75aa943120a0a7c1e098961cd0449c2cadfa | 6c86fb5dc9cdaf459839275cafbcff09bfbe49e4 | pauek/ccjs | /tests/mcm_v2.cc | C++ | cc | 231 | no_license | //
// Calcular el mínimo común múltiple de dos enteros
//
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
int n = 1;
while ((a * n) % b != 0) {
n++;
}
cout << a * n << endl;
}
|
8fc640e36974eadef9a81752734b2d6066a3b73d | 7834a18ca4c771c875d5b65b94074537eace4f05 | foreverfall123/MiniGameCity | /BaseLib/BaseServerHandler.cpp | C++ | cpp | 1,380 | no_license | #define _WINSOCK_DEPRECATED_NO_WARNINGS
#include "BaseServerHandler.h"
#include "Log.h"
void BaseServerHandler::ConnectToServer(std::string ipAddress, short port) {
m_server.SetServerSocket(WSASocketW(PF_INET, SOCK_STREAM, 0, NULL, 0, WSA_FLAG_OVERLAPPED));
if (INVALID_SOCKET == m_server.GetSocket()) {
return;
}
... |
befeaa2e896076d99ab192769a89332a523f44dd | 9eba0547c585ac89a20cb718274580856e0b236c | marco-c/gecko-dev-wordified | /third_party/libwebrtc/net/dcsctp/packet/chunk_validators.cc | C++ | cc | 2,849 | permissive | /
*
*
Copyright
(
c
)
2021
The
WebRTC
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
in
the
root
of
the
source
*
tree
.
An
additional
intellectual
property
rights
grant
can
be
found
*
in
the
file
PATENTS
.
All
contributing... |
b394c94e193fe92f7dfbf9b623c13367f1507afc | 4f01d4b3cccb750b3e3ff070531c99287ddd88f4 | thayumanavar77/prep | /hackprep/math/connect_towns.cc | C++ | cc | 316 | no_license | #include <iostream>
using namespace std;
int
main(int argc, char** argv)
{
unsigned long long prod, n, n1, data;
cin>>n;
for(int i= 0; i<n; i++)
{
cin>>n1;
prod= 1;
for(int j=0;j<n1-1;j++)
{
cin>>data;
prod = (prod * data)%1234567;
}
cout<<prod<<endl;
}
return 0;
}
|
8d4b741484b0ae6df4f4f80dd8f10700fa6fffd5 | 914baa1391f39c79e24b0907d687c1296cba09f5 | kniec/sarus | /src/runtime/Mount.hpp | C++ | hpp | 1,145 | permissive | /*
* Sarus
*
* Copyright (c) 2018-2019, ETH Zurich. All rights reserved.
*
* Please, refer to the LICENSE file in the root directory.
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef sarus_runtime_Mount_hpp
#define sarus_runtime_Mount_hpp
#include <memory>
#include <boost/filesystem.hpp>
#include <sys/mou... |
30febe0a1483249422d62c864ee9e5cd7d0ddfed | cfa382e132d231eafcebac57ddd089afd409ac07 | wzj1988tv/code-imitator | /data/dataset_2017/dataset_2017_8/Mysteryname/3264486_5633382285312000_Mysteryname.cpp | C++ | cpp | 1,312 | no_license |
/*
Contest: Google Code Jam 2017 [Qualification Round]
Problem: B. Tidy Numbers (20 Points)
Author: Phawin Prongpaophan
*/
#include<stdio.h>
#include<algorithm>
#define LL long long
using namespace std;
LL powTen[19];
LL someOne[19];
void preProcess()
{
powTen[0] = 1; for(int i=1;i<19;i++) po... |
e6ba71967a3d2142754afbc410fc766f3f6be12d | 4bbf2303956cd441a9329c565bbee00ba0a96b1f | akshonesports/node-opencv | /src/common/Range.cc | C++ | cc | 5,042 | permissive | #include "Range.h"
using namespace ncv::common;
Nan::Persistent<FunctionTemplate> Range::constructor;
void Range::Init(Local<Object> target) {
Nan::HandleScope scope;
// Constructor
Local<FunctionTemplate> ctor = Nan::New<FunctionTemplate>(New);
constructor.Reset(ctor);
ctor->SetClassName(Nan::New("Range... |
632e3afcff2fbc09db2a482a593308569adf80e1 | 859b3783e47c15b39631960ee030669e3a894446 | amandanish882/Polygot | /Level_3/Point.cpp | C++ | cpp | 799 | no_license | #include "Point.hpp"
#include <sstream>
#include <cmath>
#include <iostream>
using std::cout;
Point::Point(){cout<<"Default Constructor\n";}
Point::Point(double x,double y):m_x(x),m_y(y){cout<<"2 Parameter Constructor\n";}
Point::Point(const Point& point){
cout<<"Copy Constructor\n";
m_x = point.m_x;
m_... |
676627e3a11ecae609eed5cc34c705413e4ef03d | e3cf1c256817d5a26a0f8e19e6cc45b4e1e1e70a | bitzonecoin/bitzonecoin | /src/bitzonecoin-tx.cpp | C++ | cpp | 20,421 | permissive | // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2015-2017 The BITZONECOIN developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
#include "clientversion.h"
#include "coins.h"
#inclu... |
7b1dcbf0390a73320b32ae410c09221b4075a303 | de7310df2c04907f5ded514a35a132a97dfc2fa8 | ashiscs/C- | /sorting_vectors.cpp | C++ | cpp | 880 | no_license | // SORTING VECTORS
#include<bits/stdc++.h>
#include<vector>
using namespace std;
class test {
int id;
string name;
public:
test(int id,string name){
this->id = id;
this->name = name;
}
void print()
{
cout<<id<<": "<<name<<"\n";
}
bool operator<(co... |
7b13ac97942fc2431d67be5dff5fd326a9a3d865 | cafae4657c4f9a2b754289b1ad00b3c9ba780f35 | joeriedel/Radiance | /Source/UnitTests/Runtime/StringTest.cpp | C++ | cpp | 326 | no_license | // StringTest.cpp
// Copyright (c) 2010 Sunside Inc., All Rights Reserved
// Author: Joe Riedel
// See Radiance/LICENSE for licensing terms.
#include <Runtime/Runtime.h>
#include "../UTCommon.h"
namespace ut
{
void StringTest()
{
Begin("String Test");
string::String s("hi");
std::cout << s << std::endl;... |
8a7888a4bd0cb7c0f76aae5954090955ba36f1c9 | 2f2b924e1375029bc57cd7989a1164b96d09eeee | rabedik/hifi | /interface/src/ui/DiskCacheEditor.cpp | C++ | cpp | 4,500 | permissive | //
// DiskCacheEditor.cpp
//
//
// Created by Clement on 3/4/15.
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <functional>
#include <QDebug>
#include <QDialog>
#in... |
6ae2dccbf8cb230f428507215ac11d4caea618cb | ae52fa4bcc75a1232260b3bac59626e4f24056de | ivan-filonov/fme | /fme.cpp | C++ | cpp | 11,688 | no_license | #include <algorithm>
#include <fstream>
#include <functional>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
#include <stdio.h>
using Path = std::vector<std::string>;
using PathIterator = Path::iterator;
static Path splitPath(const std::string &path) {
Path result;
if (path.empty... |
f47e7c50c6f14b43b3f742753e1b115e31ddde1b | 5e37650c0439eb32767075ea18ffa301d78c8b55 | wwhbuaa/tizen-extensions-crosswalk | /system_info/system_info_wifi_network_mobile.cc | C++ | cc | 6,503 | permissive | // Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "system_info/system_info_wifi_network.h"
namespace {
const double kWifiSignalStrengthDivisor = 100.0;
} // namespace
SysInfoWifiNetwork::Sy... |
c7c9e61b542c46e7e05ad643318027332fcd929d | e7f3f1cd745a187d8043a8acb03608ddbe2eb825 | leonaxiongxin/Linux-Router-and-Socket-Programming | /throughput_input_queue.cc | C++ | cc | 1,259 | no_license | int count(struct sk_buff* skb)
{
struct iphdr *iph; //IP header
struct tcphdr *tcph; //TCP header
struct udphdr *udph; //UDP header
struct timeval tv; //time struct(second & micro second)
static int totalpacket=0;
do_gettimeofday(&tv); //get now time
_kernel_seconds_t intime=(tv.tv_sec*1000000)+tv.tv_usec; // in... |
f91123041096f705e14ac1dcd7662b12725da979 | 182e9ddbecb4ab6db208ba91ed554c02b36b462c | goby/150-problems | /9.cc | C++ | cc | 393 | no_license | #include <set>
#include "data_struct/node.h"
int remove_duplicate(Node * head){
std::set<int> flag_set;
Node *pre = head;
Node *cur = head;
flag_set.insert(cur->data);
while (cur) {
while((cur = cur->next) != NULL && flag_set.find(cur->data) != flag_set.end());
pre->next = cur;
... |
64b921bf18ccc69b40a3f1350804f7ee61f52f6b | c32e5c96db194c0f54ce4ba2c8a53b5e10094f26 | buaaspy/libay | /test/os_test.cc | C++ | cc | 1,707 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned int uint32;
typedef struct node* node_t;
struct node {
const void* key;
uint32 next;
} __attribute__((aligned(sizeof(uint32))));
#define cast(type, expr) ((type)(expr))
#define node_next(p) cast(node_t, (((p)->next) & ~0x3))
#define get_... |
c24241d5d54ffe4994c57047a85dbbe868499bb6 | 7ffeb32b776e9269830c10ebc3b9bed207ed6311 | wangycol/Plugin | /PluginSupport/PluginSupport/PluginImpl.cpp | C++ | cpp | 3,508 | no_license |
#include "stdafx.h"
#include "PluginImpl.h"
#include "PluginSupport.h"
#include "PluginWrapper.h"
PLUGIN_EXPORT void PIInitPlugin(CWinApp* pApp)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CPluginSupportApp* pThisApp = (CPluginSupportApp*)AfxGetApp();
// load plugin
pThisApp->SetMainApp(pApp);
pThisApp->Load... |
a2fe058bb6a108d612111972da05f6d730ef22c8 | 46e8a3a124c0334c6bed5b1ef62f60d2bd84175f | maojoejoe/Peach-Thinning-GTRI-Agricultural-Robotics-VIP | /ros2-windows/include/std_msgs/msg/int8__rosidl_typesupport_connext_cpp.hpp | C++ | hpp | 2,262 | no_license | // generated from rosidl_typesupport_connext_cpp/resource/idl__rosidl_typesupport_connext_cpp.hpp.em
// with input from std_msgs:msg\Int8.idl
// generated code does not contain a copyright notice
#ifndef STD_MSGS__MSG__INT8__ROSIDL_TYPESUPPORT_CONNEXT_CPP_HPP_
#define STD_MSGS__MSG__INT8__ROSIDL_TYPESUPPORT_CONNEXT_C... |
ce1102cbe4d054514dfa738c4a6844857640c446 | eb952369642fbde9b98171e11c7dee980297b25e | ZymoticB/granary | /granary/register.cc | C++ | cc | 26,147 | permissive | /* Copyright 2012-2013 Peter Goodman, all rights reserved. */
/*
* register.cc
*
* Created on: 2012-11-30
* Author: pag
* Version: $Id$
*/
#include "granary/register.h"
#include "granary/instruction.h"
namespace granary {
/// Registers that are forced to always be alive.
const uint16_t regi... |
323c64b16f7538056f4f358d155bc9d1e8c63a4c | 4ec04382d3e200b0ae9a5bc73194a9b139a81b2b | takkun-oniisan/practice_cpp | /practice14-2_Alpha.cpp | C++ | cpp | 544 | no_license | //コンストラクタのオーバーロード
#include<iostream>
using namespace std;
class Haruhi {
private:
const char *str;
public:
Haruhi(){ this->str = "This is the default message\n"; }//引数ありの場合
Haruhi(const char *str){ this->str = str; } //引数なしの場合
const char *call_str(){ return str; }
}default_obj;
int main(){
Haruh... |
81dc97ee2ce4c499b7b4a294a7b4913ed2beb3fa | 872593e8f17e6b66cc6d8ea1aee8042ce5b6e10a | blusno1/chromium-1 | /base/task_scheduler/task_scheduler_impl.cc | C++ | cc | 8,346 | 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 "base/task_scheduler/task_scheduler_impl.h"
#include <utility>
#include "base/metrics/field_trial_params.h"
#include "base/task_scheduler/delay... |
deadfce88fe00bd7ae4a44679d8d402dbbc131c0 | e653eaf176b05ae79d53b891ac8c28cfeea862bb | AcademySoftwareFoundation/Imath | /src/ImathTest/testVec.cpp | C++ | cpp | 10,045 | permissive | //
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenEXR Project.
//
#ifdef NDEBUG
# undef NDEBUG
#endif
#include "testVec.h"
#include <ImathFun.h>
#include <ImathVec.h>
#include <cassert>
#include <cmath>
#include <iostream>
// Include ImathForward *after* other headers to validate fo... |
51d26a9c431fd04b0ecd8cde1793efa0d43a2bf7 | 55d0e29bc35ee07f85ce2316ed251c050cce4c90 | NolanJos/vespa | /eval/src/vespa/eval/tensor/dense/dense_tensor_cells_iterator.cpp | C++ | cpp | 528 | permissive | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "dense_tensor_cells_iterator.h"
namespace vespalib::tensor {
DenseTensorCellsIterator::DenseTensorCellsIterator(const eval::ValueType &type_in, TypedCells cells)
: _type(type_in),
... |
5998030a079c40913fbef3b024e6f8da5d5ce714 | 74428a6aef5b9895c5d2ace8b92953b20b2e9443 | hermixy/StripsQT | /src/broker.cpp | C++ | cpp | 596 | no_license | #include "broker.h"
Broker* Broker::m_Instance = NULL;
Broker::Broker(QObject *parent) : QObject(parent)
{
}
Broker::Broker()
{
#ifdef _MYDEB_
std::cout<<"in Broker constructor.."<<std::endl;
#endif
buildingBoard.initializeBoard();
buildingBoard.printBoard();
}
int Broker::getStatus(int i, int j)
{
... |
f93ef26433124a58c0c29d3188cec986a5fb8329 | d53d5928a3fe72f701341bef3f72bccef43ab645 | sjames1958gm/chromium | /base/message_loop/message_loop.cc | C++ | cc | 10,906 | permissive | // Copyright 2018 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/message_loop/message_loop.h"
#include <algorithm>
#include <atomic>
#include <utility>
#include "base/bind.h"
#include "base/callback_hel... |
533762d69a5aa13682717c05f90f06c9310395bc | 077e997a5474327e198e5662c5393ee59374e1a1 | Romop5/glsl-parser | /src/glslParser/parser.cpp | C++ | cpp | 69,765 | permissive | #include <string.h> // strcmp, memcpy
#include "glslParser/parser.hpp"
#include "glslParser/util.hpp"
namespace glsl {
parser::parser(const char *source, const char *fileName)
: m_lexer(source)
, m_fileName(fileName)
{
m_ast = nullptr;
m_oom = strnew("Out of memory");
m_errorOccured = false;
}
p... |
bcffc980ab343d21190c326df001f0cfaec159aa | a2c1a51e0e0ad5e4c40c8f4402d826845758dfd7 | cforfang/Granite | /renderer/mesh_util.hpp | C++ | hpp | 9,622 | permissive | /* Copyright (c) 2017-2020 Hans-Kristian Arntzen
*
* 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, me... |
34e1947e1b567dba50c6033e0eaa4354b5598e1c | 097b64297e72e468a2e8173d7da3c7b245df1d7e | wangfuli217/study_room | /c++/expert_c++/EmployeeDB/EmployeeTest.cpp | C++ | cpp | 383 | no_license | #include <iostream>
#include "Employee.h"
using namespace std;
using namespace Records;
int main()
{
cout << "Testing the Employee class." << endl;
Employee emp;
emp.setFirstName("Marni");
emp.setLastName("Kleper");
emp.setEmployeeNumber(71);
emp.setSalary(50000);
emp.promote();
emp.pr... |
dd67638f664b03bda8c6e183cbbb15a66bef0f62 | 3a61301fd84076e860f7d7f68318741c5909a951 | shaguftaali/Curve | /Curve/SourceFile/Maths/Matrix4.cpp | C++ | cpp | 2,464 | no_license | #include "..\..\Includes\Maths\Matrix4.h"
#include <cassert>
const Matrix4 Matrix4::IdentityMat = Matrix4(
Vector4(1, 0, 0, 0),
Vector4(0, 1, 0, 0),
Vector4(0, 0, 1, 0),
Vector4(0, 0, 0, 1)
);
Matrix4::Matrix4()
{
setMatrixRow(0,Vector4());
setMatrixRow(1, Vector4());
setMatrixRow(2, Vector4... |
4008dfae3023bc2fc14b736b0593ac229355df95 | ae3bc731ae4c781c46eafc12caa63b53586bb9d5 | marco-c/gecko-dev-wordified-and-comments-removed | /third_party/libwebrtc/test/time_controller/simulated_time_controller_unittest.cc | C++ | cc | 4,470 | permissive | #
include
"
test
/
time_controller
/
simulated_time_controller
.
h
"
#
include
<
atomic
>
#
include
<
memory
>
#
include
"
rtc_base
/
event
.
h
"
#
include
"
rtc_base
/
task_queue
.
h
"
#
include
"
rtc_base
/
task_queue_for_test
.
h
"
#
include
"
rtc_base
/
task_utils
/
repeating_task
.
h
"
#
include
"
test
/
gmock
.
h... |
4d42b525c6bdaa6fe04b7333d223cdb5560cee70 | d99a40c2537861185e2f8768f5e571f2e2811fd2 | Wallsion/CPlusPractice | /leetcode/twoSumList.cpp | C++ | cpp | 1,498 | no_license | struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
bool pre;
pre = false;
ListNode *pAdd = new ListNode(0);
ListNode *pTmp = pAdd;
while(1)
... |
2c17368d3ca49cf8fc8d29bcf9524658bac2ced0 | b520bb06e2699269219d3698782fe301c9f3f73a | wuzhen247/ACM-ICPC | /Classification/POJ/其他/POJ2715.cpp | C++ | cpp | 512 | no_license | //Paint Mix,黑白瓶相互倒至一定比例,求倾倒次数
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
#define eps 0.00001
int main()
{
double b,w,c,ans,rateb,ratew;
int n;
while(scanf("%lf%lf%lf",&b,&w,&c)&&(b||w||c))
{
b*=16,w*=16;
ans=b/w;
n=0;
ratew=0,rateb=1;
while(fabs(ratew/(1-ratew)-ans)>eps||fab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.