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 |
|---|---|---|---|---|---|---|---|---|
3e3d474340279c52952a2ad19ad2abf4547e5cbc | 536b6f5f507557dc3ab5fbee89355dc268d93076 | muradkarakas/SodiumCompiler | /CompileUnitBase.hpp | C++ | hpp | 1,138 | no_license | #pragma once
#include "pch.h"
#include "ASTNode.hpp"
using namespace std;
namespace Sodium {
extern class SodiumCompiler;
enum CompileUnitType {
COMPILE_UNIT_TYPE_BASE,
COMPILE_UNIT_TYPE_FRMX,
COMPILE_UNIT_TYPE_PRE,
COMPILE_UNIT_TYPE_POST
};
class CompileUnitBase {
protected:
/// <summary>
///... |
500b9b5f7efbaaebff5979c250524d84265a6d4d | ac91ca2385cb0b1ab79046e304b2b18ecc5ef303 | RajatSran/dsapractice | /recursion/permutations.cpp | C++ | cpp | 590 | no_license | #include<bits/stdc++.h>
using namespace std;
vector<vector<int>> ans;
void generate(vector<int>& arr, int index) {
if (index == arr.size() - 1) {
ans.push_back(arr);
return;
}
for (int i = index; i < arr.size(); ++i)
{
swap(arr[i], arr[index]);
generate(arr, index + 1);
swap(arr[i], arr[index]);
}
retu... |
e81b70ba7a12366c6acd5f369497f7449cdf36f2 | 545c9e23a13e3fdb3bdc3e141a9e484b147f4493 | GM07/Island | /src/Menu/PauseMenu.cpp | C++ | cpp | 3,374 | no_license | #include "../headers.h"
#include "PauseMenu.h"
/**
* @brief Constructor
*/
PauseMenu::PauseMenu(std::shared_ptr<sf::RenderTarget> window)
: window_(window)
{
// Background
background_.setSize(sf::Vector2f(
static_cast<float>(window->getSize().x),
static_cast<float>(window->getSize().y)
... |
068f9804a7fd665dcc86bb39d6c542a31c2cad84 | 35b18105141505bb9dc5af9770c4d1e5e2412ffa | Abdallah-Elshamy/Competitive-Programming | /Arrival-of-the-General/solution.cpp | C++ | cpp | 831 | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
vector <int> row;
int n,i,x,z,Max,Min,max1,min2,min1,counter1=0,counter2=0,temp;
cin >>n;
z=n;
while(z--)
{
cin>>x;
row.push_back(x);
}
Max = *(max_element(row.begin(),row.en... |
154d3384209e4697561348460f34f0167e1999d1 | 6b245dbb05eab67261bcf1e82e2688a96a863195 | IsraMekki/tiramisu_code_generator | /cmake-build-debug/programs_tiling/function14048/function14048_schedule_40/function14048_schedule_40_wrapper.cpp | C++ | cpp | 857 | no_license | #include "Halide.h"
#include "function14048_schedule_40_wrapper.h"
#include "tiramisu/utils.h"
#include <cstdlib>
#include <iostream>
#include <time.h>
#include <fstream>
#include <chrono>
#define MAX_RAND 200
int main(int, char **){Halide::Buffer<int32_t> buf0(512, 128, 512);
init_buffer(buf0, (int32_t)0);
... |
4e0c32cf5dc68670fa3b9f3801f12bf678708ee5 | 98e12af14bf7bc59b9cee9f7e4ac07bb028d7e55 | wlellington/code_analyzer | /main.cpp | C++ | cpp | 4,042 | no_license | #include <iostream>
#include <fstream>
#include "directoryiterator.h"
#include "metric.h"
#include "derivedmetrics.h"
void test();
void printResults(DSVector<basemetric> &tests, bool verbose);
void writeResults(DSVector<basemetric> &tests, bool verbose, DSString outFile);
double calculateScore(DSVector<basemetric>& te... |
2dc8d03ef042b1cecfc4cc6371b4b991f29dadfb | 44e74a1ffca767ee3b45513fa5f129705670b4e3 | shubhanshusv/ALGORITHMS | /Dynamic Programming/longest_increasing_subsequence.cpp | C++ | cpp | 1,274 | no_license | // Shubhanshu Verma
// Dynamic Programming
// Longest Increasing Subsequence
// For an array of n elements, let L(i) be the length of the LIS ending at index i such that arr[i] is the last element of the LIS.
// Then, L(i) can be recursively written as:
// L(i) = 1 + max( L(j) ) where 0 < j < i and arr[j] < arr[i]; or... |
5e9cb03b467ce2c5b0104d86a86256798e96ebfd | 28318669377fbafd8a5a2e3b60c1bb92ccbd653a | yjcchen0913/ITK | /Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx | C++ | cxx | 2,708 | permissive | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
cbe8e50ed38388dde6593bff36b24b950ee1b2f4 | ff34c763790508f26b56040eabc2fc5143c86490 | laz/BOJ | /9252.cpp | C++ | cpp | 779 | no_license | #include <bits/stdc++.h>
using namespace std;
int l1, l2, cnt, lcs;
int dp[1001][1001];
char str1[1001], str2[1001], lcss[1001];
int main(){
scanf("%s %s", str1, str2);
l1=strlen(str1);
l2=strlen(str2);
for(int i = 1 ; i <= l1; i++){
for(int j = 1; j <= l2; j++){
if(str1[i-1]==str2... |
25264bb49fec67bb15e11dd26f48165839bac145 | 60c91562e84a271c6a85612d3e55a2eefa14bb60 | huangliliu0917/iOS_wsl_mallbuy_for_vr | /sdasdasdasd 2 2/Classes/Native/Il2CppCompilerCalculateTypeValues_3Table.cpp | C++ | cpp | 56,563 | no_license | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include "class-internals.h"
#include "codegen/il2cpp-codegen.h"
#include "mscorlib_System_Reflection_Em... |
86c7420e0ef2e5db4b682eddd0acb5eb94fa8d40 | 74f5ce869ad7b733c9281faab96784f982c116f4 | aliyun/aliyun-openapi-cpp-sdk | /paifeaturestore/src/model/GetServiceIdentityRoleResult.cc | C++ | cc | 1,617 | 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... |
af7eea75f7d12e50d061cd906df7ff566f4ad63a | df65032da517c205936afae96f8bca26cda51197 | kitaisreal/llvm-project | /llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp | C++ | cpp | 9,228 | permissive | //===- CoverageMappingWriter.cpp - Code coverage mapping writer -----------===//
//
// 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
//
//===---------------------------... |
7e95d5d9dd0bf810f1bed39cf4c683ddf549c7f0 | 824d01600caa1a8619652a6c1528aa7a8380d944 | justinhegyi/machines-are-people-too | /Dataset.cpp | C++ | cpp | 8,438 | no_license | #include "Dataset.h"
#include<sstream>
#include<fstream>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DataSet implementation
//////////////////////////////////////////////////////////////////////////////////////////////////////... |
d2ca2d7533b3809cdccd8a0d64f8d72a3549d782 | 8f6208013d7980c7ca8d595f7605aedbf2bd5c66 | Benner727/SquareRPG | /Sandbox/src/GameLayer.cpp | C++ | cpp | 796 | permissive | #include "GameLayer.h"
GameLayer::GameLayer()
{
mMessageLog = std::make_shared<MessageLog>(50, 8, "Font/VeraMono.ttf", 14, Square::Vector2(15.0f, -15.0f));
mMap = std::make_shared<Map>();
mNpcHandler = std::make_shared<NpcHandler>();
mPlayer = mPlayerFactory.NewPlayer(mPlayerUI, mMap, mMessageLog, mNpcHandler);
... |
8df26c636bc51551dc1794b97e3b50f3ff9fcec5 | 5795f762db12f479ca18689b9c95f55236bb6690 | apiweb/EmulationStation | /es-core/src/InputManager.cpp | C++ | cpp | 10,591 | permissive | #include "InputManager.h"
#include "InputConfig.h"
#include "Window.h"
#include "Log.h"
#include "pugixml/pugixml.hpp"
#include <boost/filesystem.hpp>
#include "platform.h"
#define KEYBOARD_GUID_STRING "-1"
// SO HEY POTENTIAL POOR SAP WHO IS TRYING TO MAKE SENSE OF ALL THIS (by which I mean my future self)
// There ... |
e810f35ac1aeb291b8140fe35dbdaa565ef90b1f | 85ec650022b44b223a0443e8e47241a925a3899f | wym2011aaj/ArcFaceLinux | /AgeEngine.cpp | C++ | cpp | 1,299 | no_license | #include "AgeEngine.h"
AgeEngine::AgeEngine()
{
pWorkMem = nullptr;
hEngine = nullptr;
}
AgeEngine::~AgeEngine()
{
if (hEngine != nullptr)
{
uninit();
}
}
//初始化年龄检测引擎
int AgeEngine::init()
{
pWorkMem = (MByte *)malloc(WORKBUF_SIZE_AGE);
if (pWorkMem == nullptr)
{
return -1;
}
int ret = ASAE_FSDK_InitAgeEn... |
3972d54f9cb536f6d0ebd849134e31eb6f532af1 | adf4a25540b4a775a386b383a9f4b8a5964d325b | KoviRobi/clang | /lib/CodeGen/CGExprComplex.cpp | C++ | cpp | 43,209 | permissive | //===--- CGExprComplex.cpp - Emit LLVM Code for Complex Exprs -------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
732dd4fb4e5967e89bfdcdf9f062d2f55138b04a | e90892d45663c6b78396e8b0795f630abf7bab2f | BackupTheBerlios/bvr20983 | /src/com/coenuminst.cpp | C++ | cpp | 1,455 | no_license | /*
* $Id$
*
* Generic COM Enum class.
*
* Copyright (C) 2008 Dorothea Wachmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at ... |
954fd96398ea9b852197ac13bac974e9d2131ffa | de872cc5b1631af2eb4b70015a305394b6beba85 | anilchoudhary/DSA | /Codevita/Mockvita_2/C.cpp | C++ | cpp | 743 | no_license | #include<bits/stdc++.h>
using namespace std;
int children(int x, int y)
{
if (y == 1)
return x;
if (x == y)
return 1;
x -= y;
return 1 + children(max(x, y), min(x, y));
}
int main()
{
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
int min_len_o... |
7e4d335f5338f074a2195006fcd5a541c9c1496e | 29af88f82db47829c22d5c211271ad83dcd37622 | StarPolygen/Code_Library | /比赛/2019HDU多校/HDU10/1009.cpp | C++ | cpp | 1,271 | no_license | //签到
#include<cstdio>
using namespace std;
const int maxn=2005;
int g[maxn][maxn];
int n,m,q;
int dele(int x,int y) {
if (x<1 || x>n || y<1 || y>m) {
return 0;
}
if (g[x][y]==0) {
return 0;
}
int res=0;
if (g[x][y+1]==0 || g[x][y-1]==0) {
if (g[x+1][y]==0 || g[x-1][y]=... |
ec9060503ac11517d6984d1ba671ea8ea4491c0d | e6bb583cb05f71ec96a903f49b71c131b58acd95 | saliouprogress/Probems-and-Quizes-in-CPP | /ManipulateLinkedList.cpp | C++ | cpp | 1,916 | no_license | #include <iostream>
using namespace std;
struct node
{
int data;
node *next;
};
node *head = NULL;
node *tail = NULL;
class list
{
private:
node *head, *tail;
public:
list()
{
head = NULL;
tail = NULL;
}
};
node* createnode(int value)
{
node *temp = new node;
temp-> da... |
9b0ee397699d2c9f0bf8504e159437ddc28898fe | e7d6164fb821e6ff7585cedadb3e24e6108aa050 | mikekov/RegExTester | /scintilla/src/AutoComplete.cxx | C++ | cxx | 4,020 | permissive | // Scintilla source code edit control
/** @file AutoComplete.cxx
** Defines the auto completion list box.
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#i... |
b7a0b533f526121fae2c4df5cc9c48d63b6df076 | 66d602b0bbbb54a3a34c1fda3f13a6e0f971d9c4 | xhyangxianjun/Builder6-program | /SSC/SSC_광명반도체_중국천진/HRT_430/LotUnit.cpp | C++ | cpp | 41,459 | no_license | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#include <stdio.h>
#include "LotUnit.h"
#include "SLogUnit.h"
#include "UserIni.h"
#include "UserFile.h"
#include "OptionMan.h"
... |
1b349a3d37e8a034ed1e32a9f535692cec9b4f60 | cecc633e011103152a2a3f8581d352285189414e | LingfengPang/Cpp | /1.Code/C++ Primer Plus/Chapter 9/newplace.cpp | C++ | cpp | 1,694 | permissive | // newplace.cpp -- using placement new
#include <iostream>
#include <new> // for placement new
const int BUF = 512;
const int N = 5;
char buffer[BUF]; // chunk of memory
int main()
{
using namespace std;
double *pd1, *pd2;
int i;
cout << "Calling new and placement new:\n";
pd1 = new double[N];... |
8788dee0d651fa2e5fc6b1a9281afb09d3073b67 | 892a328132a0ddba9b27f88c43e1ad3b46260ae4 | Nomadw/shaman-showdown | /ShamanShowdown/ItemComponent.cpp | C++ | cpp | 1,151 | no_license | #include "ItemComponent.h"
#include "Renderer.h"
#include "GameState.h"
#include "Controls.h"
#include "GameObject.h"
#include "TransformComponent.h"
#include "Team.h"
#include "MissileUse.h"
#include "InventoryComponent.h"
ItemComponent::ItemComponent(int textureID, Items in)
{
texture = textureID;
item = in;
}
I... |
712505048c028c7a621d5928d1a98fa781b56064 | 88c4b93670a991be4abda8cc048f7e4e2bdbba7a | tangyunzhu/libraries | /DigitalTube/TM1637.cpp | C++ | cpp | 4,552 | no_license | // Grove-4 digit display lib v1.0
// Author:Frankie.Chu
// Date:9 April,2012
// BY: http://www.seeedstudio.com\
// This library 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
// versio... |
60be48456e574443ff450de8b37455bf67c2a5f8 | f78b801bc6fffeb964bae09ba1a01a71cbf54bea | NazaninBayati/SMBFL | /java projects/jtop/jtopas/versions.alt/seeded/v3/src/de/susebox/jtopas/spi/StandardSequenceHandler.cpp | C++ | cpp | 2,429 | permissive |
package de.susebox.jtopas.spi;
import java.util.Iterator;
import de.susebox.jtopas.TokenizerProperty;
import de.susebox.jtopas.TokenizerProperties;
import de.susebox.jtopas.TokenizerException;
public class StandardSequenceHandler implements SequenceHandler {
public StandardSequenceHandle... |
de04b672e2b0c63f1e9ecefa07ffc03ae33a10d2 | 1ef23b4c72f337557bc9b3a4f456580542e5af0a | MaddoW/GWToolboxpp | /GWToolbox/GWToolbox/GuiUtils.cpp | C++ | cpp | 3,508 | no_license | #include "GuiUtils.h"
#include <algorithm>
#include <Shlobj.h>
#include <Shlwapi.h>
#include <imgui.h>
#include <GWCA\Constants\Constants.h>
#include <GWCA\Utilities\Scanner.h>
#include <Modules\Resources.h>
namespace {
ImFont* font16 = nullptr;
ImFont* font18 = nullptr;
ImFont* font20 = nullptr;
ImFont* font24... |
0d8a2e3ee93f43b900658515c881942b455b90c8 | d81efe13f1b52ddd99fe463b92d8b812bb88adfa | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE124_Buffer_Underwrite/s03/CWE124_Buffer_Underwrite__new_char_memcpy_53a.cpp | C++ | cpp | 2,529 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE124_Buffer_Underwrite__new_char_memcpy_53a.cpp
Label Definition File: CWE124_Buffer_Underwrite__new.label.xml
Template File: sources-sink-53a.tmpl.cpp
*/
/*
* @description
* CWE: 124 Buffer Underwrite
* BadSource: Set data pointer to before the allocated memo... |
ca2b5f83fee54817c9c9145131b4f1818b9bd08e | 4b2569cf728005ce4518742142524f0811a45a4e | abassiah/dzcoin | /src/qt/paymentserver.cpp | C++ | cpp | 4,501 | permissive | // Copyright (c) 2011-2013 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 <QApplication>
#include "paymentserver.h"
#include "guiconstants.h"
#include "ui_interface.h"
#include "util.h"
#i... |
f57d2120ac7a688b9a74e03ca876b2d66c73d317 | 91a3d4afd3ffa60481573bf8cb7e9147baf03bf0 | KingRaymond/OverPochSahrani | /OverPoch Trader/cfgServerTrader/NeutralClothes.hpp | C++ | hpp | 6,992 | no_license | class Category_683 {
class Skin_Rocker2_DZ {
type = "trade_items";
buy[] ={2000,"Coins"};
sell[] ={1000,"Coins"};
};
class Skin_SurvivorW2_DZ {
type = "trade_items";
buy[] ={2000,"Coins"};
sell[] ={1000,"Coins"};
};
class Skin_Functionary1_EP1_DZ {
type = "trade_items";
buy[] ={2000,"Coins"};
sel... |
412c0748abee941b6f040bd88d6e50d78dfe2710 | 4bfb67ab95ee2ea6c0622ce83142a54779b730a0 | denfrost/UE4-FPSTestingGrounds | /Source/LethalEntertainment/Private/Terrain/Tile.cpp | C++ | cpp | 3,998 | no_license | // Copyright 2018 - 2021 Stuart McDonald.
#include "LethalEntertainment.h"
#include "ActorPool.h"
#include "Components/ArrowComponent.h"
#include "Tile.h"
ATile::ATile()
{
PrimaryActorTick.bCanEverTick = false;
RootComp = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
SetRootComponent(RootComp);
... |
5af44096825b65616f5696ce48ab2022c736d314 | f56e007e9a5d44acbb21e4b6235f8bd3bc11fc7b | LionsWrath/maratona-treino | /URI1148/1148_new.cpp | C++ | cpp | 1,854 | no_license | #include <iostream>
#include <vector>
using namespace std;
#define INF 1500
typedef vector<int> vi;
vector<vi> adjMatrix;
vector<vi> nodeParent;
//void printAdjacency(int N) {
// for (int i=0; i<N; i++) {
// for (int j=0; j<N; j++) {
// cout << adjMatrix[i][j] << " ";
// }
// cou... |
6d67434614a2c3247ccf659709b71cbcae02fa72 | f875d3917c652cb5242a21b686b7599cfc2a295a | tomcamp0228/ibeo_ros2 | /src/ibeo_8l_msgs/include/object_list_lux_ros__rosidl_typesupport_fastrtps_cpp.hpp | C++ | hpp | 2,157 | permissive | // generated from rosidl_typesupport_fastrtps_cpp/resource/idl__rosidl_typesupport_fastrtps_cpp.hpp.em
// with input from ibeo_8l_msgs:msg/ObjectListLuxRos.idl
// generated code does not contain a copyright notice
#ifndef IBEO_8L_MSGS__MSG__OBJECT_LIST_LUX_ROS__ROSIDL_TYPESUPPORT_FASTRTPS_CPP_HPP_
#define IBEO_8L_MSGS... |
a84f3534264bfc3a30fbc981cf47ea300a0e2c38 | 40f736de56b12e65fcbdfe2d2049382226a681a5 | pkbhowmick/UVA | /power string.cpp | C++ | cpp | 1,524 | no_license | #include <bits/stdc++.h>
#define pb push_back
#define sc1(n) scanf("%lld",&n)
#define sc2(a,b) scanf("%lld%lld",&a,&b)
#define sc3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define MX 100000
using namespace std;
typedef long long int ll;
typedef unsigned long long ul;
char T[1000006];
ll pi[1000006];
char P[... |
7427fe167c437f506088ef1638683b4bbb5503c1 | 43652704e2ea8f9af9629ee1fad4da8131329f3f | sttr00/crypto | /crypto/rng/sys_random_win.cpp | C++ | cpp | 1,431 | permissive | #include "sys_random_win.h"
#include <assert.h>
sys_random::sys_random()
{
pRtlGenRandom = NULL;
hprov = NULL;
lib = LoadLibraryW(L"advapi32.dll");
if (!lib)
{
assert(0);
return;
}
pRtlGenRandom = (RtlGenRandom_t) GetProcAddress(lib, "SystemFunction036");
if (pRtlGenRandom) return;
pCryptAcquireContext... |
13754195e539c5e27efdd97b69810be31ef424b3 | c82c8d3318c5bb48f0fce11a5633c5ccf8fe894c | Xumengqi0201/OJ | /Leetcode/001-100/028.cpp | C++ | cpp | 451 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
/*
用内置的find函数即可
*/
int strStr(string haystack, string needle) {
size_t found = haystack.find(needle);
if (found != string :: npos)
return found;
else
return -1;
return pos;
}... |
2d137186fc144ed467586d365a89634e4dbd92a3 | cdc866707d0639940f4188138045600b99a2164c | AhmedMorgan/morganslib | /Binary search/C. Cellular Network.cpp | C++ | cpp | 909 | no_license | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int n, m;
const int len = 1e5 + 9;
int a[len], b[len];
bool valid(ll mid){
int aa = 0, bb = 0;
while(bb < m){
while(aa < n){
if(abs(a[aa] - b[bb]) <= mid){
aa++;
}else{
break;
... |
b942f950c22a2a1aadf50c0f8be74aee1a5ecddc | 5bf55db58035363aaaee14faacd2ad9c5f7c2e96 | dm-helper/dm-helper-oglvideo | /videoplayergl.cpp | C++ | cpp | 513 | no_license | #include "videoplayergl.h"
VideoPlayerGL::VideoPlayerGL(QObject *parent) :
QObject(parent)
{
}
void VideoPlayerGL::registerNewFrame()
{
}
QSurfaceFormat VideoPlayerGL::getFormat() const
{
return QSurfaceFormat::defaultFormat();
}
QSize VideoPlayerGL::getSize() const
{
return QSize();
}
void VideoPlayer... |
e5064c6cde09c7b0492ab68a465a66744c16b832 | 3b4ece3a19eecaa305466e0b277b3a731ea447dc | taoblockchain/tao-core | /src/test/base58_tests.cpp | C++ | cpp | 9,436 | permissive | #include <boost/test/unit_test.hpp>
#include "json/json_spirit_reader_template.h"
#include "json/json_spirit_writer_template.h"
#include "json/json_spirit_utils.h"
#include "base58.h"
#include "util.h"
using namespace json_spirit;
extern Array read_json(const std::string& filename);
BOOST_AUTO_TEST_SUITE(base58_test... |
d73ede6a7ca22005f2734091b92f81b3bf2b9309 | b735594cd8f3c1eb6737163325e3456fe48c464a | aabhas-sao/DSA-CB-CPP | /sorting/sort_game.cpp | C++ | cpp | 1,061 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
bool compare(pair<string, int> a, pair<string, int> b) {
if(b.second != a.second) {
return a.second < b.second;
}
int i = 0;
int j = 0;
while(i < a.first.length() && j < b.first.le... |
d28465c5c5e0a03479d5383d4c858f4dda645850 | 23025ce77fc838cebb4878853575c0843ae57961 | zxc123qwe456asd789/library | /verify/verify-yosupo-math/yosupo-tetration-mod.test.cpp | C++ | cpp | 326 | permissive | #define PROBLEM "https://judge.yosupo.jp/problem/tetration_mod"
#include "../../template/template.hpp"
#include "../../modulo/tetration.hpp"
#include "../../misc/fastio.hpp"
using namespace Nyaan; void Nyaan::solve() {
int T;
rd(T);
rep(i, T) {
uint32_t a, b, m;
rd(a, b, m);
wtn(tetration(a, b, m));... |
e8eaa830846d58d21645690390e01aa23cf1d3e8 | 95ef85e78dd8eab5736a770dc841a19d462980ee | SAMARPIT1/SEARCHING-ALGORITHMS | /binarysearch.cpp | C++ | cpp | 461 | no_license | //binary search
#include<iostream>
using namespace std;
int binarySearch(int arr[],int l,int r,int x)
{
if(r>=l)
{
int mid=l+(r-1)/2;
if(arr[mid]==x)
return mid;
if(arr[mid]>x)
return binarySearch(arr,l,mid-1,x);
if(arr[mid]<x)
return binarySearch(arr,l,mid+1,x);
}
}
int main()
{
int... |
13e0a3a41afcdef436639ed72bd96e9f59738703 | 7100adf8cd93a184cd60d01aab4cba24c7abb2d4 | denniskb/bsim | /test/gpu/brian_multi_unit_single_run_test.cpp | C++ | cpp | 2,620 | permissive | /* This program is writen by qp09.
* usually just for fun.
* Tue December 15 2015
*/
#include "../../include/BSim.h"
using namespace std;
int main(int argc, char **argv)
{
bool load = false;
if ((argc > 1) && (0==strcmp(argv[1], "load"))) {
load = true;
}
const int N = 10;
Network c;
//createPopulation(... |
23b62015e590b6222f9cee11577e9d863e826b1f | 6b046ae97ca318baa9a8ec0e8f540937574414ee | TDuffinNTU/DuffPac-SFML-Game | /Enemy.cpp | C++ | cpp | 3,490 | no_license | #include "Mobiles.h"
#include "DEFINITIONS.h"
namespace Mobiles
{
Enemy::Enemy(sf::Vector2f _grid_offset, float _grid_size,
sf::Vector2f _start_grid_pos, sf::Texture& _texture)
{
// Set up the sprite position and texture
sprite.setTexture(_texture);
sprite.setPosition((_start_grid_pos * _grid_size) + _grid_o... |
a3dee2808e359d7895c0fcdd910622c6a254422f | be1d799391cced9e80a2b6d2ad3107e731e29fa7 | alexandraback/datacollection | /solutions_2751486_1/C++/fengyang0317/a.cpp | C++ | cpp | 769 | no_license | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <set>
#include <iostream>
using namespace std;
int main()
{
freopen("A-large (1).in","r",stdin);
freopen("out.txt","w",stdout);
int cas;
int ki,i,j,n,l,p;
char s[1000010];
scanf("%d",&cas);
std::set<int>::iterator itlow,itup;
long ... |
421d947f18e59a443550412d4a0d537090c205dc | e17b084614152539bb107df529ab51761aeb52c0 | Intruderp/Codeforces | /codeforces/432/B.cpp | C++ | cpp | 875 | no_license | #include<bits/stdc++.h>
#define vi vector<int>
#define mp map<int,int>
#define ump unordered_map <int,int>
#define ll long long int
#define pb push_back
#define mod 1000000007
#define int long long
#define loop(i,x,n) for(int i=x;i<n;i++)
#define rloop(i,n) for(int i=n-1;i>=0;i--)
using namespace std;
/***************... |
70f71c820919e15628dd5e83d367cbb5edb5f0ec | ea0d5e3f2f2e5e0f16f840575d117ba43e626a5a | piotr-piotrowski/thinking-in-cpp | /ch02/ex_2_7.cpp | C++ | cpp | 406 | no_license | #include <iostream>
#include <string>
#include <fstream>
// #include <cstdlib>
//
using namespace std;
/**
* Display a file a line at a time,
* waiting for the user to press the “Enter” key after each line.
*/
int main() {
ifstream in("ex_2_7.cpp");
string line;
while(getline(in, line)) {
cou... |
e3d9478b413b403dbe84cb71cccc356ba7befe72 | fed28651faa7b12958fe908d9b6ce1d37ee98a52 | dipayandutta/c-plus-plus | /boost/basic/example01.cpp | C++ | cpp | 312 | no_license | #include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main(){
typedef std::istream_iterator<int> in;
std::cout<< "Type Any Number ";
std::cout << std::endl;
std::for_each(in(std::cin),in(),std::cout<<(boost::lambda::_1 * 10)<<"Type Any Number");
return 0;
}
|
1cc0dba17f827a2f0b725c14cd025259e8d4c53f | aa788243eeb2e8238bdc48946ce2ed1a1593947e | zhengyu-wu/CSE-LAB | /lab1/inode_manager.cc | C++ | cc | 11,603 | no_license | #include "inode_manager.h"
// disk layer -----------------------------------------
disk::disk()
{
bzero(blocks, sizeof(blocks));
}
void
disk::read_block(blockid_t id, char *buf)
{
// copy blocks[id] to buffer
memcpy(buf, blocks[id], BLOCK_SIZE);
}
void
disk::write_block(blockid_t id, const char *buf)
{
// c... |
8783caeb5a67d582582ceff489cdb39303e588df | ef6034e08684dc8ef457206836554ee69af60b70 | EvilPerfectionist/CPlusPlus | /src/Model_Transformation.cpp | C++ | cpp | 9,208 | no_license | #include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <stb_image.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <Shader.h>
#include <iostream>
// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;
// process all input: que... |
3569b739b53842e7f8d39440a718028bc5b2ff7f | 31455cbca9e7d5df3c926df00db72254741c06ff | freebsd/freebsd-ports | /games/openxcom/files/patch-src_Engine_Language.cpp | C++ | cpp | 283 | permissive | --- src/Engine/Language.cpp.orig 2019-08-03 22:25:23 UTC
+++ src/Engine/Language.cpp
@@ -17,6 +17,7 @@
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Language.h"
+#include <algorithm>
#include <assert.h>
#include <locale>
#include <fstream>
|
fd95ac64a82cbe3cb9eafcb122a003a8b4a47184 | 395eb4d50b3455341963039a09718e541155f23f | aranajhonny/chromium | /chrome/browser/search/suggestions/suggestions_service_unittest.cc | C++ | cc | 20,331 | permissive | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/search/suggestions/suggestions_service.h"
#include <map>
#include <sstream>
#include <string>
#include "base/bind.h"
#include "... |
5e9bc4e363d30e1c63d74956f44fab17863e24f2 | 7375208523421720adb3fdb120788046f42dd341 | sergeyext/Radeon_HD_glDrawBuffers_demo | /main.cpp | C++ | cpp | 8,670 | no_license | #include <iostream>
#include <cassert>
#include <string>
#include <sstream>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
static std::string getErrorDescr(const GLenum errCode)
{
// English descriptions are from
// https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glGetError.xml
switch (errCode) {
ca... |
8b5468609db04072d616facc7e823082c042ea60 | 7c75a56e8e7554785816c744b8ae290c1d99dcab | siconos/siconos | /mechanics/src/joints/JointFrictionR.cpp | C++ | cpp | 3,286 | permissive | /* Siconos is a program dedicated to modeling, simulation and control
* of non smooth dynamical systems.
*
* Copyright 2022 INRIA.
*
* 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
*
*... |
9a48cf80288509e4a2c8c047e9483f3dd4112203 | 6a0da3aef6fb24cc4b3e2a9e4fbfded25f7c7136 | weblifeio/chromium | /content/browser/webid/federated_auth_request_impl_multiple_frames_unittest.cc | C++ | cc | 17,233 | permissive | // Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/webid/federated_auth_request_impl.h"
#include <memory>
#include <ostream>
#include <set>
#include <string>
#include <utility>
#include "base/functio... |
f95676f2a8e870ceee3e93af3f1077c6494ab593 | e4b6233fbbbb77c8d128930f2b62fb70e635c412 | ibohonos/piscine_cpp | /d04/ex01/Character.cpp | C++ | cpp | 1,579 | no_license | #include "Character.hpp"
Character::Character(std::string const & name)
{
this->_name = name;
this->_ap = 40;
this->_wpn = NULL;
}
Character::Character(){}
Character::~Character() {}
Character &Character::operator=( Character const &rfs )
{
this->_ap = rfs._ap;
this->_name = rfs._name;
this->_wpn = rfs._wpn;
... |
90a00fd3462407a0755382464e4d95d093b91113 | bede538eb3ad0563bb011c464fb13c650af8dc0b | osmansajid/Contest-Problems | /SPOJ/LPS/12952074_AC_160ms_25600kB.cpp | C++ | cpp | 1,744 | no_license | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define base 1572872831
#define N 1000001
long long Power[N];
void powercal(){
Power[0]=1;
for(int i=1;i<N;i++){
Power[i]=((Power[i-1]%mod)*(base%mod))%mod;
}
}
void hashFuntion(string s,long long hashVal[]){
hashVal[0]=0;
... |
ddae8b7390b3496bb5c838f4ae99e064d08f8b24 | 135981692e3c95cf2e60591142cee45ca154425f | EnjoyHacking/ChromiumGStreamerBackend | /components/autofill/core/common/autofill_util.cc | C++ | cc | 3,591 | 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/autofill/core/common/autofill_util.h"
#include <algorithm>
#include <vector>
#include "base/command_line.h"
#include "base/i18n/cas... |
7dd6421b83bf13e30d2091d8a498c430f522c79b | 2dca736668e5e6ed7e7bec4df394641724dced65 | byx2000/GreedySnake | /GreedySnake/game/GamePainter.cpp | C++ | cpp | 552 | no_license | #include "GamePainter.h"
#include "global.h"
#include <QApplication>
#include <QPainter>
GamePainter::GamePainter(const GreedySnakeGame* game) : game(game){}
GamePainter::GamePainter(){}
/*void GamePainter::update(int msg)
{
//QPainter painter(Global::gamePage);
switch (msg)
{
case WAITTING_FRAME:
... |
9bbb2de120994133a9cc97224b3d832a540e5d40 | fca2e4573e49cb8b39d56385731d177d266102be | c6burns/TressFX | /amd_tressfx/src/TressFXSDFCollision.cpp | C++ | cpp | 8,686 | permissive | // ----------------------------------------------------------------------------
// This wraps a single signed distance field, used for TressFX collision.
// it provides the interface to generate the signed distance field, as well
// as apply that signed distance field to a TressFX simulation.
// -----------------------... |
fd02628022cd50de7d8bc82391c8ed89f1743e97 | 006a16cca966d4a4b841da5ae3a0010e34350578 | stan-dev/stan | /src/test/unit/io/json/json_data_tuples_test.cpp | C++ | cpp | 8,753 | permissive | #include <stan/io/json/json_data.hpp>
#include <stan/io/json/json_data_handler.hpp>
#include <stan/io/json/json_error.hpp>
#include <stan/io/json/json_handler.hpp>
#include <stan/io/json/rapidjson_parser.hpp>
#include <test/unit/util.hpp>
#include <test/unit/io/json/util.hpp>
#include <gtest/gtest.h>
// tuple(int, r... |
b50a2b0b3032bc88dc9a0011d64fad7bb5967e05 | 51c169cd104e413ad9425aa362e9e30fdcd7da41 | ArjunAranetaCodes/MoreCodes-CPlusPlus | /Number Patterns/problem6.cpp | C++ | cpp | 379 | no_license | /*
Problem 6: Write a program to print the number pattern of ones and zeros using loop.
11111
10001
10001
10001
11111
*/
#include<iostream>
using namespace std;
int main(){
for(int y = 0; y < 5; y++){
for(int x = 0; x < 5; x++){
if((y == 0) || (y == 4) || (x == 0) || (x == 4)){
cout << "1";
}else{
... |
6003add74dfd3aa074cc1e9fc9ce97db2dbdb91b | 0d7905876a8aefebe2ee8cfcff72e1171a3c8dda | M-Koczorowski/homework | /selsort.cpp | C++ | cpp | 694 | no_license | #include <iostream>
#include <ctime>
#include <crand>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
const int ile = 10;
void SelSort(int N, int array)
{
for(int i=0;i<N-1;i++)
{
int pom = array[i];
int min = array[i];
... |
49d4113428acf8f0f4d50cffe4c86748001888bc | a0113e725e9cfdf6a3f95a092f179f23696b7e6f | meamy/qpp | /include/qasm/parser.hpp | C++ | hpp | 27,443 | permissive | /*
* This file is part of Quantum++.
*
* MIT License
*
* Copyright (c) 2013 - 2020 Vlad Gheorghiu.
*
* 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 wi... |
ff20537a642a3afd8df2687bd33c041463ab364c | 4be0c2b42867ef8a43061b7751c43d7dac8fd534 | frankhoff/xictools | /wrspice/devlib/hisim-1.1.0/hsm1trun.cc | C++ | cc | 4,123 | permissive |
/*========================================================================*
* *
* Distributed by Whiteley Research Inc., Sunnyvale, California, USA *
* http://wrcad.com *
* Copyright (... |
3790fb620c5b0f7ccce66218e8e09fb949313934 | 4daf16e506ffc00202552612c7606e79b1dfaf0d | tsingh62/C-Masters | /triangleDIFF.cpp | C++ | cpp | 426 | no_license | #include <iostream>
using namespace std;
int main()
{
int row, sp, incVAl, decVal, n=5;
for(row=1; row<=n; row++)
{
for(sp = 1; sp <= n-row; sp++)
{
cout <<" ";
}
for(incVAl=1; incVAl<=row; incVAl++)
{
cout << incVAl;
}
for(de... |
6a63132add3d1a95dd8c626036e9f6fd9e4a8489 | 2baee72db8259c9cfeb0532c24bd5fb2fb087988 | Mancoi64/chromium | /cc/metrics/total_frame_counter_unittest.cc | C++ | cc | 3,349 | 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 "cc/metrics/total_frame_counter.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "testing/gtest/include/gtest/gtest.h"... |
3e98ba8b6a819c5e443c2e6db62d89f4ca80e65b | 96472cf85f374ad097e204c33540f1ef5f7bc6b1 | melihcanmavis/BlacerCoin | /src/util.cpp | C++ | cpp | 25,527 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2017-2018 The PIVX developers
// Copyright (c) 2018 The BlacerCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING ... |
cbcf2f3c73d26bf37e36cfad86612e89854966a7 | bde60da57b88c32d13604a7b76f3fce1e2649d92 | pesterie/nt2 | /modules/trigonometric/unit/simd/fast_tanpi.cpp | C++ | cpp | 5,070 | permissive | //////////////////////////////////////////////////////////////////////////////
/// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand
/// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI
///
/// Distributed under the Boost Software License, Version 1.0
/// ... |
27f3d8850ed72dc1367d10c83707c5dc43056f88 | 6682a1f1fe89514298851225fbfe1491345d1e04 | sebnil/FIR_v2 | /src/FIR_v2.cpp | C++ | cpp | 1,165 | permissive | /*
https://github.com/sebnil/FIR_v2
*/
#include "FIR_v2.h"
// constructors
FIR_v2::FIR_v2()
{
float newCoefficients[] = {
0.5,
0.5};
setCoefficients(newCoefficients, 2);
}
FIR_v2::FIR_v2(float *newCoefficients, unsigned int newNumberOfTaps)
{
setCoefficients(newCoefficients, newNumberOfTaps);
resetFilter();
}... |
d42a7ca4da3780ca29edb9074eb9a4df64fa3b68 | 2489dccdffa7dffcd6719be7e3a3d1d9a0bbe4e6 | YJBeetle/QtAndroidAPI | /android-29/java/nio/channels/Pipe_SourceChannel.hpp | C++ | hpp | 550 | permissive | #pragma once
#include "./spi/SelectorProvider.def.hpp"
#include "./Pipe_SourceChannel.def.hpp"
namespace java::nio::channels
{
// Fields
// Constructors
// Methods
inline jint Pipe_SourceChannel::validOps() const
{
return callMethod<jint>(
"validOps",
"()I"
);
}
} // namespace java::nio::channels
... |
74aa98cbaea904d3195a1f01ace0a59b71f8a341 | d8009a7b9405d0007085ce150eea06417802bfb3 | InnoCentCoder5497/DSA-in-C-plus-plus | /Linked List/singly_linked_list.cpp | C++ | cpp | 2,343 | no_license | #include<iostream>
using namespace std;
struct node {
int value;
node* next;
};
class SinglyList {
node *head, *trav, *var, *prev;
public:
SinglyList(){
head = NULL;
}
void insert_front(int value){
var = new node;
var->value = value;
... |
338e9f8f1a2912a50301454a4d27f5e93ed1d0d4 | cfb8d8d05e147a6cf36137319fe1a1dda646d3f8 | PachequinPlusPlus/Tareas | /Coj/Sam28-p1288-Accepted-s984804.cpp | C++ | cpp | 503 | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int t;
string n;
cin>>t;
getline(cin,n);
while(t--)
{
//Using getline for this = WA, ffs.
cin>>n;
int last = n[n.length()-1] - '0';
//cout<<"Last: "<<last<<endl;
long long int sum = 0;
for(int i = 0; i < n.leng... |
c383fb04b984152a3ddc2c856199aa7537772112 | 37e942ab4de9ca77c686394998dca2882fe89038 | prprhyt/ABC2016SpringServer | /Classes/c2xa/communication/windows_socket_api.hpp | C++ | hpp | 1,345 | permissive |
/**
@file windows_socket_api.hpp
@brief windows_socket_api wrap
@author 新ゝ月かりな(NewNotMoon)
@date created on 2016/00/00
*/
#pragma once
#ifndef C2XA_COMMUNICATION_WINDOWS_SOCKET_API_HPP
#define C2XA_COMMUNICATION_WINDOWS_SOCKET_API_HPP
#include <exception>
#include <WinSock2.h>
#pragma comme... |
da532b9f00a004a43c14f5b51658574569d57361 | e5fa13eeffbacfe49dfd3b2daaef1954a6d02a77 | YugoOsano/AtomicScaleCellularModel | /deposition/included_to_main2.cc | C++ | cc | 5,668 | no_license | // included_to_main2.cc
//=== monte_carlo.cc 内での main における
//*************************************************
//--- etch product 脱離 (Cl_ion のflag による)
//*************************************************
if(FLAG_SiCl4_INCLUDED == true &&
Cl_ion.flag_desorb_Si == true )
{
bool flag_product_diffusion ;
//=... |
496b6c8aa1398d924f4ca6b6d95f21f69c92a889 | c7e0dd30d100f894975269ae14e025f59f6038cd | yohanesnuwara/The-CPP-Workshop | /Chapter07/Exercise50/Exercise50.cpp | C++ | cpp | 1,219 | permissive | #include <iostream>
using namespace std;
struct numeric_item
{
int value_;
numeric_item* next_;
};
class numeric_list
{
numeric_item* head_;
public:
numeric_list() : head_(nullptr) {}
~numeric_list();
void print();
void add(int v);
numeric_item* find(int v);
};
numeric_list::~numeric_li... |
e5331ce42ea961891ed5abdcee9bc5e8404b087a | f9fb3851cf2b87f1a458171f19d506b436a72fca | cubetrain/CubeTrain | /contracts/libc++/upstream/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/param_eq.pass.cpp | C++ | cpp | 967 | 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.
//
//===---------------------------------... |
8b589e21a8feca62184645b1c24045f7053d9d6c | 16a681a4bdac5fb4a04d9d87d101df7b0ed92a2b | PlumpMath/panda3d-3 | /src/lib/panda/pgraphnodes/switchNode.cxx | C++ | cxx | 9,064 | permissive | // Filename: switchNode.cxx
// Created by: drose (31Jul02)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should... |
339fbddc3dbb67fc9d3a75d4f3c81293457068b3 | 07f61ffb1a7d427bdf83a45bc0a395c26da4c83a | utkarsh-27-sharma/DSA | /GeeksForGeeks/magic.cpp | C++ | cpp | 295 | no_license | // Function to swap A and B
// using pointers
void swap(int *A, int *B){
// Your code here
int temp=*A;
*A=*B;
*B=temp;
}
// Function to swap A and B
// using reference
void swap(int &A, int &B){
int temp=A;
A=B;
B=temp;
// Your code here
}
|
7b0b89ff1d6780058be610dcefc43a5c2aadff62 | 0f02bc8841f9fcd9e59cfcef62699b86984a2954 | abc881858/YiGuiBox | /project/mainwindow.cpp | C++ | cpp | 11,460 | no_license | #include "mainwindow.h"
#include <QPalette>
#include <QBrush>
#include <QPixmap>
#include <QDebug>
#include <client.h>
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
Client *client = new Client(this);
client->run();
carousel = new Carousel;
connect(carousel,SIGNAL(clicked1()),this,SLO... |
557c7558fa1b5787223d15d5cd01bf1dadbec914 | a5706dc1794e176e0e054ff60c0a4a213480f32e | pnikic/Hacking-uva | /11709.cpp | C++ | cpp | 1,064 | no_license | #include <iostream>
#include <unordered_map>
#include <vector>
#include <stack>
#include <string>
using namespace std;
typedef vector<int> vi;
vector<vi> E, rE;
vector<bool> V;
unordered_map<string, int> M;
int size;
stack<int> S;
void Kosaraju(int u, bool pass = 0)
{
V[u] = true;
vi adj = (pass ? rE[u] : E[u]);
... |
28e606d6c12d57273cb48611c0797a727bf92e67 | 87a01d008ba7f0ddf904bbfb159a359ecdc4adc1 | alisa-efremova/ood2016 | /07_Composite/painter_lib/SimpleShape.cpp | C++ | cpp | 1,160 | no_license | #include "stdafx.h"
#include "SimpleShape.h"
#include "ICanvas.h"
using namespace std;
CSimpleShape::CSimpleShape()
{
m_fillStyle = make_shared<CStyle>();
m_outlineStyle = make_shared<CLineStyle>(true, 0);
}
void CSimpleShape::SetOutlineStyle(const ILineStylePtr & style)
{
m_outlineStyle = style;
}
ILineStylePtr... |
a3b1b320b796e2eab3d46621a3cbe23f6b099db9 | bf049f803e88184247a30369d3632d5a4875804c | AlejandroNegri/POO-Biblioteca | /POO Proyecto Final/Código Fuente/Biblioteca/Singleton.cpp | C++ | cpp | 302 | no_license | /**
* @file Singleton.cpp
* @brief Declaraciones de todo lo necesario para trabajar con la clase Singleton
*
* Este archivo define la clase Singleton, utilizada para trabajar con una única
* instancia de la clase Biblioteca
**/
#include "Singleton.h"
Singleton *Singleton::instancia=NULL;
|
d325d6199fcf06adab6c82d0dce4500c138bc8e9 | 87a82a054270cdcdc3d868019ede571850ec23a4 | mousyball/Data-Structure-and-Algorithm | /Stack/Stack using Linked List - Example/Stack using Linked List.cpp | C++ | cpp | 2,017 | no_license | #include <iostream>
class StackList;
class StackNode{
private:
int data;
StackNode *next;
public:
StackNode():data(0){
next = 0;
}
StackNode(int x):data(x){
next = 0;
}
StackNode(int x, StackNode *nextNode):data(x),next(nextNode){};
friend class StackList;... |
4952e5be715a0b82b2111ec746c904f7fa8dc3b6 | e8a2ba17c93f5280df39587885e6c766118a7c33 | Chrisbattarbee/gtd | /lib/subcommands/view_subcommand.cpp | C++ | cpp | 849 | no_license | //
// Created by chris on 10/02/2020.
//
#include "view_subcommand.h"
#include "../gtd.h"
#include "utils.h"
void setup_view_subcommand(CLI::App &app) {
auto opts = std::make_shared<ViewSubCommandOptions>();
auto view_subcommand = app.add_subcommand("v", "View project.");
view_subcommand->add_option("pro... |
47ed81441ab7b0d878a527c09fb9bf6fdf409656 | 240188de0da0fdcbaa8dbacf9787a355be484efc | sh-zam/llvm-project | /clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp | C++ | cpp | 8,216 | permissive | //===-- ClangdLSPServerTests.cpp ------------------------------------------===//
//
// 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
//
//===---------------------------... |
6798f8f7ef0ea350da76281a9bc4d3248d1e48b0 | 26b891b066fc99f77002385331950474a97fa784 | ncukaran18csu103/HackerRank-Problem-Solving | /implementation.cpp | C++ | cpp | 23,233 | permissive | HackerLand University has the following grading policy:
Every student receives a in the inclusive range from to .
Any less than is a failing grade.
Sam is a professor at the university and likes to round each student's according to these rules:
If the difference between the and the next multiple of is le... |
83f69b74cfd2688c3a8f6ae8e1a257de8e016a20 | d467a1f9a1e85d8a478abc66f281ecdc02752d5a | CU-0xff/juliet-cpp | /000/094/332/CWE321_Hard_Coded_Cryptographic_Key__w32_char_73b.cpp | C++ | cpp | 5,478 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE321_Hard_Coded_Cryptographic_Key__w32_char_73b.cpp
Label Definition File: CWE321_Hard_Coded_Cryptographic_Key__w32.label.xml
Template File: sources-sink-73b.tmpl.cpp
*/
/*
* @description
* CWE: 321 Use of Hard-coded Cryptographic Key
* BadSource: Copy a hardcoded val... |
f3463e02f73d81feea25b405d53bc09af1351d4b | 4b354efe13089aa4b1672c9f32c7aee1025dd42f | Hfanes/CheckersGame | /ProjetoLab/ponto.cpp | C++ | cpp | 1,102 | no_license | #include "ponto.h"
ponto::ponto()
{
}
ponto::~ponto()
{
}
bool ponto::Set_x(int m_x)
{
x = m_x;
return false;
}
bool ponto::Set_y(int m_y)
{
y = m_y;
return false;
}
void ponto::Set_P(int m_x, int m_y)
{
x = m_x;
y = m_y;
}
void ponto::Set_P(ponto m_P)
{
this->x = m_P.Get_x();
this->y = m_P.Get_y();
}
... |
1ed24c22e4e2f14a33cbeec47bc000e9b3a5803e | 8fc6c2bc9eec1462d0d8d15d9f2f1c16a6231727 | hkoehler/LeetCode | /kthSmallestElementInBST.cpp | C++ | cpp | 766 | no_license | // https://leetcode.com/problems/kth-smallest-element-in-a-bst/
/**
* 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:
stack<TreeNode*> s;
void ... |
fc7f3486c961e0ebe3c18cad8dfcdadc8b10456b | dc2b4c72997c1401726177b76918cacd04d31d83 | ConnorZhong/ACM | /Codeforces/CF 869E.cpp | C++ | cpp | 1,726 | no_license | #include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <map>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <utility>
#include <bitset>
#include <ctime>
#define fi first
#define se second
#define pb push_b... |
3c09c4e6fb1aec270600194d8a939bbfcd92814b | 8653b46ce9f04c61fcd105927fa446c6415c38cf | Chompas/datos7506 | /Claves/ClaveFalla.cpp | C++ | cpp | 1,679 | no_license | /*
* ClaveFalla.cpp
*
* Created on: Jun 3, 2012
* Author: chompas
*/
#include "ClaveFalla.h"
#include <iostream>
#include <cstring>
#include <sstream>
#include "../Disco/IndicesManager.h"
using namespace std;
ClaveFalla::ClaveFalla(const int& falla)
: ClaveInt(falla)
{ }
string ClaveFalla::ToString() co... |
e4fdacd65c320762a2c60a066e1fe836fb12fd1a | 3a9fb55c3880bb58461085a8b5f4220b0cebd242 | jlesaba/CS127-10L | /Exer3.cpp | C++ | cpp | 4,810 | no_license | #include<iostream>
#include<iomanip>
#include<cstring>
#include<algorithm>
#include<cstdlib>
using namespace std;
#include<conio.h>
#include<windows.h>
string sort(string str);//reaaranging the orders of string to test if its anagram
bool areAnagrams(string str1,string str2);//process the strgin if anagram anf returns ... |
c5aa6070e6cfe8685f3d12ae0bae17ca6b624bf4 | 3171b22bbe65b8ede5a9005ed6735975247fda92 | spelteam/spel | /src/utils/detectorTests/surfDetectorTest.cpp | C++ | cpp | 2,243 | no_license | // SPEL definitions
#include "predef.hpp"
#include "surfDetectorTest.hpp"
void SURFDetectorTest::train(vector <Frame*> _frames, map <string, float> params)
{
SurfDetector::train(_frames, params);
}
map <uint32_t, vector <LimbLabel> > SURFDetectorTest::detect(Frame *frame, map <string, float> params, map <ui... |
4a9423e7489b1c90f0944077fe74eab797b4c4fc | 269c44fec0b0bae47dcf7854fec4e25f00904abc | farazlfc/CP | /pascal_triangle.cpp | C++ | cpp | 659 | no_license | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> ans;
vector<int> x(1,1);
ans.push_back(x);
if(numRows == 1)
return ans;
vector<int> y(2,1);
ans.push_back(y);
if(numRows == 2)
return ans;
for(i... |
23ef9258711285f99be9d06769ebe31614a4341e | 1f088ea77b6b1e70861d04a3a6f30edec5be9dcd | NevilClavain/DrawSpace | /lua_core/src/luaclass_distribution.cpp | C++ | cpp | 3,594 | no_license | /* -*-LIC_BEGIN-*- */
/*
*
* DrawSpace Rendering engine
* Emmanuel Chaumont Copyright (c) 2013-2023
*
* This file is part of DrawSpace.
*
* DrawSpace is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... |
0188ade6c14cec9f315a4d73321374a1476ddba3 | e6012538b7faac289538c577cde5b7c723889b0c | a00012025/Online_Judge_Code | /Zerojudge/b239.cpp | C++ | cpp | 710 | no_license | #include<stdio.h>
#define LL long long
#define MOD 1000000007
int n ;
LL sum[1000001] ;
LL check(LL x)
{
LL ret=0LL ;
int l , r=0 ;
for(l=0;l<=n;l++)
{
for(;r<=n && sum[r]-sum[l]<=x ; r++) ;
ret+=(LL)(r-l-1) ;
}
return ret ;
}
main()
{
int T ;
scanf("... |
453af9fa3f9050a5ac9fedf49defd2fceb7fe506 | ee9da8ed0115c20d507bfdde04d1290f8ccc7e33 | Haoxiaoling/convert_maps | /project03/src/graphviz.cpp | C++ | cpp | 3,518 | no_license | /*
writed by Xiaoling
time:2017.8.16
for: generate transform tree from the .stt files.
*/
#include <iostream>
#include <string>
#include"sttl.h"
#include <list>
#include <iterator>
#include <stdint.h>
#include <dirent.h>
#include<vector>
#include <fstream>
static int scan_dir(std::string path,std::l... |
08881bc5d47cf22512f9398b69ed4622fe51e414 | 105fec985d1ded8321736df71af8fe05f6a5c938 | longstl/mus12 | /_Library/_Include/boost/graph/smallest_last_ordering.hpp | C++ | hpp | 5,762 | no_license | ////////////////////////////////////////////////////////////////////////////////
// smallest_last_ordering.hpp
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
//
// Distribu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.