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 |
|---|---|---|---|---|---|---|---|---|
d3e3042ecf26886ec564efbd737419d7d6609992 | 4b1b75343c4c21c65ce1df070bb7dda283695cbf | mschwartz/SilkJS-cURL | /src/curl.cpp | C++ | cpp | 17,183 | no_license | /**
* @module builtin/curl
*
* ### Synopsis
* SilkJS builtin curl object.
*
* ### Description
* The builtin/curl object provides an interface to the curl library.
*
* ### Usage
* var curl = require('builtin/curl');
*
* ### See Also
* The JavaScriptimplementation of a more robust console object:
* modu... |
a85ebca7c220cc908b0ef57c30d1558f1daf9e5c | 0ca9d79c4815a7ddf390dff5cb3d6713f18afe83 | freebsd/kyua | /utils/sqlite/c_gate.hpp | C++ | hpp | 2,739 | permissive | // Copyright 2011 The Kyua Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditio... |
5cd77c1ea37cea5e76f13eb7201660d1961b77a3 | 2b1244b3ed8c7d11490cf21fe0008f5b0ab62a29 | brparis/cs124 | /problemSets/pset1/fibonacci.cc | C++ | cc | 6,893 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <stdint.h>
#include <vector>
#include <cmath>
//fib1
int fib1(int n) {
if (n == 0) {
return 0;
}
else if (n == 1) {
return 1;
}
else {
return (fib1(n-1)% 65536+fib1(n-2)% 65536)% 65536;
... |
eb898767a349346e1173b6b3374dcbce8e5214f7 | f513ec3cd715489ec81af5eb3e2516d3fb06cc2b | kyhhdm/TPlatform | /mapreduce2/src/worker/MapTask.hpp | C++ | hpp | 905 | no_license | /**
* @file MapTask.hpp
* Class MapTask.
*
* @author Fan Kai(fk), Peking University
* @date 12/08/2007 06:18:27 PM CST
*
*/
#ifndef MAPTASK_FILE_HEADER_INC
#define MAPTASK_FILE_HEADER_INC
#include "Worker.hpp"
#include "common/IceGenerated.hpp"
#include <string>
#include <IceUtil/Thread.h>
namespa... |
ec53d8d10888be73859e39d7e798be07a7986a20 | d57cd8ab0fb03ca89c3101d633c4ed6cf91f5abd | warlock20/shg | /tools/ksone.cc | C++ | cc | 1,075 | permissive | /* ksone.cc: results for test_ks in testing/mstat.cc */
/*
* Output:
*
* 1.08037435377046e-02 9.73012808686660e-01
* 6.52407728998911e-02 7.35239129875459e-08
*/
#include <iomanip>
#include <iostream>
#include "nr/nr3.h"
#include "nr/sort.h"
#include "nr/ksdist.h"
#include "nr/kstests.h"
#include "nr/erf.h"
... |
172772d81ed2ae95e7fb27f42842c7f3777aa921 | a343c2e0a128771531c1015a13993e09982c381f | VictorFromChoback/Earley-s-Broadcasts | /Grammar.cpp | C++ | cpp | 2,740 | no_license | #include "Grammar.h"
#include <stdexcept>
#include <algorithm>
std::istream& operator>>(std::istream& in, ContextFreeRule& rule) {
std::string input_string;
getline(in, input_string);
if (input_string.size() <= 4) {
throw std::runtime_error("bad_grammar_input");
}
if (!ContextFr... |
345642a087829a22ecebf4cb1d566e462de293d3 | d3672ffa7f0667ab1e4713a75a61e4f402971852 | Makmanfu/CppNote | /project/Qt5Play/src/QTPlayer.cpp | C++ | cpp | 10,014 | no_license |
#include "stdafx.h"
#include "QTPlayer.h"
#include "DisplayMediaTimer.h"
#include "ImageFilter.h"
#include "Media.h"
#include "ReadPacketsThread.h"
static bool isPressSlider = false;
static bool isPlay = false;
QTPlayer::QTPlayer(QWidget* parent) : QWidget(parent)
{
ui.setupUi(this);
QObject::connect(Displ... |
15a1728e4c68a802e3fa9aa30ad544816d879256 | 1116e371e4fc80f444ffe78175c0d9d5e144a9cb | shopglobal/v8 | /src/compiler/instruction-selector.cc | C++ | cc | 104,025 | permissive | // Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/instruction-selector.h"
#include <limits>
#include "src/assembler-inl.h"
#include "src/base/adapters.h"
#include "src/compiler/... |
88709f6b49067ae70b73a90aa0a7b89e3841d587 | e76847d1eb54c1549cb4e1f9f850b23b80cd43be | darren646/AppsSetup | /AppsSetup/stdafx.cpp | C++ | cpp | 267 | no_license | // stdafx.cpp : 只包括标准包含文件的源文件
// AppsSetup.pch 将作为预编译头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"
// TODO: 在 STDAFX.H 中
// 引用任何所需的附加头文件,而不是在此文件中引用
|
b5249657f62cc3b6998dd33f1dd69563c2c2ab76 | e23b4e37fb25873c55945ee46dc66756c7b9c322 | nickpeterb/MusicStoreProject | /utils/bmsearch.cpp | C++ | cpp | 1,483 | no_license | #include "bmsearch.hpp"
//Implementation of Boyer Moore Search
//get the maximum of 2 integers, utility function
int BmSearch::max(int a, int b) { return (a > b) ? a : b; }
//preprocessing function
void BmSearch::badCharHeuristic(string pat, int patternLength, int badchar[NO_OF_CHARS]) {
for (int i = 0; i < NO_OF_CH... |
166162cbfa8957a70d090ffe24abb27e0bc6e159 | 52c5f58c898dac6a644e6306ac177246fca2a1e6 | stomachacheGE/leetcode | /61.旋转链表.cpp | C++ | cpp | 2,351 | no_license | /*
* @lc app=leetcode.cn id=61 lang=cpp
*
* [61] 旋转链表
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* rotateRight1(ListNode* head, int k) {
... |
2f7d73c251abac8aaa9b32b0ee8fb351abfe9868 | a060e2a2b152ab31b7423d4fb11c546178ee3682 | herculas/StdChain | /src/core/script/script_witness.cpp | C++ | cpp | 575 | permissive | #include "core/script/script_witness.h"
#include "util/encode/string_encoding.h"
ScriptWitness::ScriptWitness() = default;
void ScriptWitness::setNull() {
this->stack.clear();
this->stack.shrink_to_fit();
}
bool ScriptWitness::isNull() const {
return this->stack.empty();
}
std::string ScriptWitness::toS... |
55a2513dd256a8c83d60048ab35e7431e6d5cd6b | aacd28a0dea7634e2e7362263e5cef842d9fa71f | hdfeos/kafka-to-nexus | /src/tests/UnitTests.cpp | C++ | cpp | 574 | permissive | #include <gtest/gtest.h>
#include <trompeloeil.hpp>
namespace trompeloeil {
template <>
void reporter<specialized>::send(severity s, char const *file,
unsigned long line, const char *msg) {
if (s == severity::fatal) {
std::ostringstream os;
if (line != 0U) {
os << file ... |
a79663e690cc25ef5720f95ecff2d2ed2fcf19e9 | ce7c98a852ccfe9097a5d246de08dc3e287abc76 | Vaa3D/vaa3d_tools | /released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/ext/boost/log/utility/explicit_operator_bool.hpp | C++ | hpp | 1,490 | permissive | /*
* Copyright Andrey Semashev 2007 - 2013.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file explicit_operator_bool.hpp
* \author Andrey Semashev
* \date 08.03.2009
*
... |
10c17e00e987eb1a531af6c230107a1949849c02 | c23f1ebca0c2585253ef12b0b4eb02071202d3da | allenck/DecoderPro_app | /appslib/namedbeanusagereport.cpp | C++ | cpp | 1,674 | no_license | #include "namedbeanusagereport.h"
#include "namedbean.h"
/**
* This is a data structure to pass usage information from getUsageReport() requests
* back to the calling object.
*
* @author Dave Sand Copyright (C) 2020
*/
//@javax.annotation.concurrent.Immutable
///*public*/ class NamedBeanUsageReport {
/**
* Cre... |
baf6a43c824bd04df936c3bf1c424396c5778f57 | 4bbec91a9b8f5b09e9495aff78a24b90b4ad7767 | lmark1/aoc2019 | /day04.cpp | C++ | cpp | 2,226 | no_license | #include <iostream>
using namespace std;
bool isNumber(int number)
{
int divisor = 100000;
int lastDigit = -1;
bool digitsRepeat = false;
//cout << "Checking number: " << number << endl;
while (divisor > 0)
{
int digit = number / divisor;
//cout << "Current digit: " << digit <<... |
5152a10e3b82cb778ae916069456585114d86315 | 520e1a68b5a4a1d967041fdb2060eb8ae7aaa425 | vmgray/HMolPol | /include/HMolPolEventGenericDetectorHit.hh | C++ | hh | 1,814 | no_license | /********************************************
* \author <b>Programmer:<\b> Valerie Gray
* \author <b>Assisted By:<\b> Wouter Deconinck
*
* \brief <b>Purpose:</b> This is header file for the
* HMolPolEventGenericDetectorHit class.
*
* Sets up the variable for the ROOT tree
*
* \date <b>Date:</b> 07-19... |
e638452c853b1daa39f8bca9c7cae5ce2aee53f5 | 0866dd5723e76a2f67d5f182eea106c3e537fdf8 | DamieFC/chromium | /ash/shelf/shelf_view_unittest.cc | C++ | cc | 124,908 | 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 "ash/shelf/shelf_view.h"
#include <algorithm>
#include <cmath>
#include <memory>
#include <utility>
#include <vector>
#include "ash/accessi... |
ab83ebd9586725ebabe447168f9600be6e18d781 | 2d88f1c7d933494515b327fdeb3d4b5c78256404 | cpkt9762/SCUM-SDK | /SDK/SCUM_Santa_Glove_classes.hpp | C++ | hpp | 652 | no_license | #pragma once
// SCUM (0.1.17.8320) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SCUM_Santa_Glove_structs.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// Blu... |
cc49c17b0e395f7a042cf2257738d557c37d1496 | 120ad1a900b644b371de7d91c86b8aeb4e6e46b8 | sebakri/cppgraphqlgen | /GraphQLService.cpp | C++ | cpp | 46,136 | permissive | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "GraphQLGrammar.h"
#include <graphqlservice/GraphQLService.h>
#include <iostream>
#include <algorithm>
#include <array>
#include <stack>
namespace facebook {
namespace graphql {
namespace service {
schema_excep... |
2b3dfbf45d7106af8f0e25bddd05032ba7b04a9d | c96f6ecd632c790fe62004630fc39af4533158f4 | mhochsteger/blaze | /blazetest/src/mathtest/dmatsmatkron/DDaLCa.cpp | C++ | cpp | 4,275 | permissive | //=================================================================================================
/*!
// \file src/mathtest/dmatsmatkron/DDaLCa.cpp
// \brief Source file for the DDaLCa dense matrix/sparse matrix Kronecker product math test
//
// Copyright (C) 2012-2019 Klaus Iglberger - All Rights Reserved
//
// ... |
38cf9163d2f0fe521db7300d3764e549a4aa2ed2 | ca8edc4771ec76e416bbada05cfc8edbc2b24725 | yo1990/opencv | /modules/core/src/matrix_operations.cpp | C++ | cpp | 38,155 | permissive | // This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html
#include "precomp.hpp"
#include "opencv2/core/mat.hpp"
#include "opencv2/core/types_c.h"
#include "opencl_kernels_core.hpp"
#... |
02f7e22abf196e69995c6e1748aabcb52efc5600 | 01ad656d9927ea2355ea527b7189b893916af66b | algebrato/Met_Computazionali | /Lez7_m/C++/inizializzazione.cpp | C++ | cpp | 229 | no_license | typedef unsigned int UI;
class Veicolo {
private:
UI n_ruote_;
public:
Veicolo() {};
Veicolo(UI n) : n_ruote_(n) {};
};
class Bici : public Veicolo {
public:
Bici() : Veicolo(2) {};
};
int main() {
Bici b;
}
|
5a3274a98ad95afec870cb106949ce473ea5de02 | 3ece35503f2d093a5150a4503ffdd9f8783c78f8 | thegouldfish/f2bgl | /decoder.cpp | C++ | cpp | 1,327 | no_license | /*
* Fade To Black engine rewrite
* Copyright (C) 2006-2012 Gregory Montoir (cyx@users.sourceforge.net)
*/
#include "decoder.h"
void decodeLZSS(const uint8_t *src, uint8_t *dst, int decodedSize) {
while (decodedSize > 0) {
const int code = *src++;
for (int bit = 0; bit < 8 && decodedSize > 0; ++bit) {
if (... |
47f89fd96a5e30665632e4b3b1eeef38695f973b | 1dcd1b1607cfaec6870fac9ffbe89887ba2757da | ItayGal2/sage-graphics | /app/svc/src/SVC_control.cpp | C++ | cpp | 6,793 | no_license | /******************************************************************************
* SAGE - Scalable Adaptive Graphics Environment
*
* Copyright (C) 2004 Electronic Visualization Laboratory,
* University of Illinois at Chicago
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or ... |
85193c7dbfde57e81a5f17a887bfaec77d70c6c4 | bdc785222ad3c46f6f1f99b4c487e3a2e30787f5 | panda3d/panda3d | /panda/src/express/memoryUsage.cxx | C++ | cxx | 34,512 | permissive | /**
* 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 have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file memoryUsage.cxx
* @aut... |
ff5053ee87a9e38a6e207ecdb869c8cd5dcbf750 | e67eb51ccd4a4cc7c034c44478d7f73e39aebdea | Igronemyk/OI | /LuoGu/p3385.cpp | C++ | cpp | 1,343 | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
template<typename T>
T read() {
T result = 0;int f = 1;char c = getchar();
while(c > '9' || c < '0') {if(c == '-') f *= -1;c = getchar();}
while(c <= '9' && c >= '0') {result = result * 10 + c - '0';c = getchar();}
return r... |
6139982be8d5e897aa10dc41bfdc3acfb644a626 | 8ed2df9a1802cb1f859c497242e1b748c798db76 | alexandraback/datacollection | /solutions_5751500831719424_1/C++/csy0wuk1/easy.cpp | C++ | cpp | 1,435 | no_license | #include <algorithm>
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
const int MAXN = 100 + 10;
ifstream input;
ofstream output;
int N;
string s[MAXN];
string tar;
void Read()
{
input >> N;
for (int i=0; i<N; i++)
{
input >> s[i];
}
}
int Count[MAXN][MA... |
34eece2ab9dd05e720b2ba95fb4b75323fdd1b6c | 81c0edac1f5029c5b266873531c13ec6cfd261eb | jeongjoonyoo/amd_pal | /src/core/hw/gfxip/computeCmdBuffer.cpp | C++ | cpp | 10,694 | permissive | /*
***********************************************************************************************************************
*
* Copyright (c) 2015-2019 Advanced Micro Devices, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associ... |
9a39b4337384c8fcdcebc55bf3f1eeda9bc50b93 | fe62c879294179c08b15a472e5d5ae1d2eaf7c63 | ltang15/CS32_Winter | /HW2/eval.cpp | C++ | cpp | 7,328 | no_license | #include <iostream>
#include <string>
#include <stack>
#include <cassert>
using namespace std;
int precedent(char ch);
bool checkInfix(const string& infix);
bool infixToPostfix(string input_infix, string& postfix);
int evaluate(string infix, const bool values[], string& postfix, bool& result)
{
... |
9d12f0ecfdaa8c591a007c1be7e49a31a60a1322 | 1a817d94766d0af3babcd387589bbd2d90564b26 | Venkatesh0625/Pixel-crush | /traverse.cpp | C++ | cpp | 1,422 | no_license | #include<iostream>
#include<string.h>
#include<iomanip>
using namespace std;
int sum=0;
char str[256][15];
int traverse(struct node *root,int z)
{
//Static variables are used because during recursion value should not be changed
static int a[15],k=0,f=0;
char tmp[15]; //l=... |
f8772763c625b2e61ffcf8c406cfb22395095c7b | 600d0a194a97b003581812715071664a3484a28c | CrazyNoob001/ProjektPO | /main.cpp | C++ | cpp | 2,218 | no_license | #include "mainwindow.hh"
#include <QApplication>
#include "databus.hh"
#include "tempsensor.hh"
#include "controller.hh"
#include "humiditysensor.hh"
#include "initcommand.hh"
#include "statuscommand.hh"
#include "measurecommand.hh"
#include "windsensor.hh"
#include "rainsensor.hh"
#include "pressuresensor.h... |
d7372b04d41a7538a7ef69537c442e66e4d3287c | 48087ec42942e1b75bfe55978aee62fd5e9e0a4f | stwe/SgOgl | /SgOglLib/src/SgOglLib/input/MousePicker.cpp | C++ | cpp | 7,604 | no_license | // This file is part of the SgOgl package.
//
// Filename: MousePicker.cpp
// Author: stwe
//
// License: MIT
//
// 2019 (c) stwe <https://github.com/stwe/SgOgl>
#include <glm/gtc/matrix_transform.hpp>
#include "MousePicker.h"
#include "Core.h"
#include "Application.h"
#include "Window.h"
#include "camera/Camera... |
f0287e1ce812710e481755a74b009bd0fdd744a6 | 05a667264afd89a66276065366d4c8a23f6fe3a1 | syyprime/Trebuchet | /mainwindow.cpp | C++ | cpp | 7,863 | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include "openglwidget.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
templateWidth=64;
templateHeight=64;
sum = 0;
nbCible = 10;
level = 0;
reset = false;
capFlag = false;
followFla... |
01b6bbb843f7c6271d40a7d339e208d60486f421 | 9bb22b40e17c7ba17ddab3ee2cb8cdd34a0a34cf | Bocity/ACM | /vjudge/HYSBZ/4805/15811194_WA_0ms_0kB.cpp | C++ | cpp | 1,628 | no_license | #include <bits/stdc++.h>
#define REP(i, x, n) for (int i = (x); i < (n); ++i)
#define PER(i, x, n) for (int i = (n) -1; i >= x; --i)
#define endl "\n"
#define DE puts("----------")
#define CASE(i, ans) cout << "Case #" << (i) << ": " << (ans) << "\n"
#define lowbit(x) ((x) & (-(x)))
#define sqr(x) ((x) * (x))
#define e... |
6d5b04a0ba26df0f6b0ea4a6c524539a5b2060af | 628a07bc37e4523b3b544dabec83dfd797aa4bcd | xyh-cosmo/GMAT | /src/gui/solarsys/BarycenterPanel.cpp | C++ | cpp | 12,887 | permissive | //$Id$
//------------------------------------------------------------------------------
// BarycenterPanel
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
//
// Copyright (c) 2002 - 2015 United States Governme... |
5a6c70428ed96042e35b5e38c6c3c51f907eaf0f | 760618c884332c9181ed9d99ea143a24855eec98 | searhein/Albany | /src/LandIce/evaluators/LandIce_StokesFOSynteticTestBC_Def.hpp | C++ | hpp | 12,534 | permissive | //*****************************************************************//
// Albany 2.0: Copyright 2012 Sandia Corporation //
// This Software is released under the BSD license detailed //
// in the file "license.txt" in the top-level Albany directory //
//**************************************... |
81e25f7b5ea51458a643a578887ceb8e83eabfc9 | bcc57407259eea3ccc88b212899ed029e7e8f06c | ZeroPyrozen/Competitive-Programming | /Scheduler.cpp | C++ | cpp | 6,174 | no_license | #include<string.h>
#include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;
struct Subject
{
char subjectName[100];
struct Subject *next,*prev;
}*start=NULL,*end=NULL;
struct Schedule
{
char dayName[10];
bool hasList ;
struct Subject *start,*end;
struct Schedule *next,*prev;
}*head=NULL,*tail=N... |
08137b0ea997cea48d3ea08f042864810795dd7b | ec071a670d0ada364506fd013475a685c0b4f4ca | seohojinn/BOJ_Solving | /11866/11866/main.cpp | C++ | cpp | 1,220 | no_license | #include <iostream>
#include <vector>
using namespace std;
class Node{
public:
int data;
Node * right;
Node * left;
Node(){
data = 0;
right = NULL;
left = NULL;
}
};
int main() {
Node arr[1000];
Node * tmp;
vector<int> v... |
548701bcc6a4575b07feadfc60ec8751de6e7bab | 9b8f3c53e506098455d5b9d6812e735ef1fdad1b | AlexAUT/Kroniax_Cpp | /include/modules/stateMachine.hpp | C++ | hpp | 703 | permissive | #ifndef AWSTATEMACHINE_HPP
#define AWSTATEMACHINE_HPP
#include <map>
#include <memory>
#include "states/state.hpp"
//Forward declaration
namespace sf
{
class Time;
class RenderWindow;
}
namespace aw
{
class StateMachine
{
public:
StateMachine();
void update(const sf::Time &frameTime);
void render(sf::Re... |
15202abbce49b9aa94d2b2373b5a61db178802dc | 6e41e665108a0e1396f50edfd55ea1e9c4be52e3 | EmanAllam/SPOT-FRAMEWORK | /SPOT/ITM_Img_list_field.cpp | C++ | cpp | 3,100 | no_license | #include "ITM_Img_list_field.h"
#include "GUI/CMUgraphicsLib\CMUgraphics.h"
#include "DEFs.h"
#include <iostream>
using namespace std;
ITM_Img_list_field::ITM_Img_list_field(window* pWind, string filePath, MAJORS major_flag, int topLeftX, int topLeftY):ViewField(pWind)
{
setWidtheHeightDefualt();
this->imgFilePath =... |
dea74c779c516e8a144209660ea5ef50c5faaf33 | 3aa204030c5928ef81c0b653ba4bc629ae8d084c | flex3r/cg_exercises | /cg_exercises-cg_exercise_03/cg_exercise_03/cglib/lib/glm/glm/gtc/reciprocal.hpp | C++ | hpp | 3,665 | permissive | /// @ref gtc_reciprocal
/// @file glm/gtc/reciprocal.hpp
///
/// @see core (dependence)
///
/// @defgroup gtc_reciprocal GLM_GTC_reciprocal
/// @ingroup gtc
///
/// @brief Define secant, cosecant and cotangent functions.
///
/// <glm/gtc/reciprocal.hpp> need to be included to use these features.
#pragma on... |
1c73377c1eac83c342a9cb847a6352976199f990 | ff2efa7464dd52d42aa3db151cd6ef3f48136860 | danlucian/csie-datastructures | /avl/Source.cpp | C++ | cpp | 4,565 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Client
{
unsigned int id;
char* name;
float budget;
int duration;
float cost;
};
struct Node
{
Client info;
int BF;
Node* left;
Node* right;
};
struct StackNode
{
Client info;
StackNode* next;
};
StackNode... |
6f9155d2bae8e54991705d297e821f4ce395a6bd | af1e50a412a6cfa87631a6c6b0e47d413355094a | wzyy2/chromium-browser | /android_webview/browser/command_line_helper.cc | C++ | cc | 2,360 | permissive | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "android_webview/browser/command_line_helper.h"
#include <vector>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/... |
e24566e68937d0a3ab233f79e0257bccf76801a5 | ec9ebca480bc3863fdf233bab7d842d0c2d2da24 | aalexandramus/University | /Proiect2poo/StudyGroup.cpp | C++ | cpp | 651 | no_license | #include "pch.h"
#include "StudyGroup.h"
StudyGroup::StudyGroup(int group, std::vector<Discipline*> Disciplines)
{
mGroup = group;
mDisciplines = Disciplines;
}
void StudyGroup::setGroup(int group)
{
mGroup = group;
}
int StudyGroup::getGroup()
{
return mGroup;
}
std::vector<Discipline*> Stud... |
764a6547f4682795a1f3f760df95ef83a0670c1e | d146ea73766bfcfa8e2936832179ecc6caaa9299 | realfirst/ffcpp | /void.cc | C++ | cc | 237 | no_license | #include <iostream>
void printSmallerSquares(int x) {
int y;
for (y = 0; y * y <= x; y++) {
std::cout << y * y << ' ' ;
}
std::cout << std::endl;
}
int main(int argc, char **argv) {
printSmallerSquares(17);
return 0;
}
|
e9ba6c7158f73243714ade4fd6ddbf4c8741c590 | 744b24b593e5b534026a6c2cd6866fd4a715a5c9 | robbinfan/vespa | /storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp | C++ | cpp | 6,397 | permissive | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "idealstateoperation.h"
#include <vespa/storage/distributor/idealstatemanager.h>
#include <vespa/storage/distributor/pendingmessagetracker.h>
#include <vespa/storage/distributor/idealstatemetricsset.h>
#inc... |
a8095746e52c1cc09f7e7973be0aab716e129f26 | be395616c40fb6d12351c93fc25e88f65d0f6d7a | smtdbd/c-primer-5th | /Chapter 3/practice_3_20.cpp | C++ | cpp | 720 | no_license | /* 练习3.20
* 读入一组整数并把他们存入一个vector对象,将没对相邻整数的和输出出来。
* 改写你的程序,这次要求先输出第一个和最后一个元素的和,接着输出第二个和倒数第二个元素的和,以此类推。
*/
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
int tmp;
while (cin >> tmp)
v.push_back(tmp);
auto iter1 = v.begin();
auto iter2 = iter1 + 1;
while (v.end() - i... |
8fac4cb6326bec9c021c5b4c96a2bff7eec2f493 | 984250385105b84e6fa7dc49defdf0f27588cd27 | digint/openmptl-reg-arm-cortex | /arm/cortex/Freescale/MKV44F16/include/arch/reg/lptmr0.hpp | C++ | hpp | 3,090 | no_license | /*
* OpenMPTL - C++ Microprocessor Template Library
*
* This program is a derivative representation of a CMSIS System View
* Description (SVD) file, and is subject to the corresponding license
* (see "Freescale CMSIS-SVD License Agreement.pdf" in the parent directory).
*
* This program is distributed in the hope... |
b15d68c43b47412312295e5d32b1600a03b03d61 | 5c4827f5970a1827ba8b29e9f323944f84ad42bf | aishee/hhvm | /hphp/runtime/ext/zip/ext_zip.cpp | C++ | cpp | 38,575 | permissive | /*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... |
19163b8a21045c8db62835552382c8d127913e19 | 5e6859cca191f6326401c618ddd5e9cc17520e75 | shehzi001/proxy_doodle | /src/proxy/cpp/parser_json.cpp | C++ | cpp | 1,174 | permissive | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* @File parser_json.cpp
* @Author Eike Schumann <e-schumann@online.de>
*
* (c) Copyright 2016 by Eike Schumann
*
* Created... |
fbe246629f5b98bcbc754879548bd8b68b8bd115 | 4f16ad93b9fdc0a8dbc6772664d1f7ea5060e343 | Seojeonguk/Algorithm_practice | /BOJ/9945.cpp | C++ | cpp | 528 | no_license | #ifdef _DEBUG
#include "bits_stdc++.h"
#else
#include "bits/stdc++.h"
#endif
#pragma warning(disable:4996)
using namespace std;
int n, x, y, m;
int main() {
#ifdef _CONSOLE
freopen("sample.txt", "r", stdin);
#endif
for(int tc=1;;tc++) {
scanf("%d", &n);
if (n < 0) break;
long long int summ = 0, sumx = 0, su... |
0d20966a221cde53ecf438c29eef26bdaaad02b2 | 62f4803affa0c535542dd5842e6f7a99a55e3f31 | sgirardpich/TP_maillage | /main.cc | C++ | cc | 1,439 | no_license | #include <iostream>
#include <fstream>
#include "Mesh.h"
using namespace std;
using namespace Eigen;
// -----------
// | 3 | 2 |
// | | |
// -----------
// | 0 | 1 |
// | | |
// -----------
int main(int argc, char** argv)
{
if (argc < 2)
{
cout << "Please, enter the name of your mesh... |
77ff79d0f3a157b32eeabea9a3053cf32d65d166 | a61cd185c61550f167b72c520a53281eac381966 | imyzx2017/mindspore_pcl | /mindspore/ccsrc/backend/kernel_compiler/cpu/equal_count_cpu_kernel.cc | C++ | cc | 1,716 | permissive | /**
* Copyright 2019 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
d946c3bf085fb98712a2ad95452aa1f302d9cafe | cb7463a495e58416c00f1f2f8ab666b432394f7d | ilyoungkim/wwiv | /bbs/qwk1.cpp | C++ | cpp | 32,458 | permissive | /**************************************************************************/
/* */
/* WWIV Version 5.x */
/* Copyright (C)1998-2020, WWIV Software Services */
/* ... |
30b700287b99c7263a3f0aa8ccbe96187f80debf | 9c53a99a69377d427673a5457e1e41a08b66a45f | RichardTaylorHPCC/HPCC-Platform | /plugins/javaembed/javaembed.cpp | C++ | cpp | 37,208 | permissive | /*##############################################################################
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License ... |
b3f356f46e1f226e725632a271e7e61574402283 | 2c1cdbe266b8f80943b736241aa76cb6c8ffd669 | DiaGreine/Embedded-System-Class | /Project/main.cpp | C++ | cpp | 5,351 | no_license | #include "mbed.h"
#include "stm32f413h_discovery.h"
#include "stm32f413h_discovery_ts.h"
#include "stm32f413h_discovery_lcd.h"
#include "TCPSocket.h"
#include "MQTTNetwork.h"
#include "MQTTmbed.h"
#include "MQTTClient.h"
#include <string>
#include <cstdlib>
// Global var
TS_StateTypeDef TS_State = {0};
DigitalIn but... |
79aa99824599008211e06985083ab187c1dad3cc | b508199c4826557932b7f45cf16d8b7ef22e81c9 | BITCREXCOIN/BitcrexCoin-Core | /src/script/bitcoinconsensus.cpp | C++ | cpp | 2,990 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2018-2019 The BITCREXCOIN developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bitcoinconsensus.h"
#... |
f5daebe40dc247b38271bcbabcc46954f10d092f | 9f7e9ac807bbfdb470fc2d07177ac435a9f463e0 | KqSMea8/sstd_library | /sstd_boost/sstd/boost/metaparse/v1/impl/one_of.hpp | C++ | hpp | 1,030 | permissive | #ifndef BOOST_METAPARSE_V1_IMPL_ONE_OF_HPP
#define BOOST_METAPARSE_V1_IMPL_ONE_OF_HPP
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include... |
0b472216bcd1952d56c5257f4101d87be9ca8aa2 | 593fd7457a1cbb54f373d8e01c84936f0f36723b | davidvroom/C-CPP-ll | /week_1/ex5/main.cc | C++ | cc | 312 | no_license | #include "main.ih"
#include <iostream>
int main()
{
Matrix mat{ 2, 3 };
//Matrix mat2{{1,2},{3,4}};
cout << mat << '\n';
//cin >> mat(3,2, Matrix::BY_COLS);
cin >> mat(Matrix::BY_COLS,1,1);
cout << mat << '\n';
//cout << mat(2,5);
//mat(2,5);
//cout << mat << '\n';
}
|
56f7411e298f23b8a4c3f6a0487c23ab7385cb85 | 355b687642b62c17f35c3d8683aa7c7132aaaaeb | markowanga/OI-OIG | /OIG/Przycisk.cpp | C++ | cpp | 886 | no_license | /**
* VI Olimpiada Informatyczna Gimnazjalistów
* Zadanie: Przycisk
* Wynik 100/100
* Wykonał: Marcin Wątroba
* http://main.edu.pl/pl/archive/oig/6/prz
*/
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
int n, q;
cin >> n >> q;
int *t... |
1da3bbbcdad2310062d4b122ba8c0fa589b8e217 | 665115409d498c7e541d9ca70f554588c140aee6 | Cheesemooncake/lab7 | /ConsoleApplication1.cpp | C++ | cpp | 3,636 | no_license | #include <iostream>
#include <fstream>
#include <stack>
using namespace std;
#define INF INT_MAX
int* Dijkstra(int** mat, int size, int start)
{
int* d = new int[size];
bool* used = new bool[size];
int min;
int min_index;
for (int i = 0; i < size; i++)
{
d[i] = INF;... |
89c03d1356ce844924b3e1a1edbb30013fffd000 | 13c9f542dc39f145dcb02e74b8cb772294dd1c05 | Gvence/TorchCraftAI | /common/autograd/debug.cpp | C++ | cpp | 4,752 | permissive | /*
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "debug.h"
#include <fmt/ostream.h>
namespace common {
std::string tensorInfo(torch::Tensor x) {
std::ostringstream oss;
os... |
301c1decaee7e8dc46016c88e77ec3333564e2ed | 776d301397dae1b0cb369f8d051050a4604612f9 | yutakaoka/neonavigation | /planner_cspace/src/patrol.cpp | C++ | cpp | 3,662 | permissive | /*
* Copyright (c) 2016-2017, the neonavigation authors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* not... |
f095995bcca979bbb2a15131796426e426a8cd15 | 36f293561f2302d350027e5ea007060967f3bf45 | Zayd-Waves/CUPID | /ProjectLogic/projectupdateinterfacecontrol.cpp | C++ | cpp | 1,205 | no_license | #include "projectupdateinterfacecontrol.h"
ProjectUpdateInterfaceControl::ProjectUpdateInterfaceControl(StudentOutputManager* studentOutputManager,
AdminOutputManager* adminOutputManager)
{
this->studentOutputManager = studentOutputManager;
this->adminOu... |
8b20f56ad23eed16705bb6575d2d8fb974c78317 | eb06041663d1c4ab6dd6e3563b6485c3a09bc8a8 | mridulraturi7/Data-Structures | /Array/Problem87.cpp | C++ | cpp | 801 | no_license | /*
Minimum Difference among K.
Problem is taken from GFG.
Problem Statement - https://practice.geeksforgeeks.org/problems/minimum-difference-among-k/0
Difficulty - Basic
*/
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int testCase;
cin>>testCase;
while(testCas... |
11dbd11ee008fc7000686633e73d3cbed0b2f223 | 628774d1a288e56b592f5daaa85fb790cc3b8547 | zoro8/F1-T12-858D | /Src/core.cpp | C++ | cpp | 12,063 | no_license | /*
* core.cpp
*
* Created on: 30 aug 2019
* Author: Alex
*/
#include <string.h>
#include "core.h"
#include "hw.h"
#include "mode.h"
#include "stat.h"
#include "oled.h"
#include "tools.h"
#include "buzzer.h"
#include "display.h"
#include <math.h>
#define ADC_CONV (4) // Activat... |
8154eb12be087fb517ee80f35e4a79b6e6b89ef4 | 199be9094a13ea53ef825af017f11e0da42bc5cf | meniossin/src | /chrome/browser/ui/app_list/app_list_interactive_uitest.cc | C++ | cc | 3,174 | permissive | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include "ash/app_list/app_list_controller_impl.h"
#include "ash/app_list/app_list_presenter_impl.h"
#include "ash/public/cpp/shell_win... |
447275c00a16eed77741d8e7b88503e5e1713bd4 | 79509a0d1b589d9b62006d196c810b7e549fe5bf | thngkaiyuan/chromium | /third_party/WebKit/Source/platform/CrossThreadCopier.cpp | C++ | cpp | 4,238 | permissive | /*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditio... |
a9b76800b7ff2a6097f601dcc2f8c1168fc74384 | 2fb439ea530dbbf5c44b939db2afd98ca1ef0334 | NolanJos/vespa | /searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp | C++ | cpp | 4,507 | permissive | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/document/base/documentid.h>
#include <vespa/vespalib/util/sequencedtaskexecutor.h>
#include <vespa... |
5ab24e94667d04c2028cf163e14eb4ef7865c587 | 30241230f530df2246de90075fcdb3aafc83fe50 | anhvvcs/corana | /libs/z3/src/muz/spacer/spacer_sat_answer.cpp | C++ | cpp | 5,922 | permissive | #include "muz/spacer/spacer_sat_answer.h"
#include "muz/base/dl_context.h"
#include "muz/base/dl_rule.h"
#include "smt/smt_solver.h"
namespace spacer {
struct ground_sat_answer_op::frame {
reach_fact *m_rf;
pred_transformer &m_pt;
expr_ref_vector m_gnd_subst;
expr_ref m_gnd_eq;
expr_ref m_fact;
... |
e16aca4670c737b64cce1a4c4e328ac8818502ba | 91e2920c7e87a7b9f3d7f0946265e64c6e809808 | LuminolT/Advance_Language_Programing | /Assignment_5/E. Analog the Dot Martrix Font.cpp | C++ | cpp | 1,482 | no_license | #include<bits/stdc++.h>
using namespace std;
string charstr[16] = { "□□□□", "□□□■", "□□■□", "□□■■",
"□■□□","□■□■", "□■■□", "□■■■",
"■□□□","■□□■", "■□■□", "■□■■",
"■■□□","■■□■", "■■■□", "■■■■" };
int main() {
int count = 0;
int n = 1;
... |
5c8635d1dcebeb31ac724f035d13e418940dd433 | a7e533a201fb417d2ce36b728daff4a3a8313e3c | djbarker/quantities | /src/vect.hpp | C++ | hpp | 5,518 | no_license | #ifndef VECT_HPP_
#define VECT_HPP_
#include <iostream>
#include <memory>
#include <array>
template<size_t N, typename T>
class nvect {
static_assert(N>0,"Cannot create nvect<size_t N, class T> with N<1");
using this_type = nvect<N,T>;
template<size_t M, class U> friend class nvect;
public:
// ensure nvect is ... |
7a89fc089952317d25fc0ec4ab377ee70180d2ac | fda97a98fdf3f47c432bb2b6efaeb71c5e396a32 | hthuwal/competitive-programming | /old/hackerrank/travelling-is-fun-dsu.cpp | C++ | cpp | 1,679 | no_license | /**
* https://www.hackerrank.com/contests/hack-it-to-win-it-paypal/challenges/q4-traveling-is-fun/problem
*
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define N 200005
int parent[N];
int size[N];
int find(int a)
{
if(parent[a] == a)
... |
f5275417d8b6ff600f2405ea3bef42ffbf221cc2 | 9c6337024de6cd69888fc31c285b173251f95b18 | juarezpaulino/coderemite | /problemsets/Brazil/URI/URI ONLINE/1037.cpp | C++ | cpp | 523 | permissive | /**
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
*/
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
double a;
scanf("%lf", &a);
if (a > -1E-10 && a < 25+1E-10) puts("Intervalo [0,25]");
else if (a > 25+1E-10 && a < 50+1E-10) puts("Intervalo (25... |
653eda17fa54ba73cc52391e2042a899fe2ba2c5 | c0ebd37c7ad46877c44f18d8174cd24a829fe0bf | mxgrey/ifcplusplus | /IfcPlusPlus/src/ifcpp/IFC4/lib/IfcActor.cpp | C++ | cpp | 5,283 | permissive | /* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#include <sstream>
#include <limits>
#include "ifcpp/model/AttributeObject.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/model/BuildingGuid.h"
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include... |
66d166c9590856772eec0dcb0b4ac4874b13946a | 230d827325ec34b4a6d27686fd5adb0e821aab60 | califa/redex | /opt/obfuscate/Obfuscate.cpp | C++ | cpp | 10,266 | permissive | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <list>
#include "ClassHierarchy.h"
#include "DexClass.h"
#include "DexUtil.h"
#include "IRCode.h"
#include "Obfuscate.h"
... |
112c79cc8c7cbbae5ae43e51ca4518d16a14ab1c | acad5f3da60eda103899edfe4480fdb774885c5f | TalalZafar88/Centipede-Game | /Player.cpp | C++ | cpp | 1,831 | no_license |
#include "Player.h"
Player::Player(){
setpx(400);
setpy(20);
up=false;
down=false;
right=false;
left=false;
}
int Player:: getplayerx(){
return getpx();
}
int Player:: getplayery(){
return getpy();
}
void Player::setup(){
up=true;
down=false;
right=false;
left=false;
}
bool Player:: getup(... |
a6770167f6a58084456c76c65846969a613faeeb | 1820c73897abc9ae796d9ac62e0e027c0d3e7f44 | Flamefire/onnx | /onnx/backend/test/cpp/test_main.cc | C++ | cc | 426 | permissive | #include <iostream>
#include "gtest_utils.h"
GTEST_API_ int main(int argc, char** argv) {
if (argc < 2) {
std::cerr << "target directory must be given!" << std::endl;
return EXIT_FAILURE;
}
argc--;
std::string target_dir = argv[argc];
auto testcases = ONNX_NAMESPACE::testing::LoadAllTestCases(target_... |
d1f3d1bdb2b25c81a3f766b72b6213827a4b7d75 | ed14a20971807c7393801d10e6cacdd4985b96a2 | mincore/act | /include/act/resolver.hpp | C++ | hpp | 1,374 | permissive | /*//////////////////////////////////////////////////////////////////////////////
Copyright (c) 2015-2017 Jamboree
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//////////////////////////////////////////////... |
2cb62b923af99e6f39a33a4d7f3b13e38a8ba241 | f0e2a0a23359333b887ccd7465fe249d4dfeca83 | gusrl4025/algorithm | /d.com algorithm study/week 3/11724 - 연결 요소의 개수.cpp | C++ | cpp | 991 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n, m, from, to, cnt;
vector<int> a[1005];
bool check[500005];
void dfs(int n) {
check[n] = true;
for (int j = 0; j < a[n].size(); j++) {
int x = a[n][j];
if (check[x] == false) dfs(x);
}
}
int main... |
2dd18fcfdeba54d4128e10905f0c1a938fa81fbc | a2f666522d37e92026ddbdff1e72abcc14f381ea | drownedout/datamap | /node_modules/gdal/deps/libgdal/gdal/frmts/ogdi/ogdidataset.cpp | C++ | cpp | 37,266 | permissive | /******************************************************************************
* $Id: ogdidataset.cpp 28216 2014-12-25 18:02:53Z goatbar $
*
* Name: ogdidataset.cpp
* Project: OGDI Bridge
* Purpose: Main driver for OGDI.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
*************************... |
cd976e6b498a842e1a10bf6c9a31a7f9af16fdf2 | 11ecf16ced4da928f6de5bd81843d92b4f9b3243 | johnephillips/Towers-Of-Hanoi | /Setup.cpp | C++ | cpp | 1,589 | no_license | //
// Created by John on 2017-04-23.
//
#include "Setup.h"
int N, WIDTH, HEIGHT, DISKHEIGHT, PEGWIDTH, PEGHEIGHT, count;
ALLEGRO_DISPLAY* display;
ALLEGRO_FONT* font;
bool initialize() {
count = 0;
N = 0;
while (N <= 0) {
std::cout << "Enter the number of disks desired: ";
std::cin >> N;
... |
694996b80970dd3654647adf8571be6952ca765f | 5e400555a0785c30f1b0d038f9d27c171e65d9a0 | VulkanWorks/VulkanPlot | /VulkanRender.cpp | C++ | cpp | 1,723 | no_license | #include "VulkanRender.hpp"
VulkanRender::VulkanRender()
{
try{
m_window = std::make_unique<Window>(m_context.m_instance) ;
}catch(const std::exception& e) {
std::cerr << e.what() << std::endl;
}
}
void VulkanRender::drawLine(const Line &l)
{
std::vector<Vertex> vertices;
fo... |
1031c89eebc4701e0301019fa7476bfe28f214b6 | b36913738a9b651dfe55d1bbd9a38ed6e4c5f7c9 | TechToArt/Code | /算法分析/15_01背包分支限界.cpp | C++ | cpp | 1,751 | no_license | #include<iostream>
#include<stack>
#define N 200
using namespace std;
class HeapNode
{
public:
double uprofit,profit,weight;
int level,x[N];
};
stack<HeapNode> H;
double w[N],v[N]; //物品的重量和价值
double cw,cv,c; //背包中物品重量,背包中物品价值,背包容量
int n; //物品个数
double Bound(int i)
{
double cleft=c-cw,b=cv;
... |
10c592142388b181f7f454f56c764800e61b1b4c | b5b40cf538596242bad912e0e8e2d7019604427d | budhiahimanshu96/coding | /Codeforces/831B.cpp | C++ | cpp | 859 | no_license | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
void check(ll a) { cout<<a<<endl; }
bool prime [1000001];
int sieve(int a){memset(prime,true,sizeof(prime));int p;int i;for(p=2;p*p<=a;p++){if(prime[p]==true){for(i=p*2;i<=a;i+=p)prime[i]=false;}}return 0;}
//vector<ll> a
//v... |
053f291a9053dfeafea73f8f28108d42f4d81c81 | fe5787d6226ee15f2a1e1a2f5e1f124b95f47711 | BobDeng1974/openGeeL | /openGeeL/renderer/texturing/rendertexture.cpp | C++ | cpp | 797 | no_license | #define GLEW_STATIC
#include <glew.h>
#include <cassert>
#include "framebuffer/framebuffer.h"
#include "rendertexture.h"
namespace geeL {
RenderTexture::RenderTexture()
: Texture2D(ColorType::None) {}
RenderTexture::RenderTexture(Resolution resolution,
ColorType colorType,
WrapMode wrapMode,
FilterMode... |
b2150186d5a992dd020cbf238426d8f17bd99a36 | 1a1b1226e04680ca711a131bed5db2a751ac54f7 | angelahnicole/Benchmarking-CSPong | /CSPong/AppSource/Game/GoalCeremonySystem.cpp | C++ | cpp | 8,955 | permissive | //
// GoalCeremonySystem.cpp
// CSPong
// Created by Scott Downie on 30/06/2014.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Tag Games Limited
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to de... |
62ff8c770b2d8e5336dcf293356d84fec7463252 | f9d16bddb54005f9caefdca66636d1dd29be3cfd | CODARcode/MGARD | /examples/compression/src/main.cpp | C++ | cpp | 3,389 | permissive | #include <cmath>
#include <cstddef>
#include <algorithm>
#include <array>
#include <iostream>
#include <vector>
#include "mgard/compress.hpp"
// This program illustrates the use of MGARD's compression API. The dataset to
// be compressed will consist of `N` samples of a function `f` at uniformly
// spaced points on ... |
e49318db7879214007176872d2a74c4c3f3047f8 | a47c4fd465175a2c67bff0375d165105c878493a | leandroniebles/code-compilation-component | /pseint-code/pseint/zockets.cpp | C++ | cpp | 2,825 | permissive | #include "zockets.h"
#include <iostream>
#include <cstring>
using namespace std;
ZOCKET zocket_llamar(short int port, const char *host) {
#if defined(_WIN32) || defined(__WIN32__)
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1,0),&wsaData))
return ZOCKET_ERROR;
#endif
struct hostent *hp;
hp=(struct hostent *)getho... |
deb382144538dd3929511a756d62c4e5a7fe744f | 8e0581f055a65e840ce2f9742c6fa24adfa7d55a | amlrg/smallpde | /src/fdm.cpp | C++ | cpp | 723 | permissive | #include "fdm.hpp"
#include "types.hpp"
// Zero Dirichlet BC diffusion with source
Field fdm(const Field& inp, const Params<ProblemType::Diffusion>& p) {
Field out = inp;
Field wrk(inp.size());
const Real d = p.D*p.dt/p.dx/p.dx;
using std::swap;
for (int t = 0; t < p.timeSteps; ++t) {
// df/dt = D na... |
06df1013af0198fd4aba59d129227f69f36677a2 | 9e3cb6cfb2f56602f4ce5fcbb2d7351e102bb324 | genericx64/ZOS | /src/Apps/ToTheFront/TTFMove.CC | C++ | cc | 2,839 | permissive | U8 movement_costs[16];
movement_costs[PLAINS]=2;
movement_costs[TREES]=6;
movement_costs[MOUNTAINS]=10;
I64 HexMoveOneCost(Unit *tmpu,I64 r,I64 c,I64 facing)
{
I64 res;
if (tmpu->infantry)
res=0;
else {
res=FacingChange(facing,tmpu->facing);
if (res>0) res--;
}
if (roads[r][c] && roads[tmpu->row][tmpu->col]... |
3a56f8f1999d521f0aeb702b2f3f27f4ca7f9de7 | bb1edd245d2a14b791ac7170d73c95e52c0fcce9 | metux/chromium-suckless | /third_party/angle/src/common/string_utils.cpp | C++ | cpp | 4,547 | permissive | //
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// string_utils:
// String helper functions.
//
#include "string_utils.h"
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#incl... |
09db8d876ab7f705a469c47da666ac37842db9be | 0148e496aa9a8e4c127219488eea1bc48dda6294 | pt2-study-group/Lab2 | /Lab2_1/main.cpp | C++ | cpp | 1,226 | no_license | #include <iostream>
using namespace std;
/*
* Составить алгоритм поиска заданного числа в последовательности чисел.
* Поиск прекращать, когда в последовательности встретится число 0.
* Искомое число не должно быть нулем.
* Реализовать алгоритм в виде программы на языке C++.
* Формат ... |
74babf2b54a856df1143d0507c07325c92814288 | 69e1d2e5387ad34e0ceeb42c0aa2d6e57a46225a | alexandraback/datacollection | /solutions_5630113748090880_0/C++/Andreikkaa/main.cpp | C++ | cpp | 5,861 | no_license | /*
* C++11 code template for contests.
* @author: Andrey Kalendarov
* @e-mail: andreykalendarov@gmail.com
*/
/*______ DEFINES _______*/
#define _SCL_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
//#define ANDREIKKAA_ALLOCATOR
//#define ANDREIKKAA_UNSAFE_VECTOR
#ifdef ANDREIKKAA_UNSAFE_VECTOR
#defi... |
bf7ad7b159efc1f54a6b5ba975e7db1ce5957342 | a8e316d3f5e9824f4dacad6d64d6756c9a4aef43 | harshit0311/Coding_Ninjas_Data_Sturctures_in_Cpp | /BST/CheckIfBTisBST.cpp | C++ | cpp | 1,033 | no_license | Check if a Binary Tree is BST
Given a binary tree with N number of nodes, check if that input tree is BST (Binary Search Tree) or not. If yes, return true, return false otherwise. Duplicate elements should be in the right subtree.
Sample Input 1 :
3 1 5 -1 2 -1 -1 -1 -1
Sample Output 1 :
true
Sample Input 2 :
5 2 10 0 ... |
6c2cd6264d90feb4dc9854dbe0ed2035d503cd4e | 3904699da4be7f09cff0c8c3dd732612bdabe772 | slenderdev/slendermancoin | /src/test/test_bitcoin.cpp | C++ | cpp | 1,765 | permissive | #define BOOST_TEST_MODULE Slendermancoin Test Suite
#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
#include "db.h"
#include "txdb.h"
#include "main.h"
#include "wallet.h"
#include "util.h"
CWallet* pwalletMain;
CClientUIInterface uiInterface;
extern bool fPrintToConsole;
extern void noui_connect... |
84b351b6678de7430d194c577ddece7c320481d1 | a78c300b5dfe9ca2f41c8549dafbb3835fc51e6b | shashank0107/CP-Solutions | /UVA 477.cpp | C++ | cpp | 6,724 | no_license | #include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
/*** Template Begins ***/
typedef long long ll;
typedef pair<ll,ll> PII;
typedef pair<ll, pair<int, int> > PIII;
typedef vector<int> vi;
#define endl '\n'
#define pb push_back
#define INF I... |
465594604ec18fe867cd172af0d1cb19449c83cd | 7a25349cbf0ed2e5d22d6a3a830a88235ee3b8d3 | anujrawatcode/StriverDsa | /01_DSA_Sheet/18_27July_String/5_Longest_Common_Prefix.cpp | C++ | cpp | 665 | no_license | #include <bits/stdc++.h>
using namespace std;
string commonPrefix(string str1, string str2)
{
int n1 = str1.length();
int n2 = str2.length();
string result;
for (int i = 0, j = 0; i < n1 && j < n2; i++, j++)
{
}
}
string commonPrefix(vector<string> &vec, int n)
{
string prefix = ... |
52caa686bcbd77d77c6678765760c37caa5c41ff | ecb5c35de95e6f5436acc1e5e7244adb16326e78 | CharlesE-233/aliyun-openapi-cpp-sdk | /elasticsearch/src/model/TagResourcesRequest.cc | C++ | cc | 984 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.