blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 117 | path stringlengths 3 268 | src_encoding stringclasses 34
values | length_bytes int64 6 4.23M | score float64 2.52 5.19 | int_score int64 3 5 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | text stringlengths 13 4.23M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
d5a198bd8b50c2a7e822b558e430c7ea428ea984 | C++ | TLeonardUK/ZombieGrinder | /Source/Generic/Math/Noise/Noise.cpp | UTF-8 | 3,511 | 3.078125 | 3 | [] | no_license | // ===================================================================
// Copyright (C) 2013 Tim Leonard
// ===================================================================
// A lot of the code in this file is based off code provided at;
// https://code.google.com/p/battlestar-tux/
// Full credit to them!
// ======... | true |
86de27b49f7f602fb2792c89bad66a5c2f4f7cdc | C++ | 0xc0dec/solo | /vendor/glm/0.9.8.4/glm/gtx/fast_square_root.inl | UTF-8 | 2,611 | 3.015625 | 3 | [
"Zlib"
] | permissive | /// @ref gtx_fast_square_root
/// @file glm/gtx/fast_square_root.inl
namespace glm
{
// fastSqrt
template <typename genType>
GLM_FUNC_QUALIFIER genType fastSqrt(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fastSqrt' only accept floating-point input");
return genType(1) ... | true |
6a9ce067674c56fc43308dc97c62c077f2750c2e | C++ | acsearle/mania | /mania/capture.hpp | UTF-8 | 655 | 2.96875 | 3 | [] | no_license | //
// capture.hpp
// mania
//
// Created by Antony Searle on 7/8/19.
// Copyright © 2019 Antony Searle. All rights reserved.
//
#ifndef capture_hpp
#define capture_hpp
#include <tuple>
#include <utility>
namespace manic {
// Make a tuple that perfect-captures the arguments.
//
// If an argument ... | true |
12eecb8e9ec484d2957ac0f5b225d122efdee727 | C++ | 0000duck/FabEngine | /FabEngine/inc/Mouse.h | UTF-8 | 1,239 | 2.609375 | 3 | [] | no_license | #pragma once
#include <DirectXComponentsPCH.h>
#include "IComponent.h"
using namespace DirectX;
namespace Fab
{
enum class MouseButtonName
{
LEFT, RIGHT, MIDDLE, WHOLE
};
enum class MouseButtonState
{
PRESSED, RELEASED
};
struct MouseButton
{
MouseButtonName Name;
MouseButtonState State;
MouseBu... | true |
011adc5dd6861d97655dc299b2156e8dba745a31 | C++ | jvujcic/RP1 | /Cetvrtak/Vjezbe03/copy_konstruktor.cpp | UTF-8 | 946 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
struct MyString {
char *str;
MyString() {
str = new char[1];
str[0] = '\0';
}
MyString(const char *s) {
str = new char(strlen(s));
strcpy(str, s);
}
MyString(const MyString &mystr) {
str = ne... | true |
67a0dbd85f3d14fc5c359564d3155e67b30445fe | C++ | aidandan/algorithm | /5动态规划/1088滑雪.cpp | GB18030 | 1,790 | 3.28125 | 3 | [] | no_license | //http://bailian.openjudge.cn/practice/1088/
#include <algorithm>
#include <iostream>
using namespace std;
struct section
{//
int x, y;//
int h;//߶
bool operator<(section s1)
{
return h < s1.h;
}
};
const int R = 100, C = 100;
//ÿ
section sec[R * C] = { 0 };
int a[R][C] = { 0 }; //
//ÿΪյ·߳
int len[R][C] = { 0... | true |
5b6073aba0931a716a0b2f47d786c7c3885a8cda | C++ | TheMarlboroMan/cheap-shooter | /class/aplicacion/decoracion/decoracion_explosion.cpp | UTF-8 | 1,738 | 2.796875 | 3 | [] | no_license | #include "decoracion_explosion.h"
Decoracion_explosion::Decoracion_explosion(float p_x, float p_y, DLibH::Vector_2d p_v):Decoracion(), duracion(0.5f)
{
this->vector_mov=p_v;
this->x=p_x;
this->y=p_y;
this->establecer_caracteristicas();
this->establecer_representacion();
}
Decoracion_explosion::~Decoracion_exp... | true |
afa153a2b349603dbf61e5a70c416f29fc711789 | C++ | Pentagon03/competitive-programming | /algorithmic-engagements/2002-2/tar.cc | UTF-8 | 845 | 2.828125 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <algorithm>
int solve(const std::vector<int>& h, int n, int k) {
std::vector<int> cost(n);
for (int i = 0; i < n; ++i) {
if (i == n - 1 || h[i] >= h[i + 1]) cost[i] = 0;
else cost[i] = h[i + 1] - h[i];
}
int ret = 1;
for (int i = 0, cnt = 0, j = 0; i < n; ... | true |
6b8c9fe3bfe7ab5379424a80d575412c6c07dba3 | C++ | chib0/ITC | /CoffeeShop/main.cpp | UTF-8 | 1,883 | 2.84375 | 3 | [] | no_license | // compile in debug settings
// In this process they need to change the executable file so that the program will show the shoe shop menu (which is also declared in menus.h)
#include <stdio.h>
#include "menus.h"
#include <windows.h>
#include <stdlib.h>
COORD pos;
__declspec(noinline) void SaveCursor() {
HANDLE s... | true |
ebecea92431e0de784221fea81f2a55c7ed568c9 | C++ | dahegarty/budgettracker | /budgettracker/expenseItem.h | UTF-8 | 1,225 | 2.859375 | 3 | [] | no_license | //
// expenseItem.h
// budgettracker
//
// Created by Domnall Hegarty on 2/18/16.
// Copyright © 2016 Landward Lemon Technologies. All rights reserved.
//
#ifndef expenseItem_h
#define expenseItem_h
#include <string>
using namespace std;
class expenseItem{
private:
//date
string date;
//pr... | true |
b8e03574632d396886eaeaeb8ef127b6081257a0 | C++ | kaocodes/cpp-routeplanning | /src/backup.cpp | UTF-8 | 372 | 3.21875 | 3 | [] | no_license | /* First Idea without sorting for NextNode() function:
float sum = NULL;
RouteModel::Node* pointer;
for(RouteModel::Node* open_node : this->open_list){
if((open_node->g_value + open_node->h_value) < sum || sum == NULL){
sum = open_node->g_value + open_node->h_value;
*pointer... | true |
b44a973eb8a02aadc5f9e693399229d35424f584 | C++ | linhlevandlu/FAMLab_2017_Thanh | /MAELab/imageModel/Line.h | UTF-8 | 1,632 | 2.703125 | 3 | [] | no_license | /*
Morphometry with Automatic Extraction of Landmarks (MAELab)
Copyright (C) 2017 Le Van Linh (van-linh.le@u-bordeaux.fr)
Created on: Sep 15, 2016
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundatio... | true |
af04f240dacec5c86db2f34335b88e5d58cfb2a0 | C++ | Michael-Lfx/vuk | /include/vuk/SampledImage.hpp | UTF-8 | 1,762 | 2.8125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "vuk/Types.hpp"
#include "vuk/Image.hpp"
#include "Pool.hpp"
#include <optional>
namespace vuk {
// high level type around binding a sampled image with a sampler
struct SampledImage {
struct Global {
vuk::ImageView iv;
vuk::SamplerCreateInfo sci = {};
vuk::ImageLayout image_layout;
... | true |
f74c489e508cc24f528457065e9a9d4ff5f963ff | C++ | HargovindArora/Programming | /Graphs/kosaraju2_SCC.cpp | UTF-8 | 1,419 | 3.21875 | 3 | [] | no_license | #include<iostream>
#include<cstring>
#include<vector>
using namespace std;
void dfs(vector<int> graph[], int i, bool *visited, vector<int> &stack){
visited[i] = true;
for(auto nbr:graph[i]){
if(!visited[nbr]){
dfs(graph, nbr, visited, stack);
}
}
stack.push_back(i);
}
voi... | true |
5fab132434a1225a8b2d5beec29806180d17bd9c | C++ | dtsadok-tw/auroraShapes1 | /src/auroraShapes1.cpp | UTF-8 | 3,785 | 2.984375 | 3 | [
"MIT"
] | permissive | #include "auroraShapes1.h"
void auroraShapes1::setup(){
white = ofColor(255, 255, 255);
color1 = ofColor(64, 64, ofRandom( 128, 255 ) );
color2 = ofColor(ofRandom( 128, 255 ), 64, 64 );
color3 = ofColor(64, ofRandom( 128, 255 ), ofRandom( 128, 255 ) );
color4 = ofColor(64, 64, ofRandom( 128, 255 )... | true |
b91ca33f00522323579ec4ceba43c07cb9dd1f10 | C++ | AhuntSun/C-CLI | /最後的小组项目/小组项目/上位机/小组项目3上位机/BZ.h | GB18030 | 2,532 | 2.890625 | 3 | [] | no_license | #pragma once
namespace СĿ3λ {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// BZ ժҪ
/// </summary>
public ref class BZ : public Syste... | true |
34c0d6a97bef3904e4f916c4d77ad6a061aeb4d3 | C++ | materlai/leetcode | /011_container_most_water.cpp | UTF-8 | 803 | 3.3125 | 3 | [] | no_license | /*
leetcode algorithm 011: container with most water
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
using namespace std;
class Solution {
public:
int maxArea(vector<int>& height)
{
/* can not pass time limited with O(n*n) */
int first_index=0;
int last_index=height.size... | true |
c82f5c88c35aeb81da1e0641c5e0c2d4287cca2c | C++ | johanngan/particle_reco | /Cut_optimization/ROOT_Util/loadObj.h | UTF-8 | 4,714 | 2.96875 | 3 | [] | no_license | //
// loadObj.h
// ROOT_Util/
//
// Created by Johann Gan on 6/2/17
//
//
// Template function. Opens a file and reads in a specified object. Returns a unique_ptr to the object.
//////////////////////////////////////
#ifndef LOADOBJ_H_
#define LOADOBJ_H_
//////////////////////////////////////
// Dependencies
#in... | true |
c636339bd67a8dd564d26bcd6d0655d732d234ef | C++ | yury-dymov/legacy_l2tradebot | /dialog/ui_recipeshopiteminfo.cpp | UTF-8 | 3,030 | 2.625 | 3 | [] | no_license | #include "recipeshopiteminfo.h"
RecipeShopItemInfo::RecipeShopItemInfo (int recipeId, int mp, int maxMp)
{
bool available = true;
table_ = new QTableWidget (0, 2);
QList <QString> labels;
labels.push_back ("Item");
labels.push_back ("Amount");
table_->setHorizontalHeaderLabels (QStringList (labels));
table_->ve... | true |
c0f9f7c5288735cfed9bd3526b4b13f28f75da78 | C++ | alexandraback/datacollection | /solutions_5690574640250880_0/C++/pvtGero/main.cpp | UTF-8 | 1,911 | 2.78125 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int c, R, C, M;
bool found;
void print(char gg[][51]){
printf("Case #%d:\n", c);
for(int i = 0; i < R; i++){
for(int j = 0; j < C; j++){
if(gg[i][j] != '\0') printf("%c", i == 0 && j == 0 ? gg[i][j] : '.');
else printf("%c", ... | true |
8591ed5dcd200e2e8276b75d60eec4455468462e | C++ | neer1304/CS-Reference | /CPP/Generic_Programming/stl/mapstr.cpp | UTF-8 | 678 | 3.515625 | 4 | [] | no_license |
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main ()
{
map<string, string> strMap;
strMap["Sunday"] = "0";
strMap["Monday"] = "1";
strMap["Tuesday"] = "2";
strMap["Wednesday"] = "3";
strMap["Thursday"] = "4";
strMap["Friday"] = "5";
strMap.inse... | true |
f9c4286cd24bdbd90f27ef4b51a0ba0a4dbfdc44 | C++ | Willz789/Eksamensprojekt | /PolyTank/PolyTank/Body.h | UTF-8 | 1,015 | 2.625 | 3 | [] | no_license | #pragma once
#include "ConvexShape.h"
#include <memory>
class Body {
public:
Body(std::unique_ptr<ConvexShape>&& pShape, DirectX::FXMVECTOR initPos, DirectX::FXMVECTOR initRot);
virtual ~Body() = default;
DirectX::XMVECTOR getPosition() const;
DirectX::XMVECTOR getRotation() const;
DirectX::XMMATRIX getTransfor... | true |
906b99105e6dd65fac2c1f5fc05ff91dc6780c58 | C++ | barjinderpaul/Programming | /STL/searching binary search.cpp | UTF-8 | 710 | 3.453125 | 3 | [] | no_license | //searching
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int value,t,n,numberToFind;
cin>>t;
while(t-- > 0){
cin>>n;
vector<int> a;
for(int i=0;i<n;i++)
{
cin>>value;
a.push_back(value);
}
cin>>numberToFind;
sort(a.begin(),a.end()); //sorting because ... | true |
f3f074bbed290dfa6c10394a88614691bfcc0192 | C++ | faroos3/CSCI2600_S17_lab_work | /lab10/first_LCD_thing/first_LCD_thing.ino | UTF-8 | 3,676 | 2.78125 | 3 | [] | no_license | #include <LiquidCrystal.h>
/******************************************************************************************************************/
/*********** LCD Initialization Code - Don't change unless you want stuff to stop working! ********************/
/*********************************************************... | true |
3a22b730b669ad139733ac562f139955f7ef67fa | C++ | endiliey/competitive-programming | /Codeforces/782B.cpp | UTF-8 | 772 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define all(c) c.begin(), c.end()
#define epsilon 1e-7
#define N 60010
typedef long long ll;
using namespace std;
ll x[N];
ll v[N];
bool check(double t, int n)
{
double top = -1e9;
double bot = 1e9;
for (int i = 0; i < n; i++)
{
top = max(top, x[i] - v[i] * t);
bot = min(bot, x[i] +... | true |
912649d94661f23fd3d26d2464eb76b9a60f12e6 | C++ | Dsxv/competitveProgramming | /atCoder/ABC/152/d.cpp | UTF-8 | 484 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std ;
#define int long long
pair<int,int> gf(int n){
vector<int> v ;
while(n){
v.push_back(n%10) ;
n/=10 ;
}
return {v.back(),v[0]} ;
}
int32_t main(){
int a[11][11] = {} ;
int n ;
cin >> n ;
for(int i = 1 ; i <= n ; i++){
pair<int,int> p = gf(i) ;
a[p.first][... | true |
c67940c05a1035ff978a88071f9c97683836a542 | C++ | imtiazrayman/LinkedListDatastructsCpp | /cppLinkedList/main.cpp | UTF-8 | 6,610 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include "Node.h"
using namespace std;
int main() {
cout<<"here are the tests, we assume all the print_list function works, otherwise no test will pass\n";
cout<<"press 1 for head_insert test"<<endl;
cout<<"press 2 for list_length test"<<endl;
cout<<"press 3 for list_get_tail, both const and... | true |
e4cb72a068fea446a83590024d71c6bf64e2644d | C++ | drbaird2/Restart | /BRDFs/Lambertian.cpp | UTF-8 | 2,170 | 2.6875 | 3 | [] | no_license | #include "Lambertian.h"
#include "../Utilities/Constants.h"
#include "../Samplers/Multijittered.h"
/*******************************************************************
* Constructors
*
*******************************************************************/
Lambertian::Lambertian():
BRDF(),
kd(0.0),
cd(0.0)
{}
La... | true |
a4ad34756fe298a51f61dd6fc87427be55dffd4e | C++ | felipefoschiera/Competitive-Programming | /Contests/Escola de Inverno UFRGS 2018/Dia 1/B - Babel.cpp | UTF-8 | 1,498 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long ll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;
typedef vector<ss> vss;
typedef map<string, int> msi;
map<string, vss> LG;
msi dist;
int dijkstra(const... | true |
e819ad01d5dea9d347d118e8730548a558db99df | C++ | ryotgm0417/AtCoder | /problems/C/abc059c.cpp | UTF-8 | 1,758 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using P = pair<ll, ll>;
// chmin, chmax関数
template<typename T, typename U, typename Com... | true |
1396ff39ae484356a5ac5da1b33c371462be51cd | C++ | aocsa/stDBMStarTree | /arboretum/test/PBMTree/Texture.h | UTF-8 | 5,124 | 2.71875 | 3 | [
"BSD-2-Clause"
] | permissive |
//Includes
#include <graphics.hpp>
#include <math.h>
#include <arboretum/stBasicObjects.h>
//Typedefs
typedef stBasicArrayObject<float> stArray;
typedef float TipoDescrMatrix[4][5]; // [ang][dist]
typedef float TipoRungMatrix[4][5][16]; // [ang][dist][degrau]
//Definitions
class TTextureExtractorMCO;
class TDe... | true |
90c30887ca82d8365da1b921b5fa2770d0e8dc5e | C++ | ShuhengLi/LeetCode | /Leetcode/Palindrome Linked List.cpp | UTF-8 | 534 | 3.828125 | 4 | [] | no_license | /*
Given a singly linked list, determine if it is a palindrome.
Auth
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool isPalindrome(ListNode* head) {
if (!head) return true;
vect... | true |
e681e290a173c0b31b8765dc7023dc4c4e168e06 | C++ | dma117/Labs_CPlusPlus | /HashMap_lab/HashMap/main.cpp | UTF-8 | 1,628 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include "hash_map.hpp"
#define CATCH_CONFIG_MAIN
#include "../catch.hpp"
TEST_CASE("allocator constructors", "[allocator]") {
SECTION("allocate") {
{
fefu::allocator<int> alloc;
int* place = alloc.allocate();
*place = 2;
REQUIRE(*place =... | true |
962e9c0f09d454dbc8ca50d006448da8aea33afa | C++ | SW0000J/PS | /BOJ/6000/6064.cpp | UTF-8 | 608 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int gcd(int x, int y) {
while (y != 0) {
int rem = x % y;
x = y;
y = rem;
}
return x;
}
int lcm(int x, int y) {
return (x * y) / gcd(x, y);
}
int main() {
ios::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
int T; cin >> T;
for (... | true |
c0149c4ac15606ac4d4a67c49b1ef0374a916977 | C++ | SeonJongYoo/Algorithm | /BOJ/ForCodingTest-CPP/DynamicProgramming/LongestGrowthSeq4.cpp | UTF-8 | 1,171 | 2.8125 | 3 | [] | no_license | // 가장 긴 증가하는 부분수열 4
#include <iostream>
#include <vector>
using namespace std;
int n;
const int MAX = 1001;
int A[MAX];
int dp[MAX];
int parent[MAX];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n;
for (int i = 0; i < n; i++)
cin >> A[i];
dp[0] = 1;... | true |
ffe905a1de11da8f9ec7b87d5ff51a43d1145080 | C++ | MarkPrecursor/OpenCV_Practice | /Stitcher_test/main.cpp | UTF-8 | 1,027 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include "opencv2/highgui.hpp"
#include "opencv2/stitching.hpp"
using namespace cv;
using namespace std;
int main()
{
string srcFile[6]={"1.JPG","2.JPG","3.JPG","4.JPG","5.JPG","6.JPG"};
string dstFile="result.jpg";
vector<Mat> imgs;
for(int i=0;i<6;++i)
{
Mat img=imre... | true |
9d75a109924045f1f83fddc52208cb7ef887ad71 | C++ | mwpowellhtx/simple-pacman-game | /src/cpp/pacmangameconsole/actor_base.hpp | UTF-8 | 1,227 | 2.9375 | 3 | [
"MIT"
] | permissive | #ifndef _ACTOR_BASE_HPP_
#define _ACTOR_BASE_HPP_
#include "positioned.h"
#include <functional>
#include <vector>
namespace pacman {
template<
class Derived
, class Input
>
class actor_base
: public positioned {
public:
typedef Input input_type;
typedef D... | true |
35701f62128db5a6325c61e0d45f2838d598951d | C++ | WhiZTiM/coliru | /Archive2/04/f320ce2cacfc1a/main.cpp | UTF-8 | 417 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <type_traits> // for std::result_of
template<typename Function, Function f>
struct A
{
using function_type = Function;
template<typename... ArgTypes>
typename std::result_of<Function(ArgTypes...)>::type call(ArgTypes... args)
{
return f(args...);
}
};
void func(int i) { std:... | true |
f656595f3fbae4615303c491a0701fe797d7fae6 | C++ | Draklob/TicTacToe_SFML | /TicTacToe/SFML_TEMPLATE/SplashState.cpp | UTF-8 | 1,000 | 2.703125 | 3 | [] | no_license | #include "SplashState.h"
#include "DEFINITIONS.h"
#include "MainMenuState.h"
#include <sstream>
#include <iostream>
SplashState::SplashState(GameDataRef data) : _data( data )
{
}
SplashState::~SplashState()
{
}
void SplashState::Init()
{
this->_data->assets.LoadTexture("Splash State Background", SPLASH_SCENE_BACKG... | true |
35df746713f28dc1539bcfa0b668bbf4a5924bbc | C++ | Phelixh/MTH_4300 | /_src_/HW4/problem_1.cpp | UTF-8 | 1,731 | 3.71875 | 4 | [] | no_license | #include <iostream>
void modify(long** px, long n, long s){
int x, shift = 0;
// initialize a new array measure with new length size
long *y;
y = new long[s];
// itterating through the original array that we defiend
for (int i = 0; i < n ; ++i){
x = (*px)[i];
// if x is 0 we add three zeros and... | true |
11aa7554e5c19416703b83cd75c1a904219a28f1 | C++ | YuePanEdward/PCSNet | /operators/IdxsGather.cc | UTF-8 | 2,453 | 2.546875 | 3 | [] | no_license | #include <tensorflow/core/framework/op.h>
#include <tensorflow/core/framework/shape_inference.h>
#include <tensorflow/core/framework/op_kernel.h>
using namespace tensorflow;
template<typename FLT_TYPE,typename INT_TYPE>
void idxsGather(
FLT_TYPE *feats, // [m,f]
INT_TYPE *nidxs, ... | true |
5c3064c2c741d0a06c7a51b02768397735f122d4 | C++ | JohnDelNorte/battleShip | /Computer.h | UTF-8 | 865 | 2.734375 | 3 | [] | no_license | #ifndef COM_H
#define COM_H
#include<fstream>
#include<string>
#include"Coord.h"
#include"BattleShip.h"
#include"Sub.h"
#include"Frigate.h"
#include"Cruiser.h"
#include"Destroyer.h"
using namespace std;
class Computer
{
public:
void placeShips();//computer will place its ships randomly;
void printGrid();//for diagnos... | true |
e6aa1cfb680cf8d8bb021a8090aee55d0c328f9b | C++ | LimGeon/algorithm | /LimGeon/16236.cpp | UHC | 1,892 | 2.53125 | 3 | [] | no_license | #include <stdio.h>
#include <queue>
#include <windows.h>
using namespace std;
void initVisited();
typedef struct CUR {
int y, x;
int size;
int time;
}CUR;
int map[21][21];
int visited[21][21];
int dx[4] = { 0,-1,1,0 };
int dy[4] = { -1,0,0,1 };
int allTime = 0;
int sharkExp = 0;
int n;
int newStart = 0;
queue<C... | true |
1d3b921c7a80437916ad1c971139a07f21a41057 | C++ | 2505Fredy/Trabajo-final-de-semestre | /Persona.cpp | UTF-8 | 2,799 | 2.984375 | 3 | [] | no_license | #include "Persona.h"
PersonaJuridica::PersonaJuridica(string &_nombreComercial, string &_razonSocial, string &_domicilioFiscal, string &_nroRUC, string &_fin){
nacionalidad= "PERUANA";
tipoIdentificacion= "RUC";
nombreComercial= _nombreComercial;
razonSocial= _razonSocial;
domicilioFiscal= _domicil... | true |
15e369985d90090ca3b63af028f5492516317ab5 | C++ | FilipBor/Lab1 | /homework quadratic formula complex solution.cpp | UTF-8 | 3,231 | 4.09375 | 4 | [] | no_license | #include <iostream>
#include <cmath>
int main(){
std::cout <<"Welcome to the quadratic formula solver!"<<std::endl;
float a; // variable for storing coefficient a
float b; // variable for storing coefficient b
float c; // variable for storing coefficient c
std::cout <<"Please input coefficient a\... | true |
e78864c2b329b11a5d4a9d5251043d5c91488861 | C++ | moskalenko9381/OOPgame | /myOOPGame/consolelogger.h | UTF-8 | 293 | 2.609375 | 3 | [] | no_license | #ifndef CONSOLELOGGER_H
#define CONSOLELOGGER_H
#include "logger.h"
class ConsoleLogger: public Logger
{
std::ostream* output;
int type;
public:
ConsoleLogger();
void write(const std::string& change);
Logger* getNext();
int getTypeLog();
};
#endif // CONSOLELOGGER_H
| true |
92e75d892b75db1f955bc71639a30ba6f18f862f | C++ | AntarikshaKar/C-Primer-5th-Edition | /Chapter 1/1.16.cpp | UTF-8 | 215 | 2.984375 | 3 | [
"MIT"
] | permissive | #include <iostream>
int main()
{
int inp=0,sum=0;
std::cout<<"Enter integer values for sum and non integer to close the program"<<std::endl;
while(std::cin>>inp){
sum+=inp;
}
std::cout<<"sum="<<sum;
return 0;
} | true |
7975db056402155b53f660491d6efeabd58e7763 | C++ | workOnCarrier/AccGrind | /framework/InputRouter.cpp | UTF-8 | 1,230 | 2.5625 | 3 | [] | no_license |
#include "InputRouter.h"
#include <iostream>
namespace AccGrind {
InputRouter::InputRouter ( KeyInputSource &inputSrc, HostInputHandler &InputHandler ): m_InputSource(inputSrc), m_InputHandler(InputHandler){
}
InputRouter::~InputRouter ( ){}
void InputRouter::process (){
std::ostrea... | true |
8b6be83a742240b3c3b7e91edad1ddfefb7b2fe4 | C++ | Elavarasi-P/Window_with_Menus_and_Controls | /WP5/Source.cpp | UTF-8 | 3,593 | 2.546875 | 3 | [] | no_license | #ifndef UNICODE
#define UNICODE
#endif
#include <windows.h>
#define FILE_MENU_NEW 1
#define FILE_MENU_OPEN 2
#define FILE_MENU_EXIT 3
#define CHANGE_TITLE 4
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void AddMenus(HWND hwnd);
void AddControls(HWND hwnd);
HMENU hMenu;
HWND hE... | true |
d2bafc78e6a8807ea90a5f00771d041676b124bd | C++ | ayates1306/first-dev | /cplusplus/day13/string.cc | UTF-8 | 3,633 | 3.984375 | 4 | [] | no_license | #include <iostream>
#include <string.h>
// example string class
// will learn about [] operator overloading
using namespace std;
class String
{
public:
// constructors
String(); // basic constructor
String(const char*); // constructor from const char*
// copy constructor
// destructor
~String();
Str... | true |
ee96d6367767fb63fdb012b4b146181831c026ae | C++ | Ef55/tfl | /examples/kaleidoscope/src/AST.hpp | UTF-8 | 3,581 | 3.109375 | 3 | [
"BSL-1.0"
] | permissive | #pragma once
#include <string>
#include <vector>
#include <memory>
#include <optional>
class ExprAST;
class PrototypeAST;
class FunctionAST;
template<typename R>
class ASTVisitor {
public:
virtual R number(double v) = 0;
virtual R variable(std::string const& name) = 0;
virtual R binary(char op, ExprAST c... | true |
71e3587b0587813edff596790a7dfec3f9b49e98 | C++ | jregenstein/line-maze-bot | /line_maze/line_maze_advanced.ino | UTF-8 | 6,386 | 3.03125 | 3 | [] | no_license | /**Line maze solver
* Jacob Regenstein
*
* Uses left turn rule
*
*
*/
#include "MeOrion.h"
//motor1 is right motor, motor 2 is left motor. I'd like to change this but it works as is and I don't want to introduce bugs
MeDCMotor motor1(M1);
MeDCMotor motor2(M2);
MeBuzzer buzzer;
#define NOTE_A4 440
//leftTurnC... | true |
4f667d10e0dbbe50f623be8886fd5a57a0509220 | C++ | aanchaliitd/Practice2 | /ComputeMeanModeMinMax.cpp | UTF-8 | 1,172 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <unordered_map>
#include <algorithm>
#include <vector>
using namespace std;
class TempTracker {
public:
TempTracker() : _sum(0), _count(0), _min(INT_MAX), _max(INT_MIN), _modeTemp(-1), _tempCount(111) {}
void insert(int temp) {
_tempCount[temp]++;
_sum += temp;
... | true |
f905110c69b5c83e7e8ceb123c24cd18af371a40 | C++ | juwh/ctci6 | /test/ch07_object_oriented_design/q06_jigsaw/main.cpp | UTF-8 | 779 | 3.25 | 3 | [] | no_license | #pragma region Interview Question
/*
7.6 Jigsaw: Implement an NxN jigsaw puzzle. Design the data structures and explain an algorithm to
solve the puzzle. You can assume that you have a fitsWith method which, when passed two
puzzle edges, returns true if the two edges belong together.
*/
#pragma endregion
#pragma regio... | true |
dcd22cbba5f2e906af00dfac92b9595cb1da3da4 | C++ | thuylinh-uit/Object-Oriented-Programming | /Thi TH CK/Apollo.cpp | UTF-8 | 392 | 2.75 | 3 | [] | no_license | #include "Apollo.h"
Apollo::Apollo()
{
this->alpha = 10;
this->loaiPT = "Van chuyen chuyen cho";
this->N = 15 + rand() % 16;
}
int Apollo::tieuThuNL(int T)
{
return (alpha + N) * T;
}
void Apollo::xuat(int T)
{
PhiThuyen::xuat();
cout << "So luong nguoi: " << N << endl;
cout << "So nhien l... | true |
a3f7d35fdde6baf42b646826c7dcfe5746e75bca | C++ | maple-ysd/data_structure_and_algorithm | /UnionFind/WeightedQuickUnion.h | GB18030 | 1,570 | 3.578125 | 4 | [] | no_license | #ifndef WEIGHTEDQUICKUNION_H_
#define WEIGHTEDQUICKUNION_H_
#include <iostream>
class WeightedQuickUnion
{
public:
WeightedQuickUnion(int n);
~WeightedQuickUnion() { delete arr; delete weight; }
int count() { return sz; }
bool connected(int p, int q) { return find(p) == find(q); }
int find(int p)... | true |
325dcbd31e7795bf36bbf5f090b52c341b1f4990 | C++ | Forwil/myusaco | /3.4/rockers.cpp | UTF-8 | 916 | 2.640625 | 3 | [] | no_license | /*
ID: forwil11
PROG: rockers
LANG: C++
*/
#include<algorithm>
#include<iostream>
#include<fstream>
#include<string>
#include<cstring>
#include<vector>
#include<cmath>
#define FILE "rockers"
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)>(b))?(b):(a))
using namespace std;
int n,m,t,ans,arr[30];
ifs... | true |
32611fc2ab1eabe6951fd3b794704e35ad165b8f | C++ | NguyenTheAn/nn-cpp | /lib/matrix/matrix.cpp | UTF-8 | 11,163 | 3.28125 | 3 | [] | no_license | #include "matrix.h"
#ifdef _DEBUG
#define LOG(x) std::cout << x << std::endl
#endif // _DEBUG
Matrix::Matrix() : m_Rows(0), m_Columns(0), m_Matrix() {
}
Matrix::Matrix(unsigned int rows, unsigned int columns, double initValue) : m_Rows(rows), m_Columns(columns), m_Matrix(rows*columns) {
if (initValue == -1)
Rand... | true |
dfb4c4612467aeb544bd89c4349fb05fde350e21 | C++ | stevykimpe/oogl | /src/oogl/OOGLException.cpp | UTF-8 | 5,461 | 3.1875 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////////////////////////
///! \file OOGLException.hpp
///! \brief This file contains the definition of the class oogl::OOGLException and its features.
///! The class oogl::OOGLException is the class used by the framework to sen... | true |
78087a3c66bb255cab098615591a4db5980f8b49 | C++ | Akira-Hayasaka/YES-NO | /addons/ofxColor/examples/ofxColorDemo/src/testApp.cpp | UTF-8 | 1,535 | 2.65625 | 3 | [] | no_license | #include "testApp.h"
#include "ofxColor.h"
void testApp::setup(){
ofxColorf myColor(.1, .2, .3);
cout << "ofxColorf myColor(.1, .2, .3);" << endl;
cout << myColor << endl << endl;
myColor.setRange(255);
cout << "myColor.setRange(255);" << endl;
cout << myColor << endl << endl;
myColor.setMode(OF_... | true |
2f657d50b115819f75d4b2bef3d90dfc04d24462 | C++ | dtbinh/sedgewick_cpp | /test/sort_spec.cpp | UTF-8 | 2,516 | 2.640625 | 3 | [] | no_license | #include <list>
#include <random>
#include "Binary_insertion_sort.h"
#include "Bubblesort.h"
#include "Heap_sort.h"
#include "Insertion_sort.h"
#include "Insertion_sort_x.h"
// #include "LSD_radix_sort.h"
#include "Mergesort_bu.h"
#include "Mergesort.h"
#include "Mergesort_x.h"
// #include "MSD_radix_sort.h"
#include ... | true |
21d6c20ecebf2dd12825013d970662c3416e6b72 | C++ | ChanceHenderson/Tanks | /engine/include/collider.h | UTF-8 | 383 | 2.703125 | 3 | [] | no_license | #pragma once
#include "drawable.h"
namespace CollisionType
{
enum ctypes
{
Tank, Projectile, Wall
};
}
class Collider : public Drawable
{
protected:
int ctype;
public:
Collider(const char* _image, int layer);
Collider(int w, int h, int layer);
static void do_collision();
int get_ctype();
~Collider();
prote... | true |
bbb6d22fc201216b7588559eceed09433fb79742 | C++ | bharatgudihal/Engine | /Engine/Profiling/Accumulator_Inl.h | UTF-8 | 357 | 2.859375 | 3 | [] | no_license | #pragma once
namespace Engine {
namespace Profiling {
inline Accumulator& Accumulator::operator+=(float time) {
sum += time;
count++;
minTime = minTime > time ? time : minTime;
maxTime = maxTime < time ? time : minTime;
return *this;
}
inline float Accumulator::average() const{
return stat... | true |
cfb5badad74e2b36a8586085536f6d1fd954362c | C++ | aitakaitov/ZOS | /FileSystem.h | UTF-8 | 7,419 | 3.109375 | 3 | [] | no_license | #ifndef ZOS_FILESYSTEM_H
#define ZOS_FILESYSTEM_H
#include <string>
#include <array>
#include <fstream>
#include <vector>
#define FILENAME_MAX_SIZE 8
#define EXTENSION_MAX_SIZE 3
const int32_t BYTES_PER_INODE = 8192; // there will be 1 inode per BYTES_PER_INODE bytes in FS
const int32_t BLOCK_SIZE = 2048; // da... | true |
ec6a7b62537560d0d537a701e398d58bab326283 | C++ | blockspacer/HelenaFramework | /Helena/Concurrency/Internal.hpp | UTF-8 | 1,441 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef HELENA_CONCURRENCY_INTERNAL_HPP
#define HELENA_CONCURRENCY_INTERNAL_HPP
#include <Helena/Defines.hpp>
#include <type_traits>
namespace Helena::Concurrency::Internal {
#ifdef __cpp_lib_hardware_interference_size
inline constexpr std::size_t cache_line = std::hardware_destructive_interference_size;
#else
... | true |
3547f0f87b9b63529d1bf7c5831896c11f328970 | C++ | TomHarte/CLK | /Components/KonamiSCC/KonamiSCC.hpp | UTF-8 | 1,867 | 2.625 | 3 | [
"MIT"
] | permissive | //
// KonamiSCC.hpp
// Clock Signal
//
// Created by Thomas Harte on 06/01/2018.
// Copyright 2018 Thomas Harte. All rights reserved.
//
#ifndef KonamiSCC_hpp
#define KonamiSCC_hpp
#include "../../Outputs/Speaker/Implementation/SampleSource.hpp"
#include "../../Concurrency/AsyncTaskQueue.hpp"
namespace Konami {
... | true |
f9421740d3f8166a8e168e9240f6de8340c7e890 | C++ | tupieurods/SportProgramming | /Div1/CR215_Div1_A/main.cpp | UTF-8 | 2,477 | 2.71875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
char str[100009];
int sums[100009][3];
int len, m;
void ReadData()
{
scanf("%s%*c", str);
len = strlen(str);
scanf("%d", &m);
}
int getSum(int id, int l, int r)
{
return sums[r][id] - sums[l - 1][id];
}
void Solve()
{
memset(... | true |
2823a41898da5d127ef1c101a66db39f2e04aee3 | C++ | jiama843/cs246_review | /testScripts/RAIIPtrs.cc | UTF-8 | 1,049 | 3.84375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <memory>
using namespace std;
class realObject{
int id;
string s;
public:
realObject(int id, string s): id{id}, s{s}{}
int getId(){
return id;
}
string getS(){
return s;
}
};
class Obj{
public:
int id;
string *p;
};
class uniqueObj{
public:
u... | true |
ffe6c70f1726424600d1451f765bed31fe690d8b | C++ | sz-zdy/LeetCode | /Q402_RemoveKDigits.cpp | UTF-8 | 1,493 | 3.390625 | 3 | [] | no_license | /*
* @Author: ShenZheng
* @Date: 2019-09-11 08:32:36
* @Last Modified by: ShenZheng
* @Last Modified time: 2019-09-11 14:30:32
*/
#include <iostream>
#include <stack>
using namespace std;
class Solution1 {
public:
string removeKdigits(string num, int k) {
stack<char> sta;
sta.push(num[0]);
... | true |
8538959f10e3b25a10cc520dd1b2425b12a06175 | C++ | Altu-Bitu/AltuBitu_YY | /0917/2841.cpp | UTF-8 | 1,478 | 3.765625 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
/**
* 각 줄마다 외계인이 누르고 있는 프렛을 스택에 저장하기
* 매 입력에 대해 이번에 누를 프렛이 해당 줄에서 가장 높은 프렛이어야 함
*
* 1. 이번에 눌러야 할 프렛보다 높은 프렛에서 손가락을 전부 떼기
* 2. 만약 이번에 눌러야 할 프렛을 누르고 있지 않다면 누르기
*/
int main() {
int n, p, guitar_string, fret, ans = 0; //ans 가 손을 움직인 횟수 ... | true |
52ef54423b6769d583626f0fc9adee0fb109124b | C++ | ozakiryota/tsukuba2019 | /src/imu_bias_estimation.cpp | UTF-8 | 4,421 | 2.890625 | 3 | [] | no_license | #include <ros/ros.h>
#include <sensor_msgs/Imu.h>
#include <geometry_msgs/Quaternion.h>
#include <tf/tf.h>
#include <tf/transform_broadcaster.h>
class ImuBiasEstimation{
private:
ros::NodeHandle nh;
/*subscribe*/
ros::Subscriber sub_imu;
/*publish*/
ros::Publisher pub_bias;
/*const*/
const double timeli... | true |
e884f7a4ed1998172b0db1765511033301c33835 | C++ | LaZoark/NIU_programming | /C++程式設計/ch06/ex06_01.cpp | BIG5 | 712 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int value=255; // ܼ
int *piVal,*piVal1; //ŧiӾƫAܼ
piVal= &value; //Vvalue ܼƦ}
piVal1=piVal; //piVal1VpiVal}
cout<<"value ="<<value<<" *piVal="<<*piVal<<"*piVal1="<<*piVal1<<endl;
*piVal=300; /... | true |
65025b0dc6a385a5ffed97b56de0939d5d3c026b | C++ | mirmik/nos | /nos/fprint/spec.h | UTF-8 | 3,092 | 3.03125 | 3 | [] | no_license | #ifndef NOS_FPRINT_SPEC_H
#define NOS_FPRINT_SPEC_H
/**
@file
*/
#include <ctype.h>
#include <nos/util/buffer.h>
#include <string.h>
namespace nos
{
enum class alignment
{
left,
right,
center
};
enum class text_case
{
upper,
lower,
none
};
... | true |
9eb03516e9de581a845cf5bedcda54048d083cb5 | C++ | nickoala/LC512 | /test/LC512.cpp | UTF-8 | 4,716 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "LC512.h"
#include <Wire.h>
const uint16_t HighestAddr = 0xffff;
const uint16_t WriteSize = 64;
const uint16_t ReadSize = 128;
enum ee_result ee_write(
uint8_t i2c,
uint16_t* addr, byte* bs, size_t len,
unsigned int ms
) {
if ( *addr + len > HighestAddr + 1 ) return ExceedRomCapacity;
while ... | true |
e98fa3a9ebff766e39f286c7e332f8f69a6b60cd | C++ | Grifo89/Algorithms | /insertion-sort/insertion-sort.cpp | UTF-8 | 800 | 4.25 | 4 | [] | no_license | // Insertion sort in C++
#include <iostream>
using namespace std;
// Function to print an array
void printArray(int array[], int size){
for (int i = 0; i < size; i++) {
cout << array[i] << " ";
}
cout << endl;
}
void insertionSort(int array[], int size) {
for (int step = 1; step < size; step+... | true |
4de059eb74cc1459029c30759dcc0b0d5c78b4f5 | C++ | akm-sabbir/hackerrank | /data_structure/Stacks/simple_text_editor.cpp | UTF-8 | 1,653 | 3.140625 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<sstream>
#include<stack>
using namespace std;
stack<pair<string,int>> stacks;
string container;
pair<string,int> append(string str){
container.append(str);
//stacks.push(make_pair(str,1));
r... | true |
383023d445c490f9ef908891d789e2347a66c27d | C++ | Naomi1745698/BigPrac | /racer.cpp | UTF-8 | 729 | 2.984375 | 3 | [] | no_license | #include <string>
#include "racer.h"
racer::racer() : spaceship() {
//default racer constructor equals spacceship default constructor
}
racer::racer(std::string rsName, int rsHealth, int rsFuel) : spaceship(rsName, rsFuel, rsFuel) {
//spaceship constructor with defined name, health & fuel
name = rsNam... | true |
32db509b0f0f60c4d8f7ce0bf1769ef5e976e830 | C++ | pradeepelamurugu/Competative-programming | /Find All Numbers Disappeared in an Array-leetcode.cpp | UTF-8 | 534 | 3.015625 | 3 | [] | no_license | //link: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
vector<int> ans;
// sort(nums.begin(),nums.end());
unordered_set<int> set;
for(auto j:nums){
set.insert(j);
... | true |
3ff958f247f930af6296ad0f128f441e048064db | C++ | shieldnet/BOJ_shieldnet | /2740.cpp | UTF-8 | 974 | 2.9375 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
typedef long long LL;
typedef vector< vector<LL> > Matrix;
Matrix operator* (const Matrix& a, const Matrix& b) {
int n = a.size();
int m = a[0].size();
int l = b[0].size();
Matrix c(n, vector<LL>(l));
for (int i = 0; i < n; i... | true |
b795be4a8dc576d743a902ac48f8d41af130d527 | C++ | Sparkle17/Polygon | /Polygon.cpp | UTF-8 | 1,562 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "Geometry.h"
using namespace std;
int main(int argc, char* argv[])
{
cout << "Polygon projector" << endl;
cout << argc << endl;
if (argc < 4) {
cout <<
"usage: Polygon.exe X Y Z" << endl <<
"where x, y, z - coordinates of ... | true |
ecdc2197b098260238dcda488044e8363d895be6 | C++ | ytatsukawa716/intermediate_model | /sort.h | UTF-8 | 1,820 | 3.484375 | 3 | [] | no_license | #ifndef SORT_H
#define SORT_H
#include <vector>
template<typename _T>
_T _MAX(_T x, _T y) { return x < y ? y : x; }
template<typename _T>
_T _MIN(_T x, _T y) { return x > y ? y : x; }
class Sort {
public:
std::vector<int> number;
template<typename _T>
void ascending_sort(std::vector<_T>& A) {
int left = 0;
... | true |
850f7bc6f505d257fca31d305c2668f7567b45da | C++ | emrebarisc/AdvancedRayTracing | /Sources/7 - Object Lights, Path Tracing/RandomGenerator.cpp | UTF-8 | 5,135 | 3.078125 | 3 | [] | no_license | /*
* Advanced ray-tracer algorithm
* Emre Baris Coskun
* 2018
*/
#include "RandomGenerator.h"
#include <random>
#include "Math.h"
std::random_device randomDevice; //Will be used to obtain a seed for the random number engine
std::mt19937 randomGenerator(randomDevice()); //Standard mersenne_twister_engine seeded... | true |
c2c8e79100eae998b183dea283afa6468f371580 | C++ | fedjakova-anastasija/OOD | /ChartDrawer/ChartDrawer/HarmonicOscillations.cpp | UTF-8 | 1,706 | 2.96875 | 3 | [] | no_license | #include "stdafx.h"
#include "HarmonicOscillations.h"
HarmonicOscillations::HarmonicOscillations(HarmonicOscillationTypes harmonicOscillationsType, double amplitude, double frequency, double phase)
: m_amplitude(amplitude)
, m_frequency(frequency)
, m_phase(phase)
, m_harmonicOscillationsType(harmonicOscillationsT... | true |
9d233a1808ce93e7712aa730eded34061ff8fae7 | C++ | GunniMueller/GMHUBDB | /src/hubDB/include_stud/btree.h | UTF-8 | 1,471 | 2.71875 | 3 | [] | no_license | #ifndef _BTREE_H_
#define _BTREE_H_
#include <global.h>
#include <bufferMgr.h>
class BTree
{
public:
friend ostream & operator<<(ostream & stream,BTree & btree);
/*
* Durchsucht den B-Baum nach dem gegebenen key.
*
* Rueckgabewert: gefundenes Tupel oder NULL
*/
Tup... | true |
fc1865c9ef61225e21f43a1f3b29d68f31921770 | C++ | bayertom/detectproj | /libalgo/source/structures/point/Point3DCartesian.hpp | UTF-8 | 1,998 | 2.53125 | 3 | [] | no_license | // Description: 3D cartesian point
// Copyright (c) 2010 - 2016
// Tomas Bayer
// Charles University in Prague, Faculty of Science
// bayertom@natur.cuni.cz
// This library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Fre... | true |
22acab17f0b32c49d4866691f2fda871c879ac2d | C++ | fibasile/BrainControl | /sketch/RobotController/RobotController.ino | UTF-8 | 1,547 | 3.0625 | 3 | [
"MIT"
] | permissive | #include "ZumoMotors.h"
#define LED_PIN 13 // user LED pin
#define MAX_SPEED 400 // max motor speed
#define PULSE_WIDTH_DEADBAND 25 // pulse width difference from 1500 us (microseconds) to ignore (to compensate for control centering offset)
#define PULSE_WIDTH_RANGE 350 // pulse width differe... | true |
9fc8134fa906c9c917ea130acc2cdffce9ab39bb | C++ | sasarog/MasClass | /Test/Test.cpp | WINDOWS-1251 | 1,287 | 3.1875 | 3 | [] | no_license |
#include <iostream>
#include <iomanip>
using namespace std;
#define massize 20 //
void main() {
setlocale(0, "russian");
srand(time(0));
//
int mas1[massize];
int mas2[massize];
int mas3[massize];
//
for (int i = 0; i < massize; i++) {
mas1[i] = rand() % 30 - 15;
mas2[i] = rand() % 30 - 15;
mas3[i] ... | true |
8befc7072f91f9c061ec04b6c03ff0f3af075435 | C++ | CyCelsLab/Multi-aster-swaming | /cytosim/src/test/testmap.cc | UTF-8 | 1,650 | 2.546875 | 3 | [] | no_license | //RCS: $Id: testmap.cc,v 2.3 2005/01/10 17:27:47 foethke Exp $
//-----------------------------tesmap.cc-------------------------
#include "map.h"
#include "random.h"
#include <cstdio>
#include "smath.h"
void trivialTest()
{
real min[] = {0,0,0};
real max[] = {3,3,3};
int size[] = {3,3,3};
Map... | true |
552f0f7ed5185aeb78ced7f9941f92471bcd58ee | C++ | tectronics/safe-haven | /JRX/Source/JRXCharacter.h | UTF-8 | 919 | 2.765625 | 3 | [] | no_license | /*
Class: JRXCharacter
Purpose: Represent a character rendered to the screen
Author: Jehanlos Roman
*/
#ifndef JRX_CHARACTER_H
#define JRX_CHARACTER_H
#include "JRXSpriteAnimated.h"
namespace JRX
{
class JRXCharacter : public JRXSpriteAnimated
{
public:
JRXCharacter( JRXShader* shader, JRXT... | true |
8b2003274e4f534a75d7f4ae80511f984126a274 | C++ | kodakandlaavinash/DoOrDie | /src/Practice/Websites/GeeksForGeeks/BitMagic/Page 2/CountSetBitsInInteger.h | UTF-8 | 1,084 | 2.53125 | 3 | [] | no_license | /*
* CountSetBitsInInteger.h
*
* Created on: Aug 28, 2013
* Author: Avinash
*/
//
// Testing Status
//
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <func... | true |
88fca9831c242278ba4212ff656cb6cebcbbc923 | C++ | delicatedx/test | /vector.cpp | UTF-8 | 330 | 3.5 | 4 | [] | no_license | #include<iostream>
#include<vector>//vector 为类模板
#include<string>
using namespace std;
int main()
{
vector<int> vec = {4,3,2,1,6};
for(auto e: vec) //auto为自动类型 随e而自动定义;该循环为范围循环语句,既循环vec内每个元素
cout<<e<<endl;
return 0;
} | true |
4c5733688c5235cf6514f5554f9e2a9e36ea008b | C++ | RealChaser/Cpp_IDioms | /Cpp_IDioms/31_Safe_Bool3.cpp | UHC | 621 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
// C++11 explicit
struct Testable
{
// bool Ͻ ȯ ʰ ȯ .
// , if ( t ) ɶ Ͻ bool ȯȴ.
explicit operator bool() const { return false; }
};
struct AnotherTestable
{
explicit operator bool() const { return true; }
};
int main(void)
{
Testable t;
//bool b1 = t; // error. boo... | true |
c45f65ea150dd5589d4d3828c52f82f3a3f0df2a | C++ | Shakti-chaudhary/Cpp-Learn-Code-with-harry- | /14-Friend_function_in_class.cpp | UTF-8 | 809 | 3.546875 | 4 | [] | no_license | #include <iostream>
using namespace std;
/* commplex numbers
11 + 5i
15 + 8i
-------
26 + 13i
*/
class complex
{
int a, b;
public:
void setdata(int n, int m)
{
a = n;
b = m;
}
void printdata()
{
cout << "Your number is : " << a << " and +i is : " << b <<... | true |
7b758b7f1ce00774d2ede34ef11d3ceb76214dc9 | C++ | TanveerMH/C-Codes | /try254.cpp | UTF-8 | 297 | 3.515625 | 4 | [] | no_license | #include <iostream>
using namespace std;
void odd(int);
void even(int);
int main ()
{
int num;
cout<<"Enter any number";
cin>>num;
even(num);
return 0;
}
void even(int a )
{
if ( a%2==0)
cout<<"\nEven number";
else odd(a);
}
void odd(int)
{
cout<<"\nOdd number";
}
| true |
f9060296179e97ae7370fdb572228e252664facd | C++ | paschalidoud/RoCKInCamp | /vision_tasks/object_classification/src/soc_test/main.cpp | UTF-8 | 2,744 | 2.734375 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: Sep 7, 2013
* Author: aitor
*/
#include "ros/ros.h"
#include "sensor_msgs/PointCloud2.h"
#include "std_msgs/String.h"
#include "soc_msg_and_serv/segment_and_classify.h"
class SOCDemo
{
private:
int kinect_trials_;
int service_calls_;
ros::NodeHandle n_;
std::... | true |
6e3c71064a61519093d4145942fdb7376010f75a | C++ | JeffreyTeo/SP4 | /Base/Source/Save.h | UTF-8 | 983 | 2.515625 | 3 | [] | no_license | #ifndef SAVE_H
#define SAVE_H
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include "Player.h"
#include "Shop.h"
#include "LevelDetails.h"
#include "AllLevelDetails.h"
using namespace std;
class Save
{
public:
Save(void);
~Save(void);
//In case of emergency(Lua files Deleted!)
void ... | true |
a40c0eca4d59708a20d62059badf0e0224f1ad0f | C++ | mirucar/airlinesres | /3_led_siren.ino | UTF-8 | 401 | 2.609375 | 3 | [] | no_license | const int LEDdizisi[] = {5, 6, 7};
void setup() {
for(int i=0; i<3; i++) {
pinMode(LEDdizisi[i], OUTPUT);
}
}
void loop() {
for(int i=0; i<3; i++) {
digitalWrite(LEDdizisi[i], HIGH);
delay(70);
digitalWrite(LEDdizisi[i], LOW);
}
for(int j=2; j>-1; j--) {
digitalWrite(LEDdi... | true |
e986631204e73eb399615da27b1d83635022ffaa | C++ | nilune/2019-Study-Institute | /ParallelProgram/base/hello_pth.cpp | UTF-8 | 1,192 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
int size;
typedef struct {
int rank;
} thread_args;
void *thread_func(void *arg) {
pthread_t this_thread;
this_thread = pthread_self();
auto *point = (thread_args*) arg;
printf("Thread = %lu; size = %d; rank = %d\n", this_thread, size... | true |
4730f1235ffc77ce611f974becc31f2f54f09211 | C++ | Meridor6919/OLC-game-jam-2019 | /OLC game jam 2019/Bullet.h | UTF-8 | 3,049 | 2.90625 | 3 | [] | no_license | #pragma once
#include "Object.h"
class Bullet :
public Object
{
float life_time = 2.0f;
float fading_time = 1.0f;
DirectX::XMVECTORF32 color = { 0.0f,0.0f,0.0f,1.0f };
DirectX::SimpleMath::Vector2 orientation_point;
DirectX::SimpleMath::Vector2 direction;
DirectX::SimpleMath::Vector4 hitbox;
public:
Bullet(Dir... | true |
9c8c40c30d8f3c7632a74732ea51d78f4cb57a98 | C++ | UncreativeIdea/Learning | /Create/Source.cpp | UTF-8 | 373 | 3.859375 | 4 | [] | no_license | #include <iostream>
int main()
{
std::cout << "Enter an interger: ";
int num{ 0 };
std::cin >> num;
std::cout << "Double that number is: " << num * 2 << '\n';
std::cout << "Triple that number is: " << num * 3 << '\n';
std::cout << "Plus one of that number is: " << num + 1 << '\n';
std::cout << "Minus one of... | true |