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 |
|---|---|---|---|---|---|---|---|---|
929a0c4921446d1a1f9d13750c5132484766d57d | d8b3e358a9ce2a04cd756d1381bcf3d97d6700e1 | MarkAureliy/software-engineer | /Algorithm/LeetCode/String/159.LongestSubstringwithAtMostTwoDistinctCharacters.cc | C++ | cc | 1,896 | no_license | /* Medium
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters.
Example 1:
Input: "eceba"
Output: 3
Explanation: t is "ece" which its length is 3.
Example 2:
Input: "ccaabbb"
Output: 5
Explanation: t is "aabbb" which its length is 5.
Relatives:
003. Longest Substr... |
cd6190b06d01549892083269e8710482f190d5de | 74154cfa685233d55fb09f35c0b850b9780c9a04 | ocmaymay/9181C---2019-2020 | /Seaquam/Seaquam_Da_Red/src/robot-config.cpp | C++ | cpp | 999 | no_license | #include "vex.h"
using namespace vex;
using signature = vision::signature;
using code = vision::code;
// A global instance of brain used for printing to the V5 Brain screen
brain Brain;
// VEXcode device constructors
motor LeftMotor = motor(PORT11, ratio18_1, false);
motor LeftMotor2 = motor(PORT13, ratio18_1, fals... |
6e907faa0dc06148a1f8d57b8ecc6b170428e882 | 00f5c8d2e1be2e6a07a3bc281df4de5226481f61 | SREERAGI18/chromium | /chrome/browser/ui/webui/ntp/core_app_launcher_handler.cc | C++ | cc | 2,232 | 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 "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
#include "base/bind.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/c... |
73e6ab3cc58f8a4a3f3cf60f6802199e8d341b86 | ef1a1bdd2f18741746c627b7dbb6c12e62709c72 | hathu0610/arrayfire | /src/backend/cpu/sort_by_key.cpp | C++ | cpp | 2,666 | permissive | /*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
**********************************************... |
9f582c718ea4be6714dbc02d319dfe88ca1f4c2c | 78dade61c22aee23b86db14d61fb240a1195ff16 | lit-uriy/OberonCompiler | /src/semchecker.cpp | C++ | cpp | 36,702 | no_license | #include <cstdlib>
#include <stdio.h>
#include <iostream>
#include "semchecker.h"
#include "errorhandler.h"
#include "message.h"
#include "debug.h"
#include "config.h"
#include "type.h"
#include "binaryexpr.h"
//#define DEBUG 1
extern char** predeclared_procs;
extern bool GEN_SYMTABLE;
SemanticChecker::SemanticChecker... |
b1ca8bc0b1a50d1a11d846456728a97053bc9b01 | 5c75eb328feca34aa2bfa2090a141595a6a3432f | SARTHAK-27/Ultimate-DSA | /Company Specific/Amazon Interview Experiences/Reverse K nodes in LL.cpp | C++ | cpp | 1,090 | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseKGro... |
afdc4d7456419f1d7f97cb51a0cad8cca2a00b06 | c1324a47b15e396a760fa1f2583798c99c09685b | gremilkar/AGKTier2 | /platform/mac/Source/MacNetwork.cpp | C++ | cpp | 48,879 | no_license | #include "agk.h"
#include <net/if.h>
using namespace AGK;
//*********************
// UDPManager
//*********************
UDPManager::UDPManager( UINT port )
{
if ( port == 0 ) port = 65535;
if ( port > 65535 ) port = 65535;
m_port = port;
m_socket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
i... |
15ae4bd520a327da250630c2630eeb049899a78d | c5c26b5044b50eba4dff2525a2a06be689ca26a6 | rutujak24/SPPU_SE_ADSL_Assignments | /A11_JavaDLL.cpp | C++ | cpp | 6,090 | no_license |
package specificList;
import common.commonList;
import java.util.Scanner;
class Node
{
public int data;
public Node next;
public Node previous;
public Node()
{
previous = null;
next = null;
data = 0;
}
public Node(int d, Node n, Node ... |
8078cb54ade2305ad09ec9f31b7cd29c1bd50aaa | 8d81c954d4b098ab3ffebcf4710b8fb52bbcb3c9 | OperationSleepyWeasel/PirexPickleBlowfish | /src/gui/SideField.cpp | C++ | cpp | 413 | no_license | #include "SideField.hpp"
SideField::SideField(int player, int whichToken, float radius, QGraphicsItem* parent)
: Hexagon(radius, parent), player(player), whichToken(whichToken)
{
}
int SideField::getPlayer(void) {
return player;
}
int SideField::getWhichToken(void) {
return whichToken;
}
void SideField::mouse... |
8f748f105efefab03b890acbdd155368e9e657e5 | 55cf60344b08e3b900dabbdd65b12150ae9a85fa | boaz23/SPL-Assignment1 | /src/ActionFactory.cpp | C++ | cpp | 1,963 | no_license | #include "../include/ActionFactory.h"
ActionFactory::~ActionFactory() = default;
BaseAction* CreateUserActionFactory::createAction() {
return new CreateUser();
// return nullptr;
}
ActionFactory* CreateUserActionFactory::clone() {
return new CreateUserActionFactory();
}
BaseAction* ChangeActiveUserActionF... |
923ce18cd734a881876afe5f1a5ad43192a870a4 | c5c81af27322db7b68e23cf5932738989a0dd949 | zenoalbisser/chromium | /ios/chrome/test/ios_chrome_unit_test_suite.cc | C++ | cc | 2,764 | 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 "ios/chrome/test/ios_chrome_unit_test_suite.h"
#include "ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h"
#include "ios... |
a15565d08853787aa6c9fa2a57ee08dd6185ccca | 4ccf6e2005ff8e3a408f578bcc207850fa4b973c | shureg/glooper | /lib/c++/trading/Position.struct.cc | C++ | cc | 1,974 | no_license | // =====================================================================================
//
// Filename: Position.struct.cc
//
// Description:
//
// Version: 1.0
// Created: 15/06/09 20:58:12
// Revision: none
// Compiler: g++
//
// Author: Alexander Kabanov (aak),... |
f2606b9cc2e655203f7ff8611b0efde86f26eae7 | e71528d488ef87421ce721c492e1f4e097623fd1 | Mennat-Ullah/Co-Swarm15 | /Co-Swarm with ROS/chapter7_tutorials/src/simulate_robot.cpp | C++ | cpp | 1,182 | no_license | #include "simulate_robot.h"
DsLite::simulate_robot::simulate_robot(int r, int c, point p)
{
row = r;
col = c;
grid = new int*[row];
rep(i, 0, row)
grid[i] = new int[col];
rob_pos = p;
}
DsLite::simulate_robot::~simulate_robot()
{
rep(i, 0, row)
delete[] grid[i];
delete[] grid;
}
void DsLite::simulate_ro... |
af83973d38408f0d98ca37f756a893f1c0ab8177 | a498a521007ae54ffe8cbfd67a1caa84ad4be6a8 | iomeone/pbrt-v4 | /src/pbrt/util/log.cpp | C++ | cpp | 13,394 | permissive | // pbrt is Copyright(c) 1998-2020 Matt Pharr, Wenzel Jakob, and Greg Humphreys.
// The pbrt source code is licensed under the Apache License, Version 2.0.
// SPDX: Apache-2.0
#include <pbrt/util/log.h>
#include <pbrt/options.h>
#ifdef PBRT_BUILD_GPU_RENDERER
#include <pbrt/gpu/util.h>
#endif
#include <pbrt/util/check... |
85cc793f403752d9e657124e487afedb42d80204 | f31b547c7588fa8a4e302eee99dfe620c454db90 | RealFakeAccount/Oi-times | /this computer/p2604.cpp | C++ | cpp | 2,146 | no_license | #include <bits/stdc++.h>
using namespace std;
const int MAXN=1000+2;
const int inf=0x7f7f7f7f;
namespace MCMF
{
struct edge
{
int to,cost,cap,rev;
edge(int to,int cost,int cap,int rev) : to(to),cost(cost),cap(cap),rev(rev)
{
}
};
//----------MCMF
vector<edge> g[MAXN],gc[MAXN];
int dis[MAXN],preve[MAXN],pr... |
5211fe768600644f07960a7aa918d29ebfd183e0 | 0a2cc8f4449992adf89fa11e87f221ab8b1be179 | ZVNexus/fuchsia | /garnet/examples/inspection/example_server_app.cc | C++ | cc | 1,779 | permissive | // Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "example_server_app.h"
#include <lib/sys/cpp/component_context.h>
#include "lib/fidl/cpp/interface_request.h"
namespace example {
constexpr si... |
44c21c77d7d7fc7d7505ae044940771683548fa1 | 240a6be2e3f16dc9b2073ce26bc26131d6fee262 | nickleefly/experiment | /cpp/hw5/game.cpp | C++ | cpp | 5,496 | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdlib>
#include "game.h"
#include "hexGraph.h"
#include "hexBoard.h"
using namespace std;
ostream& operator<<(ostream &out, Space sp) {
switch (sp) {
case P_EMPTY:
out << "-";
break;
case P_B... |
ff9da73b6ed20fcc97ddd0efeed1c470d73d2c2f | ba207fba8d2710ecd198c8df7af60ba249ef771f | song-df/qt-wificar | /main.cpp | C++ | cpp | 391 | no_license | #include <QApplication>
#include <QSize>
#include <QScreen>
#include <QDebug>
#include "videoClient.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QScreen *screen = qApp->primaryScreen();
QSize screenSize=screen->size();
videoClient w;
//w.resize(screenSize.width(... |
3680272c624378e2fc7f3ad8d74414b81590d414 | 69a6668a41041c336ac7c08584c88c0c9f558fcb | briancpark/deitel-cpp | /VCB600ENU1/MSDN_VCB/SAMPLES/VC98/SDK/COM/INOLE2/CHAP20/PATRON/DRAGDROP.CPP | C++ | cpp | 4,418 | no_license | /*
* DRAGDROP.CPP
* Patron Chapter 20
*
* Member functions of the CPages class concerned with drag-drop
* and other object-placement functionality. Moved here to clean
* up CPAGES.CPP somewhat.
*
* Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
*
* Kraig Brockschmidt, Microsoft
... |
6ded5a410ec5ceb10b55532535e12038b03ee391 | f1b723fef4bf9f14e419c0301d263dd4da4503c6 | grodansparadis/vscpl2drv-socketcan | /src/vscpl2drv-socketcan.cpp | C++ | cpp | 7,036 | permissive | // vscp2drv_socketcan.cpp : Defines the initialization routines for the DLL.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version
// 2 of the License, or (at your option) ... |
412b5a3e5f7b2f62eda5cb8b94bf3a0577f35901 | f5bb5bfdcec4406bb5439c68f70e1b9dc3b00238 | MicrosoftDocs/cpp-docs | /docs/parallel/concrt/codesnippet/CPP/walkthrough-removing-work-from-a-user-interface-thread_8.cpp | C++ | cpp | 541 | permissive | void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// Get the size of the client area of the window.
RECT rc;
GetClientRect(&rc);
// Create a Bitmap object that has the width and height of
// the client area.
BitmapPtr pBitmap(new Bitmap(rc.right, rc.bottom));
if... |
075d735478500f93bc138eac088ae576751162f2 | af117683e8787511123bde60006e88c067c3661d | vaspatrik/GraphicsProject | /02_LoadMesh/GLUtils.cpp | C++ | cpp | 3,769 | no_license | #include "GLUtils.h"
/*
Az http://www.opengl-tutorial.org/ oldal alapján.
*/
GLuint loadShader(GLenum _shaderType, const char* _fileName)
{
// shader azonosito letrehozasa
GLuint loadedShader = glCreateShader(_shaderType);
// ha nem sikerult hibauzenet es -1 visszaadasa
if (loadedShader == 0)
{
fprintf(stder... |
6d25304fafdb6cd30527576553869241b39c2791 | 68fa09854a7173a07cb5e0e75f912181c4c2ed27 | Micalson/qi | /src/OSGWrapper/src/OSGWrapper/FreetypeFontManager.cpp | C++ | cpp | 1,632 | no_license | #include <osgWrapper/FreetypeFontManager.h>
namespace OSGWrapper
{
FreetypeFontManager* FreetypeFontManager::m_instance = 0;
FreetypeFontManager& FreetypeFontManager::Instance()
{
if (!m_instance) m_instance = new FreetypeFontManager();
return *m_instance;
}
void FreetypeFontManager::Release()
{... |
4d7b0bb69665c177f4ab94777f947e98694a9da8 | 03ca48284e3760ce2800beb41bbedb56b08bbfe0 | AmesianX/SHZPublicDev | /Develop/Server/GameServerOck/unittest/TestItemEquiper_Equip.cpp | C++ | cpp | 6,441 | no_license | #include "stdafx.h"
#include "SUnitTestUtil.h"
#include "MockEntityPlayer.h"
#include "CCommandResultTable.h"
#include "MockField.h"
#include "MockDBManager.h"
#include "GGlobal.h"
#include "GTestWrapper.h"
#include "GItemSystem.h"
#include "CCommandResultTable.h"
#include "TestItemManager.h"
#include "GUTHe... |
bec80e4daddd8161e361be6fb7896299ac70225f | 313b00ff1d19d6bbfec6e04e45759b3c8ec93b0a | wqx081/DesignPatterns | /operational/src/command/command_application.cc | C++ | cc | 658 | permissive | // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
// book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
//
// Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
#include "command_application.h"
namespace operational
{
... |
6eaf3c0ed7b3ffaae0f55f628ce0b4089b31f5f0 | e655e63c2318d08ce625a2065ed46a1f55d88c50 | gourav13/c-_code | /codeblocks/Lecture-03/subsequences.cpp | C++ | cpp | 381 | no_license | #include<iostream>
#include<cstring>
using namespace std;
void mask(char input[],int no){
int i = 0;
for( ; no>0; no>>=1){
if(no&1){
cout<<input[i];
}
i++;
}
cout<<endl;
}
int main(){
char input[100];
cin>>input;
int n = strlen(input);
for(int i=0... |
9c9963c66a9daf3b9166b3bd559448538bfc8d63 | b4ce78e46a3ea6fdf8c7ad4a757bf4a961ffc5c1 | PTSD-3D/PTSD-Engine | /dependencies/Ogre/src/OgreMain/src/OgreDynLib.cpp | C++ | cpp | 6,797 | permissive | /*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2014 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person ... |
4037b7e783d03f3fe1c2a4205acc8a15c5448fa8 | 649bc6c5d90aabba86030251750fdd5f6c25fc10 | lauer3912/chromium.src | /chrome/browser/autocomplete/shortcuts_provider.cc | C++ | cc | 19,562 | permissive | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/autocomplete/shortcuts_provider.h"
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include "base/i1... |
6d4ef6562fc974ae7a02733db08096ed0f1da107 | ffa0f65cbcfc58bc6e9d46ebfa2804e59f5c4aa2 | birdwatcherYT/Q-learning | /Maze.cpp | C++ | cpp | 8,609 | no_license | #include "Maze.hpp"
/**
* コンストラクタ
* @param row 行
* @param col 列
* @param type 迷路の種類
*/
Maze::Maze(int row, int col, int type) {
//画面クリア
std::cout << "\x1b[2J";
this->row = row;
this->col = col;
//状態数は迷路の位置の数
numState = row * col;
//行動数は上下左右
numAction = 4;
s... |
cdf6e6a1d2cae8f8ebc151d636f8c27b99b11277 | ff848c171368d399d6c540088cab1d1fff777f5d | saharohan/CodeChef-Practice | /BUYING2/main.cpp | C++ | cpp | 585 | no_license | #include<iostream>
#include<vector>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
int c;
int sum=0;
cin>>n>>c;
vector<int> a(n);
for (auto& element : a)
{
cin >> element;
}
for(int i=0 ; i<n; i++)
{
sum+=... |
4d0da5787f6045bc2600d9a0a9e5014ed70ff6c8 | 03a10a6c2017eed52175c694092da3b880146b63 | zlgorithmy/cpp | /Project/Project1/main.cpp | C++ | cpp | 1,757 | permissive | //#include <iostream>
#include "Derive.h"
//using namespace std;
//typedef 返回类型(*新类型)(参数表)
typedef void(*Fun)(void);
void displayD(string s) {
cout << "-----------"<<s<<"-------------------------" << endl;
}
//获取虚函数表
void test()
{
Derive d;
//cout << "size(d):" << sizeof(d) << endl;
int** pVtab = (int**)&d;
/... |
7c4b36ae76b2ae1babde571b5397d84ec22a8098 | 39b141a9d7673b74387597f3b012d0766d4ef4ca | Abobului-Ioan/Homeworks-C-OOP | /Homework C++ OOP/4.Citeste si aduna 2 timpi/Timp.cpp | C++ | cpp | 607 | no_license | #include "Timp.h"
void Timp::citeste()
{
cout << "Introdu timpul:" << endl;
cout << "ore? "; cin>>ore;
cout << "minute? "; cin>>minute;
cout << "secunde? "; cin>>secunde;
}
void Timp::afiseaza()
{
cout << endl;
cout << "Timp dupa adunare: ";
cout << ore << ":" << min... |
f016a8cef01f426b3bbde06e54b1475293e0fa4f | 72865ed7b028cdfe3ced8f2b785bdb63790abd2f | eazuooz/WindowsAPI_Portfolio | /MyStudy/02_WinAPI/PlayerLittleBullet.cpp | C++ | cpp | 2,128 | no_license | #include "stdafx.h"
#include "PlayerLittleBullet.h"
#include "AniRender.h"
#include "CirclCol.h"
#include "Collision.h"
#include <JTIME.h>
#include <Sound.h>
bool PlayerLittleBullet::Init()
{
aniRender = CreateRender<AniRender>(20);
aniRender->SubPivotMode(PIVOT::CENTER);
aniRender->CreateAnimat... |
86012b6cf6279132c019a295affdfcd239903476 | 0b4a196aee5c37e4902bba67b483003c5a17a1df | BradLarson/swift-1 | /stdlib/public/runtime/MetadataLookup.cpp | C++ | cpp | 127,482 | permissive | //===--- MetadataLookup.cpp - Swift Language Type Name Lookup -------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
395dba7bfe2049b428a7ca28e829f6cd10e202c2 | 7c8348c3fe71c26a477b87c5a1558628453af061 | RDTCREW/SoT-SDK_2_0_7_reserv | /SDK/SoT_BP_Mast_structs.hpp | C++ | hpp | 364 | no_license | #pragma once
// Sea of Thieves (2.0) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SoT_Basic.hpp"
#include "SoT_Athena_classes.hpp"
#include "SoT_Engine_classes.hpp"
#include "SoT_Repair_classes.hpp"
#include "SoT_CoreUObject_classes.hpp"
#include "SoT_BP_SailStructure_classes.hpp"
namespace SDK
{
}... |
2715f63270307db91e445912bfbea7f487c1766e | ee6c87d8c85841cb023668f4d002031951219ec1 | DanLinder/crisscross | /examples/CheckMark/adler32.cpp | C++ | cpp | 4,938 | no_license | /*
* CrissCross
* A multi-purpose cross-platform library.
*
* A product of Uplink Laboratories.
*
* (c) 2006-2009 Steven Noonan.
* Licensed under the New BSD License.
*
*/
#include "header.h"
/*
* This implementation of Adler-32 was taken and modified from zlib
* to work with standard C++ Copyrig... |
8ceb6c5a86543dbe7a1adadb8ef1bc6b9ea2775e | 17ce624c7f1af2918f930a34c958e23a48f1001d | SidZhangCN/embed_lab | /server/CJsonObject.cpp | C++ | cpp | 87,149 | no_license | /*******************************************************************************
* Project: neb
* @file CJsonObject.cpp
* @brief
* @author bwarliao
* @date: 2014-7-16
* @note
* Modify history:
******************************************************************************/
#include "CJsonObject.hpp"
... |
92f7f30b6136530269fc3afc1c046e036b2c3fc0 | 24a7eb5c29b75033b59859cd5c3fbce63715f339 | caogl/Algorithms_practice | /other/Rotate array in place/main.cpp | C++ | cpp | 762 | no_license | // from leetcode cleancode handbook
// reference: http://www.geeksforgeeks.org/array-rotation/
// input: 1 2 3 4 5 6 7 2
// result: 6 7 1 2 3 4 5
#include<iostream>
#include<algorithm>
using namespace std;
void rotateK(int A[], int n, int k);
void rotateRightbyOne(int A[], int n);
int main()
{
int A[]={1,2,3,4... |
27fbe5cea6a019bdd0064157bfc4f50652aeb2f8 | 4a3a6e9035747493dd075d3a506646bfb0927310 | ilusta/DOT.RoboCup2020-software | /stm32/stm32f407/periph_library/src/stm32f407_pin.cpp | C++ | cpp | 2,396 | no_license | #include "stm32f407_pin.h"
void initPin(GPIO_TypeDef * port, uint16_t num, uint8_t mode, uint8_t pull, uint8_t af) {
//select gpio register name & set clk
if (port == A)
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
else if (port == B)
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN;
else if (port == C)
R... |
0669ed39bb4c676252fb612ac17288307b2a398d | 8c4846bb0ab26b875c9c4f6b503bdb00f751b7b0 | Juzisook/cpp_study | /01-cPlusPlus/dm19_referenceConst.cpp | C++ | cpp | 1,616 | no_license | //
// Created by YANHAI on 2019/4/27.
//
// 常引用
#include <iostream>
using namespace std;
struct Teacher
{
char name[64];
int age;
};
// 常引用 让实参变量 拥有只读属性
// void printTeacher(const Teacher * const t)
void printTeacher(const Teacher &t)
{
// t.age = 20;
cout << "age: " << t.age << endl;
}
int main()
... |
e99e83a74620c98f862285fce2b55ce5c213f64c | a74fcee43d1f1cb14c2be29ceb27b766a57bae49 | Brennan-VanderLaan/FFB | /Firmware/DCS_Test/PIDReportHandler.cpp | C++ | cpp | 8,501 | no_license | #include "PIDReportHandler.h"
PIDReportHandler::PIDReportHandler()
{
nextEID = 1;
devicePaused = 0;
}
PIDReportHandler::~PIDReportHandler()
{
FreeAllEffects();
}
uint8_t PIDReportHandler::GetNextFreeEffect(void)
{
if (nextEID == MAX_EFFECTS)
return 0;
uint8_t id = nextEID++;
while (g_EffectStates[nextEID... |
1b715c7036b58e1c9aa78f19c8e49b77cf8c1549 | 4f8d297d762eaf1d569d2623689da2706a69568b | Anzsley/My_Juliet_Test_Suite_v1.3_for_C_Cpp | /C/testcases/CWE126_Buffer_Overread/s03/CWE126_Buffer_Overread__new_wchar_t_memmove_68a.cpp | C++ | cpp | 2,438 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE126_Buffer_Overread__new_wchar_t_memmove_68a.cpp
Label Definition File: CWE126_Buffer_Overread__new.label.xml
Template File: sources-sink-68a.tmpl.cpp
*/
/*
* @description
* CWE: 126 Buffer Over-read
* BadSource: Use a small buffer
* GoodSource: Use a large buffer
... |
c142dcfe4ffaa294e4452b42c2b2a28c14ac19a3 | 927a58b30a65eb7ff9e6a86f2e05086734c58623 | znoraka/tp7 | /birds.cpp | C++ | cpp | 1,254 | no_license | #include "birds.h"
Birds::Birds(int birdCount)
{
PlyEntity *target = PlyEntity::load(":/gull.ply");
//entities.push_back(target);
for (int i = 0; i < birdCount; ++i) {
PlyEntity *e = PlyEntity::copy(target);
float x = (qrand() % 1000) * 0.001 - 0.5;
float y = (qrand() % 1000) * 0.... |
ca81464bc059100d8b32382888a601ea098e14a6 | 7af7c33abf11f71190217201fceeacaf9713be84 | D33pBlue/AnimalGame-lite- | /src/ai.cpp | C++ | cpp | 893 | permissive | #include "ai.h"
#include "partita.h"
Ai::Ai(int _punti):Giocatore("Ai",_punti){}
iterator_c Ai::trovaCartaDaTirare(Partita *p)const{
//intelligenza artificiale sostituibile
const Collettore<Carta*>* mano=getMano();
iterator_c best=mano->begin();
int mang=0;
for(iterator_c it=mano->begin();it!=man... |
1ef3417385625d0435218baa408694c43c3e7a40 | 7461ac784d60d4051d8544a0b99fe0f16d8c7373 | RWTH-HPC/llvm-project | /llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp | C++ | cpp | 28,192 | permissive | //===-- SILowerControlFlow.cpp - Use predicates for control flow ----------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
54fcb265bad96122f5a4cf434241cb2f6d141e2d | 84be9b7a218e809bacc20bd6242164f61ecdeefa | qinyafei/prpc | /examples/TaskRunningRpc.cpp | C++ | cpp | 1,082 | no_license | #include "TaskRunningRpc.h"
using namespace vmr;
//--------------------------------------------
/**
* @brief 增加新任务rpc服务
*/
void ImplJobDispatch::add(::google::protobuf::RpcController* controller,
const ::JobDispatch::TaskRequest* request,
::JobDispatch::TaskResponse* response,
::google::protobuf::Closure* done... |
67fb6289f5feaf3d8f59ddf7d13f3b6ef67546f3 | 45491a5b9d992b646f7b502a81424124e0595b7a | Mu2e/Tutorial | /GeometryBrowsing/SelectVirtualDetectors.cc | C++ | cc | 1,516 | permissive | //
// Start at a TGeoNode, descend the daughter tree. Make all virtual detectors
// visible, all else invisible.
//
#include "SelectVirtualDetectors.hh"
#include "TGeoNode.h"
#include "TGeoVolume.h"
using namespace std;
SelectVirtualDetectors::SelectVirtualDetectors( TGeoNode * node, int depth ):
_name(node->Ge... |
936dffdd7d2965ab91b24b4a474a50ce35c39d12 | 28d21a927c37d9b5f77041dac97521f8a16aa5a9 | klevler/yas | /include/yas/buffers.hpp | C++ | hpp | 3,465 | no_license |
// Copyright (c) 2010-2016 niXman (i dot nixman dog gmail dot com). All
// rights reserved.
//
// This file is part of YAS(https://github.com/niXman/yas) project.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
... |
ebed3affa51a114272ef57bfbcadd1ea2af4b636 | d3ba2ae039b82f35b54186597449a180b5be70de | yuanpengtu/SecondFile-System | /OpenFileManager.cpp | C++ | cpp | 2,899 | no_license | #include "Utility.h"
#include "OpenFileManager.h"
#include "User.h"
#include<QDebug>
OpenFileTable::OpenFileTable() {
}
OpenFileTable::~OpenFileTable() {
}
void OpenFileTable::Format() {
File emptyFile;
for (int i = 0; i < OpenFileTable::NFILE; ++i) {
Utility::memcpy(m_File + i, &emptyFile, sizeof(Fi... |
8560fce670af9b2234fe3b223e4c27fec5d41c2e | 99414431ce9b48f1601cc87fdac84b0c0086f551 | HanjieLuo/ublox_gps_ros | /Thirdparty/GeographicLib-1.48/include/GeographicLib/NearestNeighbor.hpp | C++ | hpp | 35,975 | permissive | /**
* \file NearestNeighbor.hpp
* \brief Header for GeographicLib::NearestNeighbor class
*
* Copyright (c) Charles Karney (2016) <charles@karney.com> and licensed under
* the MIT/X11 License. For more information, see
* https://geographiclib.sourceforge.io/
***********************************************... |
35e3f03be42c4e6e612ce34496ae13e82e52eae4 | cb4c79ce6727f4426a3be56a12ca29e29e9fea50 | ajaysundark/actor-framework | /libcaf_core/caf/exec_main.hpp | C++ | hpp | 4,190 | permissive | /******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
... |
5805c2497e9c8ec0673e62c08eb61884b1a98518 | bdce755dfcab0fcab0a4ef39f4c4568752dc5708 | CU-0xff/juliet-cpp | /000/115/304/CWE762_Mismatched_Memory_Management_Routines__new_array_delete_int_81_goodB2G.cpp | C++ | cpp | 1,062 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__new_array_delete_int_81_goodB2G.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_array_delete.label.xml
Template File: sources-sinks-81_goodB2G.tmpl.cpp
*/
/*
* @description
* CWE: 762 Mismatched Me... |
4f62d6a6f955326c0aa5c3e4c72fcc0631b24471 | ee00e6edf2e03dce7edabcbdfe3fb55a45626408 | Geodan/3D4EM-LoD2buildingmodels | /Library/LaserScan/src/LaserScanLine.cc | C++ | cc | 13,484 | no_license |
/*
Copyright 2010 University of Twente and Delft University of Technology
This file is part of the Mapping libraries and tools, developed
for research, education and projects in photogrammetry and laser scanning.
The Mapping libraries and tools are free software: you can redistribute it
a... |
2a26de05341a7f538672dc5e0b3c6a61ced3fbfb | 2387fa180689634c9be31750a25298243e745bb3 | sshanmanian/maya-usd | /plugin/al/mayatest/AL/maya/test/testHelpers.cpp | C++ | cpp | 23,270 | permissive | //
// Copyright 2017 Animal Logic
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... |
ff3519c2637db80c37ad51265d552ff0a4a607fc | fef2f0b9d53071e2cbc8cb9f67677f6bb31028bd | davsuss/ECE | /Homeworks/Homework3/testGroundGate/testGroundGate.cpp | C++ | cpp | 1,859 | no_license | #include <QString>
#include <QtTest>
#include <QObject>
//#include "/home/david/Documents/Git Projects/ECE/Homeworks/Homework3/assign3/andgate.cpp"
#include "/home/david/Documents/Git Projects/ECE/Homeworks/Homework3/assign3/andgate.h"
#include "/home/david/Documents/Git Projects/ECE/Homeworks/Homework3/assign3/groundg... |
c1171edba1d7c03a731bd499086340661cf9b3f4 | 323f97501040355b70b01147f4b69f5038aa68ce | SlavaC1/ControlSW | /Trunk/ObjetFamily/Tester3Resin/Sources/OCBSimualtor/OCBSimulator.cpp | C++ | cpp | 5,590 | no_license |
#include "OCBSimulator.h"
void COCBSimulator::SetTrayTemperature(TOCBSetTrayTemperatureMessage& SetTrayTemperature)
{
m_SetTrayTemperature = SetTrayTemperature;
}
TOCBTrayStatusResponse COCBSimulator::GetTrayStatus()
{
TOCBTrayStatusResponse TrayStatus;
TrayStatus.MessageID = OCB_TRAY_STATUS;
TrayStatus.Cur... |
c08b6bc6fcaa8302eaedf53f8cb7e8145e3017f8 | 4c267d20fe9869f8c256b5672793a32deabb503b | KqSMea8/sstd_library | /sstd_boost/sstd/boost/spirit/home/support/char_set/range_run_impl.hpp | C++ | hpp | 5,951 | permissive | /*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
========================================... |
f44201a6e474ede27fee7c35c71b4e7314926cf8 | 32cef7956306c9dfc3710f0221f7e1e696c18ebb | xud929/xxx | /quad_tree.cpp | C++ | cpp | 1,297 | no_license | //
// Created by Yue Hao on 7/15/16.
//
#include "quad_tree.h"
void CQuad_tree::subdivide() {
q1=new CQuad_tree(this->boundary.sub_box(1), level=this->level+1);
q1->parent=this;
q2=new CQuad_tree(this->boundary.sub_box(2), level=this->level+1);
q2->parent=this;
q3=new CQuad_tree(this->boundary.sub... |
f37d1eeda5573d4167ac34e04ea138b2d2aa4723 | 0597da1a30079b9d8054b3fd8218f4a60b494239 | Cafemug/baekjoon-cpp | /1789.cpp | C++ | cpp | 239 | no_license | #include<iostream>
using namespace std;
int main()
{
long long S;
cin >> S;
long long x=0;
long long num=1;
while (x < S)
{
x = x + num;
num++;
}
if (x == S)
{
cout << num - 1 << endl;
}
else {
cout << num - 2 << endl;
}
}
|
9e21a38e3c130c27193a9edbb9df0b3656956814 | 1a56fa42ccee262774b93d24099e89a39888df21 | lauer3912/chromium.src | /media/base/audio_splicer.cc | C++ | cc | 20,706 | permissive | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/base/audio_splicer.h"
#include <cstdlib>
#include <deque>
#include "base/logging.h"
#include "media/base/audio_buffer.h"
#include "m... |
539a5a59dca72b21c72eb571c2caf3ba1feeb381 | 2de72e8896b37ec835703cf96b88a98d4ba0e5c6 | Sunil2120/Coding_questions | /geeks_for_geeks/greedy/SJSA.cpp | C++ | cpp | 1,162 | no_license | #include<bits/stdc++.h>
using namespace std;
struct node
{
int id;
int arrival;
int burst;
};
typedef struct node Node;
struct compare1
{
bool operator()(Node* a,Node* b)
{
return a->arrival > b->arrival;
}
};
struct compare2
{
bool operator()(Node* a,Node* b)
{
return a->burst > b->burst;
}
};
voi... |
3507d4e44933388427558b34db5f9240ba524732 | 7d5d4487bf0e584e6938e75b59c5a54ca1eecd0f | foolbread/leetcode | /1122/1122.cpp | C++ | cpp | 998 | no_license | class Solution {
public:
vector<int> relativeSortArray(vector<int>& arr1, vector<int>& arr2) {
vector<int> ret;
vector<int> notexist;
map<int,int> arr1map;
for (int i=0; i<arr1.size(); i++)
{
if (arr1map.count(arr1[i]) == 0)
{
arr1map[a... |
4c20ee6de56acb81b302a0dba199f3efb2d6fd30 | c25b7e018849d47e28a3f759ba2f6450c686a113 | mastercad/db-manager | /connectionwizardsqlitepage.cpp | C++ | cpp | 2,716 | no_license | #include "connectionwizardsqlitepage.h"
#include "newconnectionwizard.h"
#include <QWizardPage>
#include <QVBoxLayout>
#include <QFileDialog>
#include <QSqlDatabase>
#include <QSqlError>
#include <QDebug>
ConnectionWizardSqlitePage::ConnectionWizardSqlitePage(QWidget* parent)
: QWizardPage(parent)
{
setTitle... |
5f6dbb0aa25162ea355907fd778f2ab2fbf278f8 | bbe5d07ec381886d2f072e9f47d49e74ed81f27f | Tiza59/primesieve | /include/primesieve/macros.hpp | C++ | hpp | 1,639 | permissive | ///
/// @file macros.hpp
///
/// Copyright (C) 2022 Kim Walisch, <kim.walisch@gmail.com>
///
/// This file is distributed under the BSD License. See the COPYING
/// file in the top level directory.
///
#ifndef MACROS_HPP
#define MACROS_HPP
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef __has_... |
28e141d957ba0e4280e53290b8116b65a1f98215 | a96efea48557abeb6d88b1a533b4198266ba65b4 | PaddlePaddle/Paddle | /paddle/fluid/operators/sequence_ops/sequence_conv_op.cu.cc | C++ | cc | 1,042 | permissive | /* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... |
5a0a1d59ce0fb9d5430b5dfc95f3f0881602a244 | e12c03dfc270d5eae84dffe6ef5ecf7f2a7f465e | amit-k-s-pundir/computing-programming | /projects/unos/automation/sync.cpp | C++ | cpp | 251 | no_license | // void sync_workspace(){
// }
void sync(Source src, Destination dest);
void sync_workspace_with(Destination dest){
// sync<Workspace>(dest);
sync(workspace, dest);
}
void sync(Workspace src, Workspace dest){
}
void sync(Opt src, Opt dest){
}
|
a6f30ef15f09c966b7d9c5ff49a74a451ba7be4f | 325029b62748e58367c605e059f8bc26b6863f9e | pieper/ModelDraw | /Base/GUI/vtkSlicerROIGUI.cxx | C++ | cxx | 8,318 | permissive | #include "vtkObject.h"
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
#include "vtkKWWidget.h"
#include "vtkSlicerApplication.h"
#include "vtkSlicerModuleLogic.h"
#include "vtkSlicerVisibilityIcons.h"
#include "vtkSlicerModuleCollapsibleFrame.h"
#include "vtkKWMessage.h"
#include "vtkKWMultiColumnList.h"
#inclu... |
2025bfcdbefe3447ec35a661dff9815b8356fdde | c47874c36b36841f537e2ce8aad20af36f96207c | JohanMes/ParticleSimulator | /Source/Simulator.cpp | C++ | cpp | 5,430 | no_license | #include "Simulator.h"
Simulator::Simulator() {
// Do not create windows yet
window = NULL;
logbox = NULL;
// Create reusable threads
unsigned int threadcount = 1;//std::thread::hardware_concurrency();
if(threadcount == 0) {
threadcount = 1;
}
workers.resize(threadcount);
}
Simulator::~Simulator() {
if(wi... |
91bdaf02476d2cb246bab8430af44fac010fec2e | 79d02658e47d17f7cb22214bd87f0852192fee8a | LegatAbyssWalker/SimpleTankGameTest | /Animation.cpp | C++ | cpp | 1,328 | no_license | #include "Animation.h"
Animation::Animation(unsigned frameWidth, unsigned frameHeight)
: FRAME_WIDTH(frameWidth)
, FRAME_HEIGHT(frameHeight) {
}
//Adds a frame...
void Animation::addFrame(unsigned index, sf::Time delay) {
sf::IntRect bounds;
bounds.top = 0;
bounds.height = FRAME_HEIGHT;
bounds.wid... |
409aa16c152e8b3ff04a899f655898098dedc9bf | 9616aaf2264d56727ddf89eec31e65dcb28d6d46 | vanasisf/MythCore | /src/server/scripts/Northrend/IcecrownCitadel/IcecrownCitadel/boss_professor_putricide.cpp | C++ | cpp | 67,210 | no_license | /*
* Copyright (C) 2008 - 2011 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2010 - 2013 Myth Project <http://mythprojectnetwork.blogspot.com/>
*
* Myth Project's source is based on the Trinity Project source, you can find the
* link to that easily in Trinity Copyrights. Myth Project is a private commun... |
6f0906173a058f22fb72557182c3326caa99928c | 7c775d4e9eaccec8743a08ebe80a58297af0de9b | softwarekid/OpenRender | /wyGL/wyGL/rendering.cpp | C++ | cpp | 15,857 | no_license | #include "stdafx.h"
#include "rendering.h"
#include <algorithm>
using namespace std;
namespace wyGL
{
WyShader::WyShader(const int _xResolution, const int _yResolution):
shadeMode_(wyGL_FLAT),
rasterizeMode_(wyGL_LINES),
xResolution_(_xResolution),
yResolution_(_yResolution),
... |
e9d1ce18bbdfe0e962b6b2cb35188c10b00d51b9 | d4e41044a85bf9905c5e1ff8c88893e7ef9050a7 | olucena/Firmware | /src/drivers/srf02_i2c/srf02_i2c.cpp | C++ | cpp | 22,113 | permissive | /****************************************************************************
*
* Copyright (c) 2015, 2016 Airmind Development Team. 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... |
005c0317d782064cc1f9e0909d20b2e6c59f1668 | 7afbe9d39db6224ed8697735fd88b8fde46cea6f | TrnAn/BS1718 | /P3/reader_writer_problem.cpp | C++ | cpp | 3,645 | no_license | #include"ReaderWriterThreads.h"
#include "Database.h"
#include<thread> //thread bib
#include<vector>
#include<iostream>
#include<stdexcept>
using namespace std;
int main(int argc, char** argv)
{
const size_t NUM_OF_THREADS = 2; //number of writing threads
const int MAX_TIME = 120;
int r_counter = 1, w_counter ... |
148499f077e0ce5c112cbc63f472c63e8ff279df | b17bece119c6b02f18690c2a73fb0009ee6bcb0a | t3dbrida/VTK | /Domains/Chemistry/Testing/Cxx/GenerateBlueObeliskHeader.cxx | C++ | cxx | 1,113 | permissive | /*=========================================================================
Program: Visualization Toolkit
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRAN... |
db965d587d98b1f06e4b5ec5ea76b92c1e1764f7 | 2f18e0c9c2333a73536ef11deadbcaf4f1b7b95a | knagakura/procon | /atcoder/kupc2020/c.cpp | C++ | cpp | 4,073 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define bit(k) (1LL<<(k))
#define SUM(v) accumulate(all(v), 0LL)
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template... |
123b0b213bab1124a8b60d0bca0712a693cd0f69 | 3490b7952c96e6cc8f45950283a815dd6edd6250 | kelvinyan1/Retro_Snaker | /test/makefile_test/main.cpp | C++ | cpp | 243 | no_license | #include <iostream>
#include "game.h"
#include "mode.h"
#include "help.h"
int main()
{
game();
mode();
help();
if (game_f == 1 && mode_f == 1 && help_f == 1)
std::cout<<"main ok"<<std::endl<<"successful!"<<std::endl;
} |
89241a74506d693cae8a5582e6dc291ae7998c28 | 010bc9fceca0f0237b6afe3abddbfde09e1ce332 | Macaulay2/mcppalloc | /mcppalloc_bitmap/mcppalloc_bitmap/include/mcppalloc/mcppalloc_bitmap/dynamic_bitmap_ref_impl.hpp | C++ | hpp | 9,650 | permissive | #pragma once
#include "integer_block.hpp"
#include <mcpputil/mcpputil/alignment.hpp>
#include <mcpputil/mcpputil/unsafe_cast.hpp>
namespace mcppalloc::bitmap
{
template <bool is_const>
inline dynamic_bitmap_ref_t<is_const>::dynamic_bitmap_ref_t(bits_array_type array, size_t sz) noexcept
: m_array(array), m_si... |
aaaa9ca8a5ada63a427fb83b495a93cb514428b7 | ff1d2f9b82b8e9556109d6e296717b8a450485bb | Stellaris-code/Tanks | /src/systems/turrethandlersystem.cpp | C++ | cpp | 8,771 | no_license | /* src/systems/turrethandlersystem.cpp TurretHandlerSystem - Yann BOUCHER (yann) 06/11/2016
**
**
** DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
** Version 2, December 2004
**
** Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
**
** Everyone is permitted to copy and distribute verbatim o... |
b9fd752b4d0d3202b32946dfd32121b36380713f | fa9b7bd60c6b5f7e0ac2eb3d9202a3a35c7d9e0c | phynos/qt-litesolar | /src-qt-ui/menu/dialogdevicedata.cpp | C++ | cpp | 1,544 | no_license | #include "dialogdevicedata.h"
#include "ui_dialogdevicedata.h"
#include <QStandardItemModel>
DialogDeviceData::DialogDeviceData(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogDeviceData)
{
ui->setupUi(this);
Qt::WindowFlags flag = Qt::Dialog;
flag |= Qt::WindowCloseButtonHint;
flag |= Q... |
6f36340a2437f904a9cbb3ac119f232179f00f72 | dcf6cc931f440c0457970ae838b038a70a3c775f | visionworkbench/visionworkbench | /graveyard/Plate/PlateFile.cc | C++ | cc | 8,235 | permissive | // __BEGIN_LICENSE__
// Copyright (c) 2006-2013, United States Government as represented by the
// Administrator of the National Aeronautics and Space Administration. All
// rights reserved.
//
// The NASA Vision Workbench is licensed under the Apache License,
// Version 2.0 (the "License"); you may not use this f... |
9e8842292826ddb204c1c7f7ec7b3931a887a878 | 052046a8a45d0c2453e0c471f6ef063d0dfc4408 | Quantum-Platinum-Cloud/llvmCore | /lib/Target/Mips/MipsJITInfo.cpp | C++ | cpp | 9,524 | permissive | //===-- MipsJITInfo.cpp - Implement the Mips JIT Interface ----------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
344feb52d6df57fc360b3adb4ed9b5386fa226ed | 5423f4d25e635e51ea22a62e588092bc332ddc8b | Vassenx/2DSDL | /Engine/Engine/Src/Collision.cpp | C++ | cpp | 686 | no_license | #include "Collision.h"
#include "ECS\ColliderComponent.h"
//is static so no object, just one
bool Collision::AABB(const SDL_Rect &recA, const SDL_Rect &recB) {
//A.x + A.w >= B.x and same for ys then collision. (overlap) or opposite
//A.x is the top left side of the rectangle
if (
recA.x + recA.w > recB.x &&
re... |
8636aa07b1e39ce5bd51b82c587b24f5a975f9a5 | 0f985854acb9564d8c22efba2b9078c6e1f79874 | CU-0xff/juliet-cpp | /000/242/565/CWE762_Mismatched_Memory_Management_Routines__delete_class_realloc_21.cpp | C++ | cpp | 4,583 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__delete_class_realloc_21.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.label.xml
Template File: sources-sinks-21.tmpl.cpp
*/
/*
* @description
* CWE: 762 Mismatched Memory Management Routines
... |
51f8e7d39ce5238045bd85ca6818c1a3d00e1a5d | ffbe6ff6875fb6b360a6fb5f0c0c0a1f399e0111 | arpit353/competitive-coding | /Geeksforgeeks/12. Check if Linked List is Palindrome.cpp | C++ | cpp | 374 | no_license | bool isPalindrome(Node *head)
{
stack<int> s;
Node *trav = head;
while(trav != NULL)
{
s.push(trav->data);
trav = trav->next;
}
trav = head;
while(trav->data == s.top())
{
s.pop();
trav = trav->next;
}
if(s.size() >0)
{
return fals... |
c8bea56613d77b7712c630a2d42c7b5dbc72e98c | 817f41e653d1ba0ccda059cce94f093cc2b6b798 | chenming163/CMake-1 | /Source/cmGeneratorExpressionDAGChecker.cxx | C++ | cxx | 7,315 | permissive | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGeneratorExpressionDAGChecker.h"
#include "cmAlgorithms.h"
#include "cmGeneratorExpressionContext.h"
#include "cmGeneratorExpressionEvaluator.h"
#include "cmGe... |
b971e95e708ed17792dc7167732373df41c30eb9 | 9c4544d7d4bbc9c9226a6a87018d573f67c76841 | JiangKevin/FishEngine | /Engine/Include/FishEngine/TagManager.hpp | C++ | hpp | 1,630 | permissive | #pragma once
#include <string>
#include <vector>
#include <algorithm>
#include "FishEngine.hpp"
#include "Debug.hpp"
#include "ReflectClass.hpp"
namespace FishEngine
{
class FE_EXPORT Meta(NonSerializable) TagManager
{
public:
TagManager() = delete;
static bool Exists(std::string const & tag)
{
auto it ... |
afdd7396e3beebe0bfc11c938785b7b79d9c3a3f | f6e11d65c3eb1ec1d6433b265d73518217050134 | SWG-Source/client-tools | /src/engine/client/application/TemplateEditor/src/shared/TableItemObjvarType.cpp | C++ | cpp | 2,323 | no_license | // ============================================================================
//
// TableItemObjvarType.cpp
// Copyright Sony Online Entertainment
//
// ============================================================================
#include "FirstTemplateEditor.h"
#include "TableItemObjvarType.h"
#include "ObjvarTypeE... |
676da83b3e7901dbb9200b646317584d5978f818 | 0b4249ec7bc7d6d9d3bc9b4c48c754784d0747fc | skarik/1Engine | /oneEngine/oneGame/source/engine/physics/motion/CRigidbodyCharacter.cpp | C++ | cpp | 8,127 | permissive | #include <stdio.h>
#include "core/debug/Console.h"
#include "core/time/time.h"
//#include "physical/physics/motion/physCharacter.h"
//#include "physical/physics/motion/physCharacterRigidBodyInfo.h"
#include "engine/behavior/CGameObject.h"
#include "CRigidbodyCharacter.h"
#ifdef PHYSICS_USING_HAVOK
/*class CRigidB... |
1571b34e5f736b0783163de40184bd0782cbf3f2 | 07dfa2d3534a590035331905b57d45d773ca0706 | getchu/MoonNetLua | /common/path.hpp | C++ | hpp | 4,986 | no_license | /****************************************************************************
Git <https://github.com/sniper00/MoonNetLua>
E-Mail <hanyongtao@live.com>
Copyright (c) 2015-2017 moon
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
********************************************************************... |
3fcf73b24542b088e3a2347a2722331052f8747e | 3af19772ed8c8cc9f36b72a1d66b8eb0e5d73385 | svn2github/p-stade | /branches/pstade_1_03_5_head/pstade_subversive/libs/oven/test/indirected.cpp | C++ | cpp | 2,336 | no_license | #include <pstade/vodka/drink.hpp>
#include <boost/test/minimal.hpp>
// PStade.Oven
//
// Copyright Shunsuke Sogame 2005-2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <pstade/oven/... |
5533a94b36e66de8072b0817363575abb0dc9fe4 | 5326ae29d7e367daefbeb1fce7df532dc43b9ffc | rosanma4/Class_prog_C | /Ejercicio_Bucle_While_01.cpp | C++ | cpp | 226 | no_license |
#include "iostream"
using namespace std;
int main()
{
int numero;
cout << "Ingrese un numero ";
cin >> numero;
while(numero <= 100)
{
cout << "Ingrese un numero ";
cin >> numero;
}
system("PAUSE");
return 0;
}
|
70203b991e623ae38c09f7deaf85b0d1311cc66e | b6f226df1ab7595d464170ee212e03a408f3603d | Haidranoid/cpp-code | /cpp-beyond/code/deque.cpp | C++ | cpp | 2,383 | no_license | /*
#include <iostream>
#include <deque>
#include <vector>
#include <algorithm>
#include <numeric>
// use template to display any vector type
template<typename T>
void display(const std::deque<T> &deque) {
std::cout << "[ ";
std::for_each(deque.begin(), deque.end(), [](T value) {
std::cout << value << "... |
de2741f6bb9787352c6744b03e57382132e34a02 | 306c4e4ee182ae2bdd2feeeea9560c6a5112bac0 | july-darl/Graphics | /halo.cpp | C++ | cpp | 1,127 | no_license | #include "halo.h"
#include <QOpenGLTexture>
#include "icon.h"
#include "object.h"
#include "cameramanager.h"
void Halo::Create()
{
for(int i = 0;i < 10;i++)
{
halo[i] = static_cast<Icon*>(ObjectInfo::Inst()->CreateObject("Icon", QVector3D(0,4,-20)));
halo[i]->AddShader("icon.vsh", "f... |
d6454965b1ab42a2cf1b235e91b52c64eb34ec17 | 3a76c2bc59ab03e0a7a38e616844877d5bcec2de | subhradeepnag/Tree-Questions | /constructallpossiblebst.cpp | C++ | cpp | 522 | no_license | #include<bits/stdc++.h>
using namespace std;
//NODE STRUCTURE
struct node
{
int key;
struct node*left,*right;
};
//A UTILITY FUNCTION TO CREATE A NEW BST NODE
struct node*newNode(int item)
{
struct node*temp = new node;
temp->key = item;
temp->left = temp->right = NULL;
return temp;
}
//A ... |
966caa2d0e8cddc0401a7dc0b093f4778c5c6646 | de5458e6cfa219c842e3d36c608ac34a6c77d501 | gonzalezdeaudikanaeneko/PROYECTO-FINAL | /Director.cpp | C++ | cpp | 259 | no_license | /*
* Director.cpp
*
* Created on: 18 de may. de 2017
* Author: Txus
*/
#include "Director.h"
Director::Director() {
// TODO Auto-generated constructor stub
}
Director::~Director() {
// TODO Auto-generated destructor stub
}
|
a11b1c0a02b5bb412860b61705e8b9f6f8e2b419 | 0b95f5e418db99c1203602c64546ed16609870a6 | junjieshen/leetcode | /src/111.MinimumDepthOfBinaryTree/main.cc | C++ | cc | 831 | no_license | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <stack>
#include "list_node.h"
#include "tree_node.h"
using namespace std;
int minDepth(TreeNode* root) {
if (root == NULL) return 0;
int left = minDepth(root->left);
int right = minDepth(root->right);
i... |
a37149d0f238600acf01c4dd7ffe9f15d69ef37b | 90f02d498962135bdf05f56b5dea0ad8addd84f3 | minblock/arcticoin | /src/net_processing.cpp | C++ | cpp | 180,213 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <net_processing.h>
#include <addrman.h>
#include <banman.h>
#include <a... |
7b282e04832cd580146028ca212d9cd764365f89 | 19b1f645d9acff94d9b9201e9956012169cff2f9 | Reizonr1/metin2-adv | /Sisteme/[C++]Offline Shop - Koray/Ready-made files/Server source/game/src/char_skill.cpp | C++ | cpp | 93,789 | no_license | #include "stdafx.h"
#include <sstream>
#include "utils.h"
#include "config.h"
#include "vector.h"
#include "char.h"
#include "char_manager.h"
#include "battle.h"
#include "desc.h"
#include "desc_manager.h"
#include "packet.h"
#include "affect.h"
#include "item.h"
#include "sectree_manager.h"
#include "mob_manager.h"
#... |
ccb304345ce282697e49e505450f0202341fbf3a | a3f9992cc8caae218790c12c2e610b70c4366f05 | remitche66/GlueXSurvey | /surveyHistToLatex.cc | C++ | cc | 2,798 | no_license | #include <iostream>
#include "FSBasic/FSString.h"
#include "countingUtilities.h"
using namespace std;
// **************************************
// MAIN
// **************************************
int main(int argc, char** argv){
cout << endl;
cout << "***********************************************************... |
a12dda6467d74da48139ba06e1b705e40f537959 | 22772e81eedf6f42519724da3b7c0f0a2dacde37 | tnarnold/netsnmpj | /netsnmpj-preliminary/native/win32socketpair.cc | C++ | cc | 4,783 | no_license | /*
Copyright(c) 2003 by Andrew E. Page
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appears in all copies and that
both that copyright notice... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.