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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
deeb07704a6399c87bdd6ac4b3d82adf20b94941 | C++ | 0JASQUE0/Course_work-sem2 | /Курсовая работа/EdmondsKarp.cpp | UTF-8 | 2,748 | 3.21875 | 3 | [] | no_license | #include "EdmondsKarp.h"
#include <string>
#include <fstream>
#include "queue.h"
void vertexesSearch(LinkedList<char>* listOfCities, ifstream& fin)
{
string str;
char tempChar;
int counter, index;
while (!fin.eof()) {
getline(fin, str);
counter = 0;
for (size_t i = 0; i < str.size(); i++) {
tempChar = st... | true |
4339ec5c065c9bcc819d3d170cd8e5f11c899612 | C++ | welshimeat/Self_Study | /알고리즘/Backjoon/일반/2206_벽부수고이동하기.cpp | UTF-8 | 1,404 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <tuple>
using namespace std;
int N, M, visited[1001][1001][2];
char map[1001][1001];
int direction_x[4] = { 1, -1, 0, 0 }, direction_y[4] = { 0, 0, 1, -1 };
queue<tuple<int, int, int, bool>> q;
void bfs();
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
c... | true |
a6deb96e018bad205a1d23bb63a1829435154756 | C++ | PancrasL/cpp-algorithms | /cpp-algorithms/PTA练习题/图/最短路径/A1003-Emergency(BellmanFord).cpp | UTF-8 | 2,351 | 3.0625 | 3 | [
"MIT"
] | permissive | #include <queue>
#include <set>
#include <vector>
#include <iostream>
using namespace std;
#define MAX_NODE 510
struct ArcNode {
int v; //邻接点
int len; //邻接边长度
ArcNode(int v1, int len1)
: v(v1)
, len(len1){};
};
int N, M, C1, C2;
vector<vector<ArcNode> > G(MAX_NODE);
vector<int> cityRescues(... | true |
d164b2d73118da48f0de27148c0c65dbdf94e445 | C++ | lshoon123/DataStructor | /hw7.cpp | UHC | 5,139 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
FILE *inp_fp, *oup_fp;
struct TreeNode {
int num;
struct TreeNode *R, *L;
};
void Insert(struct TreeNode **T, int n) {
//struct TreeNode *newNode ,*temp;
while (1) {
if ((*T) == NULL) {
(*T) = (struct TreeNode*)malloc(sizeof(struct TreeNode));
(*T)->num = n;
(*T)... | true |
42772070cf8f57f4b93af4e07eb2b24822828fa8 | C++ | mmalenta/bitsnbobs | /paf/struct_test.cpp | UTF-8 | 627 | 3.1875 | 3 | [] | no_license | #include <iostream>
using std::cout;
using std::endl;
struct obs_time
{
int ref_s;
int start_s;
int frame_s;
};
void print_struct(obs_time frame)
{
cout << frame.ref_s << " " << frame.start_s << " " << frame.frame_s << endl;
}
int main(void)
{
obs_time start{2000,350};
obs_time some1{2000, 350, 10};
obs_time... | true |
7d7ef36ae147cda0dfa39e12d6a3f1e82396793a | C++ | euanmcmen/GPCWGame | /GPCWGame/cModel.cpp | UTF-8 | 3,383 | 2.9375 | 3 | [] | no_license | #include "cModel.h"
//Constructor for model.
cModel::cModel()
{
}
// +++++++++++++++++++++++++++++++++++++++++++++
// Setters
// +++++++++++++++++++++++++++++++++++++++++++++
void cModel::setPosition(glm::vec3 mdlPosition)
{
m_mdlPosition = m_mdlScale;
}
void cModel::setRotation(GLfloat mdlRotation)
{
m_mdlRotat... | true |
dabfc7db3f69635304ea23409bf3dc29459fe231 | C++ | rdeiaco/leetcode | /bit_count.cpp | UTF-8 | 352 | 3.09375 | 3 | [] | no_license | #include <vector>
class Solution {
public:
vector<int> countBits(int num) {
int i, j;
int count;
std::vector<int> result;
for (i = 0; i <= num; i++) {
count = 0;
for (j = 0; j < 32; j++) {
if ((i>>j) & 0x1) {
count++;
}
}
result.push_back(count);
... | true |
6ccbb6afd8de29932c84cf4f978f2c77737db4a9 | C++ | wolass/platereader | /software/four_sensors/four_sensors.ino | UTF-8 | 3,761 | 2.75 | 3 | [] | no_license | /*
FILE: TSL235
AUTHOR: Wojciech Francuzik
DATE: 2016 07 20
PURPOSE: prototype TSL235R monitoring
Digital Pin layout Wemos D1 mini
=============================
D0 IRQ 0 - to TSL235R
D5 IRQ 1
D6 IRQ 2
D7 IRQ 3
D8 LED0
D1 LED1
D2 LED2
D3 LED3
TSL235R pin... | true |
c7e4f5ff156e883aa26247baf4177b440d138a69 | C++ | keishi/ShadeKit | /Camera.h | UTF-8 | 1,951 | 2.625 | 3 | [] | no_license | /*
* Camera.h
* ShadeKit
*
* Created by Keishi Hattori on 5/6/10.
* Copyright 2010 Keishi Hattori. All rights reserved.
*
*/
#ifndef Camera_h
#define Camera_h
#include "Scene.h"
#include "Image.h"
namespace ShadeKit {
class Camera {
public:
Camera(unsigned int width, unsigned int height)
... | true |
62471a43322ca1f0be1a8be444d54a26424a9342 | C++ | tritao/flood | /inc/Core/Concurrency.h | UTF-8 | 4,782 | 2.546875 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | /************************************************************************
*
* Flood Project © (2008-201x)
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/
#pragma once
#include "Core/API.h"
#include "Core/Event.h"
... | true |
bac1b9ea66af901dac64bda0cbddbb488784c94f | C++ | rjw57/Frontier.Engine | /Source/Rendering/Scene/Transform/FTTransformScale.h | UTF-8 | 538 | 2.625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <Rendering/Scene/Transform/FTTransform.h>
class FTTransformScale : public FTTransform {
public:
FTTransformScale() : scale_(0, 0, 0) {
}
void setScale(const glm::vec3& scale) {
scale_ = scale;
transform_matrix.getData()[0][0] = scale.x;
transform_matrix.get... | true |
52147615e81b357b373001a6409f133ed0ccacf6 | C++ | pritesh1/C-programspractice | /Alternate characters.cpp | UTF-8 | 542 | 2.78125 | 3 | [] | no_license | # This is a program for solving the alternate characters challenge on hackerrank
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
char a[10000];
int n,w,count,r,output[100],i,j;
scanf("%d", &r);
for(j=1;j<=r;j++){
scanf("%s",&a);
w=strlen(a);... | true |
fd8a53f9d256a6df08d3e31a8c8abd5c675a980f | C++ | gstggsstt/rubbish-minisql | /MiniSQL/fileManager.h | UTF-8 | 1,147 | 2.8125 | 3 | [] | no_license | #pragma once
#include "minisql.h"
#include "blockNode.h"
#include <fstream>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <map>
using namespace std;
class fileManager
{
// Records filename and its file pointer.
class fileNode
{
public:
stri... | true |
cc5d43d79072923956dcbcb3f445872248221315 | C++ | fangxing1996/LearnLinux | /Epoll/Client.cpp | UTF-8 | 1,561 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
#include <arpa/inet.h>
#include <string.h>
using namespace std;
#define DEST_PORT 1500
#define DEST_IP "127.0.0.1"
#define BUFFSIZE 1024
int main(){
int sockfd, new_fd;
struct sockaddr_in dest... | true |
c0be09c18aebe69a6dc834a11f7302663163a998 | C++ | xiaozhuanli/OOP345 | /w05/w05_home/Movie.cpp | UTF-8 | 1,235 | 2.984375 | 3 | [] | no_license | // Name:Luciana Gonzaga Altermann
// Seneca Student ID:129855185
// Seneca email:lgonzaga-altermann
// Date of completion: 02/16/2020
//
// I confirm that the content of this file is created by me,
// with the exception of the parts provided to me by my professor.
#include <string>
#include <iostream>
#include <iom... | true |
d51ac33270fce562eb206c448328dc2a3661569a | C++ | itstrangvu/B6B32KAB | /4SQUARE.cpp | UTF-8 | 6,346 | 3.328125 | 3 | [] | no_license | /*
* Author: Vu Thien Trang
* Date created: 22. 11. 2017
* Subject: B6B32KAB
* Faculty: SIT FEL CTU
*/
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <algorithm>
#define DELIMITER "**QQQ**"
#define DELIMITER_SIZE 7
using namespace std;
vector<vector<char> > defaultTable = {
... | true |
c2fa1719da2fa753980d33c788ad98e846485659 | C++ | singhashish-26/Leetcode | /Algorithms/Linked List/convert-binary-number-in-a-linked-list-to-integer.cpp | UTF-8 | 640 | 3.328125 | 3 | [] | no_license | #https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
int getDecimalValue(ListNode* head) {
Lis... | true |
9f495a5843e34cf0c3f1d5512b29e31a5d5d6af0 | C++ | mirek190/x86-android-5.0 | /external/lldb/include/lldb/Host/Condition.h | UTF-8 | 4,517 | 2.703125 | 3 | [
"NCSA"
] | permissive | //===-- Condition.h ---------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | true |
91925f1b89258ec68ab2f7dbedd828c9186b0888 | C++ | rishit-singh/Hacktoberfest2021 | /Algorithms/Searching/linearSearch.cpp | UTF-8 | 369 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int linearSearch(int a[],int n,int k){
for(int i = 0; i < n; i++){
if (a[i] == k){
return i;
}
}
return -1;
}
int main(){
int n;
cin>>n;
int a[n];
for(int i = 0; i < n; i++){
cin>>a[i];
}
int k;
... | true |
6a70ab4d1d54d4c4cd5590672052132da2bcc390 | C++ | kittenchilly/tf2_bot_detector | /tf2_bot_detector/Networking/GithubAPI.h | UTF-8 | 973 | 2.59375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Version.h"
#include <mh/coroutine/task.hpp>
#include <optional>
#include <string>
namespace tf2_bot_detector
{
class IHTTPClient;
}
namespace tf2_bot_detector::GithubAPI
{
struct NewVersionResult
{
bool IsReleaseAvailable() const { return m_Stable.has_value(); }
bool IsPreviewAvailabl... | true |
5290d774a70d54fe6864ce1575d93f3bb5be3b9f | C++ | lamorakde/Computer-Vision | /source/Red Color Pixels Extraction/red color pixels extraction.cpp | GB18030 | 1,468 | 2.90625 | 3 | [] | no_license | #include "czh_binary_CV.h"
#include <opencv2/core.hpp>
#include <iostream>
#include <fstream>
using namespace std;
using namespace cv;
int main()
{
// Ϣ
cout << "************************************************************************************************************************\n";
cout << "\t\t\tProgram inform... | true |
537ac45b37893119110895f3a1af0553b5a6af6b | C++ | saucisse-royale/kudasai | /src/VulkanSwapchain.cpp | UTF-8 | 9,134 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "VulkanSwapchain.hpp"
#include "VulkanContext.hpp"
#include "VulkanHelper.hpp"
#include <algorithm>
namespace kds {
VulkanSwapchain::VulkanSwapchain(VulkanContext* vulkanContext) noexcept
: _vulkanContext{ vulkanContext }
, _swapchain{ vkDestroySwapchainKHR, _vulkanContext->_device, _swapchain, null... | true |
6185a63c9108b8ae1345ab6c3dbc35f1814e1529 | C++ | Ranjiahao/DocumentSearcher | /searcher/searcher.h | UTF-8 | 1,731 | 2.8125 | 3 | [] | no_license | #pragma once
#include <stdint.h>
#include <string>
#include <vector>
#include <unordered_map>
#include "cppjieba/Jieba.hpp"
namespace searcher {
/*
* 索引模块
* */
// 用于构建正排索引
struct DocInfo {
int64_t doc_id;
std::string title;
std::string url;
std::string content;
};
// 用于构建倒排索引
struct Weight {
i... | true |
5fd067b1889f4fdeb116eeabc7d6968992cc1c90 | C++ | sjhuang26/competitive-programming | /usaco-trainer/fact4.cpp | UTF-8 | 539 | 2.578125 | 3 | [] | no_license | /*
ID: sjhuang1
PROG: fact4
LANG: C++11
*/
#include<iostream>
#include<fstream>
#include<vector>
using namespace std;
int main(){
freopen("fact4.in","r",stdin);
freopen("fact4.out","w",stdout);
int N;cin>>N;
int lastd=1;
int a=0,b=0;
for(int i=1;i<=N;++i){
int x=i;
while(x%2==0)x... | true |
1fd2ff86934a9988ef8f302f69bc7cf6fc93027c | C++ | ishibustim/rd_view | /src/pnm_display.cc | UTF-8 | 2,644 | 2.96875 | 3 | [] | no_license | #include <fstream>
#include <iomanip>
#include <sstream>
#include <string>
#include "color.h"
#include "pnm_display.h"
#include "rd_error.h"
using std::string;
using std::ofstream;
using std::ostringstream;
using std::setfill;
using std::setw;
static color** pixelGrid;
static int frameNumber;
static color bgColor(0, ... | true |
5296f8416cd5e59b15845e173876fedb81f98171 | C++ | webfrogs/leetcode-solutions | /448/448.cpp | UTF-8 | 781 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
vector<int> result;
if (nums.empty()) {
return result;
}
int n = nums.size();
for (int i=0; i < n; i++) {
while... | true |
63ad6a241e0ea3425b458e6fecf808d59d06b7d3 | C++ | cpprev/Big-num-calculator | /src/main.cc | UTF-8 | 2,586 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "lexer/lexing.hh"
#include "lexer/token.hh"
#include "parser/parsing.hh"
#include "parser/ast_visit.hh"
#include "parser/ast.hh"
#include "utils/input_error.hh"
#include "utils/string_op.hh"
#include "utils/options.hh"
/// 'base' Global variable
int base = 10;
int main ... | true |
fc3608dc7d26f924c5025fc7d2fa5649dfa619d4 | C++ | 19MH1A0536/Programs | /main (3).cpp | UTF-8 | 728 | 3.25 | 3 | [] | no_license | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | true |
9c6d01ebe33c94318549a560fedc401d35df5a2a | C++ | OpenHardware23/Contest-archive | /UVA Online Judge/10139 - Factovisors.cpp | UTF-8 | 974 | 2.921875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
vector<pii> canonica(int n) {
vector<pii> out;
for (int i = 2; i * i <= n; i++)
if (!(n % i)) {
int e = 0;
while (!(n % i)) {
n /= i;
e++;
}
out.push... | true |
6858c30c02f3481c4ca7f92efe37b918b2735b95 | C++ | AnuragJain23/other-problems | /sudokusolver.cpp | UTF-8 | 1,927 | 2.96875 | 3 | [] | no_license | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | true |
579fad4769269dc048c02b6c1a9a6e56dcc873f8 | C++ | mohistH/sqlite3_database_helper | /databaseHelper/hloghelper.cpp | UTF-8 | 2,697 | 2.75 | 3 | [] | no_license | #include "hloghelper.h"
#include <QObject>
#include <QDir>
#include <QApplication>
#include <cstdarg>
#include <QByteArray>
HLogHelper::HLogHelper()
{
m_FileLogName = QString("");
}
// 初始化创建文件并打开文件
int HLogHelper::HInit(QString strFilePre)
{
int len = strFilePre.length();
QString fileName("");
... | true |
dee686a4ef382d1d65f8f0e76810f31f7ca39d06 | C++ | rahulmak92/Cplusplus-practise | /CPPPractise_Seaman_Problem/SetOfIntegers.cpp | UTF-8 | 1,972 | 3.84375 | 4 | [] | no_license | #include "SetOfIntegers.h"
#include<iostream>
using namespace std;
Set::Set()
{
count=0;
size=0;
elements= new int[size];
}
Set::Set(int given_size)
{
size=given_size;
count=0;
elements= new int[size];
}
Set::Set(const Set &obj) //copy constructor
{
count=obj.count;
size=obj.size;
elements=new int[size];
for(... | true |
a04a105899ba073a361dc087f80e8e8c48a77859 | C++ | zhoutong12589/u_log | /queue_T.h | UTF-8 | 1,221 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <thread>
#include <mutex>
#ifndef _H_QUEUE_T_
#define _H_QUEUE_T_
namespace COMM
{
using namespace std;
static mutex g_queue_mutex;
//队列模板
template<class T>
class CQueue_T
{
public:
CQueue_T()
{
m_max_len = 1024;
}
~CQueue_T(){}
int put... | true |
84ee9cd6895ff9a36e8a9047ddfcb26a08e6f5e2 | C++ | yichizhng/CS174 | /marching.cc | UTF-8 | 7,156 | 2.984375 | 3 | [] | no_license | // (Crude) implementation of fast marching
#include <queue>
#include <vector>
#include <limits>
#include <cmath>
#include <cfloat>
#include "main.hh"
#include <iostream>
using namespace std;
extern int nvertices, ntriangles;
extern double *pos;
extern Triangle **tris;
extern vector<int> vertset;
class vert_dist {
... | true |
e725361b85eb21341feba4b4a7edba5b609ac204 | C++ | danielalpert/ASM-Tetris | /Final/Final/data.inc | UTF-8 | 2,713 | 2.671875 | 3 | [] | no_license | .data
Point STRUCT
;a point with coordinates x, y
x DWORD ?
y DWORD ?
Point ends
Tetromino STRUCT
;a tetromino of type (kind), position (pos), and orientation (rot)
kind DWORD ? ;kind includes a number representing a type of tetromino:
;1-O 2-I 3-T 4-L 5-J 6-S 7-Z
pos Point<>
rot DWORD 1 ;rot con... | true |
38515afb22edec0a098bb5493e21d9bda602b180 | C++ | samchon/framework | /cpp/samchon/templates/parallel/ParallelClientArrayMediator.hpp | UTF-8 | 1,489 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include <samchon/API.hpp>
#include <samchon/templates/parallel/ParallelSystemArrayMediator.hpp>
#include <samchon/templates/external/ExternalClientArray.hpp>
namespace samchon
{
namespace templates
{
namespace parallel
{
/**
* Mediator of Parallel Processing System, a server accepting slave clients.
... | true |
78dda9e57d19cc749c33c0afd9bc72f5be4c4869 | C++ | anik-chy/OnlineJudges | /URI/MATHEMATICS/UOJ_1214 Above Average.cpp | UTF-8 | 793 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
int main()
{
int c;
vector<int> vct;
cin >> c;
while(c--)
{
int n, temp, sum = 0, counter = 0;
cin >> n;
for(int i=0;i<n;i++)
{
cin >> temp;
vct.pb(te... | true |
fe5b2f96862d6bebffbe38b878f55ad34e27355b | C++ | aldebaran/libqi | /tests/qi/test_eventloop.cpp | UTF-8 | 8,865 | 2.875 | 3 | [] | permissive | #include <condition_variable>
#include <mutex>
#include <gtest/gtest.h>
#include <qi/eventloop.hpp>
#include <src/eventloop_p.hpp>
#include <ka/macro.hpp>
#include "test_future.hpp"
int ping(int v)
{
if (v>= 0)
return v;
else
throw std::runtime_error("Invalid argument ");
}
static const auto gEventLoopNam... | true |
077f561a610eba92ab904544db96cebc07aae56d | C++ | ivanmilov/IdTemplate | /idTemplate.h | UTF-8 | 1,282 | 3.6875 | 4 | [] | no_license | /**
Template for creation numeric based ids.
Usage:
Instead of 'typedef' and 'using' where you can use wrong type:
typedef Int32 StateID;
using RemoteID = UInt32;
foo(StateID){...}
...
RemoteID rId;
foo(rId); // wrong!
you can use this:
using SomeId = IdTemplate<uint32_t, struct Som... | true |
3503880754b0cd5edfe54734d04bba93cb9c9561 | C++ | walethesolution/CS246 | /Iteration_2/Iteration_2.cpp | UTF-8 | 1,595 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <assert.h>
using namespace std;
void minimum(int arr[], int size){
int minimum = arr[0];
for(int i=1; i < size - 1; i++){
if(arr[i] < minimum){
minimum = arr[i];
}
}
cout<<"Minimum = "<<minimum;
}... | true |
b64d02b9f327e81c6beb54dbd9e3ca1b3e1441ad | C++ | dufufeisdu/algorithms | /Leecode/cpp/numberAddNumber.cpp | UTF-8 | 2,044 | 3.515625 | 4 | [] | no_license | //Leecode #2 number add number
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode* initialList(int *a, int len){
ListNode* l = new ListNode(*a);
ListNode* temp = l;
len--;
while(len>0){
temp->next = ... | true |
0a1de69cb2a6ac53882f2308bb784bf4f8204a52 | C++ | Dwyguy/TravelingSalesman | /TravelingSalesman/MatrixGraph.cpp | UTF-8 | 1,000 | 3.1875 | 3 | [] | no_license | #include "MatrixGraph.h"
using namespace std;
MatrixGraph::MatrixGraph(unsigned num_nodes)
{
M.resize(num_nodes);
for(int x = 0; x < num_nodes; x++)
{
M[x].resize(num_nodes);
for(int y = 0; y < num_nodes; y++)
M[x][y] = 0;
}
num_edges = 0;
}
MatrixGraph::~MatrixGraph()
{
}
void MatrixGraph::addEdge(No... | true |
10833a60195e0e57f866a2770f737d170bcd626a | C++ | scgroot/ThorsSerializer | /src/Serialize/test/SerSetTest.cpp | UTF-8 | 868 | 2.8125 | 3 | [
"MIT"
] | permissive |
#include "gtest/gtest.h"
#include "JsonThor.h"
#include "SerUtil.h"
#include <algorithm>
namespace TS = ThorsAnvil::Serialize;
TEST(SerSetTest, serialize)
{
std::set<int> data{34,24,8,11,2};
std::stringstream stream;
stream << TS::jsonExport(data);
std::string result = stream.str();
resul... | true |
c0dc9bb9d92bc4372d2cd08e345d4ac3b9f27890 | C++ | MakinoRuki/TopCoder | /SRM706Div1Easy.cpp | UTF-8 | 2,092 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <queue>
#define N 22
#define inf 1000000000
#define mp make_pair
using namespace std;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
class MovingCandies {
public:
int n, m;
int dp[N][N][N * N];
bool vi... | true |
0ad47e743c1f67fa3192df4b5948abc905f52a5a | C++ | benolson/projectOR | /Code/qt/ProjectOR/imageGrabber.cpp | UTF-8 | 2,673 | 2.640625 | 3 | [] | no_license | #include "imageGrabber.h"
#include <QImage>
#include <windows.h>
#include <fstream>
#include <iostream>
void ImageGrabberStartLoop(int imageWidth, int imageHeight, IplImage** image, QMutex* cameraLock)
{
// Images to capture the frame from video or camera or from file
CvCapture* capture = cvCaptureFromCAM(CV_C... | true |
fbc9627e02b5b48638adbc4dd5179d8ac04e503d | C++ | matheustguimaraes/lapisco-training | /src/Topico_45.cpp | UTF-8 | 2,888 | 2.65625 | 3 | [] | no_license | #include <iostream>
#if (defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) || (defined(__APPLE__) & defined(__MACH__)))
#include <cv.h>
#include <highgui.h>
#else
#include <opencv/cv.h>
#include <opencv/highgui.h>
#endif
#include <cvblob.h>
using namespace std;
using namespace c... | true |
89c4f995d9b32b87b00a94c2308ae3eca6dd6698 | C++ | les-3-loustiques/CHIC-pocs | /Blazz/semester_projects/esp8266/test_sparkfun/test_sparkfun.ino | UTF-8 | 888 | 2.6875 | 3 | [] | no_license | #include "myWifiFunctions.h"
#include <ESP8266WebServer.h>
#define ESP8266_LED 5 // the blue led
myWifi wiObject;
const char *ssid = "UPC616BF3F";
const char *pass = "etW5aaf8Gbnk";
ESP8266WebServer server(80);
void handleRoot() {
server.send(200, "text/html", "<h1>You are connected</h1>");
}
void ledOn(){
se... | true |
35fb3fe648d31c88a1b3f16b6d5f3d9272855bb3 | C++ | MsNahid/Uri-Problem-Solution | /1144.cpp | UTF-8 | 499 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
int n, i, j, k, val, sqr, volume;
scanf("%d", &n);
for(i = 1; i <= n; i++){
val = i, sqr = i * i, volume = i * i * i;
for(j = 1; j <= 2; j++){
if(j == 1){
pr... | true |
a18921c9e8d7936f0b4ba712aa0acdd7d854efec | C++ | bifrurcated/LearningCpp | /FileWork/FileWork.cpp | UTF-8 | 1,006 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include "MyException.h"
using namespace std;
/*
Создание собсвенных исключений
*/
void PrintException(int value) {
if (value < 0) {
throw exception("Число меньше нуля!");
}
if (value == 1) {
throw MyException("Число равно 1!", value);
}
cout << "Пе... | true |
05a1cc7898dfaa2d3678ea944c83ef77e92f08a9 | C++ | joaoreiser/Cplusplus | /Pointers_Smart/Unique_Pointer.cpp | UTF-8 | 2,830 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <memory>
using std::cout;
using std::endl;
using std::cin;
using std::vector;
using std::string;
/*
UNIQUE POINTER (unique_ptr)
-> unique. Can only have one unique_prt pointing to the object on the heap
-> owns what it points to
-> cannot be copied o... | true |
a9f6a5a46e05e45f0eeffb5590c2063bbff5e92a | C++ | gotonis/HybridAnn | /NeuralNet.cpp | UTF-8 | 1,847 | 2.78125 | 3 | [] | no_license | #include <cmath>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include "Neuron.hpp"
#include "NeuralNet.hpp"
using namespace std;
vector<float> NeuralNet::evaluate(vector<float> input){
vector<float> t1 = input;
vector<float> t2;
vector<Neuron*> current;
for(int i=0;i<layers.size... | true |
31f671e5a4920834585a12b79dc10611781baaad | C++ | gauravsingh9891/Projects | /matrix.cpp | UTF-8 | 905 | 3.546875 | 4 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
class Matrix
{
private:
int a[5][5],i,j,m,d1_sum,d2_sum;
public:
Matrix() //Default constructor
{
d1_sum=0;
d2_sum=0;
}
void calculate()
{
cout<<"\n Enter the size of Matrix :";
cin>>m;
cout<<"\n Enter the element of matrix in row... | true |
40718c3cb859acfac424cdabf0423f9930f478f2 | C++ | MarTecs/CppProgramming | /c++ prime第5版/3/3.2/3.2.2/3_2_Test.cpp | UTF-8 | 353 | 3.09375 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<string>
using namespace std;
/**
* 编写一段程序从标准输入中一次读入一整行
* @param argc [description]
* @param argv [description]
* @return [description]
*/
int main(int argc, char const *argv[]) {
string line;
while ( getline(cin, line) )
{
cout << line << endl;
}
return 0;
}
| true |
20449557efe05c0a973161fc25ac1943ea842bb3 | C++ | asyhirfn/OS_GroupProject | /src/PAGE_REPLACEMENT_ALGORITHM.cpp | UTF-8 | 6,437 | 3.203125 | 3 | [] | no_license | #include<iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include<bits/stdc++.h>
using namespace std;
struct node
{
char data;
node *next;
};
class lru_alg
{
int frame,count,fault;
node *front,*rear;
public:
lru_alg()
{
front=rear=NULL;
fault=count=0;
}
... | true |
8abe82fb5f6b63176cddcb1e9c1c36f435849306 | C++ | fourstix/QwiicSerLCD | /examples/Example14-ShowFirmwareVersion/Example14-ShowFirmwareVersion.ino | UTF-8 | 1,233 | 2.765625 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"Beerware"
] | permissive | /*
SerLCD Library - Show the firmware version
Gaston Williams - August 29, 2018
This sketch prints the device's firmware version to the screen.
The circuit:
SparkFun RGB OpenLCD Serial display connected through
a Sparkfun Qwiic adpater to an Ardruino with a
Qwiic shield or a Sparkfun Blackboard with ... | true |
0c15f7105848174005d4c93471af5c0087cf1738 | C++ | kiorisyshen/newbieGameEngine | /Framework/Geometries/Geometry.cpp | UTF-8 | 2,282 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "Geometry.hpp"
using namespace newbieGE;
void Geometry::CalculateTemporalAabb(const Matrix4X4f &curTrans,
const Vector3f &linvel,
const Vector3f &angvel,
float timeStep,
... | true |
e0c0243bdf5115d64929b1494f2419e31dc5db34 | C++ | adamheald13/AvlTree | /main.cpp | UTF-8 | 2,983 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include "City.h"
#include "UnorderedArray.h"
#include "AvlTree.h"
using namespace std;
void readFile();
void readTestData();
void deletionTest();
void findCitiesInProximity(int x, int y, int distance);
UnorderedArray array;
AvlTree* avlTree = new AvlTree();
in... | true |
88132981354444f843be68b6edfb79369e7b9c6a | C++ | Garanyan/msu_cpp_spring_2017 | /Bezsudnova/Game/Weapon.h | UTF-8 | 1,567 | 3.109375 | 3 | [] | no_license | #pragma once
class Weapon
{
public:
virtual WeaponType getWeaponType() = 0;
virtual int getPower(ArmorType armor_) = 0;
virtual ~Weapon(){}
};
class Sword : public Weapon
{
public:
WeaponType getWeaponType(void);
int getPower(ArmorType armor_);
};
class Hammer: public Weapon
{
public:
WeaponType getWeaponTy... | true |
a43e08343b2b23fd1476c89dd7da46a6c1d3f3bf | C++ | zhutou82/JSEngine2.0 | /JSEngine2.0/src/JSEngine/Graphics/Meterial.h | UTF-8 | 838 | 2.578125 | 3 | [] | no_license | #pragma once
#include <vector>
#include "glm/glm.hpp"
#include "JSEngine/Core/Core.h"
#include "JSEngine/Graphics/Texture.h"
#include "JSEngine/Graphics/Shader.h"
namespace JSEngine
{
class Material
{
public:
Material(const Ref<Shader>& shader);
float GetShinese() const { ... | true |
5c57f5eed96ca7800b6f09825bd490f11c0b26c4 | C++ | wchunl/CompilerDesign | /asg5/emit.cpp | UTF-8 | 17,115 | 2.6875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <string.h>
#include <unordered_map>
#include <iostream>
#include "emit.h"
#include "string_set.h"
#include "lyutils.h"
#include "sym_table.h"
using namespace std;
unordered_map<const char*, const char*> structmap;
FILE* emit_file;
int while_nr = -1... | true |
e7f988536a03c4fd3cf5db625d47743b53457495 | C++ | eVillain/StruggleBox | /StruggleBox/Engine/Rendering/RenderUtils.h | UTF-8 | 2,448 | 2.625 | 3 | [] | no_license | #ifndef RenderUtils_h
#define RenderUtils_h
/* ---------------------------- *
* OpenGL GBuffer STUFF *
* ---------------------------- */
class RenderUtils {
public:
static GLuint GenerateTextureRGBAF(GLuint width, GLuint height, const GLvoid* data = NULL)
{
GLuint returnTexture = -1;... | true |
8e9aaa3747c96470f1f3ecb99bbbf2d5acd6b43d | C++ | shoukna/MyTest | /TheFallingLeaves.cpp | UTF-8 | 605 | 2.640625 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include<cstdio>
#include<string>
#include<sstream>
#include<string>
using namespace std;
const int maxn=1000;
int sum[maxn];
void build(int p){
int v;
cin>>v;
if(v==-1) return;
sum[p]=sum[p]+v;
build(p-1);build(p+1);
}
bool init(){
int v;
cin>>v;
if(v==-1) return false;
... | true |
448b0571da54cebade46ae7e91231c71624b0ca2 | C++ | bensont/BensonMooneyGoldstein | /Homework_3/simulation.cpp | UTF-8 | 3,903 | 3.265625 | 3 | [] | no_license | #include "tool.h"
#include "store.h"
#include "customers.h"
#include "timecounter.h"
#include "customerFactory.h"
#include "rentalFactory.h"
#include <iostream>
#include <queue>
#include <time.h>
#include "rentalList.h"
void BuildStore(Store* t,int prc,std::string cat){
for(int i = 0;i<4;i++){
Tool* testTool = Tool... | true |
ce9182f40a72720fe59e5999ad1f5359827e0ad8 | C++ | GregWagner/Learning-Modern-C-Plus-Plus | /Beginning_C_Plus_Plus/Chapter_02_Introducing_Fundamental_Types_of_Data/Examples/Example_01.cpp | UTF-8 | 418 | 3.953125 | 4 | [] | no_license | /*
* Example 1 Chapter 2
* Writing values of variables to the screen
*/
#include <iostream>
int main()
{
int apple_count {15};
int orange_count {5};
int total_fruit {apple_count + orange_count};
std::cout << "The value of apple_count is " << apple_count << '\n'
<< "The value of orange_count... | true |
55cff5311e285b53c0bc42e69783623bc280ba27 | C++ | mofywong/libhal | /brocast/BrocastDevice.cc | UTF-8 | 1,452 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #include <string>
#include "BrocastDevice.hh"
BrocastDevice::BrocastDevice() {
gst_play_handle = NULL;
}
BrocastDevice::~BrocastDevice() {
this->DevClose();
printf("GpsDevice\n");
}
//
bool BrocastDevice::DevOpen(const std::string& device) {
return true;
}
//无法检测是否在线,总是返回true,兼容
bool BrocastDevice:... | true |
a87c386b425c35a2234135449e93694874942667 | C++ | FollyEngine/wemos | /lib/neopixel/helpers.cpp | UTF-8 | 3,040 | 3.203125 | 3 | [] | no_license |
#include "helpers.h"
// this function sets all the pixels in a group to the same colour
void leds_set(CRGB *leds, uint len, uint8_t R, uint8_t G, uint8_t B) {
fill_solid(leds, len, CRGB(R, G, B));
FastLED.show();
}
uint8_t currentColours[3];
typedef struct {
const char* name;
CRGB colour;
} colour_def;
// f... | true |
f6c762aa28b2637ca2ed986a9fa5085fd356c5b9 | C++ | RIckyBan/competitive-programming | /AtCoder/BeginnerContest/014/AtColor.cpp | UTF-8 | 612 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
#define ll long long
int N, a, b, Arr[1000005] = {0}, ans, low = 0;
void show_Array(){
for(int i = 0; i < low; i++)
cout << Arr[i] << " ";
cout << endl;
}
int main(){
cin >> N;
for(int i = 0; i < N; i++){
... | true |
ac5d97d731b8306e93aaa1d239d6d574af90ddb8 | C++ | silvianaim02/CPP-NAIM | /gradebook.cpp | UTF-8 | 620 | 2.875 | 3 | [] | no_license | /*Fungsi definisi untuk kelas gradebook yang memecahkan
Program kelas rata-rata dengan counter-dikontrol pengulangan
*/
#include <iostream>
#include "GradeBook.h" //include definisi dari kelas GradeBook
using name space std;
//Konstruktor menginisialisasi coursename dengan string yang diberikan sebagai arg... | true |
745784df1e0e57efa771960e86329b439bab9b07 | C++ | chengyongyuan/yanetlib | /src/net/poller.h | UTF-8 | 2,757 | 2.671875 | 3 | [
"MIT"
] | permissive | #ifndef YANETLIB_NET_POLLER_H
#define YANETLIB_NET_POLLER_H
//This file implment a sys poller. currently: select
//and epoll is implemented. epoll is default for linux
//other system we just use select now (I don't think
//we will use other unix like system in short future.
//
//colincheng 2014/06/29
//
//TODO
//1. Re... | true |
5091a64203ffb7fc60b5938b9ff09920a61f0770 | C++ | shawnshuailin/Myleetcode | /3sum_closest.cpp | UTF-8 | 2,691 | 2.875 | 3 | [] | no_license | //run time 20ms
int threeSumClosest(vector<int>& nums, int target) {
std::sort(nums.begin(), nums.end());
return target - sumClosestRst(nums, target, 3, nums.size());
}
int sumClosestRst(vector<int>& nums, int target, int iRemain, int iMaxIdx)
{
int iCurClosestRst, iCurClosestRstAbs;
if (iR... | true |
e1512d0df3e48d459cdd49783358f75259793a74 | C++ | abpwrs/ece-5490-sp19 | /inclass/inclass1-abpwrs/ic2/ic2.cxx | UTF-8 | 1,072 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "itkImage.h"
#include "itkImageFileReader.h"
#include <iostream>
// Based off of
// https://itk.org/ITKExamples/src/IO/ImageBase/ReadAnImage/Documentation.html
int main(int argc, char *argv[]) {
if (argc != 2) {
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " myFile.nii.gz";... | true |
da769b2b33614700b5eabc4449e3da7ca0810a0d | C++ | git-vault/CBCompiler | /Runtime/cb_image.cpp | UTF-8 | 777 | 2.5625 | 3 | [] | no_license | #include "image.h"
#include "systeminterface.h"
#include "error.h"
Image *CBF_makeImage(int w, int h) {
Image *img = new Image(w, h);
return img;
}
Image *CBF_loadImage(CBString str) {
Image *img = Image::load(str);
if (!img && sys::errorMessagesEnabled()) {
error(LString(U"LoadImage failed! \"%1\"").arg(str));... | true |
b02eb82d149f97b6909ce33d8ea2e637a5329d0e | C++ | ILLLIGION/FileSystem | /include/file.hpp | UTF-8 | 138 | 2.5625 | 3 | [] | no_license | #include "iostream"
#include "string"
struct File
{
public:
std::string name;
File(std::string name1): name(name1) {};
~File() {};
};
| true |
d0b7527b3320f529d2655aba1b4b787fcbd3bddf | C++ | Gnob/algorithm | /boj_lecture/day3/contest_or_intern.cpp | UTF-8 | 562 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <cstring>
using namespace std;
int main() {
int N, M, K, cnt = 0;
cin >> N >> M >> K;
if (N >= 2 * M) {
cnt = M;
N = N - 2 * M;
M = 0;
}
else {
cnt = N/2;
M = M - cnt;
N = N - 2 * cnt;... | true |
5794b57bfb9b0a6a5f3099cc308c087630c993d8 | C++ | EuiSeong-Moon/Algorithm | /Baekjoon/View.cpp | UTF-8 | 585 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int arr[1000];
int max_value(int a, int b, int c, int d)
{
if (a < b)
a = b;
if (c < d)
c = d;
if (a < c)
a = c;
return a;
}
int main(void)
{
for (int test = 0; test < 10; test++) {
int N,buf,answer=0;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> buf;
... | true |
1edcce462a7afdb695579378275ebdc33d6e2e3c | C++ | DepthDeluxe/DCPU-16 | /DCPU-16/InterruptQueue.cpp | UTF-8 | 999 | 3.234375 | 3 | [] | no_license | #ifndef INTERRUPT_QUEUE_CPP
#define INTERRUPT_QUEUE_CPP
#include "InterruptQueue.h"
InterruptQueue::InterruptQueue()
{
head = 0;
count = 0;
}
BOOL InterruptQueue::EnQueue(UINT16 item)
{
// fail if the queue has gotten too large
if (count == INTERRUPT_QUEUE_MAX_SIZE)
return FALSE;
// get the ... | true |
5590dee383fda2cf289ca0250d853a5d13de56c5 | C++ | meowosaurus/Nebula_Engine | /Nebula_Engine/Transform.cpp | UTF-8 | 1,272 | 3.015625 | 3 | [] | no_license | #include "Transform.h"
void Transform::Init()
{
pos = glm::vec3();
rota = glm::vec3();
scale = glm::vec3();
}
void Transform::Update()
{
}
void Transform::SetPosition(glm::vec3 position)
{
pos = position;
}
void Transform::SetPosition(float x, float y, float z)
{
rota = glm::vec3(x, y, z);
}
void Transform::S... | true |
1b599b02fb35941a4cff6a7766ff58ecc4270dc6 | C++ | miusang/code | /algorithm/sort/bucket_sort/bucket_sort.cpp | UTF-8 | 1,750 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <vector>
using std::vector;
void array_print(int *nums, int len) {
for (int i = 0; i < len; i++) {
printf("%d ", nums[i]);
}
printf("\n");
}
void insert_sort(vector<int> &nums) {
int i, j;
for (i = nums.size() - 1; i > 0; i--) {
j = i... | true |
2305e22071fe8b6d78ddc392aca41a1dd06aa767 | C++ | f13rce/KFA-KilledFromAfar | /KFAClient/Source/utils/NetworkSimulator.h | UTF-8 | 1,110 | 2.5625 | 3 | [] | no_license | #ifndef _NETWORKSIMULATOR_H_
#define _NETWORKSIMULATOR_H_
#include <cstdint>
#include <memory>
#include <list>
#include "data/messages/NetcodeMessages.h"
namespace Net13
{
class NetworkSimulator
{
public:
NetworkSimulator();
~NetworkSimulator();
void Update();
void ProcessMessage(std::shared_ptr<Message... | true |
3f05271b24bcf7632d616117d54bc1fbc387066b | C++ | weimingtom/voiceprint | /asrplus-engine/ivector/plda.cc | UTF-8 | 3,741 | 2.625 | 3 | [] | no_license | /*
* plda.cc
*
* Created on: Mar 28, 2018
* Author: tao
*/
#include "ivector/plda.h"
#include "util/math.h"
#include <fstream>
float Plda::TransformIvector(const PldaConfig &config,
const Vector &ivector,
int32 num_examples,
Vector *transformed_ivector) const{
Vector tmp(ivect... | true |
81dbe6572a1d122dcb753ace69fee4efadaccc7a | C++ | keshav-kabra/DataStructures | /tempCodeRunnerFile.cpp | UTF-8 | 325 | 3.46875 | 3 | [] | no_license | void bubbleup(int *a, int son )
{
while(son!=0)
{
int dad = (son-1)/2;
// cout<<"\nson is "<<a[son]<<"and dad is "<<a[dad];
if(a[dad] > a[son])
{
swap(&a[dad], &a[son]);
// cout<<" value is swaped";
}
else return;
son = dad;
... | true |
2b82d26536efcc2d9e0dc4c1ceb107e262340363 | C++ | rhasan/problem-solving-practice | /problem-solving-cpp/simple-in-one-directory/uva-11799.cpp | UTF-8 | 396 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <limits> // std::numeric_limits
using namespace std;
int main() {
int T, N, c, max;
int NEG_INF = numeric_limits<int>::min();
scanf("%d", &T);
for(int tc = 1; tc <= T; tc++) {
scanf("%d", &N);
max = NEG_INF;
for(int i = 0; i < N; i++) {
scanf("%d", &c);
if(max < c) {... | true |
e8ea6bcecf3a07b9ce2aaf9c4f1b00ff6f340a6d | C++ | nikhilmoray/Data_structure | /Singly_linklist.cpp | UTF-8 | 5,314 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
}*head;
void insert(int data)
{
struct node* newnode = (struct node *) calloc(1, sizeof(struct node));
newnode->data = data;
if(head == NULL)
{
head = newnode;
newnod... | true |
bba4e6dc2886617e5eb3c10db2f3d57ba365ba27 | C++ | didix21/DesignPatterns | /FactoryPattern/AbstractFactoryPattern/FactoryPizza/src/NYPizzaStore.cpp | UTF-8 | 1,004 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #include "NYPizzaStore.hpp"
NYPizzaStore::NYPizzaStore()
{
}
NYPizzaStore::~NYPizzaStore()
{
}
std::unique_ptr<Pizza> NYPizzaStore::createPizza(std::string type)
{
std::unique_ptr<Pizza> pizza{nullptr};
std::unique_ptr<PizzaIngredientFactory> ingredientFactory = std::make_unique<NYPizzaIngredientFactor... | true |
0cd0209e55e0817ceb64e0604b0757ed9ba15f25 | C++ | liuqipei/ns3-dtn-mestrado | /model/bp-creation-timestamp.h | UTF-8 | 1,548 | 2.59375 | 3 | [
"MIT"
] | permissive | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
#ifndef BP_CREATION_TIMESTAMP_H
#define BP_CREATION_TIMESTAMP_H
#include <stdint.h>
#include <iostream>
#include "ns3/buffer.h"
#include "ns3/nstime.h"
using namespace std;
namespace ns3 {
namespace bundleProtocol {
/**
* \ingroup bundle
*
* \... | true |
6625211d3f32af6590f7ff92286596c8ed258bc8 | C++ | C-SWARM/pgfem-3d-input-stack | /preprocessor/include/initial_conditions.h | UTF-8 | 3,073 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | /* -*- mode: c++; -*- */
/* HEADER */
/**
* AUTHORS:
* Aaron Howell
* Matt Mosby
* Ivan Viti
*/
#pragma once
#ifndef CON3D_IC_H
#define CON3D_IC_H
#include "t3d_model.h"
#include <cstdlib>
#include <vector>
#include <iostream>
#include "structures.h"
/**
* \brief Base IC object.
*
* Contains the boundary con... | true |
37caee6d09e75bfb87b5aa552d64201de7d23de0 | C++ | goodspeed24e/Programming | /Effective STL/estl-examples/43-1.cpp | UTF-8 | 3,215 | 3.28125 | 3 | [
"MIT"
] | permissive | //
// Example from ESTL Item 43
//
// Fails under MSVC/native lib (mem_fun_ref problem)
//
#include <string>
#include <iostream>
#include <list>
#include <deque>
#include "ESTLUtil.h"
#include "Widget.h"
// C API: this function takes a pointer to an array of at most arraySize
// doubles and writes data to it. It re... | true |
8c37c06590449aba399ab64477585fbaba794f59 | C++ | ClubEngine/PLT | /client/mouseinput/main.cpp | UTF-8 | 6,928 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <SFML/Graphics.hpp>
#include <cmath>
using namespace std;
int main()
{
bool mouseispressed;
struct selected {
sf::Vector2i p1;
sf::Vector2i p2;
};
float aux;
selected selected;
float a = -10.0;
float b = -10.0;
float c = -10.0;
float ... | true |
f744e1b59c56b0e8b1707625f9fdfab846d35e54 | C++ | spirali/rain | /cpp/tasklib/src/connection.cpp | UTF-8 | 2,395 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "connection.h"
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include "log.h"
tasklib::Connection::Connection()
{
int s = ::socket(PF_UNIX, SOCK_STREAM, 0);
if (... | true |
2407d244174a698aa52c6c8c38a86e6498707f29 | C++ | jairoM26/crazyDuckHunt | /Logic/LogicDucks/Duck.cpp | UTF-8 | 2,808 | 3.234375 | 3 | [] | no_license | /*
* Duck.cpp
*
* Created on: Aug 3, 2015
* Author: pablo
*/
#include "Duck.h"
using namespace std;
/**
* El parametro "Vida" se basa en la cantidad de balas que puede
* recibir el pato, el cual se va a ir reduciendo con cada bala recibida.
* El parametro PuntosQueAporta se va a mantener constante y va... | true |
bff7f0574928b4626055294f2f53fb9e43d31373 | C++ | johannes-riesterer/Curvature | /Utils.cpp | UTF-8 | 7,749 | 2.828125 | 3 | [
"MIT"
] | permissive | /*
* File: Utils.cpp
* Author: johannes
*
* Created on 11. August 2014, 10:17
*/
#include "Utils.h"
struct Smooth_old_vertex {
Point_3 operator()(const Vertex& v) const {
CGAL_precondition((CGAL::circulator_size(v.vertex_begin()) & 1) == 0);
std::size_t degree = CGAL::circulator_size(v.v... | true |
53466914d10daee6a212b45f29904b6f8cefd439 | C++ | Kelinago/qua-vis-services | /include/quavis/vk/memory/buffer.h | UTF-8 | 1,905 | 2.875 | 3 | [
"MIT"
] | permissive | #ifndef QUAVIS_BUFFER_H
#define QUAVIS_BUFFER_H
#include "quavis/vk/device/logicaldevice.h"
#include "quavis/vk/memory/allocator.h"
#include "quavis/vk/debug.h"
#include <vulkan/vulkan.h>
namespace quavis {
/**
* A wrapper around the VkBuffer struct.
*/
class Buffer {
public:
/**
* Creates a new bu... | true |
4e631a5b024eb21f8320d039b5492f2fc2d45560 | C++ | jchryssanthacopoulos/ArduinoBot | /RobotBrain/ReadControls.ino | UTF-8 | 2,967 | 3.203125 | 3 | [] | no_license | /*
* readControls.ino
*
* This file contains functions to parse control data
*/
#include "RobotDefines.h"
/*
* Parse servo control
*/
void readServo(char receivedChar) {
// Serial.println(isReadingServo);
if (receivedChar == servoChar) {
// Serial.println("SERVO Path 1");
resetAllControlVars();
... | true |
f1f561805feb2da631aac73c5c56771d76a145fc | C++ | StrongAl258/repos | /Lavanya's code/Lavanya's code/Source.cpp | UTF-8 | 2,373 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <Windows.h>
#include <ctime>
#include <cstdlib>
#include <stdlib.h>
#define MAX_THREADS 2
using namespace std;
HANDLE hThreads[MAX_THREADS]; // # of threads
DWORD id[MAX_THREADS]; // array of thread ids
DWORD waiter;
int in = 0, out = 0, buffcount = 0; // used to check how much items are ... | true |
c3607be79b70adb5cf7dc858b626b464196187f8 | C++ | chaabaj/CPPLibrary | /CoreLibrary/TypeInfo.cpp | UTF-8 | 992 | 2.828125 | 3 | [] | no_license | #include "CoreLibrary/Type/TypeInfo.hpp"
TypeInfo::TypeInfo() : _info(NULL)
{
}
TypeInfo::TypeInfo(const std::type_info &info) : _info(&info)
{
}
TypeInfo::TypeInfo(const TypeInfo &info) : _info(info._info)
{
}
bool TypeInfo::before(const TypeInfo &info) const
{
return this->_info->before(*info._info);
}
... | true |
61cfb80e7cd50501840f14150bb5bf95efe9bb4f | C++ | zhangchunbao515/leetcode | /leetcode-04/solutions/cpp/0748.cpp | UTF-8 | 674 | 3.296875 | 3 | [] | no_license | class Solution {
public:
string shortestCompletingWord(string licensePlate, vector<string>& words) {
string ans;
vector<int> map(26);
for (char c : licensePlate)
if (isalpha(c)) map[tolower(c) - 'a']++;
int min = INT_MAX;
for (string& word : words) {
if (word.length() >= min) conti... | true |
3ca887a982bb01840612f9d30a84d81f98248d84 | C++ | blankspacer155/lab5 | /lab5_2.cpp | UTF-8 | 1,414 | 3.4375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
double deg2rad(double n)
{
return n*M_PI/180;
}
double rad2deg(double n)
{
return n*180/M_PI;
}
double findXComponent(double l1,double l2,double a1,double a2)
{
return (l1*cos(a1))+(l2*cos(a2));
}
double findYComponent(double l1,double l2,double a1,double a2)... | true |
c6be66a80b132847dd6635d4c3de2d960e7a2d6c | C++ | DTSCode/Cx | /src/cx-debug/expression.cpp | UTF-8 | 3,193 | 3.328125 | 3 | [] | no_license | /** Executor (expressions)
* exec_expression.cpp
*
* Executes Cx expressions
*/
#include "exec.h"
#include "common.h"
/** execute_expression Execute an expression (binary relational
* operators = < > <> <= and >= ).
*
* @return: ptr to expression's type object
*/
cx_type *cx_executor::ex... | true |
c80025b4c3d37d0194a71bae3c9454335621f9e9 | C++ | Vakicherla-Sudheethi/BecomeCoder | /recursion.cpp | UTF-8 | 288 | 3.109375 | 3 | [] | no_license | //recursion
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
void fun1(int n)//accepts n elements
{
if(n<=0)
{
return;
}
cout<<"hello"<<"\n";
fun1(n-1);//recursion call
}
int main()
{
int n=5;//this repeats n no.of times
fun1(n);
return 0;
}
| true |
225b9812bdc58a762ec7a6e3b00b97202a8ec795 | C++ | laannss/rolling | /Assignment2/Assignment2/LinkedList.h | UTF-8 | 1,182 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <assert.h>
using namespace std;
#ifndef LLIST
#define LLIST
typedef int ListElement;
class LinkedList
{
public:
//Default Constructor
LinkedList();
//Copy Constructor.
LinkedList(const LinkedList & original);
//Destructor
~LinkedList();
//Assignment Operation for LinkedList object... | true |