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 |
|---|---|---|---|---|---|---|---|---|
d687b50d2ac7e67be932d0dee583b6f20c1c0f9f | 9658d452ecdcbca0979bd8e6c2fc60f0cec7be0a | khalidwaseem/My-CPP-Code-Base | /graph/Kruskal with My Disjointset DS.cpp | C++ | cpp | 1,897 | no_license | /*
Kruskal with MY Disjointset Datastructure
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
/*********************** Disjoint-set Data structure ****************************/
void create_set(vector<int> &p,vector<int> &r, int x){
... |
79edb153a1dd24db6191187d1d22db346e572eab | a1c601dbcfd3b76c3b81b2340e76f7b8c41f3af5 | VVKoishi/OpenGLProgramsRepo | /DrawCirclef/DrawCirclef.cpp | C++ | cpp | 3,046 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gl/glut.h>
static GLfloat dx = 1.0, dy = 1.0;
class screenPt
{
private:
GLfloat x, y;
public:
screenPt() {
x = y = 0;
}
void setCoords(GLfloat xCoordValue, GLfloat yCoordValue) {
x = xCoordValue;
y = yCoordValue;
}
GLfloat getx() const {
... |
8c1cd16eec18468c3be83fd0751e8870a56aff60 | 935a119ec08972493ddc411fd67bd4786160eba7 | ditupao/vx7zip | /7z920/CPP/7zip/Common/FileStreams.cpp | C++ | cpp | 9,925 | no_license | // FileStreams.cpp
#include "StdAfx.h"
#include <errno.h>
#ifndef _WIN32
#include <fcntl.h>
#include <unistd.h>
#else
#include <io.h>
#endif
#ifdef SUPPORT_DEVICE_FILE
#include "../../../C/Alloc.h"
#include "../../Common/Defs.h"
#endif
#include "FileStreams.h"
static inline HRESULT ConvertBo... |
7d01cf2599b52d1cb1aab5a833b074414c26ec63 | 9c8cb243c1e8119d4e1a3b9c0ef728a76bfcbacb | PacchiiAkaDave/CG | /CGPrakt5/cgprakt5/src/TerrainShader.cpp | C++ | cpp | 1,462 | no_license | #include "TerrainShader.h"
#include <string>
TerrainShader::TerrainShader(const std::string& AssetDirectory) : PhongShader(false), Scaling(1,1,1), MixTex(NULL)
{
std::string VSFile = AssetDirectory + "vsterrain.glsl";
std::string FSFile = AssetDirectory + "fsterrain.glsl";
if( !load(VSFile.c_str(), FSFile.... |
2b7399faaed7c5e235cd60483b19508f096de7db | b56be47a313ec74c565ea4662935d0b693c8e884 | niuxu18/logTracker-old | /second/download/collectd/gumtree/collectd_repos_function_940_last_repos.cpp | C++ | cpp | 989 | no_license | static int conn_handle_ports(uint16_t port_local, uint16_t port_remote,
uint8_t state) {
port_entry_t *pe = NULL;
if ((state > TCP_STATE_MAX)
#if TCP_STATE_MIN > 0
|| (state < TCP_STATE_MIN)
#endif
) {
NOTICE("tcpconns plugin: Ignoring connection with "
"... |
52d4d60e35adde8da4d98db4a2a2ad688d8c54c8 | 48fab02e1085161a9ad7ee6e3fe8edb94103b06c | magicwenli/PTAbasic | /program/1014.cpp | C++ | cpp | 1,575 | permissive | /*
* @Author : magicwenli
* @Date : 2021-01-16 11:16:21
* @LastEditTime : 2021-01-18 21:09:29
* @Description :
* @FilePath : /PTAbasic/1014.cpp
*/
#include <iostream>
using namespace std;
int main()
{
char str1[60], str2[60], str3[60], str4[60];
char *p1 = str1, *p2 = s... |
70d230429fe14789072e3243fe74900234f8df25 | f5f7e653c5bab1479af74f3971754ff20c60df2e | maxenergy/CPP_2020520 | /zen_rtsp/alg-mutilthread/camera_calibration.cpp | C++ | cpp | 29,666 | no_license | #include "m_arith.h"
//lhx,20150608
/*void camera_calibration(float actual_point[][2], float img_point[][2], float mapping_matrix[], int calibration_num, ALGCFGS *pCfgs)
{
int sub_calibration_num = 4;
int subsection_num = (calibration_num - sub_calibration_num) / 2 + 1;
int num = 0;
float tx = 0, ty = 0,tu =... |
45d219ccbf1b425d6177c86b669097464462583e | e658451cc8fd310f99ca293b57cb99910ea23b6c | kiciek/etl | /test/test_unordered_set.cpp | C++ | cpp | 12,968 | permissive | /******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
http://www.etlcpp.com
Copyright(c) 2016 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associate... |
a7ac828ca00ea5198113484609847081a1723691 | 2b18cbb1607461e6e741fd3afe54758aea19adee | ahmedramadan02/TheDocumentationProject | /cpp_tipsandtricks/cpp_code/basic/assignement-vs-construtors.cpp | C++ | cpp | 783 | no_license | #include<iostream>
class MyClass
{
public:
MyClass() {
std::cout << "The construtor is called" << std::endl;
}
MyClass(const MyClass &t){
std::cout << "The construtor (copy) is called" << std::endl;
}
MyClass& operator= (const MyClass &t)
{
... |
8ced2d612248796afb79dbfbbf03cbf4f1a90de5 | c60543e92b647378e99781e62f82c2ed363e6a77 | jyotsana279/hacktoberfest2022-0 | /C++/Stack/MaxRectangleinBinaryMatrix.cpp | C++ | cpp | 3,010 | no_license | /*
Given a binary matrix M of size n X m. Find the maximum area of a rectangle formed only
of 1s in the given matrix.
Example 1:
Input:
n = 4, m = 4
M[][] = {{0 1 1 0},
{1 1 1 1},
{1 1 1 1},
{1 1 0 0}}
Output: 8
Explanation: For the above test case the
matrix will look like
0 1 1 0
1 1 1 1... |
d16138e510347862018535709c37d271a8ddd9ba | 82e55c2bb7a50564081047185522b8681464014a | bshields1/CollegeBasketball2019 | /League.cpp | C++ | cpp | 6,600 | no_license | #include "League.h"
League::League()
{
createTeams();
}
void League::readScores(ifstream& scores) {
string str1;
string str2;
string team1;
string team2;
int score1;
int score1Digits;
int score2;
int score2Digits;
string winTeam;
string loseTeam;
while... |
9fd4d83990174bf37739c259462380e4c0c952db | bded12692b080311e2504377e612a0c1f5cef4a1 | enzo1982/smooth | /classes/gui/dialogs/icons/light.cpp | C++ | cpp | 44,002 | permissive | /* The smooth Class Library
* Copyright (C) 1998-2020 Robert Kausch <robert.kausch@gmx.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of "The Artistic License, Version 2.0".
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIE... |
ba27f88bf0398136f907ade7a7b83278d3e44fc9 | 20738827444f4a777cf149f83d259c153fbe2949 | ThePhD/llvm-project | /libcxx/test/std/strings/basic.string/string.modifiers/string_replace/size_size_pointer.pass.cpp | C++ | cpp | 22,761 | permissive | //===----------------------------------------------------------------------===//
//
// 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
//
//===---------------------------... |
64b2ba046b5e6c95791287d59e2f3c1ed2091b9b | beb79b2ae310b5434c2d217c5dbbd49528c6464f | gbourgeo/42projects | /Piscine_Cpp/rush00/Map.hpp | C++ | hpp | 1,279 | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Map.hpp :+: :+: :+: ... |
94450a164cab644553f105271406fa8bcfb89362 | 848320b8db9f4c64d3cb4cf31cba04bd04a0e9b0 | rmnzr/murmur | /src/animationParticlesMega2.cpp | C++ | cpp | 9,815 | no_license | //
// animationParticlesMega2.cpp
// murmur
//
// Created by Julien on 17/05/13.
//
//
#include "animationParticlesMega2.h"
#include "soundManager.h"
//--------------------------------------------------------------
AnimationParticlesMega2::AnimationParticlesMega2(string name) : Animation(name)
{
m_isParticles... |
45c62e2e72a14e01ab24babd74a1a298a18b152c | 73a440c5ca38d929f768520dc449d29040a7246d | ankitpnwr/Placement_Class | /Day-7/Q3toeplitz-matrix.cpp | C++ | cpp | 512 | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool isToeplitzMatrix(vector<vector<int>>& matrix) {
int row = matrix.size();
int col = matrix[0].size();
bool flag = true;
for(int i = 0; i<row; i++){
for(int j = 0; j<col; j++){
i... |
f8f738434fc82871aadcd8dd77409ab8cc466f60 | 0893eefeb9d22595aca284061229e4c0add5e450 | Ashutoshwahane/TheCookBook | /C++/Constructors/Age-Val-using-Constructor/main.cpp | C++ | cpp | 425 | no_license | #include <iostream>
#include <conio.h>
using namespace std;
class validation
{
private:
int age;
public:
validation()
{
cout<<"Enter your age : ";
cin>>age;
if(age >= 18)
cout<<" You are eligible for license";
else
cout<<"You are no... |
9104f15a13dec0abaa0f6d6f67fb53017654ffbb | 100494a2cc0c04d4e6d4b50201be9301c1e485ca | Pandinosaurus/retro | /cores/atari2600/stella/src/emucore/Control.hxx | C++ | hxx | 8,662 | permissive | //============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emula... |
64bea3139ccb0115849f9ce5e7697f669a726297 | 018f5b0e2916a80552588066415740a4620cd509 | cow-coding/algorithm | /BOJ/C++/20528.cpp | C++ | cpp | 488 | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
bool arr[26] = {false,};
int n;
vector<char> ans;
cin >> n;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
if (!arr[s[0] - 'a']) {
arr[s[0] - ... |
13457e2fa03fa3e21e39b7500f1628b2093c0005 | 18adfc70fa4f22355679f53837083e448eacab64 | stevendinggang/swift | /lib/IRGen/Linking.cpp | C++ | cpp | 48,176 | permissive | //===--- Linking.cpp - Name mangling for IRGen entities -------------------===//
//
// 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... |
6e9f68b4300a5def41afb563dde25c59c5468f99 | a9000d90264cfcdfcc8ceaf1cf43b4f41819760f | KanadeSiina/PracticeCode | /202002_practice/1290/b.cpp | C++ | cpp | 1,807 | no_license | #include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do { cout << "\033[32;1m " << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v <... |
77cb1958a4731859ab2a7cf488a45bf413602b47 | 784838d0cb03551ab13dcc570a9aa50f25026684 | windystrife/UnrealEngine_NVIDIAGameWorks | /Engine/Plugins/Runtime/Oculus/OculusVR/Source/OculusHMD/Private/OculusHMD.cpp | C++ | cpp | 105,629 | permissive | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "OculusHMD.h"
#include "OculusHMD_EyeMeshes.h"
#include "OculusHMDPrivateRHI.h"
#include "EngineAnalytics.h"
#include "IAnalyticsProvider.h"
#include "AnalyticsEventAttribute.h"
#include "RendererPrivate.h"
#include "ScenePrivate.h"
#include "Scene... |
880475f005ba90a0194affc9bf3475803247b0fa | dcd4ab4bf146486d805bd15c1a97fda88926b55a | wuqiling/leetcode-myself | /leetcode_myself/300.cpp | C++ | cpp | 1,783 | no_license | #include <algorithm>
#include <iostream>
#include <vector>
using std::max;
using std::min;
using std::vector;
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
return lengthOfLIS_binarySearch(nums);
}
private:
// dp time:O(N^2) space:O(N) 16ms 55%
int lengthO... |
ad3be2984b4ee43e773e9f24cd117e09d5be83bb | c766929a6e89e106ad310f9657025b70a90e991b | ric2b/Vivaldi-browser | /chromium/device/bluetooth/floss/bluetooth_socket_floss_unittest.cc | C++ | cc | 13,093 | permissive | // Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "device/bluetooth/floss/bluetooth_socket_floss.h"
#include <memory>
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#inclu... |
d3673c36e76eaf5671a0b257be626177c9db0fb7 | 1e76ea149fd0341d9c09c6318458868bca37b425 | MustafaBiyikli/SMAQ | /Software/Real-Time/unitTest.cpp | C++ | cpp | 1,279 | permissive | #include <stdexcept>
#include "wiringPiI2C.h"
#include "BME280.h"
#include "VCNL4010.h"
#include "ADS1115.h"
#include "SH1106.h"
using namespace std;
int testI2Ccommunication_BME280()
{
int fd_BME280 = wiringPiI2CSetup(BME280_ADDRESS);
if (fd_BME280 < 0)
{
throw runtime_error("BME2... |
ba45c7960908c1fb03b986f6df5b8a0b3cab6aa3 | 9e680e95b4537bd7bc2434f35a2ea0f4fa3e8d34 | frog97/freelec_modern_c-_programming | /Project_Code/Project6 - Ch10/Menu.cpp | C++ | cpp | 2,508 | no_license | #include "Menu.h"
// 생성자 – 메뉴 정보 메모리 할당
Menu::Menu()
{
topMenu = new string[numTopMenu];
ownerMenu = new string[numOwnerMenu];
contactMenu = new string[numContactMenu];
twitterMenu = new string[numTwitterMenu];
topMenu[0] = "1. 소유자 관리 기능";
topMenu[1] = "2. 연락처 관리 기능";
topM... |
d19ff771cedfb8adf499015c003f10628e0b569b | 265eacf0edf9dcb95015dfc956010e1681b7606e | Heured/dataStructures_review | /array&generalized_list/广义表.cpp | C++ | cpp | 3,341 | no_license | #include<iostream>
using namespace std;
typedef char ElemType;
typedef struct lnode{
int tag; //节点类型标签
union{
ElemType data; //原子值
struct lnode *sublist; //指向子表的指针
}val;
struct lnode *link; //指向下一个元素
}GLNode; //广义表节点类型定义
//求广义表的长度
int GLLength(GLNode *g){ //求广义表g的长度
int n=0;
GLNode *g1;
g1 = g->val.s... |
7a78d34091054860ed93ae13a0587883eb9539bf | 96193250ef9763b9298057644d3ef87fba4ea9ce | shuaih7/LeetCode | /9_Palindrome_Number/main.cpp | C++ | cpp | 837 | no_license | #include <iostream>
#include <windows.h>
#include "Solution.h"
using namespace std;
int main()
{
Solution s;
LARGE_INTEGER tm_begin, tm_end, freq;
QueryPerformanceFrequency(&freq);
int x = 2123212;
QueryPerformanceCounter(&tm_begin);
//bool result = s.isPalindrome(x); // Execetion time = 0.0026 ms
... |
8b708f42c9c03609c2eeaf351b6e29faa97fe755 | 29a79cec164fcee7fd395503e101ca092896c683 | take-cheeze/liblcf | /src/generated/ldb_animation.cpp | C++ | cpp | 769 | permissive | /* !!!! GENERATED FILE - DO NOT EDIT !!!! */
/*
* Copyright (c) 2014 liblcf authors
* This file is released under the MIT License
* http://opensource.org/licenses/MIT
*/
// Headers
#include "ldb_reader.h"
#include "ldb_chunks.h"
#include "reader_struct.h"
// Read Animation.
#define LCF_CHUNK_SUFFIX LDB_Reader
#... |
3796952e195ef83f193371d27d77c2ab1aefef7b | d032183e51f202c64d50f0057087d1ca7f05156a | Niksonber/Hypothetical_language_assembler | /include/dictionary.hpp | C++ | hpp | 3,484 | no_license | #pragma once
#include <iostream>
#include <map>
#include "typedefs.hpp"
enum COMMANDCODE {
// Op Code Size Desc.
ADD, // 1 1 2 ACC <- ACC + MEM[OP]
SUB, // 1 2 2 ACC <- ACC - MEM[OP]
MULT, // 1 3 2 ACC <- ACC * MEM[OP]
DIV, // 1 4... |
81b95c6ee72cd0599ddc29ccd7c835433014bba5 | 3bd55577740b6b35ccda2cc118f2b4bed05876cc | RyoKodama/chromium | /google_apis/drive/drive_api_parser_unittest.cc | C++ | cc | 13,713 | 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 "google_apis/drive/drive_api_parser.h"
#include "base/time/time.h"
#include "base/values.h"
#include "google_apis/drive/test_util.h"
#includ... |
443e51085b31c334a8869b1b748111f62719d854 | f1910796db0d1eacd5dc95e4369159585036f618 | monsterdev13/MonsterNode | /src/base58.cpp | C++ | cpp | 9,811 | permissive | // Copyright (c) 2018-2015 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 "base58.h"
#include "hash.h"
#include "uint256.h"
#include <assert.h>
#include <stdint.h>
#include <string.h>
#inc... |
057c75f750b9e99fb4a7c57f4fc415dd31a85242 | 9dfa858846bd9c90c71b8d3f8eeabbb035196168 | MichelBacon/demoWindows | /employes/donnees.cpp | C++ | cpp | 1,430 | no_license | #include "donnees.h"
Donnees::Donnees()
{
for (int cpt = 0; cpt < maxEmployes; cpt++)
{
lesEmployes[cpt] = NULL;
}
for (int cpt = 0; cpt < maxTaches; cpt++)
{
lesTaches[cpt] = NULL;
}
}
Donnees::~Donnees()
{
DetruireEmployes();
DetruireTaches();
}
void Donnees::DetruireEmployes()
{
for (int cpt = 0; cpt <... |
77d9b4680ba87a2c765a6fcad2fb1382db07d2cc | 85b7ddf67d2bfdf59cf02f491bb1ddd7b360c2df | RebirthDAN/Algorithm | /走迷宫 C++.cpp | C++ | cpp | 2,529 | no_license | #include <iostream>
#include <queue>
#include <utility>
#include <cstdio>
using namespace std;
char map[100][100]={0};
pair<int ,int> gate[100][100]; // pass gate
queue<pair<pair<int ,int>,int > > qu;
void addpos(int col,int row,int steps){
qu.push(make_pair(make_pair(col,row),steps));
if(map[col][row]!='3') ... |
ae6a971ebc8116c9b8285ca4fba8b4ada48a6472 | e4808a4ab85aaf24d9396f673317d64b23a3e186 | Laganellac/Assembler | /src/Instruction.hpp | C++ | hpp | 914 | no_license | //
// Class to parse and provide information about instructions. Note: you will be adding more functionality.
//
#ifndef INSTRUCTION_HPP
#define INSTRUCTION_HPP
#include <variant>
namespace Duck
{
namespace Instruction
{
enum class InstructionType
{
Invalid, // Invalid instruction
Unknown, ... |
d425924c0a32c087e3edd90b00c64625d5ad5c25 | 25d56df30ed524160eb79ac930c7567f72c8c148 | StalkerRaftik/my-programs | /C++ Programs/C++ Programs/AssemblyLab_1/AssemblyLab_1.cpp | C++ | cpp | 776 | no_license | #include <iostream>
int main()
{
int y, a;
__asm {
mov eax, 5
mov ebx, 3
mul ebx
mov ebx, eax
mov eax, 13
mov ecx, 4
sub edx, edx
div ecx
add eax, ebx
mov a, eax // Числитель
mov eax, 12
mov ecx, 5
s... |
d3b3ce12a948c0791421d0a633e8f161087f57f5 | e5d787ef747a1783e885fbf17b09a6a559dbb4ba | zjuxlh1993/leetcode | /leetcode68.cpp | C++ | cpp | 1,613 | no_license | class Solution {
public:
string makeLine(vector<string>& pre, int space)
{
string ret="";
if (pre.size()==1){
ret+=pre[0];
ret+=string(space,' ');
return ret;
}
int even = space/(pre.size()-1);
int num = space%(pre.size()-1);
... |
9367dc836aa8f46a99abccc22829c8d4092fc83d | 914b52048df1db6232f7e2bcd8aa1afdb67cd2d2 | jvcleave/PCL_1-3-0_Libraries_for_OF | /3rdPartyLibs/vtk_5-8/include/Rendering/vtkAssembly.cxx | C++ | cxx | 12,342 | no_license | /*=========================================================================
Program: Visualization Toolkit
Module: vtkAssembly.cxx
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 d... |
bc9ecc8359a1f6bd879c4bfaab3cfa33c73d80fd | c2e6695c7e28a4683b856b9589629b0261489c40 | Manu343726/Sprout | /sprout/type_traits/is_standard_layout.hpp | C++ | hpp | 1,098 | permissive | /*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
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.tx... |
3c1a009e030828cbb87a5fa6f738d31474dfff61 | 189a24ea2754bcd8fa3802eac6361c655c6b44a0 | jhd41/ToolFrame | /20180420/Source/Eval/IEvalParser.cpp | C++ | cpp | 64,532 | no_license | #include "IEvalParser.h"
#include "MLoger.h"
#include "EvalNode.h"
#include "Eval.h"
#include "MEval.h"
NS_TOOL_FRAME_BEGIN
bool InitEvalParser(){return true;}//仅仅绕过编译器完全链接的执行代码
//解析器基类
//////////////////////////////////////////////////////////////////////////
CEvalActiveCreator::CEvalActiveCreator( const std::stri... |
a26fa55d10f80c07eed6d0d3e22715f1cf6af9db | 8010af5575ccd3fea30f8d7f1888e71a5ea787eb | darshanparajuli/langtons_ant | /src/texture.cpp | C++ | cpp | 1,411 | no_license | #include "headers/texture.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <iostream>
Texture::Texture(const char *file_path) : m_id(0), m_path(file_path), m_width(0), m_height(0)
{
}
Texture::~Texture()
{
if (m_id)
{
glDeleteTextures(1, &m_id);
}
}
void Texture::load()
{
SDL_Sur... |
59d5c8604a5be1c1595ad5c2b3b264c95da28f7d | 8e9d9d500cd9a767f045977449b63863c0cf2745 | ehennenfent/binaryninja-api | /mainthread.cpp | C++ | cpp | 1,647 | permissive | #include "binaryninjaapi.h"
using namespace BinaryNinja;
using namespace std;
struct MainThreadActionContext
{
function<void()> action;
};
MainThreadAction::MainThreadAction(BNMainThreadAction* action)
{
m_object = action;
}
void MainThreadAction::Execute()
{
BNExecuteMainThreadAction(m_object);
}
bool Main... |
e7560d27be1587e423ef8d610ce61366ef440b74 | c8f72bf620de2c6a3ca779d8ae0881c02810fdb0 | Lsx1999/C- | /OnlineJudge/3016/main.cpp | C++ | cpp | 470 | no_license | #include <iostream>
using namespace std;
int main()
{
int *arr,*dif,i,n,ave,step = 0,sum = 0,sum1 = 0;
cin>>n;
arr = new int[n];
dif = new int[n];
for(i = 0;i < n;++i)
{
cin>>arr[i];
sum += arr[i];
}
ave = sum / n;
for(i = 0;i < n;++i)
{
dif[i] = arr[i]... |
e6f99f576933ec77c7b79d6c9b20a196f4abb60d | 3c83ac7b5ad663b68162107d32b47aeaa9738517 | FatemehZahedi/Damping-Map-KUKA | /FRI-Client-SDK_Cpp/example/VariableDampingControl/KukaVariableDamping.cpp | C++ | cpp | 33,111 | no_license | #include <sys/time.h>
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <string.h>
#include "PositionControlClient.h"
#include "friUdpConnection.h"
#include "friClientApplication.h"
#include <time.h>
#include <sys/shm.h>
#include <eigen3/Eigen/Den... |
d0659637499f772f6835178c0c6ca50f1942b451 | 782c6823b93aa09be6dea4ba0337b6ff240eccc8 | niuxu18/logTracker-old | /second/download/git/gumtree/git_new_hunk_3642.cpp | C++ | cpp | 333 | no_license | if (obj->type != OBJ_COMMIT && is_branch(refname)) {
error("%s: not a commit", refname);
errors_found |= ERROR_REFS;
}
default_refs++;
obj->used = 1;
if (name_objects)
add_decoration(fsck_walk_options.object_names,
obj, xstrdup(refname));
mark_object_reachable(obj);
return 0;
}
static void get_default... |
366acdbacf0e3a460104742d988280c8435bf345 | a7eebcd5a3f1fedf30a02160b3d892e45dd5e654 | brycelelbach/nt2 | /modules/ieee/bench/scalar/frexp.cpp | C++ | cpp | 1,076 | 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
/// ... |
71e707b9edd3bee8a5734a1ebf46b2ef29f82dc8 | d1810a78bca0fbe0fc767e9c37535a535e011a98 | andylee589/CPPStandLibraryCase | /StandardLibrary/STLAlgorithms/accumulate1.cpp | C++ | cpp | 624 | no_license | #include "algostuff.h"
using namespace std;
int main(){
vector<int> coll;
INSERT_ELEMENTS(coll, 1, 9);
PRINT_ELEMENTS(coll);
// process sum of elements
cout << "sum: "
<< accumulate(coll.begin(), coll.end(), 0)
<< endl;
// process sum of elements less 100
cout << "sum: "
<< accumulate(coll.begin(), coll... |
a398fe058d74a1e88b8a12d9a224e1c09aef0d7d | 19405ecf47c18db52860fb5359b855883fb39eb9 | ArtyomIvanoff/Mandelbrot-Set | /MandelbrotSet_boost/MandelbrotSet_boost.cpp | C++ | cpp | 440 | no_license | // MandelbrotSet_boost.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"
using namespace MandelbrotSet_boost;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompat... |
956107dbc2a51b07785d928ac175dc5c6a1d805e | 3fbbcecc61402836e223890b43aaab71c961c219 | dfrozen/wc_esp8266 | /Connection.cpp | C++ | cpp | 1,721 | permissive | #include "Connection.h"
#include "Settings.h"
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
// Create Wifi Connector
WifiConnector::WifiConnector(bool inDebugMode)
{
debugMode = inDebugMode;
tryingReconnect = false;
}
// Set params and try to connect
void WifiConnector::start()
{
if (debugMode){
Serial.... |
e242e8a703335df53cec93dcbc218da549485fea | 9aa947537ee4baecfd49c7c60272a28c686e28ae | novakoki/PAT | /1109.cpp | C++ | cpp | 1,903 | no_license | #include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdlib>
... |
a2a18a01bf346e59ca33bb9ada1a45ed6284ff9e | 944fa34637045eefb73c4e337f7e126df4c1d86d | otcshare/chromium-src | /ash/system/holding_space/holding_space_tray_icon_preview.cc | C++ | cc | 29,480 | permissive | // Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/system/holding_space/holding_space_tray_icon_preview.h"
#include <algorithm>
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/holding_space/hold... |
ccf0a9e45e8c166350c94e2da0718e2ba48e9c82 | aaba41597ed866d9697767b13d4e2a8659cad19d | rtohid/blaze | /blazetest/src/mathtest/smatdmatschur/UCbU3x3a.cpp | C++ | cpp | 3,869 | permissive | //=================================================================================================
/*!
// \file src/mathtest/smatdmatschur/UCbU3x3a.cpp
// \brief Source file for the UCbU3x3a sparse matrix/dense matrix Schur product math test
//
// Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
//
// ... |
42e01499370e2e87a00b77a73db982b73a8608b2 | 21af299cbbd332d35a8b8404fb938922d92106de | kkrizka/rootimeit | /src/LoadVector.cxx | C++ | cxx | 829 | no_license | #include "LoadVector.h"
#include <sstream>
#include <ctime>
#include <iostream>
LoadVector::LoadVector()
: LoadBase()
{
for(uint i=0;i<10000;i++)
m_pointers[i]=new std::vector<float>();
}
LoadVector::~LoadVector()
{
for(uint i=0;i<10000;i++)
{
delete m_pointers[i];
m_pointers[i]=0;
}
}
... |
7bd62351cdbb08af992381008126daa4f9c193b8 | 8935ccc2fa7c2edd01b45ddefcb64f33c4424757 | vhirtham/GDL | /gdl/rendering/openGL/core/renderWindowGLFW.cpp | C++ | cpp | 4,692 | no_license | #include "gdl/rendering/openGL/core/renderWindowGLFW.h"
#include "gdl/base/exception.h"
#include "gdl/input/inputState.h"
#include "gdl/input/keyMappingGLFW.h"
#include "gdl/rendering/openGL/core/contextManagerGLFW.h"
#include "gdl/rendering/openGL/core/glewController.h"
namespace GDL::OpenGL
{
RenderWindowGLFW::... |
a1e3ef4429eedf02e163e0773b33adcd42ffefaa | cad1667edd9fa3f03123c399f96e4f40b82dff97 | tanacchi/rogue_game | /src/rogue_game/utility/point.cpp | C++ | cpp | 1,666 | permissive | #include <utility/point.hpp>
template<typename T>
Point<T>::Point(T x, T y)
: x_{x}, y_{y}
{
}
template<typename T>
Point<T>::Point(const Point<T>& point)
: x_{point.x_}
, y_{point.y_}
{
}
template<typename T>
Point<T>::Point(Point<T>&& point)
: x_{std::move(point.x_)}
, y_{std::move(point.y_)}
{
}
templa... |
28276a54be923e1a3b63ee6895c52d17f1481e17 | 689cfe183540dd78b2faa6856d0fddeb742f43e2 | shreyasoni15/Assignment-1 | /lab6_q4a.cpp | C++ | cpp | 718 | no_license | //WAP MINIMUM (By Value) with a function that takes two int parameters, finds the min, then returns the minimum. The program should ask the user for two numbers, then call the function with the numbers as arguments, and tell the user the minimum.
//library
# include <iostream>
using namespace std;
int min(int a, int ... |
b80a6b011ba5a11dbecbc8df27a4c7fa90355b7b | 46d7598c5fc464fa8b982105fc457797f5935d80 | asishcse60/Problem-Solving | /Tree/Unique Binary Search Trees II.cpp | C++ | cpp | 2,940 | no_license | /*
Complexity: //Catalan number (2n)! / (n+1)!n!
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
1 3 3 2 1
\ / / / \ \
3 2 ... |
871efeabd2a2e63f6f8b38289b23af341bb1c90f | c4944859e16c9ef465a00d4c81da2f6227a0a3b2 | hanshouqing85/wh6603_hpkj | /服务器组件/游戏服务器/ServiceUnits.cpp | C++ | cpp | 18,111 | no_license | #include "StdAfx.h"
#include "ServiceUnits.h"
#include "ControlPacket.h"
//////////////////////////////////////////////////////////////////////////////////
//静态变量
CServiceUnits * CServiceUnits::g_pServiceUnits=NULL; //对象指针
//////////////////////////////////////////////////////////////////////////////////
BEGIN_... |
e220930e88260753a97db5146261f619f12565e5 | ad9e20fb2a1cf30680f305144d2d21b16e34ef57 | chromium/chromium | /third_party/blink/renderer/modules/accessibility/ax_layout_object_test.cc | C++ | cc | 11,601 | permissive | // Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/accessibility/ax_layout_object.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/rendere... |
58fff443c70a3f01acde752acb0f0c49e570691b | a23beb44371f97a4d296eb5c50d7293ad825e748 | xman/universal | /tests/posit/32bit_posit.cpp | C++ | cpp | 2,065 | permissive | // 32bit_posit.cpp: Functionality tests for standard 32-bit posits
//
// Copyright (C) 2017 Stillwater Supercomputing, Inc.
//
// This file is part of the universal numbers project, which is released under an MIT Open Source license.
#include "stdafx.h"
#include <vector>
#include "../../posit/posit.hpp"
#include "..... |
5c94f623e556e3814fdf16c5d5a2726d8296af1c | 85010db095af969c57a47266ea66c1a287225f11 | analyticalmonk/hackerrank_30daysofcode | /cpp/day12_inheritance.cpp | C++ | cpp | 1,936 | no_license | #include <iostream>
#include <vector>
using namespace std;
class Person{
protected:
string firstName;
string lastName;
int id;
public:
Person(string firstName, string lastName, int identification){
this->firstName = firstName;
this->lastName = lastName;
this->id = identification;
}
void printPer... |
35d41c2891e087282d79e861ee7d1e9bde1d791c | 106d952368cd10c74f626e1228fbd554edbe7b28 | rhinton/hdlConvertor | /src/vhdlConvertor/subProgramDeclarationParser.cpp | C++ | cpp | 6,373 | permissive | #include <hdlConvertor/createObject.h>
#include <hdlConvertor/notImplementedLogger.h>
#include <hdlConvertor/vhdlConvertor/exprParser.h>
#include <hdlConvertor/vhdlConvertor/interfaceParser.h>
#include <hdlConvertor/vhdlConvertor/literalParser.h>
#include <hdlConvertor/vhdlConvertor/subProgramDeclarationParser.h>
#incl... |
7f4bc3929c9274223879db7ade0067ff6a9cf897 | eb39f2e10645ba1b8a8905cd3815469c78a9df16 | thededlier/git-training-session | /selection_sort.cpp | C++ | cpp | 471 | permissive | #include<iostream>
#define max 100;
using namespace std;
int main()
{
int a[max],len,min;
cout<<"Enter the no. of elements in array:";
cin>>len;
cout<<"\nEnter each element of the array:";
for(int i=0; i<len; ++i)
cin>>a[i];
for(i=0; i<len-1; i++){
min=i;
for(j=i+1; j<len; ++j)
if(a[j]<a[min])
min=j;... |
e23776cec6989fa6a545f7b70f3f53c1774dbd39 | 5c85d45c76f92cacfdb75ac56e8e190a4eb08912 | DodgeeSoftware/FMOD3.75Wrapper | /Stream/Stream2D.cpp | C++ | cpp | 9,995 | no_license | #include "Stream2D.h"
bool Stream2D::load(std::string filename)
{
this->pFMODSoundStream = FSOUND_Stream_Open(filename.c_str(), FSOUND_FORCEMONO, 0, 0);
if (this->pFMODSoundStream == 0)
{
// Send a message to the console
std::cout << "*******************************" << std::endl;
/... |
dbee704fa010933f318f232b09f1f195f04b3322 | 2f3bf2d3b0ba20f908d0f98f337e27120fe9f1c4 | monsterbasher/Multicraft | /Aurora/Aurora/Utils/GameManager.cpp | C++ | cpp | 1,190 | no_license | #include <Aurora/Utils/GameManager.h>
#include <Aurora/Utils/GameState.h>
#include <stdio.h>
#include <string.h>
namespace Aurora
{
namespace Utils
{
GameManager::GameManager()
{
m_running = true;
}
void GameManager::ChangeState(GameState* state)
{
// cleanup the current state
if ( !states.empty... |
99d98cfca474b2d0825e4e5d3109e30afae8444b | ab32d0ba92c2d5a9993a337f19005eedae86bad3 | therray/old-codes | /cf/Round #720/d/old/sol.cpp | C++ | cpp | 371 | no_license | // author: erray
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int T;
cin >> T;
while (T--) {
int n;
cin >> n;
vector<vector<int>> g(n);
for (int i = 1; i < n; ++i) {
int x, y;
cin >> x >> y;
--x, --y;
g[x].... |
02739b89124a2c958d711b0ec9fff8b3db86691d | f20294676e893e6acbe6264b9dba0bac960a16cf | liuqiker/magenta | /kernel/lib/userboot/userboot.cpp | C++ | cpp | 15,210 | permissive | // Copyright 2016 The Fuchsia Authors
//
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT
#include <assert.h>
#include <err.h>
#include <inttypes.h>
#include <kernel/cmdline.h>
#include <kernel/vm.h>
#include <kernel/vm/... |
25dfde38f6d0827bc559edafc0528bca4e60e418 | b361662aab096c1528e047ab3ea315468235f194 | gwgoliath/learnalljoyn | /alljoyn/alljoyn_core/unit_test/InterfaceTest.cc | C++ | cc | 20,732 | no_license | /******************************************************************************
* Copyright AllSeen Alliance. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and th... |
c2d19f748f739de3aa2619a80b2988716ff8eec6 | d41545e9d7f515b15fe87818d0d35c97cab76f12 | rahitkumar/VidyoPortal | /VidyoHA/clusterip/src/clusterip.cpp | C++ | cpp | 17,901 | no_license | ////////////////////////////////////////////////////////////////////////////////
// Filename: clusterip.cpp
// Description:
// Author: Eric Fernandez
// Date Created: 02-06-2012
// Modification History
// 02-06-2012 - Initial Coding (Eric)
/////////////////////////////////////////////////////////////////////////////... |
db2bfae4ddd905f23252ff66248188d255a38179 | ddffefa1e40ac973ae972e11b2bc02e50ca43c5d | masixian/RelayLive | /common/avformat/pes.cpp | C++ | cpp | 3,664 | no_license | #include "common.h"
#include "pes.h"
//#define SELF_DTS
static PESType pes_type(pes_header_t* pes)
{
if (pes->pes_start_code_prefix[0] == 0 && pes->pes_start_code_prefix[1] == 0 && pes->pes_start_code_prefix[2] == 1)
{
if (pes->stream_id == 0xC0)
{
return pes_audio;
... |
a820b1bb5bbeef3129956e42bcb179d4cbc3be64 | 97ceb0c8e5626d55e46c180cb021b6937f27bda8 | coder4hire/ChumbySuite | /VolumeControlDlg.cpp | C++ | cpp | 1,169 | no_license | #include "VolumeControlDlg.h"
#include "ui_VolumeControlDlg.h"
#include <QProcess>
#include <QDesktopWidget>
#include "HardwareLayer.h"
CVolumeControlDlg::CVolumeControlDlg(QWidget *parent) :
QDialog(parent,Qt::FramelessWindowHint | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint),
ui(new Ui::CVolumeControl... |
0dd07f4d3361423133e75acef9d36fab2c07cf0b | 5c075bb4ca03af502e013ddf2dcd48a0d4a125e1 | Robotics-Mark/riot-ros2 | /generated/std_msgs/rosidl_typesupport_introspection_cpp/byte_multi_array__type_support.cpp | C++ | cpp | 3,712 | no_license | // generated from rosidl_typesupport_introspection_cpp/resource/msg__type_support.cpp.em
// generated code does not contain a copyright notice
#ifndef __std_msgs__msg__byte_multi_array__type_support__h__
#define __std_msgs__msg__byte_multi_array__type_support__h__
// providing offsetof()
#include <cstddef>
#include <... |
eaaf0d2bf2b48d207a680fde99c486646df9abc4 | d5577059b2eb8ca2fffcaa94abf01891941d299b | seventeeen/algorithm | /baekjoon_online_judge/boj_11509_풍선맞추기.cpp | C++ | cpp | 430 | no_license | /*
* About
*
* Author: seventeeen@GitHub <powdragon1@gmail.com>
* Date : 2017-02-22
* URL : https://www.acmicpc.net/problem/11509
*
*/
#include<cstdio>
#include<iostream>
using namespace std;
int main(void) {
int N, x;
int arr[1000001] = { 0 };
cin >> N;
int cnt = 0;
for (int i = 0; i < N; i++) {
sc... |
687c8a66d7c6a5a0b930ec116da3fc236c4229ab | 9d331dd4efc9784fa898fd3fbc9b112c86d76a0c | weimingtom/rpg2kemuSvn | /new_file/Model.cpp | C++ | cpp | 9,301 | no_license | #include "Debug.hpp"
#include "Model.hpp"
#include "define/Define.hpp"
#include <stack>
#include <cctype>
#include <cstdio>
namespace rpg2kLib
{
namespace model
{
Base::Base(SystemString const& dir)
: fileDir_(dir), fileName_( defaultName() )
{
checkExists();
}
Base::Base(SystemString const& dir, Sys... |
2a7eee970c6d1cd9f6244c6fdcdc0a33deddb814 | 2866d16c05d4423a9aafd1e0c2a2c553eb2ceccb | BlitzModder/dava.engine | /Programs/ResourceArchiver/Classes/main.cpp | C++ | cpp | 1,423 | permissive | #include <DocDirSetup/DocDirSetup.h>
#include <Base/BaseTypes.h>
#include <Engine/Engine.h>
#include <Logger/Logger.h>
#include <Debug/DVAssertDefaultHandlers.h>
#include "CommandLineApplication.h"
#include "ArchivePackTool.h"
#include "ArchiveUnpackTool.h"
#include "ArchiveListTool.h"
int DAVAMain(DAVA::Vector<DAVA... |
f3cb295e27f44a7d29fb23e6b7108dca2d001d9f | 07755178fae6044ab3da15cf501e46c4ed742fa7 | taruvar-mittal/DSA-Solutions | /DP/largest sum subarray with of size atleast k - IMP.cpp | C++ | cpp | 1,281 | no_license | /*
gfg Largest Sum Subarray of Size at least K
ques:-
Given an array and a number k, find the largest sum of the subarray containing at least k numbers. It may be assumed that the size of array is at-least k.
Example 1:
Input :
n = 4
arr[] = {-4, -2, 1, -3}
k = 2
Output :
-1
Explanation :
The sub array is {-2, 1... |
1afd18ceee4941445531fc9027cbb8febd6d5a9f | 5431018ecef9dce218254e7a10af60fce410b7b7 | gnocuil/kea-1 | /src/bin/perfdhcp/tests/command_options_unittest.cc | C++ | cc | 35,159 | permissive | // Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDE... |
725502047e44a940f79a8f2561346c1fef646c20 | 969833a25b8534d6dd859559d1682639e0cc1d55 | hj3938/mapbox-gl-native | /platform/android/src/native_map_view.hpp | C++ | hpp | 9,485 | permissive | #pragma once
#include <mbgl/map/change.hpp>
#include <mbgl/map/camera.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/default_thread_pool.hpp>
#include <mbgl/util/run_loop.hpp>
#include <mbgl/storage/default_file_source.hpp>
#include <mbgl/storage/network_status.hpp>
#include... |
5b7daeca024fa438054b3eee4d463ee35c2a7f38 | 5ef8e1ecc65b700360a1bf50ca1af353a15925c6 | xiaominfc/TeamTalk | /server/src/db_proxy_server/business/MessageModel.cpp | C++ | cpp | 12,687 | permissive | /*================================================================
* Copyright (C) 2014 All rights reserved.
*
* 文件名称:MessageModel.cpp
* 创 建 者:Zhang Yuanhao
* 邮 箱:bluefoxah@gmail.com
* 创建日期:2014年12月15日
* 描 述:
*
================================================================*/
#include <map>
#incl... |
a530f059d9a3e7c805d0a2e56a9d0e947db2bbb2 | 6d664bfbef0015c6b38cd4b9f87bd772c7bc7fba | stianlik/dbmulticore | /src/hashjoin_omp.cpp | C++ | cpp | 2,305 | no_license | #include <omp.h>
#include "util.cpp"
#ifndef JOINVAR_LEFT
#define JOINVAR_LEFT key
#endif
#ifndef JOINVAR_RIGHT
#define JOINVAR_RIGHT key
#endif
#ifndef JOINOP
#define JOINOP ==
#endif
using namespace std;
void hashjoin_omp(
row16_t *left, int leftLength,
row16_t *right, int rightLength,
row32_t *result, int... |
97476639edb1d51d62c11f0aaeb4695fbcd02e0a | c96acca09c89d20b7af5ab92db8b655fcea462b9 | stanleywxc/chromium-noupdator | /src/chrome/test/payments/payment_request_test_controller_android.cc | C++ | cc | 3,975 | permissive | // Copyright 2019 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/test/payments/payment_request_test_controller.h"
#include "base/bind.h"
#include "chrome/browser/android/background_task_scheduler/chrom... |
b883202934efe57826401888894c5c53f9f7ec89 | 795e60e07bd5c0aa0254e7ff1d4ad160cb24fc6c | wangyoucao577/libosmium | /include/osmium/io/compression.hpp | C++ | hpp | 12,324 | permissive | #ifndef OSMIUM_IO_COMPRESSION_HPP
#define OSMIUM_IO_COMPRESSION_HPP
/*
This file is part of Osmium (https://osmcode.org/libosmium).
Copyright 2013-2020 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to an... |
2bd780a4c4e81c067d08f3ef7ef8ce08d96cfa8d | 57b78288a7125efb54345efd49a85639517f7065 | swipswaps/xatlas-web | /extra/viewer_model.cpp | C++ | cpp | 40,788 | permissive | /*
MIT License
Copyright (c) 2018-2020 Jonathan Young
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, pub... |
b9fcfb991d089560bdaf3ef018192612e84c2fc7 | d1e448746a30b8016938205404fe986c757fc012 | whytui/code4cpp | /ch01/math.cpp | C++ | cpp | 512 | no_license | /*
* 作者:刘时明
* 时间:2020/6/13-0:55
* 作用:
*/
#include "ch01.h"
/**
* 基本数学函数
*/
void math_demo()
{
printf("%lf\n", sqrt(PI));
printf("%lf\n", sin(PI));
printf("%lf\n", cos(PI));
cout << "圆周率=" << M_PI << endl;
cout << "向上取整=" << ceil(PI) << endl;
cout << "向下取整=" << floor(PI) << endl;
doubl... |
e04b28fac1ae62872f9b5f09f71245924edb2df0 | a3d3d12bc0dc224184801708ec5158a086ba0c55 | amosbird/ccutils | /ccutils/Stopwatch.hpp | C++ | hpp | 1,828 | no_license | #pragma once
#include <atomic>
#include <chrono>
template <typename TClock>
class BasicStopwatch {
public:
using Clock = TClock;
using TimePoint = typename Clock::time_point;
using Duration = typename Clock::duration;
using TickType = typename Duration::rep;
class ticker {
public:
tic... |
64545166e8556d83218bc328b6d4d186cebb9952 | 7648d56d27ba5de34d3c756dd3bb3173a6afa291 | cmiyachi/CygWinAlgorithms | /Leetcode/kMergeLists.cpp | C++ | cpp | 3,664 | no_license | #include <bits/stdc++.h>
using namespace std;
struct ListNode* mergeKSortedLists(vector<ListNode*> arr, int k) ;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
/*
from Queue import PriorityQueue
class Solution(object):
def mergeKLists(self, lists):
... |
0dfe5c2e91107b0937d3d8cb2fabd10e81d54eec | 705304d18c866fa5426bdfaa03c92a3ff06e219a | kmsbusch/CSCI-1300-Projects | /Entire C9 Workspace/Hmwk5/getDigitCount.cpp | C++ | cpp | 1,193 | no_license | // CS1300 Spring 2019
// Author: Kevin Busch
// Recitation: 301 – Thanika Reddy
// Cloud9 Workspace Editor Link: https://csci1300-kevinbusch.c9users.io
// Homework 5 - Problem #1
#include <iostream>
#include <string>
using namespace std;
/*
Algorithm: For each value in the string, check if it's ascii value is between ... |
28aefde9ac06cb50eaa7b27d91819529f8cb8411 | d5d7ff3baf96dfeae77565b3ee2af7e319b9216f | EC132-8-Queens-Game/8QueenGame | /GAME/Source.cpp | C++ | cpp | 10,787 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <ctype.h>
#include <iostream>
#include <windows.h>
// Const.
#define BOARD_SIZE 8
#define BACK 3
#define QUEEN 'Q'
#define POS_SAFE 0
#define D_NOT_SAFE 3
#define R_NOT_SAFE 1
#define COL_NOT_SAFE 2
// Gglobal Variables
char queen_board[BOARD_SIZE]... |
bbd10513af84e175d6c138fcd5a6074a619fe89c | 2f3bdbb0a3043a4941d4a34495955c9fc133e466 | 1119-2916/competitive-programming | /codeforces/454/a.cpp | C++ | cpp | 1,482 | no_license | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb ... |
e74693d5a3ba1d288406917092c5cadb38c4b0b9 | 0933e303295ce6b21571a3e7b22a408982c447f2 | jjkke88/incubator-tvm | /src/te/operation/extern_op.cc | C++ | cc | 6,210 | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
3190ef778646d0e2c1deef3ccc6b86bdbb1c6177 | 621a2e5da3b156e17afe9821458738830be093e4 | horance-liu/Sprout | /sprout/range/algorithm/binary_search.hpp | C++ | hpp | 1,399 | permissive | /*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2017 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version ... |
986ff339dd2d6268cc03cdd9c16dbd48e7575936 | e4b25f93212fb2b8186e942e8750f1e1cc2378c8 | phella/semaphores-counter | /sem_process.cpp | C++ | cpp | 1,741 | no_license | #include <sys/types.h>
#include <stdio.h>
#include <iostream>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>
#include <sys/sem.h>
union semun {
int val;
struct semid_ds *buf;
ushort *array;
struct seminfo *__buf;
void *__pad;
};
void down(int sem)
{
struct sem... |
a10c9b8117b6e4ee1296d5cdef2236e9d0d895d7 | dac128097267078bc911ae8d2d71bc6d4b524574 | johansavfalt/NeuralNetworkC | /src/main.cpp | C++ | cpp | 1,539 | no_license | #include <iostream>
#include "Matrix.hpp"
#include "Data.hpp"
#include "NeuralLayer.hpp"
#include "Activation/Relu.hpp"
#include "Activation/Sigmoid.hpp"
#include "Training.hpp"
Matrix getTestSet(){
Matrix testSet(4, 1);
testSet.setData(0, 0, 1.0);
testSet.setData(1, 0, 1.0);
testSet.setData(2, 0, 0.0... |
9431320d87a33ab2f7c7be562b636b7e1c9b1962 | 55ff02611d520a848c95d201afb87d4e7bd97d98 | apple-oss-distributions/clang | /src/tools/clang/tools/clang-service/lib/Core/Service.cpp | C++ | cpp | 48,604 | permissive | #include "clang-service/Messaging.h"
#include "clang-service/Service.h"
#include "clang-service/SafeLibclang.h"
#include "clang-service/Support/ValueUtils.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/raw_os_ostream.h"
#include <condition_variable>
#include <fstrea... |
5ca3ad76101fdb2d5f1bbc3d8e37e0e74628f571 | 5312c3ece14156937c89d8f2ba92e6e265418349 | romainfrancois/arrow | /cpp/src/arrow/array/array_primitive.cc | C++ | cc | 5,370 | permissive | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
0863c260389c9bc7f430f980c442033ab2bd72b3 | d2524d61118bae429f9f5f45828de7c354af5f0b | madtrapper/MyBase | /fctbase/platform_thread.cc | C++ | cc | 2,107 | no_license | #include "stdafx.h"
#include "platform_thread.h"
namespace base{
namespace {
// The information on how to set the thread name comes from
// a MSDN article: http://msdn2.microsoft.com/en-us/library/xcb2z8hs.aspx
const DWORD kVCThreadNameException = 0x406D1388;
typedef struct tagTHREADNAME_INFO {
DWORD dwType;... |
9ab6e559bec5e3a21c272fbfbf71eb29c8395cad | 06291933491a6ae0578d039bfcb34990756380ee | touyou/CompetitiveProgramming | /pku/3368.cpp | C++ | cpp | 1,748 | no_license | #include <cstdio>
#include <climits>
#include <algorithm>
using namespace std;
const int MAX_N=200000;
int n, ni, q, dat[2*MAX_N-1];
int a[MAX_N];
int x[MAX_N], sum[MAX_N];
void init(int n_) {
n=1;
while (n<n_) n*=2;
for (int i=0; i<2*n-1; i++) dat[i]=INT_MIN;
}
void update(int k, int a) {
k += n-1;
... |
801b0375b15e6eb0aa74eb335d2b199eeb8c0885 | 42878c053ed3c47bce065a41267d845a43fcbf94 | MaxJTRice/CSE_100_Data_Structure | /CSE100_projects/proj2/RST.hpp | C++ | hpp | 6,307 | no_license | #ifndef RST_HPP
#define RST_HPP
#include "BST.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
template <typename Data>
class RST : public BST<Data> {
public:
/* Insert new data into the RST if it is not already present.
* Input
* item - the data to i... |
bc00758e9be81d9dd911db43d7bc9f5e7c2f7d25 | 5eff97be11ff4c59a63a221e5c6112b57fe950cd | RussellJerome/DeepRockGalacticSDK | /SDK/FSD_STE_Dash_parameters.hpp | C++ | hpp | 356 | no_license | #pragma once
// DeepRockGalactic SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "FSD_STE_Dash_classes.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
}
#ifdef... |
393062d27432c0fdbdb86b1694fee34c7dcfdd17 | 982bae748d97c7e2add2e469e347c86e759a43ea | nadavcohe/job_interview_questions | /mergeN_2N.cpp | C++ | cpp | 983 | no_license | void merge_array (int small[],int large[],int n){
if (small == NULL || large == NULL || n<1){
cerr << "error";
return;
}
//i will start by from the end, and will merege the array;
int *itr_insert = large+2*n-1;
int *itr_large = large+n-1;
int *itr_small = small+n-1;
// i need... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.