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 |
|---|---|---|---|---|---|---|---|---|
c052ccc89f959653fbd45120e05810c9091cae19 | 80de68f4c2884a364575efd7b5a637b469183e0c | qicny/skia | /src/gpu/effects/GrXfermodeFragmentProcessor.cpp | C++ | cpp | 22,048 | permissive | /*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GrXfermodeFragmentProcessor.h"
#include "GrConstColorProcessor.h"
#include "GrFragmentProcessor.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLBl... |
c27542c2f8f766972a0a2463e259b6651928ae91 | 36e04490346d8afd06108cf69d36dc7b2e087192 | sweetkristas/roguelike | /src/input_process.cpp | C++ | cpp | 1,477 | permissive | #include "SDL.h"
#include "component.hpp"
#include "input_process.hpp"
namespace process
{
input::input()
: process(ProcessPriority::input)
{
}
input::~input()
{
}
bool input::handle_event(const SDL_Event& evt)
{
if(evt.type == SDL_KEYDOWN) {
keys_pressed_.push(evt.key.keysym.scancode);
return tru... |
55d94c0f32080cb8935a03a60a0fd5317e84a943 | 656d77303d9b30b52811def72f6a4f64c737568a | mahnovsky/RogueLike | /code/include/widget_text.hpp | C++ | hpp | 773 | no_license | #pragma once
#include "defines.hpp"
#include "widget.hpp"
struct TextData
{
std::string text;
std::string font_name;
int32_t font_size;
};
class WidgetText : public Widget
{
public:
WidgetText(core::WidgetSystem* root);
~WidgetText() override;
void initialize();
void set_... |
7bacd72ee54e79e8243cff8116c87c384b54263d | 702731499928d9da3387c42acb4da40f2617167d | ZubinGou/leetcode | /HDU/HDU-1874-畅通工程续-dijkstra.cpp | C++ | cpp | 1,923 | permissive | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
// #include <unordered_map> // can't compile on poj
#include <algorithm>
#include <cstring>
#include <climits>
using namespace std;
const int MAX_N = 205;
const int INF = 1e9;
/*
dijkstra O(V^2)
复杂度:
1. 找最短距离:O(V^2)
2. 更新距离:O(2 ... |
4088ff67d8139a008b59b495eee7cde3a0ab26ba | 102ab94be76b6218e529824092e03f93aa63a4ee | SpencerCDixon/SpenceBoy | /Emulator/Joypad.cpp | C++ | cpp | 4,530 | no_license | //
// Created by Spencer Dixon on 6/1/20.
//
#include "Joypad.h"
#include "Emulator.h"
#include <SD/Assertions.h>
#include <SD/Bytes.h>
Joypad::Joypad(Emulator& emulator)
: m_emulator(emulator)
, m_mode(JoypadReadMode::None)
{
for (int i = 0; i < static_cast<int>(Key::_Count); ++i)
m_keys[i] = fal... |
c6ec6b26088cc26e12393e477dfb6e5f7439a45c | 431de5b1e2c23b80da51de95be48cfdd227ea1bd | LocalToasty/chiisai_os | /chiisai_os/os/util.cpp | C++ | cpp | 512 | permissive | #include "os/util.hpp"
#include "os/output.hpp"
#include <avr/io.h>
void os::util::set_bit(Port* port, uint8_t bit) {
*port |= _BV(bit);
}
void os::util::clear_bit(Port* port, uint8_t bit) {
*port &= ~_BV(bit);
}
void os::util::write_bit(Port* port, uint8_t bit, bool value) {
if (value) {
set_bit(port, bit... |
656ba4088b7ba90d607e9cbf4204cbe49e12904f | 1f8b58717e10669b813afe2239ccd051c94b646a | mxito3/algorithm | /数据结构/tree.cpp | C++ | cpp | 1,681 | no_license | #include "iostream"
#include "stdlib.h"
#include <vector>
using namespace std;
typedef struct nod //节点定义
{
int num;
struct nod * left;
struct nod * right;
}node;
class tree
{
public:
void create(node *nowNode,int type);
void preOrderList(node *head);
static vector<node *> nodeNee... |
9b8ba447b5466e557cfd5b0f82cc136de9825c90 | 09efe4bb4900499f643f3f2ad16deea9eed0a1a2 | RyannDev/progpow | /src/addrman.cpp | C++ | cpp | 15,809 | permissive | // Copyright (c) 2012 Pieter Wuille
// Copyright (c) 2012-2014 The Bitcoin developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2017-2018 The cosmitto & Bitfineon developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licens... |
073644dbe62ddc0f4fe3f70f4f337e76a2283a17 | 5b06b40313bc0b698de0c476a9c0427c59564062 | wangyanhai/Halide | /src/IROperator.cpp | C++ | cpp | 87,329 | permissive | #include <algorithm>
#include <atomic>
#include <cmath>
#include <iostream>
#include <sstream>
#include <utility>
#include "CSE.h"
#include "Debug.h"
#include "IREquality.h"
#include "IRMutator.h"
#include "IROperator.h"
#include "IRPrinter.h"
#include "Util.h"
#include "Var.h"
namespace Halide {
// Evaluate a float... |
7edc4455216bf97a8cfa6e5cf3e4322cfb2b74b4 | c70975e19f4a159b7e2c98100f0b18dcae0f2d76 | md-qubais/Data_Structures_Algorithms_and_Competitive_Programming | /coin_change_bottom_up.cpp | C++ | cpp | 650 | no_license | #include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)
#define int long long
#define endl "\n"
#define qubais_judge freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
using namespace std;
int coinChange(vector<int>& coins, int amount){
int dp[amount+1]={0};
dp[0]=0;
for(in... |
1e27de3bdb48e4a04e55811d4717ce9cbc222d0a | 38f7b0d056ffb23dfa05e85252c73e2e06ea1797 | vdbe/school-oop | /labos/labo_01/exercise_05/src/main.cpp | C++ | cpp | 634 | no_license | #include <iostream>
#include <cstdlib>
#define EYES 6
#define TURNS 6000
int main() {
int throw_results[EYES] = { 0 };
srand(time(NULL));
int number;
for (int i = 0; i < TURNS; i++) {
number = rand() % EYES;
switch(number) {
case 0:
throw_results[0]++;
break;
case 1:
throw_results[1]++;
... |
c85ea03d40075914cb29f0126513befffcc82de0 | fe8a0eafaf13944bba1bab4e54e1233dc6afe4a2 | bebatman/oj_solutions | /leetcode/src/334.cpp | C++ | cpp | 1,021 | no_license | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int numsLen = nums.size();
if (numsLen < 3) return false;
int currMin = nums[0];
bool validTwoSeq = false;
int twoSeqEnd;
for (int i = 1; i < numsLen; i++) {
// invarian... |
713ee273520635a681118642de3b619da7a1d79c | 1748b3ffd683c036e9487410bbbb875f4326833c | pushkalkatara/habitat-sim | /src/esp/bindings/SimBindings.cpp | C++ | cpp | 5,784 | 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 "esp/bindings/bindings.h"
#include <Magnum/ImageView.h>
#include <Magnum/Magnum.h>
#include <Magnum/SceneGraph/SceneGraph.h>
#incl... |
ea5f615da09316791a5429d50ad1cd38074f33fc | 704b586df6e2c7e9dacea15cbe33fd6d9e09b6b1 | tiankonguse/leetcode-solutions | /problemset-new/012/01217-minimum-cost-to-move-chips-to-the-same-position/1217.cpp | C++ | cpp | 3,586 | no_license | #include <bits/stdc++.h>
#include "base.h"
using namespace std;
typedef __int128_t int128;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pll> vpll... |
780cf98fc092d0e6a8dea7cfd38d6dddc5720fd1 | 1c1df7af3a941693d1a58033d0fd616ae9dc93a2 | farmanp/terminal | /src/renderer/dx/DxRenderer.cpp | C++ | cpp | 55,648 | permissive | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "precomp.h"
#include "DxRenderer.hpp"
#include "CustomTextLayout.h"
#include "../../interactivity/win32/CustomWindowMessages.h"
#include "../../types/inc/Viewport.hpp"
#include "../../inc/unicode.hpp"
#include "../../inc/D... |
fa94b2b08357a60bbd89bdb8fe266a99f04899ed | 2bbb0c6f668b439b275ba544ecad50931ce80f7e | wenqi-wang20/HungrySnake | /Controller.hpp | C++ | hpp | 378 | no_license | #ifndef CONTROLLER_HPP
#define CONTROLLER_HPP
class Controller
{
public:
Controller() : speed(200), key(1), score(0) {}
void Start();
void Select();
void DrawGame();
int PlayGame();
void UpdateScore(const int& );
void RewriteScore();
int Menu();
void Game();
int GameOver();
priv... |
8a8c06e773b56887151e65e2829f3d1d35647ac2 | 94563af2e2e78678369bd30a66b88855f2abaf58 | druzzt/ALGORYTMY_OPTYMALIZACJI_DYSKRETNEJ | /LISTA2/OLD/dial.cpp | C++ | cpp | 3,799 | no_license | // C++ Program for Dijkstra's dial implementation
#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
// This class represents a directed graph using
// adjacency list representation
class Graph
{
int V; // No. of vertices
// In a weighted graph, we need to store vertex
// and weight p... |
aa1a345390e5fdaabe000f41285a9bbe3fd17a7a | 4367896b8b4415060970db655143deb066f12a39 | kaibraaten/swrip-1.5 | /src/commands/openhatch.cpp | C++ | cpp | 2,396 | no_license | #include "ship.hpp"
#include "mud.hpp"
#include "character.hpp"
#include "room.hpp"
#include "act.hpp"
void do_openhatch(std::shared_ptr<Character> ch, std::string argument)
{
std::shared_ptr<Ship> ship;
char buf[MAX_STRING_LENGTH] = { '\0' };
if(argument.empty() || !StrCmp(argument, "hatch"))
{
... |
fcc019a7401acda1bd0df432e160b98cd61a62a4 | af24937a57a072fe6a4a9a8d83a2aee82c7c81e1 | crackwitz/msdnblogsmfsamples | /MFSimpleEncode/ProfileBuilder.cpp | C++ | cpp | 16,587 | no_license | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
#include "common.h"
#includ... |
e246cd8169899df1f0abe4fa71635df974bedd21 | cd652b2d32c1d9a9ae0087ea14462ec648a5ed05 | hieule22/contests | /codechef/JulyChallenge16/workchef1.cpp | C++ | cpp | 629 | no_license | #include <iostream>
#include <cstdint>
#include <cstring>
using namespace std;
int k;
uint64_t L, R;
int known[10];
bool Check(uint64_t n) {
memset(known, 0, sizeof known);
uint64_t temp = n;
int cnt = 0;
while (temp != 0) {
int digit = temp % 10;
if (digit != 0 && !known[digit] && n % digit == 0) {
cnt+... |
89a9fb03c3e8eefe523f863ae77f2019fc7400f5 | 9a3476cee138655dce5388455b3ecca13c59ac8c | jim-normand/NAM | /chiang/RoadExtraction.hpp | C++ | hpp | 1,002 | no_license | #ifndef ROADEXTRACTION_HPP_
#define ROADEXTRACTION_HPP_
#include <opencv/cv.h>
#include <opencv/highgui.h>
void SetMatElem(CvMat *mat, int row, int col, int channel, int val);
class RoadExtraction
{
public:
RoadExtraction();
~RoadExtraction();
public:
void LoadImage(const char * filename);
void ShowSource();
v... |
f7837fd011ec0a8a89521c05d4e41d979daf8090 | fc3f1ef63085f3b24d0b4ab69fe87df8173e230f | hexu1985/cpp_book_code | /cpp.func.handbook/ch06/6-5-17.cpp | C++ | cpp | 288 | no_license | #include <set>
#include <iostream>
using namespace std;
#define len 5
int main( )
{
multiset <int> ctr;
int i;
for(i=0;i<len;i++)ctr.insert(i); //下面给先给ctr赋值
cout<<"The current multiset's length is: ";
cout<<ctr.size()<<endl;
return 0;
}
|
16d095543b364820b0e4dd1263d082506c3d701d | 2ae53d9e7b9247926650a12c6d6d0a0365836791 | 1InfinityDoesExist/OOPS | /abastraction.cpp | C++ | cpp | 547 | no_license | #include<bits/stdc++.h>
using namespace std;
class Solution
{
private:
int x, y;
public:
Solution();
void getInput(int a, int b);
void display();
};
Solution::Solution(){}
void Solution::getInput(int a, int b)
{
x = a;
y = b;
}
void Solution::display(... |
e2bdde702565ca5c7ce97bfe391f3a35ba2ca566 | 790e10d1e7007ffc38b9150e1559c2890a270696 | italocoin-project/italo-gui | /src/qt/KeysFiles.cpp | C++ | cpp | 6,000 | permissive | // Copyright (c) 2014-2019, The Italo Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
//... |
b4a27547bf16cf261de5fa95502c5a4505682c72 | 8e6ddc6e1acdafbe1763cd0ace0eba6b81d3f77f | mjanonis/Advent-of-Code-2019 | /day13-1.cpp | C++ | cpp | 4,301 | no_license | #include <algorithm>
#include <cmath>
#include <fstream>
#include <map>
#include <set>
#include <vector>
std::tuple<int, int, int, int> getModeAndOpcode(int num)
{
std::tuple<int, int, int, int> res;
int opcode = num % 100;
num /= 100;
int mode_first = num % 10;
int mode_second = (num / 10) % 10;
... |
4fc5d0d74ca160bc998c4f3869248f26c9285ce1 | 0de7ab2e823ac161c2e63c354f2480c3ae957c48 | staveesh/dsa-implementations | /Graphs/bfs.cpp | C++ | cpp | 546 | no_license | #include <bits/stdc++.h>
using namespace std;
vector<int>graph[112345];
int visited[112345];
void bfs(int source){
queue<int> q;
visited[source] = 1;
q.push(source);
while(!q.empty()){
int u = q.front();
q.pop();
for(int i = 0; i < graph[u].size(); i++){
if(!visited[graph[u][i]]){
q.push(graph[u][i... |
085055234cdd3296556b012ca4fe50bf14f9060b | 7a4cdd3d324817b8aa0d66dae24b3240f91ee2a1 | afirez/GuiLiteSamples | /Hello3D/BuildWin32/Hello3D.cpp | C++ | cpp | 5,038 | permissive | // Hello3D.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "UiBlock.h"
#include "Hello3D.h"
#include <windowsx.h>
#include <shellapi.h>
#define MAX_LOADSTRING 100
#define COLOR_BYTES 2
// Global Variables:
HINSTANCE hInst; // current instance
WCHAR sz... |
f0512e7dfbd54a705fdcf75e71324972030c2b0c | 965cced4d253f4f5514316efe4fb6fb76d0e44fd | Naronco/Rekd-Engine | /Rekd-Engine/PredefinedShader.cpp | C++ | cpp | 5,244 | no_license | #include "PredefinedShader.h"
Rekd2D::Core::PredefinedShader::PredefinedShader(const std::string &v, const std::string &f)
{
vshader = v;
fshader = f;
Compile();
Bind();
}
void Rekd2D::Core::PredefinedShader::SetVertex(const std::string &shader)
{
vshader = shader;
}
void Rekd2D::Core::PredefinedShader::SetFragm... |
965e62e65a5708646404e60c6894792663a620b6 | ae56c09ead46496a0a307ff2c40befa427c25b6d | adrianolls/ll | /2d77/wxWidgets-2.9.1/src/unix/threadpsx.cpp | C++ | cpp | 51,465 | no_license | /////////////////////////////////////////////////////////////////////////////
// Name: src/unix/threadpsx.cpp
// Purpose: wxThread (Posix) Implementation
// Author: Original from Wolfram Gloger/Guilhem Lavaux
// Modified by: K. S. Sreeram (2002): POSIXified wxCondition, added wxSemaphore
// Created: ... |
5073974b7d8bea5734663753086a73029a737fcd | 40a306b666b49387e1baf3e1de44e887b4476493 | arpitkjain/ComputerVision | /QueueUsingTwoStacks.cpp | C++ | cpp | 1,331 | no_license | /*
#include<iostream>
#include<stack>
using namespace std;
stack<int> StackFBottom;
stack<int> StackRBottom;
class Q
{
public:
void Qpush(int);
void Qpop(void);
int Qfront(void);
int Qback(void);
int Qempty(void);
};
void Q::Qpush(int x)
{
StackFBottom.push(x);
}
void Q::Qpop(void)
{... |
8aeb00f0bdfce59756ddd2a0d7bc7c4a47f2b024 | 3651324c38dfb0efae9192d99ab9c93590e0a7df | YuhBoyMatty/hpphack | /hppcsgo-60605925f08a/hppcsgo/ValveSDK/interfaces/IClientEntity.hpp | C++ | hpp | 6,143 | no_license | #pragma once
#include "IClientNetworkable.hpp"
#include "IClientRenderable.hpp"
#include "IClientUnknown.hpp"
#include "IClientThinkable.hpp"
struct SpatializationInfo_t;
class IClientEntity : public IClientUnknown, public IClientRenderable, public IClientNetworkable, public IClientThinkable
{
public:
virtual void... |
8375520b72e7717b16e7a8ebeb726b44caf35c10 | 60d39e0b0658ccf8bf0626c02020bb790e926723 | DinnerHowe/cpp_study_case | /src/test_threadpool.cpp | C++ | cpp | 302 | no_license | #include "threadpool.h"
#include <iostream>
void ServerUnit(const int& num) {
std::cout << "AF_INET: " << num << ", thread id: " << std::this_thread::get_id() << std::endl;
}
int main(int argc, char* argv[]) {
ThreadPool pool(4);
while (1) {
pool.enqueue(ServerUnit, 1);
}
return 0;
}
|
27899cb484800821809aa1e0cf5b750ff51ef360 | 46b7cbf5277387e418a123e1adec7740de685dcc | Quantum-0/MyCompiler | /MyCompiler/TValue.hpp | C++ | hpp | 700 | no_license | //
// TValue.hpp
// MyCompiler
//
// Created by Nikita-Mac on 14.06.17.
// Copyright © 2017 Nikita-Mac. All rights reserved.
//
#ifndef TValue_hpp
#define TValue_hpp
#include "TypeList.hpp"
#include "Exceptions.h"
class TValue{
private:
int type;
double* pointer;
bool referenceType;
public:
... |
30dd4fe2675895169ed26d7d1c07ebb84c06e3a1 | 7e21e8e49d4d696070be9cfe0d022695c077b9d0 | svn2github/divz | /src/camera_test/CameraThread.cpp | C++ | cpp | 14,152 | no_license |
#include <QImage>
#include <QMutex>
#include <QMutexLocker>
#include <QStringList>
#include <QDebug>
#include <QApplication>
#include "CameraThread.h"
extern "C" {
#include "libswscale/swscale.h"
#include "libavdevice/avdevice.h"
}
//#include "ccvt/ccvt.h"
#include "CameraViewerWidget.h"
#if de... |
906663521e5b2754b54d2bf8feb09f1fbb1371a5 | 501188cb5ad2612c6139de5be12961f8c4f19286 | soccercoin/SoccerCoin | /src/init.cpp | C++ | cpp | 45,230 | no_license | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "txdb.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "net.h"
#... |
b37d967b72995a10c0f4ff5dc5afca9633a1fa7e | 0432cc5aba000d284f78ba9469b31a0ba99d66bd | nkchmyrovich/TanksOnline | /bullet.cpp | C++ | cpp | 1,211 | no_license | #include "bullet.h"
#include <cmath>
const String bulletString = "BULLET";
Bullet::Bullet (Image &image, float X, float Y, float moveTimer_) :
Entity (image, X, Y, WIDTH, LENGTH, bulletString)
{}
Bullet::~Bullet () {}
Vector2f& operator * (float value, Vector2f& vector) {
vector.x *= value;
vector.y *= va... |
5ab49aeeadc456574e9576183c9183c536428250 | fe6ee2d1bce76caf35aa6ed1235b28ea8e574ca0 | tatwd/coding-time | /design_patterns/abstract_factory/main.cc | C++ | cc | 1,947 | no_license | /* 抽象工厂 p.57 */
#include <iostream>
class Product {
public:
int GetID() { return _id; }
Product(int id) { _id = id; }
private:
int _id;
};
class AbstractProductA : public Product {
public:
std::string GetType() { return _type; }
AbstractProductA(int id) : Product(id) {}
private:
std::string _type = "A";
};
cl... |
72509090b5ce12af7d7302b83224290c004c2158 | a41388c84092ebec924f66951caf05facfda2855 | cran/mlsbm | /src/logf_z_given_A.cpp | C++ | cpp | 1,260 | no_license | #include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
double logf_z_given_A(NumericVector zs,
List A,
NumericVector pis,
NumericMatrix Ps) {
int L = A.length();
double logf_z_given_A = 0;
int n = zs.length();
for(int i = 0; i < n; i++)
... |
85f26a1a3606c87b4b07fdb718e19bcc3e13b746 | f7188eb9a41f43b7476d238c90c08d943088e121 | caizhixiang/zikao | /C++/程序第2-5章/5.4 例题.cpp | C++ | cpp | 756 | permissive | #include <iostream>
using namespace std;
class Base{
private:
int x;
const int a; //常数据成员只能通过初始化列表来获得初值
static const int b; //静态常数据成员需在类外初始化
const int& r; //常引用只能通过初始化列表来获得初值
public:
Base(int,int); //声明含两个整型参数的Base类的构造函数
void Show( ){cout<<x<<","<<a<<","<<b<<","<<r<<endl;}
... |
067c047f03befe77116b9b888d384c7983167b5f | 5b887683848585631f62409215e6aa9304ff8268 | kudryashovda/mython | /runtime_test.cpp | C++ | cpp | 18,984 | no_license | #include "runtime.h"
#include "test_runner_p.h"
#include <functional>
using namespace std;
namespace runtime {
namespace {
class Logger : public Object {
public:
static int instance_count;
explicit Logger(int value_ = 0)
: id_(value_) {
++... |
c629f991e4603554657f8506e75634e4a8d9ff26 | 25d5e17c11f631c9da8c790f34e96781cc9cdc21 | fxrc2018/Demos | /Algorithms/DisjSets.cpp | C++ | cpp | 585 | no_license | #include <vector>
using namespace std;
class DisjSets{
public:
explicit DisjSets(int numElements):s(numElements,-1){};
int find(int x){
if(s[x] < 0){
return x;
}else{
return s[x] = find(s[x]); //路径压缩
}
}
void unionSets(int root1, int root2){
if(s[... |
3c70f28d6feedc7b5520320d8f0dd7ce254fe33a | 49bc4f8d1a830452188229c3989e93790307d7ef | Adaryian/E-Currency | /src/test/wallet_tests.cpp | C++ | cpp | 14,102 | permissive | #include <boost/test/unit_test.hpp>
#include "main.h"
#include "wallet.h"
// how many times to run all the tests to have a chance to catch errors that only show up with particular random shuffles
#define RUN_TESTS 100
// some tests fail 1% of the time due to bad luck.
// we repeat those tests this many times and onl... |
50fad31c3707a455064154cef5aa02205a39deea | d82aac9a7e61c2ee1553637882ddf109e6936857 | dsgorthy/Dinkel_CSCI2270_FinalProject | /Main.cpp | C++ | cpp | 5,558 | no_license | //Jack Dinkel
//CSCI 2270 - Hoenigman
//Final Project
//Driver file
//Builds a hashtable to store movie information using user input
//Uses class: HashTable
//Takes no command line input
#include <iostream>
#include <regex>
#include "HashTable.h"
using namespace std;
void displayMenu();
string askInput();
int rege... |
44cd841dd73474ad733fae0a1748168a930120ee | 17d817a63ab59718a7789b4ed640182cf5853688 | flaviomartins/taily-cpp | /TailyRunQuery.cpp | C++ | cpp | 21,094 | no_license | /*
* TailyRunQuery.cpp
*
* Created on: Nov 6, 2013
* Author: yubink
*/
#include <time.h>
#include "indri/QueryEnvironment.hpp"
#include "indri/LocalQueryServer.hpp"
#include "indri/delete_range.hpp"
#include "indri/NetworkStream.hpp"
#include "indri/NetworkMessageStream.hpp"
#include "indri/NetworkServerPro... |
de4a7770890203a41a985ecc772076e36e127305 | 97d329b0af854db7341bb32ea873cea1b0593e0d | godlikepanos/anki-3d-engine | /AnKi/Renderer/GBuffer.cpp | C++ | cpp | 8,905 | permissive | // Copyright (C) 2009-2023, Panagiotis Christopoulos Charitos and contributors.
// All rights reserved.
// Code licensed under the BSD License.
// http://www.anki3d.org/LICENSE
#include <AnKi/Renderer/GBuffer.h>
#include <AnKi/Renderer/Renderer.h>
#include <AnKi/Renderer/RenderQueue.h>
#include <AnKi/Renderer/VrsSriGe... |
3c873bcbe399c2c53af5b2c091addd6ac0156b0a | 1c5580275eeae60cf0420a5b9b37158ddcbb1be5 | hl23889909/hi3515a-lsdvs | /public/hton.cpp | C++ | cpp | 313 | no_license | #include "hton.h"
#include <arpa/inet.h>
uint Htonl( uint hostlong )
{
return htonl( hostlong );
}
ushort Htons( ushort hostshort )
{
return htons( hostshort );
}
uint Ntohl( uint netlong )
{
return ntohl( netlong );
}
ushort Ntohs( ushort netshort )
{
return ntohs( netshort );
}
|
51690a934fdc14964e28ff0cd4b969d1499e03d7 | d5467e2dc5ea7d413675a0f68f60d2d7e7d06e8c | shinesolutions/swagger-aem-osgi | /clients/cpp-pistache-server/generated/model/ComDayCqWcmDesignimporterParserTaghandlersFactoryImgTagHandlerProperties.cpp | C++ | cpp | 3,410 | permissive | /**
* Adobe Experience Manager OSGI config (AEM) API
* Swagger AEM OSGI is an OpenAPI specification for Adobe Experience Manager (AEM) OSGI Configurations API
*
* OpenAPI spec version: 1.0.0-pre.0
* Contact: opensource@shinesolutions.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-gener... |
2fcdad3585812cf5048d518bc159e486cd45ccb4 | 50879a87efc116815e6d6607604e56e82600f4fb | solutiipbinfo/solutiipbinfo.github.io | /secventapara.cpp | C++ | cpp | 646 | no_license | #include <bits/stdc++.h>
using namespace std;
ifstream fin("secventapara.in");
ofstream fout("secventapara.out");
int main()
{
int maxim = 0, nrmax = 0;
int x, nr = 0;
while(fin >> x)
{
if(x % 2 == 0) ++nr;else
{
... |
ca1a34160224324a324015951e9b82d6430cac1b | 8bc809b6381c1a9b5a2fdec49f8da239c678c863 | FrancoisChabot/variadic_future | /examples/include/asio/detail/thread_info_base.hpp | C++ | hpp | 3,097 | permissive | //
// detail/thread_info_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
//
#ifndef ASIO_... |
ded88f2dd62581797a3ee5bc19ca7e4003a7c897 | 0c233ab07b822f87e679c1eda6e0dcda201a6844 | digint/openmptl-reg-arm-cortex | /arm/cortex/Spansion/MB9BF56xx/include/arch/reg/bt14.hpp | C++ | hpp | 8,412 | 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 "License.txt" in the parent directory).
*
* This program is distributed in the hope that it will be useful,
* bu... |
f3f5448f443206e5f2a3a63683c06e1f02e99112 | 3db36d0926cb20c77345e98a4c11fe5745d3265b | SREERAGI18/chromium | /chrome/browser/themes/theme_properties.cc | C++ | cc | 12,712 | permissive | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/themes/theme_properties.h"
#include <memory>
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#... |
978db5f04727ddf3b94247ab917efbcd0ccbecb6 | 4d9f2eb0f0e35f15a532e546a522ba8e71431c7d | jonasjonas/libsass | /src/prelexer.hpp | C++ | hpp | 16,328 | permissive | #ifndef SASS_PRELEXER_H
#define SASS_PRELEXER_H
#include <cstring>
#include "lexer.hpp"
namespace Sass {
// using namespace Lexer;
namespace Prelexer {
//####################################
// KEYWORD "REGEX" MATCHERS
//####################################
// Match Sass boolean keywords.
co... |
a9cc5fe68e5d360f28dabe7665d1ec3be33213f3 | f64486d2bd19e1cc6d8b9358bcd2335e540832f9 | Zip000000/CppPractice | /7.Interview/7.Sogou/1.cpp | C++ | cpp | 1,136 | no_license | /*************************************************************************
> File Name: 1.cpp
> Author: Zip
> Mail: 307110017@qq.com
> Created Time: 2019年09月08日 星期日 16时30分26秒
************************************************************************/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<... |
b86b6b3bde92e86fd6ee2933b689fcb771b942ab | 0daa968b0aa9ec9f9807347f5a0829352bafc6ee | izman48/Tetris | /Tetris/Board.cpp | C++ | cpp | 5,805 | no_license | #ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glew.h>
#include <GL/freeglut.h>
#endif
#include "Tetrominos.h"
#include "Square.h"
#include "Board.h"
#include "Tetris.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <memory>
#include <string>
// Initialise Board
Bo... |
ab5b8c0fa26ff653edd031bc276c9f7da56675a1 | db8c95e251aaf558decf5c39e79ae23663933a3d | davidli2010/gporca | /libgpopt/src/operators/CPhysicalCTEProducer.cpp | C++ | cpp | 10,458 | permissive | //---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2012 EMC Corp.
//
// @filename:
// CPhysicalCTEProducer.cpp
//
// @doc:
// Implementation of CTE producer operator
//---------------------------------------------------------------------------
#includ... |
810f6c78b5687da4e0f267a5dc8828001c3945b3 | 86d70f5cc8c357e0f985594a758f93b05a85c517 | zrma/PLinCPP | /Week4-1-Debug-bs_oop/bs_oop/Player.cpp | C++ | cpp | 2,449 | no_license | #include "stdafx.h"
#include "Player.h"
#include "Aircraft.h"
#include "Battleship.h"
#include "Destroyer.h"
#include "Crusiser.h"
#include "Submarine.h"
CPlayer::CPlayer(void)
{
}
CPlayer::~CPlayer(void)
{
}
void CPlayer::SetPosition()
{
CAircraft aircraft;
CBattleship battleship;
CCrusiser cruiser;
CDestroye... |
5525feb356c6ba2cee7317bea417e5801088075f | 417802414b96629d0b5fc369805542a06d92bbbe | uve/tensorflow | /tensorflow/core/kernels/split_v_op_test.cc | C++ | cc | 6,832 | permissive | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... |
8b14197e3e14f24cc511f024aed46ac99e9e378b | a80d7e8ccc629e8982d8d337480ae55b0c71ac23 | sramos02/FAL_Fundamentos_De_Los_Algoritmos | /Otros/letrasVueltaAtras.cpp | C++ | cpp | 1,007 | permissive | #include <iostream>
#include <vector>
using namespace std;
//Dada n letras diferentes, diseñar un algoritmo que calcule las palabras con m letras (m <= n) diferentes
//El orden de las letras es importante
bool esValida(vector<int> solucion, int k){
int i = 0;
while(i < k && solucion[i] != solucion[k])i++;
... |
3150729cf26b836d7179fedf60a644ff66f2f087 | 0fbe2b55bdf314549b6e60f8b3b657f3d2496523 | bbangwon/bbangwon_study | /bws_cpp/LinkedListStack/LinkedListStack.cpp | C++ | cpp | 2,931 | no_license | // LinkedListStack.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다.
//
#include "stdafx.h"
#include "LinkedListStack.h"
#include "Calculator.h"
void LLS_CreateStack(LinkedListStack** Stack)
{
/*스택을 자유 저장소에 생성*/
(*Stack) = new LinkedListStack;
(*Stack)->List = nullptr;
(*Stack)->Top = nullptr;
}
void LLS_DestroyStack(LinkedListS... |
27d00dea170d47f2b778ebec6e39940efa256f1a | e45e686dd0eeace04e9f241b69b0fb840f006490 | Superjomn/Paddle | /paddle/fluid/operators/kldiv_loss_op.cc | C++ | cc | 5,738 | permissive | /* Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
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... |
6f2944369f29e69ae72b98787241fbc3449de432 | 01fc51ea5c6ebd762bcf136bd47b0fdd1d3de1bb | lucasvickers/ciFlyCap | /samples/FireFlyBasic/src/FireFlyBasicApp.cpp | C++ | cpp | 945 | no_license | #include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Texture.h"
#include "ciFlyCap.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class FireFlyBasicApp : public AppNative {
public:
void setup();
void mouseDown( MouseEvent event );
void update();
void draw();
... |
62d7ae84961a546665c47b277c47d2a6b33931b9 | 492f27995e5746da8404b58c3db29e39a001727f | dbc148/dynet | /dynet/nodes-conv.cc | C++ | cc | 16,620 | permissive | #include "dynet/nodes-conv.h"
#include <sstream>
#include <limits>
#include <cmath>
#include <stdexcept>
#include <array>
#include "dynet/functors.h"
#include "dynet/nodes-macros.h"
#if HAVE_CUDA
#include "dynet/cuda.h"
#include "dynet/gpu-ops.h"
#endif
using namespace std;
namespace dynet {
#ifndef __CUDACC__
s... |
fbee48abcfc7bfa4b960e37e89b49de69c4cfe56 | 339501ecccf12b0a227338f024395fbdfa6788e2 | bryantbyr/LeetCode-solutions | /303. Range Sum Query - Immutable.cpp | C++ | cpp | 750 | no_license | //303. Range Sum Query - Immutable.cpp
#include <iostream>
#include <vector>
using namespace std;
//20170818
//Time:O(n)
//Space:O(n)
//DP
class NumArray {
public:
NumArray(vector<int> nums) {
// int t=0;
// sum.push_back(0);
// for(unsigned int i=1;i<=nums.size();i++){
... |
139418279aa5009e081e30e29d28db37d3ebceca | 11cf27135286caa5f9a4b562c56b0fd7ba37357c | slixurd/vespa | /searchcore/src/vespa/searchcore/proton/matching/fakesearchcontext.cpp | C++ | cpp | 570 | permissive | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "fakesearchcontext.h"
namespace proton {
namespace matching {
FakeSearchContext::FakeSearchContext(size_t initialNumDocs)
: _clock(),
_doom(_clock, -1),
_selector(new search... |
cb64f5a0cea862047cdae4f5c681e293ae58154e | 3d7e1911ac0dc320d5a6ab3e9942bb1cd3e45793 | UTP-TriforceX/Competitions | /CCPL/CCPL 01 - 2016/E - Going Shopping with Grandma (I).cpp | C++ | cpp | 594 | no_license | #include <bits/stdc++.h>
#define MOD 9999959999
using namespace std;
long memo[2001][2001];
long DP(long l, long s) {
if (l <= 0 and s <= 0) return 0;
if (memo[l][s] != -1) return memo[l][s];
long ans = 0;
if (s > 0) {
ans += DP(l, s - 1) + 1;
ans %= MOD;
}
if (l > 0) {
ans += DP(l - 1, s + ... |
19a7a946634cf81ab8f610db1d6706bc116936a3 | eeab082336d6b0118e603dabd750e4e86116d2e1 | amir5200fx/Tonb | /TnbMesh/TnbLib/Cad/GapCurve/T/UniMetric/Cad_tPlnGapCurveUniMetric.cxx | C++ | cxx | 1,812 | no_license | #include <Cad_tPlnGapCurveUniMetric.hxx>
#include <Aft2d_tSegmentGapEdgeUniMetric.hxx>
#include <TModel_ParaCurve.hxx>
#include <TnbError.hxx>
#include <OSstream.hxx>
template<>
std::pair
<
std::shared_ptr<tnbLib::Aft2d_tPlnCurveSurfaceUniMetric>,
std::shared_ptr<tnbLib::Aft2d_tPlnCurveSurfaceUniMetric>
>
tnbLib::C... |
889f903c823adc34615eff9a7a1bc6992818a534 | c6d2b3ec8c46e22c7eb1eadd80ceeff96953a339 | DLR-TS/SUMOLibraries | /gdal-3.4.0/ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp | C++ | cpp | 85,723 | permissive | /******************************************************************************
*
* Project: Oracle Spatial Driver
* Purpose: Implementation of the OGROCITableLayer class. This class provides
* layer semantics on a table, but utilizing a lot of machinery from
* the OGROCILayer base class.
*... |
257ad4c628788bd6fdf3ee7343560ee698db208e | 3120b3aab586c72fc2800a11399e9948d58dea53 | brigitac/pirma_uzduotis | /main.cpp | C++ | cpp | 2,957 | no_license | #include <iostream>
#include <string>
#include <iomanip>
using std::cout; using std::cin; using std::endl; using std::string; using std::setprecision; using std::fixed;
double galBalas_mediana(int mas[],int nd_sk, int egz_paz);
double galBalas_vidurkis(int mas[],int nd_sk, int egz_paz);
int* masyvo_tvarkymas(int mas[],... |
7d278e5e5dd916a2c95e74b5a75e814129f72d71 | fd88aa7d4ce30e96da8dabdcd80e706de5fa247c | fycookie/PD | /appForWin/FileViewerDialog.cpp | C++ | cpp | 2,268 | no_license | #include "FileViewerDialog.h"
#include <QVBoxLayout>
FileViewerDialog::FileViewerDialog(QWidget *parent) :
QDialog(parent)
{
setWindowTitle(tr("File Viewer"));
currDir = new QLineEdit;
currDir->setText("E://");
fileListWidget =new QListWidget;
QVBoxLayout *vbLayout=new QVBoxLayout(this);
vb... |
4a820cfcb2a75c9d65e8455fe68b431fe53a04f1 | d7ba09aad0ed16745ebad8e9a262e8eedbcd3a6f | cormoran/CompetitiveProgramming | /src/contest/aoj/1192/main.comp.cpp | C++ | cpp | 722 | no_license | #include <bits/stdc++.h>
using namespace std;
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
template<class T> bool set_max(T &a, const T &b) { return a < b ? a = b, true : false; }
class Solver {
public:
int price(double p, double x) {
return floor(p * (100 + x) / 100.0);
}
bool so... |
f8c5790a290fb29b2c9f09689216a3dec8f171ff | efb1875d4c4ce62403b2e143bcabd16f4ae12b4e | SDxKeeper/dldt | /ngraph/core/reference/include/ngraph/runtime/reference/sum.hpp | C++ | hpp | 2,763 | permissive | // Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <cmath>
#include <numeric>
#include "ngraph/coordinate_transform.hpp"
#include "ngraph/shape_util.hpp"
#include "ngraph/type/bfloat16.hpp"
#include "ngraph/type/float16.hpp"
namespace ngraph {
namespace runt... |
c9ee4144ce7b2fa468a122e87daf53c699866b31 | 37a98cda950a28a52a9c878a336f231641d5fa60 | YC-collection/loco | /src/common/LegStateTouchDown.cpp | C++ | cpp | 2,425 | permissive | /*****************************************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2014, Christian Gehring, Péter Fankhauser, C. Dario Bellicoso, Stelian Coros
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or with... |
d2dc3abb22b62279093a7818c74736f410b51950 | 032be02c67d35999cbfa0e1ac5539a1969d2bbb7 | vimalmanohar/old-kaldi-git | /src/cudamatrix/cu-vector.cc | C++ | cc | 35,024 | permissive | // cudamatrix/cu-vector.cc
// Copyright 2012-2013 Karel Vesely
// 2012-2014 Johns Hopkins University (author: Daniel Povey)
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complia... |
3d4bfe8f0f9f59f7545aa837d6c7c6306c351050 | 4a03b78a52c1b899ebc7d17c4dd4291f44383921 | ronsaldo/simple-cpp-game-template | /src/GameLogic.cpp | C++ | cpp | 2,538 | permissive | #include "GameInterface.hpp"
#include "HostInterface.hpp"
#include "GameLogic.hpp"
#include <algorithm>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
GlobalState *globalState;
HostInterface *hostInterface;
static MemoryZone *transientMemoryZone;
uint8_t *allocateTransientBytes(size_t byteCount)
{
retur... |
85d8dee8f17d0340a8165a9bc8e32814feaddc06 | 306f4db14b8bb845bbb5bdef02de4689c84a0e00 | fetchai/ledger | /libs/oef-messages/include/oef-messages/search_response.hpp | C++ | hpp | 1,544 | permissive | #pragma once
//------------------------------------------------------------------------------
//
// Copyright 2018-2020 Fetch.AI Limited
//
// 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 Licen... |
07528af41bd94e8bb45de7b7a5a7347512c3be0d | 435348e5531a24dad278e955b92a3ae2f5db5fce | vsboy/Data-structures---stacks-and-queues | /授课例程(周单元4)/回文字符串的判定(栈的应用)/回文/test.cpp | C++ | cpp | 433 | no_license | #include<iostream>
#include<string>
using namespace std;
#include"SeqStack.cpp"
void main()
{
char str[50];
cout<<"请输入一个字符串";
gets(str);
SeqStack<char> S;
int len,i;
len=strlen(str);
for(i=0;i<len;i++)
S.Push(str[i]);
i=0;
while(!S.Empty() && i<len )
{
if(S.Pop()==str[i])
i++;
else
{
cout<<str... |
ea37c09f6f74398f5278fef759cf0c1a3b9df287 | c96cc46b3c6e9fc239d381240b3655e05ec8a6ed | Fuzzbawls/PIVX | /src/qt/paymentserver.cpp | C++ | cpp | 24,517 | permissive | // Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2020 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "paymentserver.h"
#include... |
34ff1f4e4eb6050b51ba0def6a89ca047d4151f3 | 72a9edf36fcb6de1339695431e572e3efef9a2e4 | tomvidm/preppers-brainstorm-repo | /test/game/TestWorldsimParty.cpp | C++ | cpp | 1,288 | no_license | #include "TestWorldsimParty.h"
namespace game {
void TestWorldsimParty::SetUp()
{
wc1.setAttribute(WorldsimCharacter::Attributes::SoftAttack, 1.f);
wc2.setAttribute(WorldsimCharacter::Attributes::SoftAttack, 5.f);
wc3.setAttribute(WorldsimCharacter::Attributes::HardAttack, 10.f);
}
... |
5f99601b3a7b131a0a849e94b17f365f8e57780e | e4a20ed211a29f8d477f841458cd7965d739343c | arctic-han/video-Algorithm-QWL | /021chipTest.cpp | C++ | cpp | 4,132 | no_license | #include <list>
#include<algorithm>
#include <iostream>
using namespace std;
//来源于https://github.com/zhang35/Algorithm-Design-And-Analysis/blob/master/%E7%AC%AC2%E7%AB%A0%20%E5%88%86%E6%B2%BB%E7%AD%96%E7%95%A5%20/%E8%8A%AF%E7%89%87%E6%B5%8B%E8%AF%95.cpp
struct Chip{
int label; //第几个芯片
int state; //... |
ee62021902056fe20ee70d2df7199614d4cc7023 | f887588270500c0d5388c958e5341e4627eb3f18 | krutibaraiya/Codeforces | /1133C.cpp | C++ | cpp | 555 | no_license | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
const int N = 2e5 + 5;
int32_t main()
{
IOS;
int n,start,end,ans=0;
cin >> n;
int a[n];
for(int i=0; i<n; i++)
{
cin >> a[i... |
5c22f7ff5d1a6c704930e9c22951c55c9c271d46 | 000a6bbd51f4ce70bcc72ec8efdacfee876ad389 | shjii/Map-Tool | /Myprojects/SampleLOD2/SMapLOD.cpp | C++ | cpp | 6,242 | no_license | #include "SMapLOD.h"
void SMapLOD::InitLevelOrder(SNode* pRooSNode, int iMaxDepth)
{
m_LevelList.resize(iMaxDepth + 1);
for (int iLevel = 1; iLevel < iMaxDepth + 1; iLevel++)
{
m_LevelList[iLevel].resize(pow(4.0f, iLevel));
}
m_LevelList[0].push_back(pRooSNode);
}
void SMapLOD::SetLOD(DWORD dwWidth, int iNumD... |
088a7443fca18a310d4182f2df1de70054349746 | 4c906d6b6686f2c16d93222460c2fa8560a1521e | molar/FroboMind | /fmControllers/platform/roboteq/include/roboteq/hbl2350.hpp | C++ | hpp | 4,026 | no_license | /****************************************************************************
# FroboMind
# Copyright (c) 2011-2013, author Leon Bonde Larsen <leon@bondelarsen.dk>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followin... |
c11fe7b493d5d364b047c776697eb5fbb913d93b | 0719b052c4b91a182899c95f3c8a977b1c7f132d | Yuanjrah/BetaShapeMachine | /Code/ShapeSynthesis/ShapeSynthesis/SamplePoissonDisk.cpp | C++ | cpp | 6,997 | no_license | #include "SamplePoissonDisk.h"
const double SamplePoissonDisk::RELATIVE_RADIUS = 0.76;
float mSample_MinimumSampleRate = 0.8;
int mSample_MaximumFailedCount = 10000;
SamplePoissonDisk::SamplePoissonDisk(void)
{
}
SamplePoissonDisk::SamplePoissonDisk(vector<ivec3> face_list, vector<vec3> position, vector<vec3> normal)... |
eda5492daf3409146db0e5c54fa9c66564640027 | de5115321721d5fc341cc331c7fe09bd2429ab50 | KendalDroddy/CPP_EarlyObjects | /Chapter_3/3_3.cpp | C++ | cpp | 1,279 | no_license | /*********************************************************************
** Author: Kendal Droddy
**
** Date: February 8, 2017
**
** Description: Write a program that askes the user to enter their
** monthly costs for each of the following housing-related expenses:
** Rent, utilities, phone, and cable. The program should... |
3bcf1e9937f49c79e036c563ddb5b8623eb2bc0a | 232fb95f079fb8a2d98dfa3e34208c8d43049d62 | Mat-Loz/ofxSimpleSpline | /src/ofxSimpleSpline.cpp | C++ | cpp | 4,644 | no_license | //
// ofxSimpleSpline.cpp
//
// Created by lars berg on 10/23/13.
//
//
#include "ofxSimpleSpline.h"
/**
* Catmull-Rom 1D interpolation
*/
float ofxSimpleSpline::interpolate( float p0, float p1, float p2, float p3, float w, float w2, float w3 )
{
float v0 = ( p2 - p0 ) * 0.5, v1 = ( p3 - p1 ) * 0.5;
return ( 2 ... |
1beefe1d2ceacc8707c266816f97acb86e89c07c | fff4ae90ba4a47268b502641ba4189f8db33e431 | wpilibsuite/allwpilib | /simulation/halsim_ws_server/src/test/native/cpp/WebServerClientTest.cpp | C++ | cpp | 4,642 | permissive | // Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "WebServerClientTest.h"
#include <cstdio>
#include <fmt/format.h>
#include <wpi/SmallString.h>
#include <wpin... |
783e8ea2b90bbcc19ce1f188b6f83734d54e8011 | 93905d1838ad986c669d28207ba18a7a17bb812a | PopCap/GameIdea | /Engine/Source/Runtime/Core/Private/Tests/Internationalization/MetadataTest.cpp | C++ | cpp | 21,367 | permissive | // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "CorePrivatePCH.h"
#include "AutomationTest.h"
#include "Internationalization/InternationalizationMetadata.h"
IMPLEMENT_SIMPLE_AUTOMATION_TEST(FMetadataTest, "System.Core.Misc.Internationalization Metadata", EAutomationTestFlags::ATF_SmokeTest)
b... |
d7ccf2f714e2ada78c222c857c5793c17cb2a99e | 8c318acdd1a6840bf7baa664bc2952976319ab7e | LineageOS/android_system_nfc | /src/fuzzers/nci/hal.cc | C++ | cc | 4,092 | permissive | #include "fuzz.h"
void hal_inject_event(uint8_t hal_evt, tHAL_NFC_STATUS status) {
tNFC_HAL_EVT_MSG msg = {};
msg.hdr.len = 0;
msg.hdr.event = BT_EVT_TO_NFC_MSGS;
msg.hdr.offset = 0;
msg.hdr.layer_specific = 0;
msg.hal_evt = hal_evt;
msg.status = status;
FUZZLOG("Injecting event to NFC code: event=%d... |
51e18cd3fd641442f6bc9f4522a8d29a358040cc | bdc471663ac4425a8b107e56875512efd30c59bd | tvanginkel/BattleTank | /BattleTank_UE4/Source/BattleTank_UE4/Private/Projectile.cpp | C++ | cpp | 969 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "Projectile.h"
#include "GameFramework/ProjectileMovementComponent.h"
#include "Engine/World.h"
// Sets default values
AProjectile::AProjectile()
{
// Set this actor to call Tick() every frame. You can turn this off to improve... |
36ea10e8cb96c48c51d8829f0f0e5852a62fe563 | aba82ad548b1ae918c4f687097e45e7679a70dd7 | pushp360/CCC | /C++/Operating-Systems/File-Organization/Single-Level/sl.cpp | C++ | cpp | 984 | no_license | /*
* Created Date: Monday May 6th 2019
* Author: Gurubalan Harikrishnan
* Email-ID: gurubalan.work@gmail.com
* -----
* Copyright (c) 2019 Gurubalan Harikrishnan
*/
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int fileno,i,newalloc=0;
char files[100][100], fname[100], dirname[100]... |
6920952bf7486ab1d67fe98346657622ddc0b725 | 00c4ebcb6e68a56f4aa80e4514c3d6ac2a10e3b1 | Thomassheng/mt8735-vendor | /mediatek/proprietary/platform/mt6735/hardware/mtkcam/D2/core/featureio/pipe/aaa/aaa_hal_base.cpp | C++ | cpp | 5,249 | no_license | /* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or ... |
66a2c3977c9b9730606f5cd84a47f350ee86c1c1 | 989b42832158288eab6d3e6df361656c898f5ac7 | Pandinosaurus/OTB | /Examples/IO/MetadataExample.cxx | C++ | cxx | 5,534 | permissive | /*
* Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* 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 ... |
9a54573e5bdbdc063d20ab389161e8b84aa38b43 | e96a5451d6fcdc0088205f3cfb9f9d77122c3808 | akshit-thakur/college | /first-year/cpp/FriendComplexAdd.cpp | C++ | cpp | 484 | no_license | #include<iostream>
using namespace std;
class Complex{
int real,imag;
public:
void getComplex(){
cout<<"Enter real and imaginary part: \n";
cin>>real>>imag;
}
void show(){
cout<<real<<" +j"<<imag<<"\n";
}
friend Complex sum(Complex &c1,Complex &c2){
Complex temp;
temp.real=c1.real+c2.real;
temp.ima... |
e8c6e58624d301da5a5d6abe68562cb50df0e5c2 | 1a7c893306da40d59a3b7e915e3da08112e8de7d | lsils/mockturtle | /experiments/window_rewriting.cpp | C++ | cpp | 3,563 | permissive | /* mockturtle: C++ logic network library
* Copyright (C) 2018-2022 EPFL
*
* 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... |
fa9db72a1285bae4554c3197a02710216dd23722 | 23afcfd437a9716af48e9b994ae114de7ca6f446 | tucoUgl/chance_lottery-S- | /mainwindow.cpp | C++ | cpp | 3,173 | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <numeric>
using std::vector;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QFile file("23.txt");
if(file.open(QIODevice::ReadOnly)){
qDebug() << "Ошиб... |
3a563594a4addcc081f151a972069121f3cd3670 | 982473bbd8a23ce22e5f6086f55578d4171fe933 | Keybinhoainam/codecpp | /ctdl/tonglonnhatcuadayconkhongkenhau.cpp | C++ | cpp | 420 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
long long n;
cin>>n;
long long a[n+5],kq=0;
for(int i=1;i<=n;i++)
{
cin>>a[i];
kq=max(kq,a[i]);
}
a[0]=0;
long long t[n+5];
t[1]=a[1];t[2]=a[2];t[0]=a[0];
// cout<<a[1]<<" "<<a[2]<<" "<<kq<<endl;
for(int... |
805212e9a7e704a2fb393d61a88315686048d298 | 578a83a5a0ae2b59efbe86bfdf342ef53d271e93 | JulianThijssen/glPortal | /source/engine/Ray.cpp | C++ | cpp | 1,229 | permissive | #include "Ray.hpp"
#include "Entity.hpp"
#include <climits>
namespace glPortal {
bool Ray::collides(const Entity &e, float *tNear, float *tFar) {
float min[3] = {e.position.x - e.scale.x / 2,
e.position.y - e.scale.y / 2,
e.position.z - e.scale.z / 2};
float max[3] = {e.positi... |
81723d73a5d0a4dc8a1c8809666280c2b0e1c665 | b1c4e8bd4123a3607723306f4d385b5c2765e696 | Virus9nder/OOP | /2k8/2k8/1.cpp | C++ | cpp | 1,573 | no_license |
#include <iostream>
#include <conio.h>
#include "windows.h"
#include "Exeptions.h"
#include "Stack.h"
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
try
{
Stack<int> St;
Stack<int> Test;
Stack<int> St1;
Stack<double> St2;
// Stack<float> St3;
... |
ed34b6910c7ed19d7ccbf7b8a2fb41ab7d8b3881 | 6d8ca3e8a0195ed2e11cf67207229bb1ad79f007 | lfisher5/CPSC-122 | /project7.cpp | C++ | cpp | 2,848 | no_license | /*
Class: CPSC 122 - 02
Team Member: Lauren Fisher
Submitted by: Lauren Fisher
GU Username: lfisher5
FileName: project7.cpp
Program illustrates dynamic allocation of memory and linked lists
To build: g++ project7.cpp project7Tst.cpp
To execute: ./a.out
*/
#include <iostream>
using namespace std;
#include "project7.h... |
a3c7e0acc5df4c290954af1534329410b79aa571 | fe5c846d282851941ba3797cbade718debfddf02 | thngkaiyuan/chromium | /content/renderer/shared_worker/shared_worker_repository.cc | C++ | cc | 2,198 | permissive | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/shared_worker/shared_worker_repository.h"
#include "content/common/view_messages.h"
#include "content/renderer/render_frame_im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.