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 |
|---|---|---|---|---|---|---|---|---|
04face1a40e9003f94a6f6796874ac9cae4e82e5 | 151e6489db99bc3edf3b8859e21160c51fccbec3 | santiglesias/Practica_Geant_4 | /include/YourPrimaryGeneratorAction.hh | C++ | hh | 1,227 | no_license | #ifndef YOURPRIMARYGENERATORACTION_HH
#define YOURPRIMARYGENERATORACTION_HH
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class YourDetectorConstruction;
class G4ParticleGun;
class G4Event;
class G4String;
class YourPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
public:
Yo... |
c59ba301562ea149773cbdf5171bddbac7ce1303 | b9576f4159a5432ed8619a77fd60418f41b70b69 | sdk-team/aliyun-openapi-cpp-sdk | /rds/src/model/ModifyDBInstanceConnectionStringResult.cc | C++ | cc | 1,348 | permissive | /*
* Copyright 2009-2017 Alibaba Cloud 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... |
589a6e64b03d7ccd043cc049714e74c56bf2231f | 180a0ecca759da63c479c21d8b87bc6a23221687 | sakayaparp/CodeChef | /Easy/1 - Make a Convex Polygon/sol.cpp | C++ | cpp | 975 | permissive | #include <iostream>
#include <cmath>
using namespace std;
void solve()
{
int n;
cin>>n; //Input number of vectors
/* LOGIC:
We will normalize each position vector and then, scale it
so that each position vector has the same magnitude. After that,
since... |
add82566cc9266d71c6e84a1b2dd271042d5f2bd | 9a45e2931b7f9dba1f243ff10d4457d89d05c546 | jackxan/chromium | /chromeos/services/secure_channel/public/cpp/client/connection_manager_impl.cc | C++ | cc | 7,445 | permissive | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/services/secure_channel/public/cpp/client/connection_manager_impl.h"
#include "ash/constants/ash_features.h"
#include "base/callback_h... |
1078a76ccdf82e7318b71aa6c3c52bb1ec489e36 | 543995ed85774138fb8a679bfe7b463e5e222acd | zhenbinwu/SuperTopTagger | /Tool/src/HistTool.cc | C++ | cc | 25,673 | permissive | // ===========================================================================
//
// Filename: HistTool.hh
//
// Description: A helpful class to handle the histograms
//
// Version: 1.0
// Created: 05/29/2013 02:19:25 PM
// Revision: none
// Compiler: g++
//
// Autho... |
360c501963d1653a1227d1ad373db6594f43c912 | aa3d82401333d7a4f5afc21426d0b703df616970 | AspidT/Zerlight | /guichan/gui/WidgetFactory.cpp | C++ | cpp | 4,874 | no_license | //
// Created by tatiana on 27.09.18.
//
#include "WidgetFactory.h"
#include "ZButton.h"
#include "ZCheckBox.h"
#include "ZIcon.h"
#include "ZTextBox.h"
#include "ZLabel.h"
#include "ZContainer.h"
#include "ZScrollArea.h"
#include "ZListBox.h"
#include "ZDropDown.h"
#include "ZSlider.h"
#include "ZProgressBar.h"
name... |
0fc614645fec3e1ad5037c5dae2351757498d29a | dd6e2b1431433c73842581eb6548180b8ad4dcb3 | Sebbyastian/Source-Code-from-Tutorials | /C++/67_cppBeginners.cpp | C++ | cpp | 305 | no_license | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream theFile("players.txt");
int idNumber;
string name;
double money;
while(theFile >> idNumber >> name >> money && theFile.good())
{
cout <<idNumber << "," << name << "," << money << endl;
}
}
|
6430dbf0f0e0e184629979842da389a1ca90afa6 | 2a373e934d1ada9c8ff7ccec9c44811e43a2d105 | mld-cih/chrome_deps | /chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc | C++ | cc | 35,648 | 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.
//
// This test creates a safebrowsing service using test safebrowsing database
// and a test protocol manager. It is used to test logics in safebrowsi... |
ec5906d1c6ecf7c201fed13a26c8ad5e697612a9 | f19cb7c76ccdbbe0f2f5e3bd1ec46d2e3820a53e | TrellixVulnTeam/proto-quic_1V94 | /src/net/tools/quic/test_tools/server_thread.cc | C++ | cc | 3,449 | 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.
#include "net/tools/quic/test_tools/server_thread.h"
#include "net/quic/test_tools/crypto_test_utils.h"
#include "net/tools/quic/quic_dispatcher.h... |
e9abb0d1175841a373da709d5c83d271d6310dc0 | aa245d896e635a781b18d65bff975f93c538e864 | TG-yang/LeetCode | /463. Island Perimeter/main.cpp | C++ | cpp | 871 | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int count = 0;
int row = grid.size();
int col = grid[0].size();
for(int i = 0; i < row; ++i){
for(int j = 0; j < col; ++j){
... |
cdaf8adaef3b7c8c5f511b731b6dbc904fcec8be | 360bddc4b9a8227c0551d187a68cc55a0e8a4c10 | iontower/node | /deps/v8/src/snapshot/snapshot.cc | C++ | cc | 27,030 | permissive | // Copyright 2006-2008 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The common functionality when building with or without snapshots.
#include "src/snapshot/snapshot.h"
#include "src/base/platform/platform.h"
#... |
2e040515a7e782135021e356338affe563d678c7 | 927492df91e7fcdd0bb09cef81883f44ac3fcd09 | alchemz/CPlusPlusTraining | /Deconstructor/Cat.cpp | C++ | cpp | 261 | no_license | #include <iostream>
#include "Cat.h"
using namespace std;
void CAT::speak()
{
if(happy)
{
cout<<"Meouw...\n";
}else
{
cout<<"Ssss...\n";
}
}
CAT::CAT()
{
cout<<"Cat created\n";
happy=true;
}
CAT::~CAT()
{
cout<<"Cat destoryed";
}
|
1e42ff4ce95d5f96a1ad776af100fe54db2c057a | df61e547622140ffd223983ff8e20f4b61f278c1 | thisishoon/BOJ | /data_structrue_queue.cpp | C++ | cpp | 842 | no_license | #include <iostream>
using namespace std;
int *Queue;
int Size;
int head, tail;
int num;
void initQueue(int size){
Queue = (int*)malloc(size*sizeof(int));
Size = size;
head = 0;
tail = 0;
num = 0;
}
void push(int data){
if(num==Size){
cout<<"Queue is full"<<endl;
}
else{
... |
e6ac6289bc6f71ac085923451286c9064ce3428d | 8c27af7ddcdae7c3027cff75e8e94a74519179bc | askarakshabayev/PP1-2018 | /Week10/1/3.cpp | C++ | cpp | 209 | no_license | #include <iostream>
#include <vector>
using namespace std;
vector<int> a(10, 1);
int main() {
cout << a.size() << endl;
for (int i = 0; i < a.size(); i++)
cout << a[i] << " ";
return 0;
} |
3ec7bebd1883379b5a76fbd23751fd696b587308 | 88963c330a39b439bb7532a7cbd13703d1bd2e88 | kuro-wa/Library | /kitamasa.cpp | C++ | cpp | 1,196 | no_license | template<typename T> T _zero() { return T(0);}
template<typename T> T _one() { return T(1);}
// Kitamasa Method
template<typename T, T (*zero)()=_zero<T>, T (*one)()=_one<T>>
struct kitamasa {
public:
kitamasa(const vector<T>& v) : m(v.size()), cs(v), rs(1) {
assert((int)v.size() >= 1);
rs[0] = vector<T>(2*... |
76c1668f9736867205e7341bb2004da436233a62 | 0d07f0a8d492f91d80b58830d046c6215f7ba884 | apache/openoffice | /main/svtools/source/uno/unocontroltablemodel.cxx | C++ | cxx | 40,834 | permissive | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to y... |
8f4fbdce6c3b59d97977f8fb5b5fda80a3689f19 | 8b97bd59c3e286b114b9608077b6274998af7a45 | xiaol-luo/Utopia | /Code/Server/Logic/LogicModules/GameLogic/Scene/SceneModule/SceneEffects/SceneEffects.cpp | C++ | cpp | 1,650 | no_license | #include "SceneEffects.h"
#include "GameLogic/Scene/Effects/EffectConfigMgr.h"
#include "GameLogic/Scene/NewScene.h"
#include "GameLogic/Scene/Config/SceneAllConfig.h"
#include "GameLogic/Scene/Effects/EffectConfigBase.h"
namespace GameLogic
{
const ESceneModule SceneEffects::MODULE_TYPE = ESceneModule_Effects;
Sce... |
505d7ad54b921a37835790fff87f9d52df693e3a | 93ecc4fdb7d7ce866196ff1744b9de06fff51755 | adrienmignot/cplusplus | /rpn_calc/stack.cpp | C++ | cpp | 2,039 | no_license | <<<<<<< HEAD
#include<iostream>
void push(int liste_depart[], int* top, int ajout){
// c'est un tableau à la c pas de append c'est pas du python
// liste_depart est un tableau d'entier donc ajout est un entier
// on traduit "32" en 32 avec atoi("32")
liste_depart[*top] = ajout;
*top = *top + 1;
// liste_d... |
5069c3ef1ffdd1f061b68b6c5cc8bd2d612f060b | 2849623a1446a73f07cf80686d449748939f8c1d | yalaudah/CtCI-6th-Edition-cpp | /chapter-2-Linked-Lists/deleteANode.cpp | C++ | cpp | 673 | no_license | Node* Delete(Node *head, int position)
{
// TODO: assert position >= 0
// if position is zero, set head to the next value and return it. it the next value is nullptr, then it’s like we deleted the list
if (position == 0)
{
head = head->next;
return head;
}
Node *current = head;
... |
52416a694bb37b7cfc3e063b87313607ce2e7b3e | 798c1ddca782570c795ad9b31c4815673ebd4bc7 | Ricardokevins/NJU_2020Spring_Advanced-Programming | /project2/.history/main_20200406215223.cpp | C++ | cpp | 297 | no_license | #include <Windows.h>
void modeset(int w,int h) {
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
COORD size = {w, h};
SetConsoleScreenBufferSize(hOut,size);
SMALL_RECT rc = {1,1, w, h};
SetConsoleWindowInfo(hOut ,true ,&rc);
system("cls");
return;
}
int main(){
modeset(100,2);
return 0;
} |
012efd04b58ee031749a6e8ff9c126705187e76e | 763be8b59202119cafdcbf1236a8998eca9a3790 | suzhiyang/leetcode | /RectangleArea.cpp | C++ | cpp | 483 | no_license | #include <iostream>
using namespace std;
class Solution {
public:
int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
int x = 0, y = 0;
if (min(C,G) > max(A,E)) x = min(C,G) - max(A,E);
if (min(D,H) > max(B,F)) y = min(D,H) - max(B,F);
return (C - A) * (D - B) ... |
fdfb4a890e5c524995d4af07abe8e45fea441284 | 254c321ff3848e86c619e8192c2790e5f4349a5b | joshrymkiewicz/csci-3011 | /lectures/12_static/tree_main.cpp | C++ | cpp | 2,532 | permissive | #include <iostream>
#include "Tree.h"
// Names: David Skrenta
int main() {
Tree oak;
std::cout << "Number of trees: " << oak.get_number_seeds() << std::endl;
// 0) Attempt to directly access the number_seeds_ static field here. Can you do so? why/why not?
// std::cout << Tree::number_seeds_ << std:... |
e38efc3d43a0bf390bf5ed96204632cf9e897ba0 | ac9c434915670872109a6b1c48d7df45117a9f0c | UltraSoundX/Wechat_Inject_Study | /GETMessage/GetMessage/getmsg.cpp | C++ | cpp | 1,230 | permissive | //WeChat 6A6F0000
//WXNAME 16B48AC
//WXPHONE 16B48E0
//WXID 16B4A10
//WXPHOTO 16B4B74->zhizhen
#include "pch.h"
#include "resource1.h"
#include "getmsg.h"
#include <stdio.h>
//WechatWin.dll
DWORD getWechatWin() {
HMODULE WechatAdd = LoadLibrary("WeChatWin.dll");
return (DWORD)WechatAdd;
}
//Read Mem
VOID ReadMemo... |
10be7ec84fc2814fd6fb0c97bcc9009dbe01ce69 | 740c65342b5686accecc1c72fd6d353d3e8d537f | mmicciolo/VenomFramework | /src/test/Test1 (Window)/Test1Window.cpp | C++ | cpp | 529 | no_license | #include "Test1Window.h"
void Test1Window::Init() {
monitorManager = new VF::Window::MonitorManager();
monitor = monitorManager->GetPrimaryMonitor();
monitors = monitorManager->GetMonitors();
windowManager = new VF::Window::WindowManager();
window = new VF::Window::Window(640, 480, "Test 1 Window");
windowManage... |
7276f48566a67093694608fa94a77631a15c3683 | 4faaf31558706f774db9fed22b265198d5bad9d9 | fengjixuchui/UPXAutoUnpacker | /xed_operand.cpp | C++ | cpp | 2,031 | permissive | #include "pch.h"
#include "xed_operand.hpp"
xed_operand::xed_operand(const xed_operand_t *operand)
{
this->m_operand = operand;
}
xed_operand::~xed_operand()
{
}
xed_uint32_t xed_operand::get_imm()
{
return xed_operand_imm(this->m_operand);
}
xed_operand_enum_t xed_operand::get_name()
{
return xed_operand_name(... |
a10d11b75ab039fac53c0c45ac7b68cd7abe9e81 | b0768fe834f4cff4d867f36925ef24816dae9a9a | Victor-Y-Fadeev/qreal | /plugins/blockDiagram/visualDebugSupport/visualDebuggerPlugin.cpp | C++ | cpp | 11,004 | permissive | /* Copyright 2007-2015 QReal Research Group
*
* 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... |
92a7e6bf60eda9fa6df7994ae7f97653f2dded3d | 64966786f3f3c7df4e674de742b4c26272fdfeb6 | bin-y/skills | /leetcode/382. Linked List Random Node/answer.cpp | C++ | cpp | 1,200 | no_license | std::random_device rd_;
std::mt19937 mt_(rd_());
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* head_;
/** @param head The linked list's head.
Note that the... |
54a0dd77365e3ed501e403a276a121bfdc5d7d80 | e2b352869fe60127867832eae4f58b68603df2cc | PrakharPipersania/LeetCode-Solutions | /Questions Level-Wise/Medium/count-triplets-that-can-form-two-arrays-of-equal-xor.cpp | C++ | cpp | 611 | permissive | class Solution {
public:
int countTriplets(vector<int>& arr)
{
int x,temp=0;
for(int i=0;i<arr.size();i++)
temp^=arr[i],arr[i]=temp;
temp=0;
for(int i=0;i<arr.size()-1;i++)
for(int j=i+1;j<arr.size();j++)
for(int k=j;k<arr.size()... |
6b7feb8a9a4fafd87f1a4556dd58f57513fb4efd | 8c7db415002aaf1e8c19095b443d2a950768a35c | vadimkhu/binarysearch.io | /hard/longest_prefix_that_is_a_suffix.cpp | C++ | cpp | 617 | no_license | /*
Longest Prefix that Is a Suffix
Question 718 of 953
https://binarysearch.com/problems/Longest-Prefix-that-Is-a-Suffix
*/
string solve(string s) {
int n = s.length();
int lps[n];
lps[0] = 0; // lps[0] is always 0
int len = 0;
int i = 1;
while (i < n) {
if (s[i] == s[len]) {
... |
d74d20c34ae2328cdc112f871728acd3d129046d | f263506204450aaa78b057b7cf94a9553f1d1b7d | jsenn/ifcplusplus | /IfcPlusPlus/src/ifcpp/IFC4/lib/IfcClassification.cpp | C++ | cpp | 6,887 | permissive | /* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#include <sstream>
#include <limits>
#include "ifcpp/model/AttributeObject.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/model/BuildingGuid.h"
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include... |
3159c2cf1904ec898734f5994247e159e9566f69 | 42731c204a863871e9866368e889e6e3d0872c6a | mm-s/symbol-sdk-cpp | /core/Hmi/Blob.cpp | C++ | cpp | 3,612 | permissive | /**
*** Copyright (c) 2016-2019, Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp.
*** Copyright (c) 2020-present, Jaguar0625, gimre, BloodyRookie.
*** All rights reserved.
***
*** This file is part of Catapult.
***
*** Catapult is free software: you can redistribute it and/or modify
*** it under the terms of the GNU... |
4c8c6a5aca40c346e9d87cfcd549a070e0e7134b | 4a0c7681d45289d7fde432c8013aff6157bbf9a8 | sailfish009/binding_affinity_calculator | /lib/rosetta/source/src/core/pack/dunbrack/RotamerLibraryScratchSpace.cc | C++ | cc | 1,271 | no_license | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... |
211e69fe4cc0a5144810f8fd7a7b2467f0d337b1 | 5ecb8c824829ab8db56cb3cca5ab08858ce36511 | avinash625/CodingProblems | /LeetCode/Binary_tree_right_view.cpp | C++ | cpp | 827 | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int getHeight(TreeNode *root){
if(!root) return 0;
else return max(getHeight(ro... |
2c23d6ee1ac9ffcb54b02587ddd2d70f4cab453e | d7a17d09022ae3a58c629abe82433d77b7f7a860 | wpmyj/MonitorSystem | /JS-VEMCUCtl_20140409/VEMCUCtl/Label.cpp | C++ | cpp | 26,878 | no_license | // Label.cpp : implementation file
//
#include "stdafx.h"
#include "Label.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
BEGIN_MESSAGE_MAP(CLabel, CStatic)
//{{AFX_MSG_MAP(CLabel)
ON_WM_TIMER()
ON_WM_LBUTTONDOWN()
ON_WM_SETCURSOR()
ON_WM_SYSCOLORCHANGE()
ON_W... |
e319f4a52c84dc0dfc9affe63351299981112382 | 49dbce8af2acd1e306dc7648c33e6f4ea9540494 | yp155136/codebook | /boook/tri.cpp | C++ | cpp | 1,388 | no_license | PII p[MAX];
int n , idx[MAX] , pos[MAX];
long long wnt;
vector<PII> v;
inline PII operator + (PII x , PII y){ return mp(x.A + y.A , x.B + y.B); }
inline PII operator - (PII x , PII y){ return mp(x.A - y.A , x.B - y.B); }
inline long long cross(PII x , PII y){ return 1ll * x.A * y.B - 1ll * x.B * y.A; }
inline long long... |
8fdbfebe12f66763c83019941361dcc914ce196a | 63d9be1af38d7076b92424394c0eca14c0988177 | jasha64/jasha64 | /2015/SPF-割点.cpp | C++ | cpp | 1,224 | permissive | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int N = 1007;
int n, Low[N], DFN[N], Children[N], idx;
bool G[N][N], C[N];
inline int max(int a, int b, int c) {return max(a, max(b, c));}
void Tarjan(int x, int fa)
{
Low[x] = DFN[x] = ++idx;
for (int i = 1; i <= n; ++i)
if (G... |
1d5bfc8494a2e3d8ae315fae2c03eab3143fe7de | 1ab458c04a16381e5fb760218ad6551c9065aae1 | CatWallin/WallinCatherine_CIS17A_49285 | /Homework/Assignment 5/Assign5_Chap13_Prob7/main.cpp | C++ | cpp | 1,557 | no_license |
/*
* File: main.cpp
* Author: Catherine Wallin
* Created on November 6, 2020, 3:43 PM
* Chapter 13 Problem 7: Test Scores Class
*/
#include <cstdlib>
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
class TestScores
{
private:
int testScore1, testScore2, testScore3, averageS... |
2463533bfeb81fcadb8e454fd6d6ff5b37b76589 | a0f0770755f1497a0cc42e89b9cd4492bfec5878 | kbellve/mmCoreAndDevices | /DeviceAdapters/Jenoptik/mmgrProgRes.cpp | C++ | cpp | 55,317 | no_license | ///////////////////////////////////////////////////////////////////////////////
// FILE: mmgrProgRes.cpp
// PROJECT: Micro-Manager ProgRes Camera Driver
// SUBSYSTEM: DeviceAdapters
//-----------------------------------------------------------------------------
// DESCRIPTION: Implementation o... |
8bcd1f7418599cb0dfc5493076426ebae2843401 | 1df3b21c6d27a400b3e9072e316e837a3c6a8c4b | SebastianHall69/Competitive_Programming | /Atcoder/Knapsack 2/main.cpp | C++ | cpp | 1,333 | no_license | /*
* File: main.cpp
* Author: Sebastian Hall
* Created on August 21, 2020, 4:50 PM
* Purpose: https://atcoder.jp/contests/dp/tasks/dp_e
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double triple;
int main() {
ios::sync_with_stdio(false);
//Declare variables
... |
6ce32c14e01327b4fb51e7395323257bf869f568 | 19199539d94a47310c00c87e5cf8fd595fd0c0ec | jameswhang/chromium | /chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc | C++ | cc | 33,592 | permissive | // Copyright 2017 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/resource_coordinator/tab_lifecycle_unit_source.h"
#include <memory>
#include "base/macros.h"
#include "base/message_loop/messag... |
fa0f16125dd2760ff50c02b800ad1f625bee8ff8 | 9b421e708f42c03450a73d22c90190fefc39fee7 | coderfamer/linuxstudy | /c++/c++primer_3/10/ex10_03.cpp | C++ | cpp | 211 | no_license | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int main()
{
vector<int> ivec = {1, 2, 3, 4};
cout << accumulate(ivec.cbegin(), ivec.cend(), 0) << endl;
return 0;
}
|
5a04e9751ed2f7bcc327ab9599703e3e6daa1012 | 97f079b0b97480a1273390c84ef999bd5a740989 | FLABDUL/masbcpp | /src/compute_ma.cpp | C++ | cpp | 4,472 | permissive | /*
Copyright (c) 2016 Ravi Peters
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, publish, distribute, sub... |
f57f31bece42bd987c8398e303c1b498ac0ab420 | ee465f98b0c43c54af79c3d0d6bac9cb452751e9 | Gohan/aws-sdk-cpp | /aws-cpp-sdk-polly/source/PollyClient.cpp | C++ | cpp | 17,713 | permissive | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
19243098d12d601f1a37e684aec1b1a17f1deda7 | a836765f51a77ec7702952e29c0287a3a9d6e643 | hcxiong/incubator-mxnet | /src/imperative/cached_op.cc | C++ | cc | 51,738 | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
2803d652e31eae00f8e159bede203615b3dc5bb0 | 5862b282ac4490d9e8d005b26b24662801af5706 | cdk-king/T2D | /CursorAndIcon/CursorAndIcon.cpp | C++ | cpp | 2,056 | no_license | //includes
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <math.h>
#include "resource.h"
//defines
#define WINDOW_CLASS_NAME "WINCLASS1"
//globals
//functions
//WinProc
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT msg,
WPARAM wparam,
LPARAM lparam
) {
PAINTST... |
ad872ede8fc7c07883b8f7b505873b2634223be1 | 05966d846cdf3672c4a33c526fab5de1fb246e4e | westomopresto/PL_Game_test | /Plugins/LogicDriver/Intermediate/Build/Android/UE4/Inc/SMExtendedRuntime/SMExtendedRuntime.init.gen.cpp | C++ | cpp | 1,091 | no_license | // Copyright Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
========================================================================... |
7b2143d4d508930ecc63f9b3cd6146cbfd5f73db | 24d170d28cdc0f851b21b484e44fb4bcb3ef3ed7 | dotnet/dotnet-api-docs | /snippets/cpp/VS_Snippets_CLR/RuntimeEnvironment/cpp/RuntimeEnvironment.cpp | C++ | cpp | 1,489 | permissive | //Types:System.Runtime.InteropServices.RuntimeEnvironment
//<snippet1>
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;
int main()
{
//<snippet2>
// Show whether the EXE assembly was loaded from the GAC or from a
// private subdirectory.
Cons... |
3f763830818ce4be111884d0af2bb8c7b7adb30f | 755b8f0dc2138d2efefe41aeea16b68da0f6e03d | jmexe/learning_cpp | /CPP_PRIMER/cp12/main.cpp | C++ | cpp | 225 | no_license | #include "StrBlob.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(int argc, char const *argv[]) {
StrBlob sb({"abc", "123", "test"});
cout << sb.front() << sb.back() << endl;
}
|
3afbaa488498897f33d9b0b5a5e89ea182fd544d | 87af9ab9c853ddf9ebc1d88713d4e81cfec588a5 | nashsclay/electra-1 | /src/netbase.cpp | C++ | cpp | 32,900 | permissive | // Copyright (c) 2009-2016 Satoshi Nakamoto
// Copyright (c) 2009-2016 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 "netbase.h"
#include "util.h"
#include "sync.h"
#ifndef WIN32
#include <... |
04384a669c41acbeca05b46808a5319330e52767 | e91a3100d6b356e3f12d793b7336988b9a97f999 | chrisr-cs/trafficserver | /example/cppapi/async_http_fetch_streaming/AsyncHttpFetchStreaming.cc | C++ | cc | 6,082 | permissive | /**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may n... |
4129e689e39dee759cb9712c27f767e09cd46cd4 | 1dfb357e8323f0bda15315127c8ca53b2e37382a | aiyer/tinyxmlpp | /Node.cpp | C++ | cpp | 4,678 | no_license | #include "Node.h"
#include "XMLException.h"
namespace tinyXMLpp{
/**
*Constructor
*/
Node::Node() {
this->numberOfChildren = 0;
this->parentNode = nullptr;
this->nextSibling = this->previousSibling = nullptr;
}
/**
*Destructor
*/
Node::~Node() {
int i;
for (i = 0; i < this->... |
82584ea2f8e82ba3fa932662020660928f45281e | 196af55daa767d04d8d1ff6937c0eb1f7a738385 | huqinwei/cv_experiment | /string_operation/main.cpp | C++ | cpp | 10,783 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <iostream>
#include <windows.h>
using namespace std;
double stringToDouble(string num)
{
bool minus = false; //标记是否是负数
string real = num; //real表示num的绝对值
if (num.at(0) == '-')
{
minus = true;
real = num.substr(1, ... |
826792bf273ec8797a347578f97d29487712f33e | b0cdcf7e83fb25cb2ab4b0c755f96831bfe19cc5 | Marianitomotion/cgru | /afanasy/src/watch/viewitems.cpp | C++ | cpp | 4,125 | no_license | #include "viewitems.h"
#include "item.h"
#include "watch.h"
#include "listitems.h"
#include <QtCore/QEvent>
#include <QtGui/QKeyEvent>
#include <QtGui/QPainter>
#include <QtGui/QScrollBar>
#define AFOUTPUT
#undef AFOUTPUT
#include "../include/macrooutput.h"
ItemDelegate::ItemDelegate( QWidget *parent):
QAbstrac... |
cfd715167d3f7c87440e2d63ac3c4dfeac606756 | eb050e72fdd98f8468a3065c77ea43bda1c71003 | idiottrytocode/3670_assm3 | /group/question2_2/tcp.cpp | C++ | cpp | 1,293 | no_license |
#include "stdlib.h"
#include "SystemUtils.h"
#include "Packet.h"
#include "EthLayer.h"
#include "VlanLayer.h"
#include "IPv4Layer.h"
#include "TcpLayer.h"
#include "HttpLayer.h"
#include "UdpLayer.h"
#include "DnsLayer.h"
#include "PcapFileDevice.h"
bool udppacket(str::string stripm, int port){
/*------------------... |
098d9d46a4a1f32fee3824de69e68c64fa55b695 | 426b801b25f0b60690ba972f3ed1c79d7945be4e | wooyunjae/Tetris | /Tetris/Factorys.cpp | C++ | cpp | 1,189 | no_license | #include <assert.h>
#include "Factorys.h"
#include "Macro.h"
Factorys* Factorys::mpInstance = nullptr;
Factorys::Factorys()
: mpD2DFactory(nullptr)
, mpWICFactory(nullptr)
, mpDWriteFactory(nullptr)
{
}
Factorys::~Factorys()
{
SAFE_RELEASE(mpD2DFactory);
SAFE_RELEASE(mpWICFactory);
SAFE_RELEASE(mpDWriteFactory... |
63aa363c7da2200638f8fd47e37e967100d3b8d8 | 70997bac70f605f9c5b062ba73d38e83243670a4 | maguilo11/locus | /include/DOTk_SteihaugToint/DOTk_SteihaugTointKelleySachs.hpp | C++ | hpp | 2,033 | no_license | /*
* DOTk_SteihaugTointKelleySachs.hpp
*
* Created on: Apr 16, 2016
* Author: Miguel A. Aguilo Valentin
*/
#ifndef DOTK_STEIHAUGTOINTKELLEYSACHS_HPP_
#define DOTK_STEIHAUGTOINTKELLEYSACHS_HPP_
#include <memory>
#include "DOTk_SteihaugTointNewton.hpp"
namespace dotk
{
class DOTk_BoundConstraints;
class DO... |
449f62e92fc73f36c8f04b21c0f3d7251a7858f4 | 59a12727cbe0fc7268cd8854b07e4a95ee2c4ef8 | Burnung/TestOpenGL | /main.cpp | C++ | cpp | 6,838 | no_license | #include <stdlib.h>
#include<GL_Frame.h>
#include<iostream>
#include <glm/gtc/type_ptr.hpp>
#include<glm/gtc/matrix_transform.hpp>
#include<Model.h>
#include<Camera.h>
#include<GL_Fbo.h>
#include<GL_Shader.h>
#include<GL_Blend.h>
#include<GL_Scene.h>
#include<PHO_ViewPort.h>
#include<PHO_Random.h>
#incl... |
4879d608e50128bd35fc4b260235190eb7aac6cf | 49648fa0cf54742ad73e9f6821700cf169af2f6c | tonyzhang1231/data-structure-and-alg-practice-cpp-java | /cpp/236. Lowest Common Ancestor of a Binary Tree.cpp | C++ | cpp | 612 | no_license | class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
return postOrder(root,p,q);
}
TreeNode* postOrder(TreeNode* root, TreeNode* p, TreeNode* q){
if (root==nullptr || root==p || root == q) return root;
TreeNode* l... |
35c43552e9e8e844ba2dfd413f93b1533dde8a0f | 1b80883dcc7b39c19e669cfbb38601393a75f2c2 | denisolenison/MAILabs | /OOP/Lab-7/SListItem.cpp | C++ | cpp | 1,442 | no_license | #include "SListItem.h"
#include <iostream>
#include <memory>
template <class T> SListItem<T>::SListItem(T* _item) {
item = std::shared_ptr<T> (_item);
next = nullptr;
prev = nullptr;
std::cout << "List item: created" << std::endl;
}
template <class T> std::shared_ptr<SListItem<T>> SListItem<T>::SetNext(s... |
e6456f9a8e9c7d07be16a6fe911fa37757493c14 | 9e66054c397cd8adde94c0f8fe83791a30d27501 | s3lab-edu/s3lab_virtual_drive_creator | /VnPlib.VirtualDriveCreator.cpp | C++ | cpp | 3,152 | no_license |
// VnPlib.VirtualDriveCreator.cpp : Defines the class behaviors for the application.
//
#include "pch.h"
#include "framework.h"
#include "VnPlib.VirtualDriveCreator.h"
#include "VnPlib.VirtualDriveCreatorDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CVnPlibVirtualDriveCreatorApp
BEGIN_MESSAGE_MAP(CVnPlibVi... |
166502ab7ceef6b8bfe9f77314f441dc5e768a79 | 05558973a3fd56fcb953f3f44138d41f59f351cf | ljgdsq/OpenGLProject | /OpenGLProject/Utils/LogUtil.cpp | C++ | cpp | 704 | no_license | #include "LogUtil.h"
#include <iostream>
LogUtil::LogUtil()
{
_logLevel = VERBOSE;
}
void LogUtil::Verbose(std::string msg)
{
FormatPrint(VERBOSE, msg);
}
void LogUtil::Info(std::string msg)
{
FormatPrint(INFO, msg);
}
void LogUtil::Warn(std::string msg)
{
FormatPrint(WARN, msg);
}
void LogUtil::E... |
9f08436a26912b550aa5eae1e131623d59fe16c7 | 7085d887881a3f23b36ebbb2b5aa2a9fd851b1b9 | CLDP/USACO-Training | /Section-3/kimbits.cpp | C++ | cpp | 823 | no_license | /*
ID: CHN
PROG: kimbits
LANG: C++
*/
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
int f[40][40];
int main() {
freopen("kimbits.in", "r", stdin);
freopen("kimbits.out", "w", stdout);
int n, l;
lo... |
e42bef50d305b04aec9b886334904f11aa22ce59 | aa30fe7d6c5e8c098a37de4bcaa4970cc22472c1 | loongarch64/afnix | /src/lib/std/shl/Set.hpp | C++ | hpp | 6,206 | no_license | // ---------------------------------------------------------------------------
// - Set.hpp -
// - standard object library - set class definition -
// ---------------------------------------------------------------------------
// -... |
75b67c5db78078597ece06600736fa551a4447eb | d5cede305c3f1d414b8c1773fd9b8bd9290e4cd0 | mhochsteger/blaze | /blazetest/src/mathtest/dmatdmatadd/MDbM4x4a.cpp | C++ | cpp | 3,782 | permissive | //=================================================================================================
/*!
// \file src/mathtest/dmatdmatadd/MDbM4x4a.cpp
// \brief Source file for the MDbM4x4a dense matrix/dense matrix addition math test
//
// Copyright (C) 2012-2019 Klaus Iglberger - All Rights Reserved
//
// This fi... |
8a59c96a63a37f234d2b78a275c17475d47c2ca7 | 19304b0c314d362832f987254ac386c11cc3156d | Vhiral/unnamed-sdvx-clone | /Graphics/include/Graphics/Window.hpp | C++ | hpp | 3,073 | permissive | #pragma once
#include <Graphics/Keys.hpp>
#include <Graphics/Gamepad.hpp>
namespace Graphics
{
// Windowed or bordered window style
enum class WindowStyle
{
Windowed, Borderless
};
// Text input data
struct TextComposition
{
WString composition;
int32 cursor;
int32 selectionLength;
};
/*
Simple wi... |
98e5b348ad33fb1260b393152459ab40f3e7dd68 | 8b4f6e7e34c8004fe8cc28ee263e02287115c124 | dinobot71/ecu-bridge | /ecubridge/src/ChannelManager.cc | C++ | cc | 20,809 | no_license | #include "ChannelManager.hh"
/* standard constructor */
ChannelManager::ChannelManager(void) : Object("ChannelManager") {
unReady();
info("starting up...");
{
for(int i=0; i<(CMMaxChannels+1); i++) {
inputTrans[i] = NULL;
inputFilter[i] = NULL;
outputFilter[i] = NULL;
outputTr... |
2369ed08d178548c659234e791d5c72589ea9467 | 526c53ecb3df24ad87907ac92cc5489664a28ea4 | superphil0/heuropt | /c++src/src/main.cpp | C++ | cpp | 5,620 | no_license | #include "kpmp_instance.h"
#include "kpmp_solution_writer.h"
#include "page.h"
#include "edge.h"
#include "node.h"
#include "deterministic.h"
#include "edgeswap.h"
#include "nodeswap.h"
#include "genetic.h"
#include <memory>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <ctime>
#... |
766e8a769db76ec1bdd4ea7b0e563a2776fdb5e7 | 40fdfbdaeb10cacc7881888dc52755369d00a466 | sumitkaushik1005/coding | /sat3.cpp | C++ | cpp | 649 | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
int mat[n][m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
int x;
cin>>x;
mat[i][j]=x;
}
}
int dp[n][m];
dp[0][0]=mat[0][0];
for(int i=1;i<m;i++){
dp[0][i]=dp[0][i-1]+mat[0][i]... |
7952cc3ac740a0cb593697e5699312492be2bc81 | 3dd2019e00ec25099c055d380cafc58994dc6341 | gheorghesava/My-Projects | /QuizWindow/QuizWindow/GeneratedFiles/qrc_quizwindow.cpp | C++ | cpp | 1,368 | no_license | /****************************************************************************
** Resource object code
**
** Created by: The Resource Compiler for Qt version 5.6.0
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#ifdef QT_NAMESPAC... |
7145071128bfe7af20f63a3ae94b90287f1cbc52 | 0c6facdbdee102e82b2626e9e532437bc9ea7000 | gem-sw/cmssw | /RecoMET/METFilters/plugins/GreedyMuonPFCandidateFilter.cc | C++ | cc | 3,685 | no_license |
// system include files
#include <memory>
#include <iostream>
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDFilter.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/... |
dfdb3487a2df78630458803aa481db247b80a3f5 | 5e08160aa10152ec02ea27fa52a651ee6bb24fc1 | TheRealAdamSandler/50tcejorp | /warrior.hpp | C++ | hpp | 582 | no_license | #ifndef WARRIOR_HPP
#define WARRIOR_HPP
#include "JsonEntityBuilder.hpp"
#include "entity.hpp"
class Warrior : public Entity
{
private:
void Strike(Entity* target);
void ShieldSmash(Entity * target);
void Fist (Entity* target);
public:
Warrior(JsonEntityBuilder &builder, JsonItemBuilder & inventory... |
104375de87f3643963ba195f4c03680d744f3bee | c8f15428e42b9319ad824653e34153db71203c88 | dong777/eNVR | /Apps/DlgEmap.cpp | C++ | cpp | 89,345 | no_license | // DlgEmap.cpp : implementation file
//
#include "stdafx.h"
#include "MainFrm.h"
#include "DlgEmap.h"
#include "BaseRadioButton.h"
#include "resource.h"
#include "DlgSettingEvent.h"
#include "IntraEvent.h"
#define STCW 150
#define STCH 20
#define COCKPITW 400
#define VIDEOW 200
#define VIDEOH 150
#define SPLITW 150
#d... |
87743f5a023aa0d18e0ace973a3395dd778bb5a0 | 3877b198c92f2aae1e8a8934819b8f4d09f92991 | blues/note-c | /test/src/NoteGetStatus_test.cpp | C++ | cpp | 2,496 | permissive | /*!
* @file NoteGetStatus_test.cpp
*
* Written by the Blues Inc. team.
*
* Copyright (c) 2023 Blues Inc. MIT License. Use of this source code is
* governed by licenses granted by the copyright holder including that found in
* the
* <a href="https://github.com/blues/note-c/blob/master/LICENSE">LICENSE</a>
* fil... |
e7b34eb6e15f0bdf4727294299f7e83da5718ed3 | ff41fd866aff11a82bf70a3a630aae2b528ad28c | voile-source/Answer-Collection | /石子合并(区间dp).cpp | C++ | cpp | 1,417 | no_license | /**
一条直线上摆放着一行共n堆的石子。现要将石子有序地合并成一堆。规定每次只能选相邻的两堆合并成新的一堆,并将新的一堆石子数记为该次合并的得分。请编辑计算出将n堆石子合并成一堆的最小得分和将n堆石子合并成一堆的最大得分。
Input
输入有多组测试数据。
每组第一行为n(n<=100),表示有n堆石子,。
二行为n个用空格隔开的整数,依次表示这n堆石子的石子数量ai(0<ai<=100)
Output
每组测试数据输出有一行。输出将n堆石子合并成一堆的最小得分和将n堆石子合并成一堆的最大得分。 中间用空格分开。
Sample Input
3
1 2 3
Sample Output
9 11
解题思路:区间dp,开两个... |
fb07d786c13793fc01da45be7bbee480a80a6bca | 6f5491c5716728b0ee814d13b1df52ea5056b2a0 | PrivatePay-Reborn/PrivatePay | /src/mnemonics/electrum-words.cpp | C++ | cpp | 17,823 | permissive | // Copyright (c) 2014-2018, The Monero Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list o... |
a15b071968ab8efa302afa4b043a75c0971b12fe | 8794138249cd140815bc23daf9653a2268b009da | Fazo92/Server | /Projekt4/rsFeature.cpp | C++ | cpp | 16,376 | no_license | #include "rsFeature.h"
#include <fstream>
#include <sstream>
#include <chrono>
rs2::pipeline rsFeature::getColorFrameRSpipeline() {
rs2::pipeline pipe;
rs2::config cfg;
cfg.enable_stream(RS2_STREAM_COLOR, this->width, this->height, RS2_FORMAT_BGR8, 30);
pipe.start(cfg);
return pipe;
... |
ff85b0a62ea918cfc3a9fc5f46c95d58b74c6ae3 | 90691a8517fc02fbb2fbb89ce577006e257e62c1 | frainfreeze/studying | /university/10004-Programming/home exercises 1/v5z2.cpp | C++ | cpp | 516 | permissive | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector <int> poljeBrojeva;
int suma = 0;
for (int i = 10; i <= 100; i++)
{
if(i%3 == 0)
poljeBrojeva.push_back(i);
}
//Ispis u obrnutom redoslijedu
cout << "Brojevi djeljivi s 3 iz raspona [10-100]" << endl;
for (int i = poljeBroje... |
224464a863a3eb1a51c747de36d1e80eaf528610 | 51b51a371005290858ace670875e9a340e46c235 | singhsd/SPOJ-Codes | /FARIDA.cpp | C++ | cpp | 500 | no_license | #include <iostream>
using namespace std;
long long int dp[10000];
long long int a[10000];
#define max(a,b) (a>b?a:b)
long long int fun( int k, int n)
{
if(dp[k])
return dp[k];
if(k>=n)
return 0;
if(k==n-1)
return dp[k]=a[n-1];
return dp[k]=max( a[k]+fun(k+2,n) , fun(k+1,n) );
}
int main()
{
int t,n,i,k=1;
... |
cfd82a91e05b14367720ccdf8423caa1bff0cde1 | f84f85027961fbef7af321d04d4eeef513c7aeab | mull-project/mull | /tests/MutatorsFactoryTests.cpp | C++ | cpp | 4,043 | permissive | #include "mull/Diagnostics/Diagnostics.h"
#include "mull/Mutators/MutatorsFactory.h"
#include <functional>
#include <gtest/gtest.h>
#include <vector>
using namespace mull;
using namespace llvm;
using namespace std;
TEST(MutatorsFactory, SingleMutators) {
Diagnostics diagnostics;
MutatorsFactory factory(diagnosti... |
fe2ff4f0694c35feea1ea83edeab39390ae87ac8 | a30fc4441d95ee96bbe9794ec883ef1d2f92e305 | ektagarg786/Coding-Ninjas-CP | /String_algo/Palindromic_substrings.cpp | C++ | cpp | 855 | no_license | /*Given a string S, count and return the number of substrings of S that are palindrome.
Single length substrings are also palindromes. You just need to calculate the count, not the substrings.
Input Format :
String S
Output Format :
count of palindrome substrings
Constraints :
1 <= Length of S <= 1000
Sample Input :
ab... |
0faea9d44efafeb9d5f3c678bc185805f124c1e3 | b7464c692ad1256c073ffc0a6d220eea09986766 | DPinato/Emulient | /src/l2helper.cpp | C++ | cpp | 6,272 | no_license | #include "l2helper.h"
L2Helper::L2Helper() {
headerSize = sizeof(struct ether_header);
frameSize = headerSize;
sendbuf = new uint8_t [frameSize * sizeof(uint8_t)]; // this holds the whole L2 header + L2 payload
eh = (struct ether_header *) sendbuf;
payloadSize = 0;
// initialise these just in case
dot1q = fal... |
e8ccae34c39c94faabe07288279b01c14391ca46 | da65bf14f400a3dd7f73dd5e538652e54585eb6c | naveenmahadevuni/incubator-trafodion | /core/sql/comexe/ComTdbTupleFlow.cpp | C++ | cpp | 4,001 | permissive | /**********************************************************************
// @@@ START COPYRIGHT @@@
//
// (C) Copyright 1998-2014 Hewlett-Packard Development Company, L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You m... |
7b464af784aacb87caba2ae8044c65509b5ae140 | b504a839cfeb9fbce4e98bc31c79590bdd929c20 | GlenSol/homies | /GraphicsX/GFX_Camera.cpp | C++ | cpp | 4,537 | no_license | #include "gdix.h"
#include "gdix_i.h"
/////////////////////////////////////
// Name:
// Purpose:
// Output:
// Return:
/////////////////////////////////////
PUBLIC hCAMERA CameraCreate(const float vEye[eMaxPt], angle yaw, angle pitch, angle roll)
{
hCAMERA newCam;
if(MemAlloc((void**)&newCam, sizeo... |
70c768e860d2330fa07d336dc74f13c543afc6eb | 3aa536d0f07814d7003ccd4c5b02d1931b011e2c | AngelKyriako/PROJECT-HY454-2012 | /Bubble Bobble/src/animations/MovingPathAnimation.cpp | C++ | cpp | 733 | no_license | #include "MovingPathAnimation.h"
#include "MemoryManage.h"
MovingPathAnimation :: MovingPathAnimation (const std::vector<PathEntry> _path, animid_t id, bool c)
:path(_path), Animation(id),continuous(c){
DASSERT(!_path.empty());
DASSERT(id>0);
}
MovingPathAnimation :: ~MovingPathAnimation(void){
path.clear();
}... |
915ed78bd5addd738ed7372c7f93d9aabb6875ad | f42d5b9e5e355878d2aa0c10182e7080592c877b | laekov/oophomework | /hw1/Problem5/t.cpp | C++ | cpp | 1,070 | permissive | #include <iostream>
#include "t.h"
T::T() {
this->a = 1;
this->b = 2;
this->c = 3;
this->d = 4;
}
template <class O>
void coute(O c) {
std::cout.width(16);
std::cout.setf(std::ios::left);
std::cout << c;
}
void T::showMap() {
coute("Name");
coute("Value");
coute("Address");
coute("Size");
std::cout << st... |
02be6703d08d15e2b6a8a088bc4dc4afc3ba7301 | 89e609debb75d5b113a7b780c20283d39ff882e8 | cubetrain/CubeTrain | /contracts/libc++/upstream/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp | C++ | cpp | 2,790 | permissive | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... |
be39301a880b901de5af0d449ad819fcf1ad2fa4 | f6dfd6932fb68781de8e90554c1409e43be750ec | addiegupta/InterviewBitProblems | /Two Pointers/Container With Most Water.cpp | C++ | cpp | 1,467 | no_license | /*
InterviewBit : Container With Most Water
Link : https://www.interviewbit.com/problems/container-with-most-water/
Asked in
Google
Facebook
Amazon
Given n non-negative integers a1, a2, ..., an,
where each represents a point at coordinate (i, ai).
'n' vertical lines are drawn such that the two endpoints of line i ... |
2eb9b5425a906a69b252edc7389bb7ec14b060c7 | 4bec054e53e3b447361608eb9ad80b9a2ecf6f8c | AlinLipan/MPS | /Marin Andreea, Tanasescu Adelina, Lipan Alin/ImageBinarization/ImageBinarization/MyThread.cpp | C++ | cpp | 1,084 | no_license |
/**
* Developed by Marin Andreea - Lavinia.
* Code reviewed (including coding style) by Lipan Alin - Ionut.
*/
#include "stdafx.h"
#include "MyThread.h"
MyThread::MyThread() :
m_handle(0),
m_systemID(0),
m_id(0),
m_fp(NULL)
{ }
MyThread::~MyThread()
{
if (m_handle)
{
CloseHandle... |
741acf325c6b303f70d23811a427777f3bca2082 | d1a74ff2b8cf90c87b532ba352c90c44340f0df3 | IsraMekki/tiramisu_code_generator | /cmake-build-debug/programs_tiling/function14452/function14452_schedule_6/function14452_schedule_6.cpp | C++ | cpp | 1,203 | no_license | #include <tiramisu/tiramisu.h>
using namespace tiramisu;
int main(int argc, char **argv){
tiramisu::init("function14452_schedule_6");
constant c0("c0", 128), c1("c1", 64), c2("c2", 64), c3("c3", 64);
var i0("i0", 0, c0), i1("i1", 0, c1), i2("i2", 0, c2), i3("i3", 0, c3), i01("i01"), i02("i02"), i03("i03... |
cb02a39f4e96c9335eeee845ab34d597fcd1d17e | 4f65a2844a9d188665b2763c24463e9026802147 | tille/algorithm-challenges | /more/2010-2011/general/MCITYHAL.cpp | C++ | cpp | 1,639 | no_license | #include <algorithm>
#include <iostream>
#include <iterator>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#includ... |
6b93b7a8eb5f65f4444873fdf1130c52064ee6c5 | 7b84e5596feac45b7937de200dcc2dc8405666d3 | RigoGabriel/exam_05_42 | /module_01/Warlock.cpp | C++ | cpp | 1,478 | no_license | #include "Warlock.hpp"
Warlock::Warlock(const std::string &name, const std::string &title): _name(name), _title(title)
{
std::cout << _name << ": This looks like another boring day" << std::endl;
}
Warlock::~Warlock(){
std::cout << _name << ": My job here is done!" << std::endl;
}
const std::string Warlock::getNam... |
fc5853d7ab95697cc27717d714d9b1412452999a | b2d9b0f71f48e8bae9e3c693656ecafd5475c652 | Chester-King/Cpp-Code-Guide-for-Beginners | /3. Variables/code.cpp | C++ | cpp | 281 | no_license | #include <iostream>
using namespace std;
// Variables are just placeholders
int main(){
int var1 = 7; // Int Datatype takes integer
int var2 = 4;
int sum = var1 + var2;
cout << var1 << endl;
cout << var2 << endl;
cout << sum << endl;
return(0);
} |
f45e8c7116324c006655c4aec93e4018a7ebc486 | 9d1e290ef2e3cd79188e57a743f6d4a7e9c96b8d | utensil-contrib/lean | /src/library/vm/init_module.cpp | C++ | cpp | 2,649 | permissive | /*
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include "library/vm/vm.h"
#include "library/vm/vm_nat.h"
#include "library/vm/vm_int.h"
#include "library/vm/vm_aux.h"
#include "library/vm/vm_io.h"
#inclu... |
cd66fa8a4422f7f116cf92400586abfb591ada70 | d1f929e88626ccd915afe5d278fb1b2e3850bf76 | jems-mishra/DSA-Bootcamps | /Jems Mishra/4.String/to_uppercase.cpp | C++ | cpp | 330 | no_license | #include <iostream>
using namespace std;
int main()
{
int i;
string str;
cout << "Input a string:" << endl;
getline(cin,str);
for (i=0 ; str[i] != '\0' ; i++)
{
str[i] = (str[i] >= 'a' && str[i] <= 'z') ? (str[i] - 32) : str[i];
}
cout << "Uppercase String:" << str;
ret... |
e78b72de99f284ed1a41fd4b6f8c58a7317d6f3c | 1adc973738491b600a9bc8f33f0f97b32c8bc914 | ironpatriot/chromium | /components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc | C++ | cc | 31,245 | 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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
#include <map>
#include <utility>
#include "base/command_line.... |
bba4de412f2db49a764d7be5b5017b4ed9d7c161 | e5e0b6a1b9d632ddfc432d66b0cbd8b8981e19b8 | xiuguodong/mine-sweeping | /wincg.cpp | C++ | cpp | 1,335 | no_license | #include "wincg.h"
#include "ui_wincg.h"
#include"QString"
int i2= 1;
winCG::winCG(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::winCG)
{
ui->setupUi(this);
ui->label->setText(" 歼星炮的所有位置已经全部被我们发现了,现在启动星际主炮,准备摧毁所有歼星炮 ");
}
winCG::~winCG()
{
delete ui;
}
v... |
8fcb5322916e5d131baabfac1fb5fdc9969015a2 | 9bfc4612e8c87f541a19c88ca3257f3b2b4b7f85 | gitter-badger/Kvasir-1 | /Lib/Chip/Unknown/Fujitsu/MB9BF51xR/INTREQ.hpp | C++ | hpp | 53,693 | permissive | #pragma once
#include "Register/Utility.hpp"
namespace Kvasir {
//Interrupts
namespace Nonedrqsel{ ///<DMA Request Selection Register
using Addr = Register::Address<0x40031000,0x00000000,0,unsigned>;
///The interrupt signal of the external interrupt ch.3 is output as a transfer request to the DM... |
124cae7e1fe7908e57b626a913d9be559f501624 | a3fd9a84a79b4c34d8e0ebaf83f8a462bc93e05d | open-telemetry/opentelemetry-cpp | /api/test/trace/span_context_test.cc | C++ | cc | 1,145 | permissive | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
#include "opentelemetry/trace/span_context.h"
#include "opentelemetry/trace/span_id.h"
#include "opentelemetry/trace/trace_id.h"
#include <gtest/gtest.h>
using opentelemetry::trace::SpanContext;
namespace trace_api = opentelemetry::trace;
... |
6f39b27b6c3e7be112fdb9e64218521036ac4696 | ccc303fd02d6a5118660626b469741d7839db87a | lucatoldo/arduino-fhir | /autogenerated/searchparameter-pskel.hxx | C++ | hxx | 24,948 | no_license | // Copyright (c) 2005-2020 Code Synthesis Tools CC.
//
// This program was generated by CodeSynthesis XSD/e, an XML Schema
// to C++ data binding compiler for embedded systems.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as... |
b8a27ffd2a18052dcfbe2bb226c562220afd2c68 | a33a3df4540aca293deb8e480b6cabb51b236893 | Josecespedesant/Datos2.TareaExtraclase1.Cliente | /TareaExtraclase1Cliente/main.cpp | C++ | cpp | 347 | no_license | #include "mainwindow.h"
#include <QApplication>
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include "sockets.h"
#define PORT 8080
#include "deserealizador.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.