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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e0395865f2c35c1fc0d695e1f6e7f3bcdaa6abee | C++ | kks227/BOJ | /5500/5555.cpp | UTF-8 | 409 | 2.53125 | 3 | [] | no_license | #include <cstdio>
using namespace std;
int main(){
char W[11];
int N, result = 0;
scanf("%s %d", W, &N);
for(int i=0; i<N; i++){
bool found = false;
char R[11];
scanf("%s", R);
for(int i=0; i<10; i++){
found = true;
for(int j=0; W[j]; j++){
if(R[(i+j)%10] != W[j]){
found = false;
break;... | true |
5c38485ea8934b14e53b1603462f80aa3d70bcde | C++ | muhammet-mucahit/My-C-Studies | /Others/char 4.cpp | UTF-8 | 645 | 3.078125 | 3 | [] | no_license | #include<stdio.h>
#define SIZE 20
int boyut(char a[])
{
int i;
for(i=0;a[i]!='\0';i++)
{
}
return i;
}
int main()
{
char string1[SIZE];
char string2[SIZE];
printf("Karakter giriniz : ");scanf("%s",&string1);
printf("Karakter giriniz : ");scanf("%s",&string2);
int b1=boyut(string1);
int b2=boyut(string... | true |
b64c2867a91d3d4650f9873cd529a3b32d54c860 | C++ | ccccqyc/Books | /WD_Alg/5th/5_3_3_12.cpp | UTF-8 | 844 | 3.578125 | 4 | [] | no_license | // 第五章 树与二叉树
// 5.3.3 二 12
// 打印值为x结点祖先
#include <malloc.h>
#include <cstdio>
typedef int ElemType;
// 二叉树
typedef struct BitNode {
ElemType data;
BitNode *lchild, *rchild;
} BitNode, *BitTree;
// 思路后续遍历,查询到x值的结点,终止遍历,输出队列中祖先
void search(BitTree T, ElemType x) {
Queue Q;
initQueue(Q); //初始化遍历队列.
... | true |
b9e6cca42e9746435890771626c674775a8ed9b8 | C++ | q545244819/leetcode | /week/202/5490.cpp | UTF-8 | 779 | 3.265625 | 3 | [] | no_license | class Solution {
public:
unordered_map<int, int> memo;
int minDays(int n) {
return dfs(n);
}
int dfs (int n) {
if (n == 0) return memo[0] = 0;
if (n == 1) return memo[1] = 1;
if (n == 2) return memo[2] = 2;
if (memo.find(n) != memo.end()) return memo[n];
... | true |
fa9e7affc7d76ed0702a7fff9e02fa7b43a3da6c | C++ | Ch3shireDev/WIT-Zajecia | /semestr-3/Programowanie obiektowe 1/rozwiazania/06-bottle.cpp | UTF-8 | 2,159 | 3.984375 | 4 | [] | no_license |
class Bottle {
double max_amount;
double current_amount = 0;
public:
// 4.2.3 Bottle: Butelka o ograniczonej pojemnosci - bitcoin
// Napisz klase Bottle reprezentujaca butelke. Zaimplementuj:
// Konstruktor przyjmujacy pojemnosc butelki.
Bottle(double amount) {
max_amou... | true |
83d404bba55e3f573ea5d60aef589cf7988584ef | C++ | reagler/general | /cpp/test/initlist.cpp | UTF-8 | 741 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Abc
{
public:
Abc(){
a = 0;
cout << "Abc::default constructor\n";
}
Abc(int a){
this->a = a;
cout << "a = " << a << endl;
cout << "Abc::a constructor\n";
}
~Abc()
{
cout << "~Abc" << endl;
}
private:
int a;
};
class BB{
p... | true |
9c96eec70dec4f951b376a1d65d64fd18e1213e2 | C++ | skndi/OnlineShop | /OnlineShop/ItemOrganizer.cpp | UTF-8 | 1,735 | 3.34375 | 3 | [] | no_license | #include "Inventory.h"
Message ItemOrganizer::addItem(const Item& item, const int& quantity) {
Message msg;
if (checkItemExistance(item)) return msg.error("Item already exists!");
if(!checkQuantity(quantity)) return msg.error("Invalid quantity!");
items.insert(std::make_pair(item, quantity));
return... | true |
8eafdd78d3815f178c5ed70e38fac041a121310e | C++ | BehaviorTree/BehaviorTree.CPP | /src/loggers/bt_sqlite_logger.cpp | UTF-8 | 3,836 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "behaviortree_cpp/loggers/bt_sqlite_logger.h"
#include "behaviortree_cpp/xml_parsing.h"
#include "cpp-sqlite/sqlite.hpp"
namespace BT {
SqliteLogger::SqliteLogger(const Tree &tree,
std::filesystem::path const& filepath,
bool append):
StatusChangeLogger(... | true |
ea84d055519180299d1e9ca7fe949d94c72bf8fe | C++ | kwan0xfff/fmtk | /src/math/interpbilinear.cc | UTF-8 | 556 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | // binear interpolation
//
// Implementation loosely based on the algorithm at:
// http://en.wikipedia.org/wiki/Bilinear_interpolation
//
#include "interpbilinear.h"
float
interpbilinear(const float v[], const float xb[], const float yb[], float x, float y)
{
float weights =
v[vx00] * (xb[1]-x) * (yb[1... | true |
22c431eeeb97f0c411b0ebb92b501377fb8b3cad | C++ | fmi-lab/up-gr8-seminars | /week5/problem0.cpp | UTF-8 | 826 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
/*
* Задача 0. Напишете програма, която сравнява лексикографски два въведени низа.
* (без да използвате вградените функции)
*/
int main()
{
char s1[40], s2[40];
cout << "Enter the two strings on separate lines:" << endl;
cin.getline(s1, 40);
... | true |
07c793bb49f45e5fff621239814862b933eb3d75 | C++ | darennet/CrackingTheCodingInterview | /ChapterThree/StackWithMin.cpp | UTF-8 | 755 | 2.96875 | 3 | [] | no_license | /*
* StackWithMin.cpp
*
* Created on: Nov 24, 2014
* Author: ubuntu
*/
#include "StackWithMin.h"
#include "RuntimeException.h"
#include <iostream>
#include <limits>
#include <memory>
using namespace std;
namespace chapterThree {
StackWithMin::StackWithMin() :
_stack() {
}
StackWithMin::~StackWithMin()... | true |
6b34f956d125f258fbd03909f97b9d12eab44193 | C++ | TobbyT/example | /example_algo/TwoPointer/608.cpp | UTF-8 | 496 | 3.109375 | 3 | [] | no_license | #include "general.h"
int main()
{
vector<int> nums = {2, 7, 11, 15};
int target = 9;
int left = 0, right = nums.size() - 1;
vector<int> res;
while (left < right){
int sum = nums[left] + nums[right];
if(sum == target){
res.push_back(left + 1);
res.push_back(r... | true |
19037fe9e22f27ba4dfdfaa5cef322b4fdde0374 | C++ | andr2000/avic900-vncviewer | /server/jni/libvncnative/AndroidGraphicBuffer.h | UTF-8 | 2,878 | 3.09375 | 3 | [] | no_license | #ifndef ANDROIDGRAPHICBBUFFER_H_
#define ANDROIDGRAPHICBBUFFER_H_
#include <EGL/eglext.h>
#include <stdint.h>
/**
* This class allows access to Android's direct texturing mechanism. Locking
* the buffer gives you a pointer you can read/write to directly. It is fully
* threadsafe, but you probably really want to us... | true |
fd4dcfb5db887887321405f10df4eb81c7682d5c | C++ | josyulakrishna/motion-toolkit | /jointlimits/EllipsoidJointLimits.cpp | UTF-8 | 1,721 | 2.828125 | 3 | [
"MIT"
] | permissive | /* IK - Sample Code for Rotational Joint Limits in Quaternion Space
Copyright (c) 2016 Gino van den Bergen, DTECTA
Source published under the terms of the MIT License.
For details please see COPYING file or visit
http://opensource.org/licenses/MIT
*/
#include "EllipsoidJointLimits.hpp"
namespace i... | true |
ed33312fdeeb116f7a1f0527810a1a4e52784af9 | C++ | lvtx/gamekernel | /kcore/base/Result.h | UTF-8 | 252 | 2.640625 | 3 | [] | no_license | #pragma once
namespace gk
{
struct Result
{
enum { SUCCESS, FAIL };
int code;
Result( int code = SUCCESS )
{
this->code = code;
}
operator bool () const
{
return code == SUCCESS;
}
};
} // namespace gk
| true |
7c83245a53ac73980b39c1d4dbea198a834ae0d7 | C++ | alexandraback/datacollection | /solutions_5670465267826688_1/C++/ptrj/Dijkstra.cpp | UTF-8 | 2,405 | 2.984375 | 3 | [] | no_license | //==============================================================================
// Qualification Round 2015
// Problem C. Dijkstra
//
//==============================================================================
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <array>
#include <alg... | true |
fd27614c250f760aa906f447f5579218c8954860 | C++ | omarKaushru/Numb-UV-Life-activites | /CSE/u/Recovered data 05-03-2015 at 01_14_01/NTFS/My pc/programing fun/chapter wise program/chapter-9/sum of n numbers .cpp | UTF-8 | 286 | 2.5625 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
int add(int n);
main(){
int n;
printf("enter n=");
scanf("%d",&n);
printf("sum=%d",add(n));
getch();
}
int add(int n){
if(n!=0)
return n+add(n-1);
}
| true |
b9069a8ea103a8dd7310bf5963e51cbe6469917c | C++ | saniahamid/AlgorithmicToolbox | /week3_greedy_algorithms/1_money_change/change.cpp | UTF-8 | 474 | 3.15625 | 3 | [] | no_license | #include <iostream>
int get_change(int m) {
//write your code here
int x[3] = { 1, 5, 10 };
int change_count = 0;
int current_change = 0;
while (m > 0)
{
for (int i = 0; i <= 2; i++)
{
if (m >= x[i])
{
current_change = x[i];
}
}
//std::cout << "Current change is: " << current_change << std::... | true |
8664b2de2cfb041e94119155474a15ccaf0e21e1 | C++ | Xuming8812/LeetcodeSolution | /LeetCodeSolution/Easy/292 Nim Game.cpp | UTF-8 | 661 | 3.21875 | 3 | [] | no_license | #include<vector>
#include<map>
#include<string>
#include<queue>
#include<sstream>
#include<stack>
#include<set>
#include<bitset>
using namespace std;
/*
You are playing the following Nim Game with your friend: There is a heap of stones on the table,
each time one of you take turns to remove 1 to 3 stones. The one who... | true |
aa96b64b54aceef8000b0ea2d742fa4acd28a948 | C++ | Robotics-Zhikai/Computational-Geometry | /ConvexHull/TestConvexHull.cpp | GB18030 | 8,088 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "ConvexHull.h"
#include "Visualization.h"
#include <time.h>
#include <math.h>
vector<Point> GenerateRandomPoint(int pointsNum, float RangeXmin, float RangeXmax, float RangeYmin, float RangeYmax)
//generate pointsNum random points in [RangeXmin,RangeXmax,RangeYmin,RangeYmax]
{
vector<Point> Points;
srand((in... | true |
f51b5cc8745ce4b8c7b9baf07787fe8b416d1787 | C++ | UNIVERSAL-IT-SYSTEMS/SOMO14D | /SOMO14D.cpp | UTF-8 | 2,389 | 2.625 | 3 | [
"MIT"
] | permissive | /*
Arduino Library for 4D Systems SOMO-14D Embedded Audio-Sound Module
go to http://www.4dsystems.com.au/product/10/117/Development/SOMO_14D/ for more information
License: CC BY-SA 3.0: Creative Commons Share-alike 3.0. Feel free
to use and abuse this code however you'd like. If you find it useful
please attrib... | true |
17e0cd87c2ba43930a571e1e3563d89b028ea276 | C++ | oldtree/TestHash | /HashTableProbed.h | UTF-8 | 12,251 | 3.34375 | 3 | [] | no_license | /*=====================================================================
HashTableProbed.h - Probing hash table template class
Author: Per Nilsson
Freeware and no copyright on my behalf. However, if you use the
code in some manner I'd appreciate a notification about it
perfnurt@hotmail.com
Classes:
... | true |
3ceace4b88b52c03e0ea8ac8ffd0251c0f7f023f | C++ | DIYEmbeddedSystems/ArduinoLogger | /examples/multipleLoggers/multipleLoggers.ino | UTF-8 | 2,346 | 2.8125 | 3 | [
"MIT"
] | permissive | /**
* This code shows how you can create and use multiple logger contexts.
*
*/
#include <Arduino.h>
#include <ArduinoLogger.h>
// default logger (not instantiated here) uses Serial for output, and logs all messages
// logger1 context, for main program, uses Serial for output, logs only messages above t... | true |
5ae9f26b9aeb078e0ecec2595d651fab369f426c | C++ | Vishalshelke7558/OOP_using_CPP | /22_multilevel_inheritance.cpp | UTF-8 | 1,255 | 3.78125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class student
{
protected:
int roll_no;
public:
void set_number(int);
void get_number();
};
void student ::set_number(int r)
{
roll_no = r;
}
void student ::get_number()
{
cout << "the roll number is " << roll_no << endl;
}
class e... | true |
80e6725c731e1dfa9e21b8bf092a0b01ea238507 | C++ | matthew99carroll/OpenGLGraphics | /OpenGLCourseApp/main.cpp | UTF-8 | 4,885 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <cmath>
#include <vector>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "Window.h"
#include "Mesh.h"
#include "Shader.h"
#include "Camera.h"
// OpenGL rotations use ... | true |
57fb832f6c52685bd32f44ad786e98ac4d611e79 | C++ | xsaiter/exts | /main.cpp | UTF-8 | 4,873 | 2.828125 | 3 | [] | no_license | #include <algorithm>
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <memory>
#include <queue>
#include <string>
#include <vector>
#define PRINT(...) \
std::printf(__VA_ARGS__); ... | true |
aa8f5d5343ac76fe47d269d5b172bedf6e19f422 | C++ | valdersoul/CGProject3-4 | /src/librt/Camera.cpp | UTF-8 | 4,791 | 2.859375 | 3 | [] | no_license | //------------------------------------------------------------------------------
// Copyright 2015 Corey Toler-Franklin, University of Florida
// Camera.cpp
// Camera Object - position, up and lookat
//------------------------------------------------------------------------------
#include "Camera.h"
#include <assert.h... | true |
dc424a17145cf3c9b4f6e4b1a071b1758c7e8291 | C++ | rizky-bagus/Tsunemori-Akane | /CQU/Winter Training 6 - Test/E.cpp | UTF-8 | 949 | 2.65625 | 3 | [] | no_license | #include <queue>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
int N, K;
bool visited[200010];
int main() {
freopen("in", "r", stdin);
while (~scanf("%d%d", &N, &K)) {
memset(visited, false, sizeof visited);
queue<pair<int, int> > q;
q.push(make_pair(N, 0));... | true |
edebb19a84deb5676b3a469049110d0365142a43 | C++ | IcedLeon/Introduction-to-3D-with-OpenGL | /src/ParticlesUpdaters.h | UTF-8 | 2,143 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef _PARTICLESUPDATERS_H_
#define _PARTICLESUPDATERS_H_
//Lib
#include "ParticleUpdater.h"
#include "ParticleData.h"
#include <vector>
using std::vector;
class EulerUpdater : public ParticleUpdater
{
public:
vec4 m_vGlobalAcceleration;
EulerUpdater() : m_vGlobalAcceleration(vec4(0.0f))
{
}
~EulerUpdater()... | true |
eb2f356ad27bbab21c9d07b854f9a8b18aaac14c | C++ | cckroets/platformer | /level.h | UTF-8 | 3,656 | 3.140625 | 3 | [] | no_license | #include <vector>
#include "window.h"
#include "stickman.h"
#ifndef LEVEL_H
#define LEVEL_H
class HUD;
// A Tile (Space) in the level.
class Tile : public Picture {
private:
// Height of the tile. Zero means there is no tile.
int height;
// Position of the tile relative to the screen (Not constant!)
int x_po... | true |
28fff320fd67ce685b74e949534c38905e40fe0c | C++ | kylehug/COCC_Cplusplus_Programming | /Assignment3b/Assignment3b.cpp | UTF-8 | 2,298 | 3.96875 | 4 | [] | no_license | // COCC C++ - Kyle Hug - Assignment 3b
//
// [x] Draw out a 2D Array of periods
// [x] Change a point to be an asterisk
// [x] Draw a horizontal line
// [ ] Draw a vertical line ( WORK IN PROGRESS )
// [ ] Draw a diagonal line
// [x] Using Loops show the array on screen
//
// [ ] Clean up warnings
//
#include <iostr... | true |
5e63ddef8988d1afeec574b02335a626a2cc533d | C++ | TDarkx13/Chapter_5 | /Excercise5.2.cpp | UTF-8 | 257 | 3.015625 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int r;
float volume_sphere;
printf("Enter radius : ");
scanf("%d",&r);
volume_sphere = (4/3.0)*3.14*r*r*r;
printf("\nVolume of sphere = %f",volume_sphere);
return 0;
}
| true |
b34cc6cce9da4c0ee39ed3e179f4703be3b27a23 | C++ | nashdingsheng/spii | /include/spii/dynamic_auto_diff_term.h | UTF-8 | 15,644 | 2.8125 | 3 | [
"BSD-2-Clause"
] | permissive | // Petter Strandmark 2013.
#ifndef SPII_DYNAMIC_AUTO_DIFF_TERM_H
#define SPII_DYNAMIC_AUTO_DIFF_TERM_H
//
// This header specialized dynamic versions of AutoDiffTerm,
// allowing the sizes of the variables to be specified at
// runtime.
//
// AutoDiffTerm<Functor, 2, 3, 5> my_term(arg);
//
// is equivalent to
//
// ... | true |
d6225d9a353a787eb207a1690e3314e8dbdac074 | C++ | dilsekhpatnaik7/cbcplusplus | /Pointers&Functions/etc.cpp | UTF-8 | 477 | 3.53125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int a = 10;
int *ptr = &a;
int *ptr2 = ptr;
cout << *ptr << endl;
cout << *ptr2 << endl;
int b = 20;
*ptr2 = b; // was pointing to the same location ad ptr and this changes what
// was in that location
// hence it is changed for both.... | true |
332a3b2da30a89cc1fcd2d187382b793776ddd28 | C++ | dustinslade/Sector_TD | /Position.h | UTF-8 | 1,271 | 3.296875 | 3 | [] | no_license | #ifndef POSITION_H
#define POSITION_H
class Position
{
public:
//Pre-condition:none
//Post-condition: none
//Parameters: none
//Return Values: none
Position();
//Pre-condition:none
//Post-condition: a new postion is created
//Parameters: integer x an... | true |
4987ab494753e81979b3589bfe50547a44a5a27e | C++ | alyapunov/banlog | /IndexedBitsetUnitTest.cpp | UTF-8 | 1,250 | 3.140625 | 3 | [
"BSD-2-Clause"
] | permissive | #include <IndexedBitset.hpp>
#include <iostream>
#include <set>
void check(bool aExpession, const char* aMessage)
{
if (!aExpession)
{
//assert(false);
throw std::runtime_error(aMessage);
}
}
void test(size_t aBitCount)
{
size_t sRuns = 1000 + aBitCount * 10;
IndexedBitset b(aBitC... | true |
ea0f8c96cf1513830b5dcd85449a9439ec71354c | C++ | tomomii0806/Banking | /BSTree.cpp | UTF-8 | 4,047 | 3.46875 | 3 | [] | no_license | /*
* Tomomi Nakamura
* Banking
* file @ BSTree.cpp
*/
#include "BSTree.h"
#include "Account.h"
//default constructo
BSTree::BSTree() {
root = NULL;
size = 0;
}
//destructor
BSTree::~BSTree() {
Empty();
}
//inserting new account into BST
bool BSTree::insert(Account * account) {
if (isEmpty())
{
... | true |
166968139a77c15bc85208cb6e626b67e32f0461 | C++ | kobe24o/LeetCode | /algorithm/leetcode5713.cpp | UTF-8 | 608 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int numDifferentIntegers(string word) {
word.push_back('a');
unordered_set<string> s;
string num;
for(auto c : word) {
if(isalpha(c))
{
if(!num.empty())
{
while(num.size()>1 && *num.b... | true |
b9fe77d57fdc00e7866df871e7bca8c353c7064d | C++ | yetanotherbot/leetcode | /289. Game of Life/solution.cpp | UTF-8 | 934 | 3.015625 | 3 | [] | no_license | class Solution {
private:
int neighbors(vector<vector<int>> &board, int i, int j) {
int n = 0;
int row = board.size(), col = board[0].size();
for (int r = max(0, i-1); r < min(i+2, row); r++)
for (int c = max(0, j-1); c < min(j+2, col); c++)
n += board[r][c] & 1;
... | true |
9faf64082f832f7f1c94c5e6d2c92146bb13c3b1 | C++ | VipinPatel1305/mean_stack | /arduino/uv_tmp_big_attiny/uv_tmp_big_attiny.ino | UTF-8 | 1,353 | 2.84375 | 3 | [] | no_license |
#include "ssd1306.h"
#include "DHT.h"
#include <avr/pgmspace.h>
SSD1306 oled;
#define UV_PIN A3
#define DHTPIN A2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup(void)
{
pinMode(UV_PIN, INPUT);
pinMode(DHTPIN, INPUT);
delay(3000);
dht.begin();
delay(2000);
TinyWireM.begin();
oled.begin();
... | true |
1ef15263689db1bb23a275da12c0a0518fe92017 | C++ | AutumnKite/Codes | /POJ/1737 Connected Graph/DP,组合数学/std.cpp | UTF-8 | 2,494 | 2.6875 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
struct BigInt{
const static long long P = 1000000000;
std :: vector<long long> a;
BigInt operator = (int x){
while (x) a.push_back(x % P), x /= P;
return *this;
}
BigInt operator + (const BigInt &b) const {
BigInt c;
c... | true |
0c47a61fedd89b377ad5bdf9cdb8b13162a26e60 | C++ | engichang1467/3D-Game-Simulator | /Vector3.h | UTF-8 | 700 | 2.78125 | 3 | [] | no_license | #ifndef VECTOR3_H
#define VECTOR3_H
#include <iostream>
#include <GLFW/glfw3.h>
#include "Matrix3.h"
typedef struct {
GLfloat x, y, z;
} Vector3;
Vector3 makeVector3( GLfloat x, GLfloat y, GLfloat z );
Vector3 addVector3(Vector3 vectorA, Vector3 vectorB);
Vector3 subtractVector3(Vector3 vectorA, Vector3 vector... | true |
5958cc58eb47a7eef6f0b5e2b25d4acdfec99429 | C++ | ksolo/cppnd-system-monitor | /src/linux_parser.cpp | UTF-8 | 8,915 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "linux_parser.h"
#include <dirent.h>
#include <unistd.h>
#include <string>
#include <vector>
// debugging
#include <cassert>
#include <iostream>
using std::stof;
using std::string;
using std::to_string;
using std::vector;
// DONE: An example of how to read data from the filesystem
string LinuxParser::Oper... | true |
c1aae9e5116b73a8201f2e32534452d7511c8d2e | C++ | stqp/algorithm | /other/stl/17.set.cpp | UTF-8 | 481 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
using namespace std;
int main(){
set<int> s;
s.insert(10);
s.insert(20);
s.insert(30);
cout << "lower bound: " ... | true |
300d35444bc0524a4a5e051fed6f166c6c938537 | C++ | Holy-YxY/Algorithms-Dstructure | /Algorithms(算法)/Sorting_algorithm(排序算法)/Insertion.h | IBM852 | 285 | 2.9375 | 3 | [] | no_license | #pragma once
/*
//Insertion_sort
*/
template <class T>
void insertion(T* arr, int n)
{
for (int i = 0; i < n; i++)
{
int p = i - 1;
T temp = arr[i];
while (arr[p] > temp && p >= 0 )
{
arr[p + 1] = arr[p];
p--;
}
arr[p + 1] = temp;
}
} | true |
274e0643313e9a6800f8b369d610afc081ab414e | C++ | gusugusu1018/rclcpp_websocket | /include/rclcpp_websocket/rclcpp_websocket.hpp | UTF-8 | 3,637 | 2.515625 | 3 | [] | no_license | #ifndef RCLCPP_WEBSOCKET_HPP
#define RCLCPP_WEBSOCKET_HPP
#include <cstdio>
#include <cstdint>
#include <memory>
#include <string>
#include <rclcpp/rclcpp.hpp>
#include <std_msgs/msg/string.hpp>
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
#include <functional>
#include <boost/thr... | true |
7e28370ee49c4d2cc3c5e80876fad6cbaee4d6c0 | C++ | PrachiSinghal86/Leetcode | /Graph/Evaluate Division.cpp | UTF-8 | 1,945 | 2.640625 | 3 | [] | no_license | class Solution {
public:
bool p(map<string,vector<pair<string,double>>>m,string a,string b,double d,vector<double>&ot,map<string,bool>&vis)
{
for(int i=0;i<m[a].size();i++)
{
if(m[a][i].first==b)
{
ot.push_back(d*m[a][i].second);
... | true |
92115773e68f5324a9374b417bd289ad9c99df84 | C++ | pavelsimo/ProgrammingContest | /leetcode/46_permutations.cpp | UTF-8 | 1,226 | 3.21875 | 3 | [] | no_license | /* ========================================================================
$File:
$Date:
$Creator: Pavel Simo
======================================================================== */
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
void perm(int lo, vector<i... | true |
39fd1e59a187d920664340787924c4a91a373eff | C++ | gemperline/Employee-File-I.O---Vector-Storage | /pay.cpp | UTF-8 | 4,212 | 3.46875 | 3 | [] | no_license | // Adam Gemperline
// CPSC 301-03
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <vector>
using namespace std;
#include "person.cpp"
void readData(vector<Person> &P, string fileName, int &numPeople)
{
string fName;
string lName;
int empID;
string company;
float ho... | true |
846bb54dae01bffb2f1e1e6f3897ec0034bb22ad | C++ | beeguy74/cpp_modules | /mod_01/ex01/main.cpp | UTF-8 | 463 | 3.203125 | 3 | [] | no_license | #include "Zombie.hpp"
#include <iostream>
Zombie *zombieHorde(int N, std::string name);
void hordeAnnounce(int N, Zombie *arr){
for (int i = 0; i < N; i++){
arr->announce();
}
return ;
}
int main(void)
{
Zombie *arr;
int N;
N = 3;
arr = zombieHorde(N, "Bill Murray");
h... | true |
6d233233380ecf06a920395c26d5986c7a54467f | C++ | xyuan/cosmopp | /source/test_kd_tree.cpp | UTF-8 | 9,277 | 2.90625 | 3 | [] | no_license | #include <utility>
#include <algorithm>
#include <macros.hpp>
#include <random.hpp>
#include <timer.hpp>
#include <numerics.hpp>
#include <kd_tree.hpp>
#include <test_kd_tree.hpp>
std::string
TestKDTree::name() const
{
return std::string("KD TREE TESTER");
}
unsigned int
TestKDTree::numberOfSubtests() const
{
... | true |
0cb288aa93d4dc09953665b86f17140e07f9138d | C++ | beingbing/pppucpp | /ch-05/drill.cpp | UTF-8 | 271 | 2.84375 | 3 | [] | no_license | #include "std_lib_facilities.h"
using namespace std;
int main () {
try {
cout<<"Success!\n";
return 0;
}
catch (exception& e) {
cerr<<"error for samar: "<<e.what()<<'\n';
return 1;
}
catch (...) {
cerr<<"Oops samar: unknown exception!\n";
return 2;
}
} | true |
13faf3bb0fe7d753ec1152d0640c194463259efc | C++ | MarkusFischer/hpc-class | /exercise_5/task4/driver.cpp | UTF-8 | 777 | 2.9375 | 3 | [] | no_license | #include <cstdint>
#include <iostream>
extern "C"
{
void gemm_asm_gp( uint32_t const * i_a,
uint32_t const * i_b,
uint32_t * io_c );
}
int main()
{
uint32_t a[8] = {1, 2, 3, 5, 7, 11, 13, 17};
uint32_t b[4] = {1, 2, 3, 4};
uint32_t c[8] = {1, 2, 3, 4, 5, 6, 7,... | true |
2cd997df23ed305925373faa06a10725eedcb203 | C++ | alexElArte/Crypto_2.0 | /Crypto/examples/example/example.ino | UTF-8 | 4,879 | 2.9375 | 3 | [] | no_license | #include <new_crypto.h>
// You can change the value to have a powerful key
// I usually use 32 or 64
const uint8_t length_array = 16;
// The max value depends on the context
const uint8_t max_value = 32;
Crypto cryp(max_value, length_array);
uint8_t keyA[max_value];
uint8_t keyM[length_array];
uint8_t ms... | true |
ec3be118024583f878bfadea216de8f0764505d7 | C++ | VasilescuAndreea/POO-Tema2 | /Abonat.cpp | UTF-8 | 264 | 2.640625 | 3 | [] | no_license | #include "Abonat.h"
Abonat :: Abonat() = default;
Abonat :: Abonat(std::string nr) {
this->nr_telefon = nr;
}
void Abonat :: set_nr_telefon(std::string newNr){
this->nr_telefon = newNr;
}
std::string Abonat :: get_nr_telefon(){
return nr_telefon;
} | true |
86c4e358b77e29a1cb56b4e184b586661d634eea | C++ | jonasla/icpc | /simulacros/TC2017 - Prueba 5/i.cpp | UTF-8 | 2,866 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <set>
#include <queue>
using namespace std;
typedef long long tint;
typedef pair<tint, tint> ii;
typedef vector<ii> vii;
typedef vector<tint> vi;
typedef set<tint> si;
#define forsn(i,s,n) for(int i=(tint)s; i<(tint)n; i++)
#define forn(i,n) forsn(i,0,n)
const tint I... | true |
f10f4739b96bfa2ad739b8eb4aff53e918e7c4bf | C++ | calm11/TP2 | /datagrump/debug_printf.hh | UTF-8 | 1,996 | 2.96875 | 3 | [] | no_license | #ifndef DEBUG_PRINTF_HH
#define DEBUG_PRINTF_HH
#include <cstdarg>
// Debug logging definitions.
const int ERROR = 0;
const int WARN = 1;
const int INFO = 2;
const int VERBOSE = 3;
const int EXTRA_VERBOSE = 4;
//const int DEBUG_LEVEL = 0; // 0 means only output upto Error Level.
const int DEBUG_LEVEL = 2; // 2 mean... | true |
9c59596fd6ec79e04212da18b1e1ea8c00fa0299 | C++ | debapratimsaha/wiiglove-codebase | /stretch_grid_with_processing/stretch_grid_with_processing/stretch_grid_with_processing.ino | UTF-8 | 2,335 | 3.3125 | 3 | [] | no_license | // two variables for each input pin to read and store the values
int inPin0 = 0; //right
int inPin1 = 1; //down
int inPin2 = 2; //left
int inPin3 = 3; //up
int meanPos[4];
// an identifier for each value
int id_1 = 'A';
int id_2 = 'B';
int id_3 = 'C';
int ... | true |
ac03959c44e19fcb5277df8f84dc0ae4e2b394fd | C++ | evlinsky/cpp | /ta/huletski/HSE_S20/02-200123/03-gtest-extra.cpp | UTF-8 | 725 | 2.53125 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <vector>
#include <cassert>
#include <sstream>
void always_die() {
assert(0);
}
// checks if process dies
TEST(MyDeathTest, TestAlwaysDie) {
std::vector<int> vi;
ASSERT_DEATH(always_die(), ".*? Assertion .*? failed");
}
TEST(MyDeathTest, ExceptionThrow) {
std::vector<int> vi... | true |
c7d4964cf7f6c5245650d2dce17e0d6162dab279 | C++ | loganjensen/Harry-Potter-Command-line-Game | /Game Files/ron.hpp | UTF-8 | 895 | 3.015625 | 3 | [] | no_license | /*************************************************
Author: Logan Jensen
Assignment: Final Project
Date: 11 JUN 2019
Description: This is the ron.hpp file. It contains the Ron class definition.
*************************************************/
#include "space.hpp"
#ifndef RON_HPP
#define RON_HPP
/***************... | true |
a025846b6d7875c7c7406a82a328b82323b5333e | C++ | quangtruong4297/LTM_TUNGBT_20172 | /Sources/Server/Client/Client.cpp | UTF-8 | 4,837 | 2.5625 | 3 | [] | no_license | #define _WINSOCK_DEPRECATED_NO_WARNINGS
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<winsock2.h>
#include<WS2tcpip.h>
#pragma comment(lib,"Ws2_32.lib")
#define BUFF_SIZE 2048
#define USER 1
#define PASS 2
#define LOUT 3
#define ADDP 4
#define LIST 5
#define LIFR 6
#define TAGF ... | true |
5f1bdd6dc706196e6aff744ce50f36c27ead351a | C++ | Tangjiahui26/CrackingCode | /Hard/ContinuousMedian/main.cpp | UTF-8 | 1,825 | 4.0625 | 4 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
// Given that integers are being read from a data stream,
// Find median of all the elements read so far start from the first
// integer till the last integer.
// solution: Using max heap + min heap to store the elements
// of higher half and lower half.
voi... | true |
7d44f6452d0a769189d30bb5f2695cbadfd26d72 | C++ | JetAr/ZNginx | /ZGame/DX11/directx-sdk-samples/OIT11/OIT.h | UTF-8 | 4,524 | 2.796875 | 3 | [
"MIT"
] | permissive | //-----------------------------------------------------------------------------
// File: OIT.h
//
// Desc: Description for a class that handles Order Independent Transparency.
// The algorithm uses a series of passes:
//
// 1. Determine the number of transparent fragments in each pixel by drawing
// each of the t... | true |
b96d310f82aac792c38a69237f7b44fed03973d2 | C++ | caokeai/NowCoderOffer66 | /13.奇数位于偶数前面.cpp | UTF-8 | 717 | 3.84375 | 4 | [] | no_license | /*
题目:
输入一个整数数组,实现一个函数来调整该数组中数字的顺序,
使得所有的奇数位于数组的前半部分,所有的偶数位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变。
解析:
同样使用辅助存储空间来实现。
*/
class Solution {
public:
void reOrderArray(vector<int> &array) {
vector<int> res;
for(int i=0;i<array.size();i++)
if(array[i]%2!=0)
res.push_back(array[i]);
... | true |
2dfa7108550970bfa861ccabecb8e639b96dcda0 | C++ | Arelaxe/practicasED | /Práctica_5/letras/src/cantidad_letras.cpp | UTF-8 | 1,608 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cctype>
#include "Diccionario.h"
#include "Bolsa_Letras.h"
using namespace std;
int main (int argc, char *argv[]){
if(argc!=4){
cerr << "Número de argumentos incorrecto." << endl;
cerr << "Uso: <" << argv[0] << "> <fichero diccionario> <fichero letras> <fichero sa... | true |
5d4a310f5fff960fb7e69176b75aefc684e9ffa7 | C++ | hunubul/tpg | /src/logging.cpp | UTF-8 | 2,773 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | #include <string>
#include <fstream>
#include <time.h>
#include "logging.h"
#include "globals.h"
#include "openGL/initOpenGL.h"
using namespace globals;
bool loggedSomething = false;
// Get current date/time, format is YYYY-MM-DD.HH:mm:ss
const std::string getCurrentDateTime() {
time_t now = time(0);
stru... | true |
f83461714e09ae7adc2342cc89b3b32280e5cb79 | C++ | geekypandey/cc_solutions | /cses/introductory_problems/palindrome_reorder.cpp | UTF-8 | 1,420 | 2.71875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define... | true |
71c6215e0802b260aec34650f8f7a0e529a71a7f | C++ | RalfHendriks/Machiavelli | /Machiavelli/Condottiere.h | UTF-8 | 300 | 2.65625 | 3 | [] | no_license | #pragma once
#include "Character.h"
class Condottiere : public CharacterCard
{
public:
Condottiere(int id,CharacterType type);
Condottiere();
~Condottiere();
void Execute(GameController & game_controller) override;
private:
void PrintCharacterCards(GameController & game_controller) const;
}; | true |
8e0bd514fc3cdf27a594959d6f3b95e48a6e23bd | C++ | zanariah8/MyRepo | /C++ (Object Oriented Programming)/Workshops/AbstractBaseClasses-Workshop/AbstractBaseClasses-Workshop/w5.cpp | UTF-8 | 664 | 3.078125 | 3 | [] | no_license | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <iostream>
using namespace std;
#include "Polygon.h"
int main() {
// added some nice welcoming to the program
cout << "\n Workshop#5 OOP344A(Winter2014)\n" << endl;
cout << "------------OUTPUT------------" << endl;
Polygon rect("Rectangle", 4);
re... | true |
019cf35dc39bd4ecb7ac8db88fd88fc4270e056e | C++ | 1214wuai/public_code1 | /C++/10_27类和对象/test1.cpp | UTF-8 | 449 | 3.46875 | 3 | [] | no_license | #include<iostream>
using namespace std;
class Date
{
public:
//Date(int year,int month, int day)
//{
// _year = year;
// _month = month;
// _day = day;
//}
Date(int year,int month,int day)
:_year(year)
,_month(month)
,_day(day)
{}
void Print()
{
cout<<_year<<"-"<<_month<<"-"<<_day... | true |
ecd771b6465f9aab0726c9cb3df8bb3d0b4d3e53 | C++ | bananaXu/algorithm | /算法题解/素数伴侣(二分图最大匹配).cpp | GB18030 | 2,586 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <stack>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <ctype.h>
#include <map>
#include <cfloat>
#include <string>
using namespace std;
#define M 105
struct EDGE
{
int r, next;
}ed... | true |
6886ad2493d23b6f29a461aa11152a0bfc10aa29 | C++ | aryandosaj/CompetetiveProgramming | /best_worst_first.cpp | UTF-8 | 6,232 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int mem[]={9500,7000,4500,8500,3000,9000,1000,5500,1500,500};
int pro[]={5760,4190,3290,2030,2550,6990,8940,740,3930,6890,6580,3820,9140,420,220};
cout<<"--------------------BEST FIT --------------------\n";
{
map<int,int>asinged;
... | true |
bcf8065e7ff5e8bfca35b4a491555ac0599be310 | C++ | chaabaj/BricksVM | /device/SimpleCPU/include/SimpleCPU/MathUnit.hpp | UTF-8 | 3,305 | 2.84375 | 3 | [] | no_license | #ifndef __BRICKSVM_DEVICE_MATHUNIT_HPP__
# define __BRICKSVM_DEVICE_MATHUNIT_HPP__
# include <functional>
# include "interpreter/Value.hpp"
# include "device/Memory.hpp"
namespace bricksvm
{
namespace device
{
class MathUnit
{
public:
interpreter::Value sqrt(interpreter::V... | true |
1f3300c6fee85779a70ff5c228b926d7388338ad | C++ | Beryl2208/CI-2 | /Coding Club India/Interview Questions/MinimizeMaxDifferenceInsertK.cpp | UTF-8 | 854 | 3.171875 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
int minimizedMaxDiff(int arr[], int n, int k){
int maxx = INT_MIN;
for (int i = 0; i < n - 1; i++)
maxx = max(maxx, abs(arr[i] - arr[i + 1]));
if (maxx == 0)
return 0;
int low = 1;
in... | true |
14060463a6672f132d610c2feb18f2efed8abd15 | C++ | jonongjs/auv-vision-system | /src/PropertyAdaptor.h | UTF-8 | 579 | 2.703125 | 3 | [] | no_license | // Helper class to connect between property widget and the filter
#ifndef PROPERTYADAPTOR_H
#define PROPERTYADAPTOR_H
#include <QObject>
#include <string>
#include "ImageFilterBase.h"
class PropertyAdaptor : public QObject
{
Q_OBJECT
public:
PropertyAdaptor(ImageFilterBase *_filter, const std::string& _property... | true |
a57d788383a7ae44db276e5b2ddf125a8c956f3a | C++ | HachimineDaiki/KBC4U-22- | /2021summer_GAME/Time.cpp | UTF-8 | 352 | 2.5625 | 3 | [] | no_license | #include "Time.h"
void InitTime() {
effect_time.count = 0;
effect_time.time = 0;
effect_exit_time.count = 0;
effect_exit_time.time = 0;
}
int EffectExitTime() {
effect_exit_time.count++;
return effect_exit_time.time = effect_exit_time.count / 60;
}
int EffectTime() {
effect_time.count++;
return effect_time.... | true |
a8c7a3fdb67361fff532b9b1659e663bd8612af4 | C++ | esix/competitive-programming | /e-olymp/~contest-8903/A/main.cpp | UTF-8 | 2,843 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;
template <typename INT>
INT gcd(INT m, INT n) {
if (m == 0) return n;
if (n == 0) return m;
if (m == n) return m;
if (m == 1) return (INT)... | true |
af99061e8e5ed33522991d18a2b55a4aa9fa3abc | C++ | alexandraback/datacollection | /solutions_2692487_1/C++/Jonick/a.cpp | UTF-8 | 891 | 2.65625 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
void solveTest()
{
int A, N;
cin >> A >> N;
vector<int> a(N);
for( int i = 0; i < N; i++ ) {
cin >> a[i];
}
sort(a.begin(),a.end());
int best = a.size();
in... | true |
5b8719a5d9c359215eb7038762f79ef75180fe43 | C++ | xzrunner/sop | /include/sop/ParmList.h | UTF-8 | 2,985 | 2.8125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "sop/ParmType.h"
#include "sop/GeoAttrDefine.h"
#include <SM_Vector.h>
#include <vector>
#include <memory>
namespace sop
{
class ParmList
{
public:
ParmList() {}
ParmList(const ParmList& p);
ParmList(GeoAttr attr);
ParmList(const std::string& name, ParmType type);
ParmLis... | true |
193347780af6da270cd4dc2f16e12f9abc32e222 | C++ | Jerryh001/UVa | /318.cpp | UTF-8 | 2,146 | 2.75 | 3 | [] | no_license | #include<iostream>
#include<climits>
#include<cstdio>
#include<algorithm>
using namespace std;
struct domi
{
int dis;
bool checked;
};
struct edge
{
int a;
int b;
int dis;
float time;
};
int map[501][501];
domi v[501];
edge e[124751];
int main()
{
int n, m;
for (int time = 1;; time++)
{
cin >> n >> m;
if (... | true |
350e1bbf097dab7dea6660cee48bee31a9d35185 | C++ | Knabin/TBCppStudy | /Chapter3/Chapter3_01/main_chapter31.cpp | UTF-8 | 413 | 3.828125 | 4 | [] | no_license | #include <iostream>
#include <cmath>
int main()
{
using namespace std;
// 수식이 들어오면 어느 쪽을 먼저 계산할지 결정한다.
// 필요한 경우 괄호를 사용해서 우선순위를 명확하게 남기자.
int x = 4 + 2 * 3; // * 먼저
int y = 3 * 4 / 2; // *와 /는 우선순위가 같음, Associativity
int z = std::pow(2, 3); // 2의 세제곱
cout << z << endl;
return 0;
} | true |
a0ebcc8e92bea685302e4764118afc8a2709e4bf | C++ | rizwankadhar/OOP | /Delivery/FuelTank.h | UTF-8 | 398 | 3.421875 | 3 | [] | no_license | #pragma once
class FuelTank
{
public:
FuelTank(double petrol,double capac): fuel(petrol), capacity(capac) {}
double getFuel() const {return fuel;}
double getCapacity() const {return capacity;}
void addFuel(double amount) {fuel += amount;}
void consumeFuel(double amount) {fu... | true |
118d0569fcc7f0c7dfe70d38e94b58301b1ee464 | C++ | bluemix/Online-Judge | /CodeForce/444A DZY Loves Physics.cpp | UTF-8 | 2,460 | 3.40625 | 3 | [] | no_license | /* 7038615 2014-07-07 11:27:32 Shark A - DZY Loves Physics GNU C++ Accepted 46 ms 0 KB */
#include<cstdio>
#define MAX(x,y) ( (x) >= (y) ? (x) : (y) )
int main(){
int n, m;
while (scanf("%d%d", &n, &m) == 2){
int S[501];
double ans = 0;
for (int i = 1; i <= n; i++) scanf("%d", S + i);
for (int i = 0; i ... | true |
06afd173e67785561e052656a8db1133a1a96ce1 | C++ | Brigapes/LivingExpenses | /LifeInUK/Life.cpp | UTF-8 | 1,796 | 3.640625 | 4 | [] | no_license | #include "Life.h"
#include <iostream>
void Life::SetRent(int input)
{ Rent = input;}
void Life::SetHourRate(double input)
{ HourRate = input;}
void Life::SetWorkDays(int input)
{ WorkDays = input;}
void Life::SetWorkHours(int input)
{ WorkHours = input;}
void Life::SetExpenses(double input)
{ Expen... | true |
4dfe36253f54ce1a8db4ab8394d7b760db6e1caf | C++ | coollama11/cpp | /tests/person/testing-class-person.cpp | UTF-8 | 7,113 | 3.46875 | 3 | [] | no_license | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
#include "person.h" //<-usually, the class uses the include to import
//the implementation
//for some freaking reason, the body of member functions pertaining to a class
//usually appear in the .cpp file instead of the .h file
/... | true |
d647c3f4eddbd75b0434f29b1cf7f8a3a794eed0 | C++ | OmarAhmedSaleh/competitive-programming | /UVA/537 - Artificial Intelligence?.cpp | UTF-8 | 3,502 | 2.53125 | 3 | [] | no_license | #include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <c... | true |
c95ae1ea3b91cc73a2ae87bb454271cd1dc9e579 | C++ | Steelbadger/OpenGLThreading | /Windows Framework/Lab6c/myvector3.cpp | UTF-8 | 726 | 3.328125 | 3 | [
"MIT"
] | permissive | #include "myvector3.h"
#include "myvector4.h"
Vector3::Vector3(void):
x(0),y(0),z(0)
{
}
Vector3::Vector3(const float _x, const float _y, const float _z)
:x(_x),y(_y),z(_z)
{
}
Vector3::Vector3(const Vector3 &rhs):
x(rhs.x), y(rhs.y), z(rhs.z)
{
}
Vector3::Vector3(const Vector4 &rhs):
x(rhs.x/rhs.w), y(rhs.y/rhs... | true |
30f7d1cd6927fd27b2d54b769615b8bb668ac0cc | C++ | sumeetgajjar/CS7610-F20 | /lab2/src/utils.h | UTF-8 | 1,364 | 2.53125 | 3 | [] | no_license | //
// Created by sumeet on 9/30/20.
//
#ifndef LAB2_UTILS_H
#define LAB2_UTILS_H
#include <string>
#include <vector>
#include <unordered_map>
#include "message.h"
namespace lab2 {
class Utils {
public:
static std::vector<std::string> readHostFile(const std::string &hostFilePath);
static s... | true |
6d186fe2acb36eb74e333ce2ad5d951bab5ef77d | C++ | wallstead/school | /2016/Spring 2016/cs202/project4/project4.cpp | UTF-8 | 4,513 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
struct Pieces {
char *word;
int jump;
};
void readFile(ifstream *fin, Pieces *pptr, int *kptr, int pieceCount, int keyCount);
void decrypt(char *decrypted, Pieces *pptr, int *kptr, int pieceCount, int keyCount);
int stringLength(char *str);
void str... | true |
575406ee3be6fa75daa4f6df312b5b2654e91be4 | C++ | Aiorosu-cn/Learning | /C++/c_plus_Neworigin/this指针/Circle2.cpp | UTF-8 | 390 | 3.375 | 3 | [] | no_license | #include "Circle.h"
Circle::Circle( float _r, float _x ,float _y )
{
radius = _r;
x = _x;
y = _y;
}
Circle& Circle::setRadius( float r )
{
radius = r ;
return *this;
}
Circle& Circle::setX (float x )
{
this->x = x ;
return *this;
}
Circle& Circle::setY( float x )
{
this->y = y ;
return *this;
}
void Circl... | true |
6d8d7695598e68aff287534efc73ed3edafbb5a1 | C++ | mcolula/CaribbeanOnlineJudge-Solutions | /frankzappa-p1690-Accepted-s809290.cpp | UTF-8 | 1,606 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef struct {
int * sz;
int * id;
int count;
} UnionFind;
UnionFind create(int n) {
UnionFind u;
u.sz = new int[n];
u.id = new int[n];
for (int i = 0; i < n; i++) {
u.id[i] = i;
u.sz[i] = 1;
}
u.count = n;
r... | true |
7ae1a2916ca2db7429447fc37a07539807d7ff38 | C++ | kbinani/WaveFile | /format.hpp | UTF-8 | 846 | 2.859375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <cstddef>
namespace WaveFile
{
class Format
{
public:
enum class Type
{
PCM,
FLOAT,
};
public:
explicit Format(unsigned int channels = 2, Type type = Type::PCM, int sample_rate = 44100)
: channels_(channels)
, type_(type)
, sample_rate_(sample_rate)
, bit_per_sample_(16)
{}
... | true |
a854c5857aba67b78d3437133d588e08d617c1ee | C++ | warmshowers1/cse_100-labs | /12Lab/awoersching.cpp | UTF-8 | 1,926 | 3.25 | 3 | [] | no_license | #include<iostream>
#include<vector>
// The implementation of this algorithm was made possible
// through the use of the textbook: ISBN: 978-0-262-03384-8
// on pages 651 - 653
using namespace std;
void bell(vector<int> vert[], int **weight);
int v, e;
int main(){
int i, j, u, V, w;
cin >> v >> e;
int ... | true |
df6ff031eb1d33a378abb25c1d94a0b25bd2a749 | C++ | xuanjianwu/KAVI | /KAVI/utils/GraphClass.cpp | UTF-8 | 9,304 | 2.546875 | 3 | [] | no_license | #include "GraphClass.h"
#include "XMLUtils.h"
#include "EdgeStructure.h"
using namespace XMLUtils;
using namespace KAVIGraph;
GraphClass::GraphClass(QDomElement diagram)
{
graphData = diagram;
igraph_empty(graph, 0, false);
}
GraphClass::~GraphClass()
{
igraph_destroy(graph);
}
bool GraphClass::init(cha... | true |
56b57596c775ff6035b3e1acfdc618988e7f2f72 | C++ | Imammulh/Belajara-bahasa-C | /itung2an.cpp | UTF-8 | 95 | 2.515625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{int A,B,T;
A=6;
B=8;
T=A*B;
cout << T;
}
| true |
dd1d3f5f725e7551964072dfe162d54557670b49 | C++ | rafy13/Competitive-Programming | /UVa/uva-12468 - Zapping.cpp | UTF-8 | 367 | 2.640625 | 3 | [] | no_license | #include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int a,b,t1,t2;
while(scanf("%d%d",&a,&b)==2)
{
if(a==-1)
break;
if(a>b)
swap(a,b);
t1=b-a;
t2=99-b+a+1;
if(t1<t2)
printf("%d\n",t1);
els... | true |
dde8a390259c80d4be859c10b523ce72858f23cf | C++ | WhiZTiM/coliru | /Archive2/8b/e78a8962c2deaa/main.cpp | UTF-8 | 1,432 | 3.078125 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <memory>
#include <chrono>
int main()
{
const char TAB = '\t' ;
// values to be written into one line in the file
// in the actual program, these would be the calculated values
// volatile, because we do not want any super-smart optimization
... | true |
8e203d406ab9a67d0680079d90f2f215937ce1de | C++ | anhvvcs/corana | /libs/z3/src/smt/old_interval.h | UTF-8 | 7,510 | 2.625 | 3 | [
"MIT"
] | permissive | /*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
old_interval.h
Abstract:
Old interval class. It is still used in some modules.
Author:
Leonardo de Moura (leonardo) 2008-12-09.
Revision History:
--*/
#ifndef OLD_INTERVAL_H_
#define OLD_INTERVAL_H_
#include "util/rational.h"
#include "util... | true |
7a8eb2e703d2fe44870257bc7d2b936c66f62e55 | C++ | WeiyiGeek/Study-Promgram | /C++/第六节/classdemo.cpp | GB18030 | 530 | 4.1875 | 4 | [] | no_license | #include <iostream>
/**
Class Objectʼ֤
**/
//
class Person{
public:
//
std::string name;
//ԭ
void cook(void);
};
//ж巽
void Person::cook(void){
std::cout << "Һܺóԣ" << std::endl;
}
int main(void){
//ʵ ->
Person girl;
//Ըֵ
girl.name = "С";
std::cout << "Name : " << girl.name << std::endl;
/... | true |
12a96767c26fc234f570366dd8b16906075e8d1a | C++ | toth7667/h5cpp | /examples/reference/reference.cpp | UTF-8 | 2,060 | 2.703125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"NCSA",
"LicenseRef-scancode-hdf5",
"LicenseRef-scancode-llnl",
"LicenseRef-scancode-hdf4"
] | permissive |
#include <armadillo>
#include <vector>
#include <h5cpp/all>
int main(){
h5::fd_t fd = h5::create("ref.h5", H5F_ACC_TRUNC);
{
h5::ds_t ds = h5::create<float>(fd,"01",
h5::current_dims{10,20}, h5::chunk{2,2} | h5::fill_value<float>{1} );
h5::reference_t ref = h5::reference(f... | true |