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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ee31bd2a7d68ef6272fba2b8e0d3676c701cf7e3 | C++ | masakotoda/SakiPublic | /SakiColorGame/SakiColorGameServer/SakiColorGameServerEngine.cpp | UTF-8 | 1,738 | 2.6875 | 3 | [] | no_license | #include "stdafx.h"
#include "SakiColorGameTcpServer.h"
#include "SakiColorGameServerEngine.h"
CSakiColorGameServerEngine::CSakiColorGameServerEngine(void)
: m_nRedOwner(0)
, m_nGreenOwner(0)
, m_nBlueOwner(0)
{
m_pServer = new CSakiColorGameTcpServer(this);
::InitializeCriticalSection(&m_criticalSection);
}
C... | true |
f67b3176b6a74c588fea21abb0c4c831bf4f6963 | C++ | wgnet/wds_qt | /qttools/src/assistant/3rdparty/clucene/src/CLucene/index/Term.h | UTF-8 | 4,544 | 2.578125 | 3 | [
"Apache-2.0",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LicenseRef-scancode-unknown-license-reference",
"Qt-LGPL-exception-1.1",
"LGPL-3.0-only",
"GPL-3.0-only",
"GPL-2.0-only",
"GFDL-1.3-only",
"LicenseRef-scancode-digia-qt-preview",
"LicenseRef-scancod... | permissive | /*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
*
* Changes are Cop... | true |
c6cb4ea14754ae128af56d427ec2b0160e220fed | C++ | duynhan39/Hackerrank | /acid naming.cpp | UTF-8 | 780 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int q;
cin>>q;
for(int each = 0; each < q; each++) {
string s = "";
cin>>s;
string head, tail;
head.assign(s, 0, 5);
tail.assign(s.end()-2, s.end());
int type = 0;
if(tail == "ic") {
... | true |
817f6b9a7fea942136a29a4ebe4a0f8f079dff18 | C++ | shawnpringle/steemedit | /source/wxrichtextmdhandler.cpp | UTF-8 | 1,433 | 2.625 | 3 | [] | no_license | #include "wxrichtextmdhandler.h"
#include <iostream>
wxRichTextMDHandler::wxRichTextMDHandler(const wxString& name, const wxString& ext, int type)
: wxRichTextFileHandler(name, ext, type) {
//ctor
}
wxRichTextMDHandler::~wxRichTextMDHandler() {
//dtor
}
/// Can we handle this filename (if using files)? B... | true |
a7f4f3b62fa64f24cace49cf9f17a93f6e0e8f78 | C++ | codedazzlers/DSA-Bootcamps | /Sawtantar/Strings/palindrome.cpp | UTF-8 | 419 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int length(string p)
{
int i = 0;
while (p[i])
{
i++;
}
return i;
}
int main()
{
string p, rev = "";
cout<<"Enter a value:";
cin >> p;
for (int j = length(p) - 1; j >= 0; j--)
rev += p[j];
{
if (rev == p)
c... | true |
5ef1be08f248aa85630c53ebba6bbfe6707dda9b | C++ | kaitou-1412/A2OJ-Ladders | /Codeforces Division 2A/Ilya and Bank Account/main.cpp | UTF-8 | 372 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
if(n >= 0)
cout << n << "\n";
else
{
n = abs(n);
int v = ((n/10) < (10*(n/100) + n%10)) ? (n/10) : (10*(n/100) + n%10);
if(v == 0)
cout << "0\n";
else
... | true |
94edf3c9e450dd801077e93075ca5e2cfbf2c472 | C++ | fenix0111/Algorithm | /Leetcode/209. Minimum Size Subarray Sum/MinimumSizeSubarraySum.cpp | UTF-8 | 1,281 | 3.75 | 4 | [] | no_license | // Leetcode 209. Minimum Size Subarray Sum
// https://leetcode.com/problems/minimum-size-subarray-sum/description/
// Runtime: 8ms
// one pointer in front, another in rear.
// front pointer first move forward until sum of range [rear, front] is greater than or equal to s.
// then move rear pointer one step forward.
/... | true |
0a6489141352fea35e766d08ceb62d8525212c32 | C++ | kirbyandrew/mr-signals | /src/apb_logic.h | UTF-8 | 3,234 | 2.953125 | 3 | [
"MIT"
] | permissive | /*
* apb_sensor.h
*
* Created on: Nov 23, 2018
* Author: ackpu
*/
#ifndef SRC_BASE_APB_SENSOR_H_
#define SRC_BASE_APB_SENSOR_H_
#include <vector>
#include "base/logic_interface.h"
#include "logic_collection.h"
#include "sensor_interface.h"
namespace mr_signals
{
/**
* A very simple APB logic implementa... | true |
59e51338e43538a86164668e09a50bf248dd4ff0 | C++ | ncbi/sra-tools | /tools/loaders/sharq/hash/tiger.h | UTF-8 | 33,711 | 2.578125 | 3 | [
"LicenseRef-scancode-ncbi",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-us-govt-public-domain"
] | permissive | /*
* Chocobo1/Hash
*
* Copyright 2017-2020 by Mike Tzou (Chocobo1)
* https://github.com/Chocobo1/Hash
*
* Licensed under GNU General Public License 3 or later.
*
* @license GPL3 <https://www.gnu.org/licenses/gpl-3.0-standalone.html>
*/
#ifndef CHOCOBO1_TIGER_H
#define CHOCOBO1_TIGER_H
#include <arr... | true |
98e85bd7ab094e9b95029207873584bfa3de3668 | C++ | cyberplantru/pH-to-I2C-sample-code | /pHtoI2C_serial_test.ino | UTF-8 | 1,563 | 2.53125 | 3 | [] | no_license | #include <SoftwareSerial.h>
#include "Wire.h"
#define pHtoI2C 0x48
float voltage, data;
float pH;
byte highbyte, lowbyte, configRegister;
const int numReadings = 10;
float readings[numReadings]; // the readings from the analog input
int index = 0; // the index of the current reading
float tota... | true |
21b813719ffca69622cd7753825a967b0730c4bb | C++ | danjia/voxelized-shadows-improved | /Source/Rendering/Overlay.hpp | UTF-8 | 1,022 | 2.5625 | 3 | [] | no_license | #pragma once
#define GL_GLEXT_PROTOTYPES 1 // Enables OpenGL 3 Features
#include <QGLWidget> // Links OpenGL Headers
#include <string>
using namespace std;
#include "Shader.hpp"
#include "Mesh.hpp"
#include "Camera.hpp"
#include "Texture.hpp"
class Overlay
{
public:
Overlay(const string &name, const string &sh... | true |
3cf3db535e0dd186ab89d4ad360cfce11e4c1ad1 | C++ | choreonoid/choreonoid | /src/Body/Imu.cpp | UTF-8 | 2,847 | 2.546875 | 3 | [
"Zlib",
"MIT"
] | permissive | #include "Imu.h"
#include "StdBodyFileUtil.h"
#include <cnoid/EigenArchive>
using namespace cnoid;
Imu::Imu()
: spec(new Spec)
{
spec->w_max.setConstant(std::numeric_limits<double>::max());
spec->dv_max.setConstant(std::numeric_limits<double>::max());
Imu::clearState();
}
Imu::Imu(const Imu& org, b... | true |
3796a20010c7ffd35e2db30a706dd09d6f97195f | C++ | ITnull/VisualProject | /C_Plus/C_Plus/C_Plus.cpp | GB18030 | 439 | 2.578125 | 3 | [] | no_license | // C_Plus.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include<iostream>
using namespace std;
struct treeNode
{
int value;
treeNode *Left;
treeNode *Right;
};
enum Month{
One,Two,Three,Four,Five,Six,Seven,Eight,Night
};
int _tmain(int argc, _TCHAR* argv[])
{
enum Month obj = One;
//cout << obj << endl;
for (int i = 0... | true |
aec93a1242591a1c64708b69689dcc1a9303dc22 | C++ | itpresidents/oF_bouncing_ball_objects_with_vectors | /ball_bounce_demo/src/testApp.cpp | UTF-8 | 3,045 | 2.9375 | 3 | [] | no_license | #include "testApp.h"
#include <iostream>
//--------------------------------------------------------------
void testApp::setup(){
ofBackground(20);
//let's populate our
for(int i = 0; i<3; i++){
ball b;
balls.push_back(b);
}
}
//-----------------------------------------------------... | true |
82c7624a62de7b673ba9c3de5184667107ff49f0 | C++ | oliverhamburger/Pizza-Tracker | /Driver.cpp | UTF-8 | 4,297 | 3.53125 | 4 | [] | no_license | //--------------------------------------------------------------------
//
// CS120 Final Project Driver.cpp
//
// Class definitions for the Driver class
//
// Author: Angelo Williams
// Date: 4/28/19
//
//--------------------------------------------------------------------
#inc... | true |
c023213964753762097d9116005e8a1bebaf8782 | C++ | Martin111997/Space_Invaders-WHS- | /Space_Invaders/Space_Invaders/Space_Invaders.cpp | ISO-8859-1 | 6,630 | 2.546875 | 3 | [] | no_license | #include "Space_Invaders.h"
using namespace std;
Space_Invaders::Space_Invaders(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
this->setFixedSize(Fenstergre_X, Fenstergre_Y); //Gre des MainWindow setzten
this->setWindowTitle("Space_Invaders"); //Fenstertitel
//-... | true |
afde652864b5ed39b5713e1fa7beef444a727809 | C++ | Shadowwws/AdventofCode2020 | /Day2/Day2.cpp | UTF-8 | 1,852 | 3.140625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <chrono>
#include <string>
#include <fstream>
using namespace std;
using namespace std::chrono;
int countChar(string s, char c) {
int count = 0;
for (int i = 0; i < s.size(); i++)
if (s.at(i) == c)
count++;
return count;
}
int m... | true |
c7c7beb8e4c1ff4b2e41d8de919e9e3ad6b78ec8 | C++ | frankkopp/FrankyCPP | /src/common/ThreadPool.h | UTF-8 | 2,683 | 2.703125 | 3 | [] | no_license | // FrankyCPP
// Copyright (c) 2018-2021 Frank Kopp
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use,... | true |
503108581dfafb469bf61e4c80afa32482f0d0e8 | C++ | kimsezin/Algorithm | /프로그래머스_행렬테두리회전.cpp | UTF-8 | 1,603 | 3.03125 | 3 | [] | no_license | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int rows, int columns, vector<vector<int>> queries) {
vector<int> answer;
vector<vector<int>> map(rows,vector<int>(columns));
int cnt = 1;
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
... | true |
c149f390aed44056c1e84e01e7d2e43593a5b66e | C++ | tupieurods/SportProgramming | /CR104/CR104_A/main.cpp | UTF-8 | 513 | 2.71875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int n;
scanf("%d%*c", &n);
char str[59];
scanf("%s", str);
int c = n / 2 + 1;
int a[2] = {0, 0};
int index = 0;
for(int i = 1; i <= n; i++)
{
if(i == c)
{
index++;
}
if(str[i - 1] == '4' || str[i - 1] == '7')
{
a[index... | true |
422bbb5e97ce498968fed5878b44b0f72d71cc9d | C++ | NitishShandilya/PracticeExercises | /VectorPractice.cpp | UTF-8 | 1,283 | 3.796875 | 4 | [] | no_license | #include <iostream>
using namespace std;
class RedoStructure
{
int a;
public:
RedoStructure():a(0){}
void setValue(const int newValue)
{ a = newValue; }
const int getValue() const
{ return a; }
};
class VectorPractice
{
RedoStructure *redoStructure;
int *structureNumbers;
public:
... | true |
8e5ade79fbb413cd69434bbdb8e663a7aa156dc5 | C++ | hello-sources/Coding-Training | /LeetCode/1817查找用户活跃分钟数.cpp | UTF-8 | 828 | 2.875 | 3 | [] | no_license | /**
* Note: The returned array must be malloced, assume caller calls free().
*/
int cmp(const void *a, const void *b) {
int *pa = *(int **)a, *pb = *(int **)b;
if (pa[0] == pb[0]) {
return pa[1] - pb[1];
}
return pa[0] - pb[0];
}
int* findingUsersActiveMinutes(int** logs, int logsSize, int* l... | true |
7d233c145a3e69df61e3a11e29412fd7f85e85c7 | C++ | kemot1709/Proi_Sklep | /Sklep.cpp | UTF-8 | 2,733 | 2.765625 | 3 | [] | no_license | #include "Sklep.h"
Sklep::Sklep(int n, int m, int o) {
int towar_ilosc = o;
sklep_ilosc_kas = n;
sklep_ilosc_pracownikow = m;
sklep_ilosc_klientow = 0;
sklep_stan = true;
sklep_utarg = 0;
sklep_klienci.clear();
sklep_kasy.reserve(n);
for(int i = 1; i <= n; i++) { // rezerwacja miejs... | true |
de7e7c8ad46d02b2c8786a5e36ee8b8e0cf16450 | C++ | EvanWang2015/Hackerrank | /StringConstruction.cpp | UTF-8 | 893 | 3.796875 | 4 | [] | no_license | /*
String Construction
Amanda has a string, s, of m lowercase letters that she wants to copy into a new string, p. She can perform the following operations any number of times to
construct string p:
1) Append a character to the end of string p at cost of 1 dollar.
2) Choose any substring of p and append it to the end... | true |
8e5fc3e9100fb771513b956fb3f9cd6c33acc1bc | C++ | oliverhuangchao/algorithm | /yelp/generalCase.cpp | UTF-8 | 533 | 2.9375 | 3 | [] | no_license | #include "basic.h"
void dfs(vector<string> &result,int step, string &path){
if(step == path.size()){
result.push_back(path);
return;
}
if(path[step] >= 97 && path[step] <= 122){
path[step] -= 32;
dfs(result,step+1,path);
path[step] += 32;
dfs(result,step+1,path);
}
else{
dfs(result,step+1,path);
}
... | true |
f9d59e0291c9277b2308cefa5f237196b6815b45 | C++ | samlanth/Projet | /AS2018 etudiants/Brute.h | UTF-8 | 2,269 | 3.28125 | 3 | [] | no_license | ////////////////////////////////////////////////////////////
// Brute.h
//
// Déclaration de la classe CBrute qui représente
// un type de monstre
//
// Samuel Lanthier
// Création: 2018-05-15
// - CBrute - Dérive de CMonstre
////////////////////////////////////////////////////////////
#pragma once
#include <SFML/Gr... | true |
4f0b5db6a160bbda0f90c649abd6820ec333c764 | C++ | ronbaldona/CSE190S_Final | /Minimal/Player.h | UTF-8 | 2,057 | 2.765625 | 3 | [] | no_license | /* By Ronald Allan Baldonado
* Player class derived from Node.h
* Compatible with Scene Graph
*/
#pragma once
#ifndef _PLAYER_H_
#define _PLAYER_H_
#define GLFW_INCLUDE_GLEXT
#ifdef __APPLE__
#define GLFW_INCLUDE_GLCOREARB
#else
#include <GL/glew.h>
#endif
#include <GLFW/glfw3.h>
// Use of degrees is deprecated. Us... | true |
273f33f238d335bf394ccb4c408a75795e414115 | C++ | vanello/wifi-arsenal | /banjax/lib/metrics/metric.hpp | UTF-8 | 2,469 | 3.203125 | 3 | [] | no_license | /* -*- mode: C++; tab-width: 3; -*- */
/*
* Copyright 2011 NICTA
*
*/
#ifndef METRICS_METRIC_HPP
#define METRICS_METRIC_HPP
#include <net/buffer.hpp>
#include <boost/shared_ptr.hpp>
#include <iosfwd>
namespace metrics {
/**
* Alias for shared_ptr<metric>.
*/
typedef boost::shared_ptr<class metric... | true |
1880d0d8485cdb8bc157cd05fb5e3ecb00000c6c | C++ | Seongmin-Hong/algorithm | /step4/5_test.cpp | UTF-8 | 1,245 | 3.109375 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
int pat() {
int i;
}
int bir(int x, int y) {
int arr1[8]{ 0, };
int arr2[8]{ 0, };
int j=0 , cnt = 0;
while (1) {
arr1[j] = x % 2;
x /= 2;
if (!x) break;
j++;
}
j = 0;
while (1) {
arr2[j] = y % 3;
y /= 3;
if (!y) break;
j++;
... | true |
3d439b2af1421b3263e9e7b964d295c72224b879 | C++ | TLeonardUK/ZombieGrinder | /Source/Engine/Renderer/Null/Null_Texture.cpp | UTF-8 | 918 | 2.546875 | 3 | [] | no_license | // ===================================================================
// Copyright (C) 2013 Tim Leonard
// ===================================================================
#include "Engine/Renderer/Null/Null_Texture.h"
#include "Engine/Renderer/Textures/Pixelmap.h"
Null_Texture::Null_Texture(int width, int height,... | true |
6d51d0c3e6269f413b2bbce40513cc413cacc7bb | C++ | hongyang1657/project_c | /serialTest2/serial.cc | UTF-8 | 4,064 | 2.609375 | 3 | [] | no_license | #include "serial.h"
const char *Serial_Dev = "/dev/ttyS0";
typedef struct {
char R_flag;
char W_flag;
int len;
char Data[255];
}Serial;
typedef struct {
int Forward;
int left;
int rotate;
unsigned char Check;
char Enter[3];
}Vehicle;
Vehicle Serial_Tx = {0,0,0,0,{"\r\n"}};
Seri... | true |
8e36fb074f5182011cee56e79348fa057b26d3fa | C++ | Rukopet/CPP_modules | /day03/ex04/SuperTrap.hpp | UTF-8 | 399 | 2.546875 | 3 | [] | no_license | #ifndef EX04_SUPERTRAP_HPP
#define EX04_SUPERTRAP_HPP
#include "FragTrap.hpp"
#include "NinjaTrap.hpp"
class SuperTrap : public FragTrap, public NinjaTrap {
public:
SuperTrap(const std::string &name);
SuperTrap(SuperTrap const &other);
SuperTrap();
virtual ~SuperTrap();
SuperTrap &operator=(const SuperTrap& tra... | true |
6b2363aeff34d09b3e1985c302c5b62eae6f73c3 | C++ | andrei828/Arduino | /Lab_Homeworks/4Digit7SegmentDisplayJoystick.ino | UTF-8 | 4,306 | 2.734375 | 3 | [] | no_license | #define LOCKED_DIGIT 1
#define BROWSE_DIGITS 0
// joystick pins
const int pinX = A0;
const int pinY = A1;
const int pinSW = 0;
// 4 digit 7 segment display pins
const int pinA = 12;
const int pinB = 8;
const int pinC = 5;
const int pinD = 3;
const int pinE = 2;
const int pinF = 11;
const int pinG = 6;
const int pin... | true |
be695b7a22fbd0d854e0d10742d679d2c3f81598 | C++ | redwanh25/cpp | /data structure/Linked List (Inserting a node at beginning) 2.cpp | UTF-8 | 599 | 3.6875 | 4 | [] | no_license | #include<iostream>
using namespace std;
struct node
{
int data;
node* link;
};
node* inser_t(node* head, int x)
{
node* temp = new node();
temp -> data = x;
temp -> link = head;
head = temp;
return head;
}
void print(node* head)
{
while(head != NULL){
cout... | true |
1c513202dfc738df415eda8815a55d195f0fc4bd | C++ | DavidLee999/leetcode | /3Sum.cpp | UTF-8 | 1,239 | 2.890625 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
int length = nums.size();
vector<vector<int> > res;
std::sort(nums.begin(), nums.end());
for (int i = 0; i < length; ++i)
{
int target = -nums[i];
int front = ... | true |
a551302eb48abb2bdb1a6749fea8441a4c6d6566 | C++ | Prateek-Sethi/CODING_INTERVIEW_PREP | /5. ALGO/Recursion/swapAdjacentNodesInLinkedList.cpp | UTF-8 | 661 | 3.84375 | 4 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | #include <iostream>
using namespace std;
struct Node
{
int val;
Node *next;
};
Node *newNode(int val)
{
Node *temp = new Node();
temp->val = val;
temp->next = NULL;
}
Node *insertNode(Node *head, int val)
{
Node *itr = head;
if (!head)
{
head->val = val;
head->next = N... | true |
b4a51164acdff184dc17af854ef3076f3401d5ec | C++ | nisak0503/leetcode | /Company/Google/293.FlipGame/293.cpp | UTF-8 | 906 | 3.140625 | 3 | [] | no_license | class Solution {
public:
vector<string> generatePossibleNextMoves(string s) {
vector<string> res;
for(int i = 1; i < s.size(); ++i)
{
if(s[i] == s[i-1] && s[i] == '+')
{
string ss = s;
ss[i] = '-';
ss[i-1] = '-';
... | true |
44073d3c3dc4d4db44873b22df99a5e9f52e7318 | C++ | huntmj01/CodingSamples | /C++/CS331 Intro to C++/HW4/Hunt_Matthew_CS331_HW4/Q2/Q2/Q2.cpp | UTF-8 | 1,200 | 3.609375 | 4 | [] | no_license | /*
* NAME: Matthew Hunt
* INSTRUCTOR: Dr. Yoo
* COURSE: CS 331
* DATE: 08/03/2018
* ASSIGNMENT: HW4_Q2
*/
#include "stdafx.h"
#include <vector>
#include <iostream>
#include <string>
using namespace std;
// rotateLeft template function - void rotateLeft (vector <T>& v)
template <typename Type>
void rotateLeft (... | true |
9746601c57a17a52724f630591b705fc4bce2f80 | C++ | chuang39/eos-contracts | /contracts/mev/mev.cpp | UTF-8 | 8,880 | 2.5625 | 3 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | permissive | #include "mev.hpp"
uint64_t mstarttimes[4] = {1535760000, 1538352000, 1541030400, 1543622400};
uint32_t getstartmonth(uint32_t epochtime) {
for (int i = 0; i < 4; i++) {
if (epochtime <= mstarttimes[i]) {
return mstarttimes[i-1];
}
}
return mstarttimes[3];
}
void mev::create... | true |
70f2fa75c9da5e7d049f65b584531824c0c827fe | C++ | Lyyua/CPPGame | /GameProject/Engine/Game/Player.cpp | GB18030 | 1,129 | 2.703125 | 3 | [] | no_license | #include "Player.h"
Player::Player()
{
}
Player::Player(Sprite _sprite)
{
mSprite = _sprite;
pos = mSprite.GetPos();
mSprite.SetScale(Vector3(0.1, 0.1, 0.1));
Rect* pRect = new Rect(mSprite.GetPos(), mSprite.GetSize(), Vector3(0, 0, 0));
rd.Initialize(-9.8, mSprite.GetPos(), mSprite.GetSize(), pRect, false);
f... | true |
7443aedde67f0245e66283fd9c7ae489a6ffb5f2 | C++ | shubhankar-31/DS-using-cpp | /circular_LL O(1).cpp | UTF-8 | 2,534 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
#include <array>
using namespace std;
class node
{ public:
int data;
node *next;
};
class circular_ll
{
private:
node *head,*tail;
int i = 1;
public:
circular_ll()
{
head = NULL;
tail =... | true |
f9647c5a7b66a0d19af6d26cab9f181e606626a9 | C++ | baaOff/temp | /backup/miner.h | UTF-8 | 1,373 | 2.9375 | 3 | [] | no_license | #ifndef MINER_H
#define MINER_H
#include "basegameentity.h"
#include "Locations.h"
class State;
const int comfortLevel = 5;
const int maxNuggets = 3;
const int thirstLevel = 5;
const int tirednessThreshold = 5;
class Miner : public BaseGameEntity
{
public:
Miner(int ID);
// this must be implemented
voi... | true |
1bb7095a6d51021f47d8be433e47a1a5f9004a76 | C++ | nkn-kzht/designpattern | /PrototypePattern_sample/sources/Manager.cc | UTF-8 | 568 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* Manager.cc
*
* Created on: 2016/03/22
* Author: parallels
*/
#include <Manager.h>
#include <IProduct.h>
namespace framework {
Manager Manager::instance_;
Manager::Manager() = default;
Manager::~Manager() = default;
Manager& Manager::getInstance() {
return instance_;
}
void Manager::register_product... | true |
64c9636f1947b63841ad557d523c9cfb030f214e | C++ | krishna-mathuria/competitive | /leetcode1010.cpp | UTF-8 | 260 | 2.53125 | 3 | [] | no_license | class Solution {
public:
int numPairsDivisibleBy60(vector<int>& time) {
vector<int> mp(60);
int res=0;
for (auto t : time) {
res += mp[(60 - t % 60) % 60];
mp[t % 60]++;
}
return res;
}
}; | true |
452ea5bef07d986ebbb2bbfb62dd1f5000a0ad8b | C++ | Vityoube/MMwGK_PROJEKT | /bottom.cpp | UTF-8 | 1,636 | 2.6875 | 3 | [] | no_license | #include "bottom.h"
Bottom::Bottom()
{
}
void Bottom::draw(){
// glEnable(GL_DEPTH_TEST);
// glDepthFunc(GL_LEQUAL);
// glEnable(GL_CULL_FACE);
// glCullFace(GL_BACK);
glColor4f(1.0f,1.0f,1.0f,1.0f);
glBegin(GL_QUADS);
glVertex3f(center_x-9,center_y,-2.0f);
glVertex3f(center_x+9,center_y,... | true |
23f1b680adc968041fc6e1b53bf6d95d5ce1a980 | C++ | swolecoder/Techie-Delight | /Array/c++/zeroSumSubarray.cpp | UTF-8 | 592 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <unordered_set>
using namespace std;
bool zeroSumSubarray(int arr[], int n)
{
//set
unordered_set<int> set;
set.insert(0);
int sum = 0;
for (int i = 0; i < n; i++)
{
sum += arr[i];
if (set.find(sum) != set.end())
{
printf("Fou... | true |
a932c1b7467bdaae1983eb3c3b3c560b8f45e3fe | C++ | clausmeyer/P5-Platooning | /Following_car/Arduino/Velocity_sensor/DCmotorpwm/DCmotorpwm.ino | UTF-8 | 2,741 | 2.515625 | 3 | [] | no_license | #include <TimerOne.h>
#define PWM_PIN 10
volatile byte magnet_counter = 0;
float velocity = 0.0;
unsigned int rpm = 0;
unsigned long timeold = 0;
unsigned long starttime = 0;
int period = 1; //100 ms
unsigned long time_last = 0;
double circumference = 0.2765; //27,65 cm
double magnets = 4.0;
//double result = 0;
//int... | true |
7912452e25b37ad88157c4049b204bb281fdee1d | C++ | JOOHOJANG/Problem_Solving | /boj_sources/6416.cpp | UTF-8 | 780 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <unordered_set>
using namespace std;
unordered_set<int> node;
int u, v;
int line;
int cnt = 1;
int main() {
while (1) {
cin >> u >> v;
if (u == -1 && v == -1) {
break;
}
if (u == 0 && v == 0) {
if (line == 0 || node.size() == lin... | true |
03ca77cf0a31eedb338e880fff9a7bdc7e2425a3 | C++ | benbraide/OOSL | /oosl/driver/numeric_driver.cpp | UTF-8 | 9,420 | 2.78125 | 3 | [] | no_license | #include "numeric_driver.h"
oosl::driver::numeric::~numeric() = default;
oosl::driver::object::entry_type *oosl::driver::numeric::cast(entry_type &entry, type_object_type &type, cast_option_type options){
if (OOSL_IS(options, cast_option_type::ref) || type.is_ref())
return object::cast(entry, type, options);//Refe... | true |
1d006c8adc9c99f72782ab4ee745640d57ffacf8 | C++ | rameshg87/osmosys | /smldr/cpp/filesys.cpp | UTF-8 | 6,968 | 2.65625 | 3 | [] | no_license | /********************************************************************************
PART OF OSMOSYS OPERATING SYSTEM; CODE WRITTEN BY TEAM OSMOSYS
v1.1
********************************************************************************/
#include <filesys.h>
#include <common.h>
#include <video.h>
/* disk buffer declared ... | true |
da0faacb0907ef5bbb6e0704ac5a8f832be1bb04 | C++ | jatropj/plume-sph | /src/preproc/preprocess.h | UTF-8 | 4,711 | 3.140625 | 3 | [] | no_license | /*
* preprocess.h
*
* Created on: Mar 7, 2015
* Author: zhixuanc
*/
#ifndef PREPROCESS_H
#define PREPROCESS_H
#include <vector>
#include <iostream>
using namespace std;
#include <buckstr.h>
struct PartiHead
{
int xind, yind, zind, proc;
unsigned key[KEYLENGTH];
bool is_underground;
unsigned top_... | true |
98377fb224e918c72a12807b8fee181689b24945 | C++ | glandu2/DIFKdom | /DIFK/TemplateDefinitions.h | UTF-8 | 693 | 2.640625 | 3 | [] | no_license | #ifndef DIFK_TEMPLATEDEFINITIONS_H
#define DIFK_TEMPLATEDEFINITIONS_H
#include <vector>
#include <string>
#include "MemberType.h"
namespace DIFK {
class Block;
class TemplateDefinitions
{
public:
struct FieldDef {
std::string name;
ElementType type;
TemplateGuid guid; //valid only if type == ET_Template... | true |
c7b87f4a81e40b163b185a6f0be03b573aba9972 | C++ | lnghia/Big-O-Coding | /orange/dp/session1/Minimum Indexed Character/code.cpp | UTF-8 | 671 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
string patt;
string str;
string ans = "No character present";
unordered_set<char> counting;
cin >> t;
while(t--){
if(!counting.empty()) countin... | true |
a5083aaf8ec421a58e95a21cd17b3215a43de87d | C++ | sg-p4x347/RISC-Simulator | /RISC Simulator/GOTO.h | UTF-8 | 284 | 2.84375 | 3 | [] | no_license | #pragma once
#include <set>
enum ConditionalFlags {
True,
False,
Underflow,
Overflow,
Greater,
Equal,
Less
};
class GOTO {
public:
GOTO();
void SetFlag(ConditionalFlags flag);
bool Check(ConditionalFlags flag);
void Clear();
private:
std::set<ConditionalFlags> m_flags;
}; | true |
bdf62267b7c1b70bc89be994f2ce0597586a6021 | C++ | dishant-123/Data-structure- | /TreesCodes/implementing binary tree.cpp | UTF-8 | 2,602 | 3.671875 | 4 | [] | no_license | //all the leftnodes of any nodes is smaller and right nodes are greater;
#include<iostream>
#include<queue>
using namespace std;
struct BstNode{
int data;
BstNode *left;
BstNode *right;
};
BstNode * getNewNode(int data)
{
BstNode *newNode = new BstNode()
newNode->data=data;
newNode->left=newNode->right=NULL;
ret... | true |
8b61129ba0977dd274a46dbcaec8a94a8cd655be | C++ | Marukyu/RankCheck | /src/Shared/Utils/StringStream.cpp | UTF-8 | 559 | 2.65625 | 3 | [
"MIT"
] | permissive | #include "Shared/Utils/StringStream.hpp"
#include <iostream>
StringStream::StringStream()
{
myStreamRedirect = 0;
}
StringStream::~StringStream()
{
}
StringStream::StringStream(std::ostream & redirect)
{
myStreamRedirect = &redirect;
}
StringStream StringStream::Cout(std::cout);
std::string StringStream::str() ... | true |
2fbaeb39e718dc1626b8cc4262451b4d1c0b72e2 | C++ | apache/celix | /libs/promises/gtest/src/VoidPromisesTestSuite.cc | UTF-8 | 20,169 | 2.734375 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | permissive | /**
*Licensed to the Apache Software Foundation (ASF) under one
*or more contributor license agreements. See the NOTICE file
*distributed with this work for additional information
*regarding copyright ownership. The ASF licenses this file
*to you under the Apache License, Version 2.0 (the
*"License"); you may n... | true |
b96fb98b509ca662fe68f969a23da44089eff588 | C++ | goopey7/BinarySearchTree | /main.cpp | UTF-8 | 252 | 2.6875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "BinaryTree.h"
int main()
{
BinaryTree tree;
tree.insert(20);
tree.insert(30);
tree.insert(10);
std::cout << tree.toString() << std::endl;
tree.remove(20);
std::cout << tree.toString() << std::endl;
return 0;
}
| true |
d1ce51a6030c25b06c8637924e97cff4445c136e | C++ | garrettsickles/CSCI262 | /labs/PostfixCalculator/postfix_calculator.cpp | UTF-8 | 2,805 | 3.390625 | 3 | [] | no_license | /*
postfix_calculator.cpp
For CSCI 262, Fall 2013, Lab 3.
Implementation of the postfix calculator. You should modify the code
everywhere you see a "TODO" comment!
*/
#include "postfix_calculator.h"
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
bool postfix_calculator::evaluate(s... | true |
48e1909fed86212a4cfc167c83c2f14584c13611 | C++ | Waterx/Cpp_Learning | /mooc-homework/mooc4-4 ege/main.cpp | UTF-8 | 2,881 | 3.28125 | 3 | [] | no_license | #include"graphics.h"
#include<cstdlib>
using namespace std;
class Screen;
class MyRectangle;
class Screen {
public:
Screen();
Screen(int newWidth,int newHeight);
~Screen(){
closegraph();
}
int getWidth() {
return width;
}
int getHeight() {
return height;
}
int setWidth(int width) //return width
{
t... | true |
d111a83b6332496a1504f37505b52802bd89bfea | C++ | pavanpvl/cp_problems | /codechef/DSA/Qhouse.cpp | UTF-8 | 988 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define DEBUG
using namespace std;
int find(int c, int d)
{
int l = 0, r = 1000, res{};
int m;
string s;
while (l <= r)
{
m = l + (r - l) / 2;
if (d)
cout << "? " << m << " " << c << endl
<< flush;
else
cout... | true |
3477c1bd7c80b5ff7790ac51505bfd9c522407ab | C++ | deepakantony/rendering | /dray/images/prog04/extra_credit/fft.cc | UTF-8 | 2,955 | 2.9375 | 3 | [] | no_license | // To use this program, pass in a PPM file on stdin and it will send the
// Fourier transform to stdout. i.e.:
//
// ./fft < prog04.ppm > prog04-fft.ppm
//
// Depending on the intensities in your image, you may need to adjust the
// value on line 82.
#include <math.h>
#include <complex>
#include <iostream>
#include ... | true |
adf38aa01ffd5c4389b9d2a05900940857c65256 | C++ | freddyox/screen_saver | /src/Owl.cpp | UTF-8 | 2,553 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "../include/Owl.hh"
#include <cmath>
Owl::Owl(){
if (!fOwlSheet.loadFromFile("images/Bird_Owl_noBG.png")) {
std::cout << "Owl sheet not found..." << std::endl;
}
fChangeSprite = 0.1; // sec
fTime = 0.0;
fTempTime = 0.0;
fAlphaTime = 0.25;
fAlphaTimeTemp = 0.0;
fHootOnce = true;
/... | true |
d89bf322f3e56eb63d97f13e7443aac499f11067 | C++ | taniave/Club-de-Algoritmia | /MINHEAP_final.cpp | UTF-8 | 1,594 | 3.171875 | 3 | [] | no_license | //MINHEAP -> ordena 10 numeros
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int tree[maxn];
int sz = 0;
int getParent(int index){
return(index-1)/2;
}
int getLeftChild(int index){
return (index*2) + 1;
}
int getRightChild(int index){
return(index*2)+... | true |
9a4e4d0034cfb12d86758ee35d49d7eaacb2e741 | C++ | leaflet757/CPP-SFML-Assignments | /Summer15 SFML Assignments/SFML Console Test/Main.cpp | UTF-8 | 2,045 | 3.359375 | 3 | [] | no_license | #include <SFML/Graphics.hpp>
#include <cstdio>
#include <thread>
#include <iostream>
#include <mutex>
#include <string>
using namespace std;
std::mutex _lock;
bool running = true;
long int testNum = 0;
long updateNumer = 0;
// Create Dummy Shape
sf::CircleShape shape(10.f);
void renderingFunction(sf::RenderWindow... | true |
ce2fd57467c6a5e5174ab59f171b6c9ce526821e | C++ | glsubri/morninglight | /arduino/lib/AlarmManager/src/Alarm.h | UTF-8 | 1,220 | 3.734375 | 4 | [
"MIT"
] | permissive | #ifndef ALARM_H
#define ALARM_H
#include <Time.h>
/**
* @brief Data class used to store an Alarm
*
*/
class Alarm {
public:
/**
* @brief Construct a new default Alarm object
*
*/
Alarm();
/**
* @brief Construct a new specific Alarm object
*
* @param enabled Is the alar... | true |
62980612ee8fc38c898d181a639f524d643c7e55 | C++ | rosswarren/OpenGL-Terrain | /RawLoader.cpp | UTF-8 | 1,747 | 3.25 | 3 | [] | no_license | #include "RawLoader.h"
RawLoader::RawLoader(void) {
}
RawLoader::~RawLoader(void) {
}
// load a texture and return its OpengGL mapped integer
GLuint RawLoader::LoadTextureRAW(char * filename, int wrap, int width, int height) {
GLuint texture;
GLubyte * data;
FILE * file;
//char * folder = "Textures\\... | true |
c058724c897e3e670566f9b34166f09297229bb3 | C++ | R-droid101/DSA | /Graphs/sample.cpp | UTF-8 | 1,049 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <conio.h>
using namespace std;
int a[20][20], q[20], visited[20], n, i, j, f = 0, r = -1;
void bfs(int v)
{
for (i = 1; i <= n; i++)
if (a[v][i] && !visited[i])
q[++r] = i;
if (f <= r)
{
visited[q[f]] = 1;
bfs(q[f++]);
... | true |
33331c6716c7f13f48a744ce6391f63136f5ed82 | C++ | jpinto3/programming-work | /c++ projects/Project4/Weapon.h | UTF-8 | 304 | 2.8125 | 3 | [] | no_license | #ifndef WEAPON_H
#define WEAPON_H
#include <iostream>
using namespace std;
class Weapon {
private:
int stamina_required;
int hit;
string weapon_name;
public:
Weapon(string a, int b, int c);
string get_weapon_name();
int get_stamina_required();
int get_hit();
};
#endif
| true |
d4fbba11863b1fe0a56de931608203e5780be277 | C++ | kmulrey/LORA_master_integrate | /lora_daq-master/include/Socket_Calls.h | UTF-8 | 3,755 | 2.84375 | 3 | [] | no_license | /**
@author hershalpandya@gmail.com
*/
#pragma once
// These are all OS libraries. No equivalent in C++.
#include <sys/socket.h> // ip protocols for eg int values for AF_INET defined here.
#include <netdb.h> //has getaddrinfo(),struct addrinfo,etc.
#include <sys/fcntl.h> // fcntl(), O_NONBLOCK,etc
#include <sys/select... | true |
dbd728d34146cc0cf237b6123d206709964c3c40 | C++ | samgqroberts/pyxl | /src/WaveAnimation.cpp | UTF-8 | 2,415 | 3.078125 | 3 | [] | no_license | #include "WaveAnimation.h"
using namespace std;
WaveAnimation::WaveAnimation(
long numLines,
long numCols,
long duration,
long maxFrames,
long waveWidth,
long stayUp
) : Animation(numLines, numCols, duration, maxFrames){
this->waveWidth = waveWidth;
this->stayUp = stayUp;
}
WaveAnimation* WaveAnimatio... | true |
496d41c46f9815e7ed08aff8ef0c5de9588e2ce4 | C++ | OloieriAlexandru/Competitive-Programming-Training | /codeforces/1203F2.cpp | UTF-8 | 1,334 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector<pair<int,int>>positives_e;
vector<pair<int,int>>negatives_e;
int n, r, x, y, ans;
int main()
{
cin>>n>>r;
for (int i=1; i<=n; ++i)
{
cin>>x>>y;
if (y >= 0) positives_e.push_back(make_pair(x,y));
else negatives_e.push_back(make_pair... | true |
225ecfffac6f5f9c6a17df9310acdaf650963a6b | C++ | justHusam/Competitive-Programming | /UVa/686 - Goldbach's Conjecture (II).cpp | UTF-8 | 582 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int N = 1 << 15;
bool isPrime[N];
int main(int argc, char **argv) {
memset(isPrime, true, sizeof isPrime);
isPrime[0] = isPrime[1] = false;
for (int i = 2; i * i < N; ++i)
if (isPrime[i])
for (int j = i * i; j < N; j += i)
isPrime[j] = false;
int n;
wh... | true |
ebebff1feaae229c7e62b2cafb4195757538c429 | C++ | MaximV88/RoboCup | /Robocup/BehaviorTree/SequenceNode.cpp | UTF-8 | 1,154 | 2.9375 | 3 | [
"MIT"
] | permissive | /************************************************************
* Student Name: TreeBots *
* Exercise Name: Ex6 *
* File description: Implementation of Nameable Class *
***********************************************************/
#include ... | true |
c52d1bb83bdca5acc5106c38af10c57945891870 | C++ | mdirshad17/MATHS | /Zalgo.cpp | UTF-8 | 779 | 2.984375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
vector<int> Zalgo(string s)
{
int n = s.size();
int l = 0, r = 0;
std::vector<int> Z(n);
Z[0] = 0;
for (int i = 1; i < n; i++)
{
if (i > r)
{
l = r = i;
while (r < n && s[r - l] == s[r])
{
r++;
}
Z[i] = r - l;
r--;
} else
... | true |
3bd0e86344787edc10810a33f0aa8366733d533b | C++ | chienlisu/Leetcode2019 | /415. Add Strings.cpp | UTF-8 | 792 | 2.875 | 3 | [] | no_license | class Solution {
public:
string addStrings(string num1, string num2) {
int len1 = num1.length();
int len2 = num2.length();
if (len1 < len2)
{
string temp(len2-len1,'0');
num1 = temp + num1;
}
else if (len2 < len1)
{
... | true |
f778d26d34455800e2f439dd6b25f17ec6e078ec | C++ | jinbeomdev/daily-algorithm-problems | /[BOJ]1309/Source.cpp | UHC | 1,225 | 3.078125 | 3 | [] | no_license | //https://www.acmicpc.net/problem/1309
/*
η ĭ η Nĭ Ʒ 츮 ִ.
ڵ ִµ ڵ 츮 , ηε ηε پ ְ ġ . û ڵ ġ Ӹ ΰ ִ.
û Ӹ ʵ 츮 2*N 迭 ڸ ġϴ ˾Ƴ α ۼ ֵ . ڸ ġ ʴ 쵵 ϳ ģٰ Ѵ.
Է
ù° ٿ 츮 ũ N(1N100,000) ־.
ù° ٿ ڸ ġϴ 9901 Ͽ.
Է
4
41
*/
#include <iostream>
#include <cstring> //memset
using namespace std;
const int... | true |
ffb2b416bc37d71b9168879c7d02c90179d08743 | C++ | doycode/magic-cube-3d | /MagicCube3D/utilities.h | GB18030 | 1,492 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
//#ifndef __UTILITIES_H__
//#define __UTILETIES_H__
#include"stdafx.h"
//rotate direction
enum Axis{X, Y, Z};
//description of chunk position
enum ChunkIndex{NEGATIVE, MIDDLE, POSTIVE};
enum RotateDirection{CLOCKWISE, COUNTERCLOCKWISE, NOROTATE};
//description of the 6 aspects and the situation that n... | true |
ad8912ba569cd6081d45c0220dd935c59b3ebaa8 | C++ | ZoranPandovski/al-go-rithms | /data_structures/Disjoint_Set_Union/Cpp/DSU_Path_Compress.cpp | UTF-8 | 729 | 3.234375 | 3 | [
"CC0-1.0"
] | permissive | #include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
int p[maxn], size[maxn];
void initialize(int n){
for(int i = 1; i<=n; i++){
p[i] = i;
size[i] = 1;
}
return ;
}
int find(int u){
return p[u] = (p[u] == u ? u : find(p[u])); //path compression
}
//weighted union for maintaing balance
void... | true |
d769eccbc3648c609c8b5a0d46dce27a6f7472d7 | C++ | WenqinHuangfu/Parallelized_GEMM | /dgemm-pthread.cpp | UTF-8 | 3,032 | 3.015625 | 3 | [] | no_license | //
// dgemm-pthread.cpp
//
//
// Created by Nan Wu on 5/4/19.
//
#include <stdlib.h>
#include <sys/types.h>
#include <stdio.h>
#include <pthread.h>
#include <mkl.h>
#define thread_count 4
const char *dgemm_desc = "pthread, three-loop dgemm.";
const double BETA = 1.0;
const char *ntran = "N";
#if !defined(BLOCK_SIZ... | true |
0fd8a3d309fdabeddc8862dbb714ee3ca9e4158f | C++ | tburtenshaw/worldview2 | /Project1/mytimezone.cpp | UTF-8 | 4,911 | 3.21875 | 3 | [] | no_license | #include "mytimezone.h"
#include <ctime>
#include <string>
#include <chrono>
unsigned long MyTimeZone::AsLocalTime(unsigned long unixtime)
{
return unixtime+tz_offset_second(unixtime);
}
//thanks https://stackoverflow.com/questions/32424125/c-code-to-get-local-time-offset-in-minutes-relative-to-utc
long MyTimeZone:... | true |
cdf15feee994d297c3308b24e1a14e5ff2107646 | C++ | MasterZul/Example-C---Source-Code-Lesson | /C++/10 Class/Employee/EmployeeData.h | UTF-8 | 1,056 | 3.4375 | 3 | [] | no_license | #ifndef EMPLOYEEDATA_H
#define EMPLOYEEDATA_H
#include<string>
using namespace std;
class Employee{
private:
string name;
int idNumber;
string department;
string position;
public:
Employee(string,int,string,string);
Employee();
void setName(string n){ name = n;}
void setIdNumber(int i){ idNumber = i;}
void s... | true |
4acd71fbb7762dbd4ddbc31d04abb378e043d666 | C++ | mdub555/OS-Project-2 | /src/info/memory_info.cpp | UTF-8 | 1,374 | 3.09375 | 3 | [] | no_license | #include "memory_info.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <ncurses.h>
using namespace std;
MemoryInfo get_memory_info() {
// make initial struct
MemoryInfo info;
// open the file
ifstream meminfo_file(PROC_ROOT "/meminfo");
string line, name; // declare the line and name... | true |
cceefd5c3b4221473339ae869cdb5db3ee2a6db1 | C++ | johndevwayne/ltm-plus-plus | /BigNum.cpp | UTF-8 | 738 | 2.71875 | 3 | [
"MIT"
] | permissive | /*
* BigNum.cpp
*
* Created on: Dec 21, 2012
*
* LICENSING: See LICENSE.txt or http://opensource.org/licenses/MIT
*/
#include "BigNum.h"
BigNum::BigNum(const std::vector<unsigned char> &bin) :
N(new mp_int) {
mp_init_size(*this, 1);
mp_read_signed_bin(*this, &bin[0], bin.size());
}
std::strin... | true |
be39a4da8cb53d8675deac0601990590488c4296 | C++ | JakubSokolowski/tsp-distributed-worker | /src/solvers/bnb/BranchAndBound.h | UTF-8 | 1,439 | 2.546875 | 3 | [] | no_license | #ifndef TSP_BRANCHANDBOUND_H
#define TSP_BRANCHANDBOUND_H
#include <iostream>
#include <limits>
#include <deque>
#include <stack>
#include <utility>
#include "LittleMatrix.h"
#include "../Solver.h"
#include "../Solution.h"
using std::stack;
using std::deque;
using std::pair;
using std::cout;
using std::endl;
struc... | true |
8acb451aafa5314bc141044fcb3792dae1c4f129 | C++ | inglada/OTB | /Examples/DataRepresentation/Containers/TreeContainer.cxx | UTF-8 | 9,595 | 2.859375 | 3 | [] | no_license | /*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
Some parts of this code are derived from ... | true |
ea06c6fd33a97259daace2807af7fec43daa959d | C++ | ilovelibai/C-Cpp-Notes | /src/object-lifecycle.cpp | UTF-8 | 5,458 | 3.609375 | 4 | [] | no_license | // File: object-lifecycle.cpp
// Brief: Demonstrate Object Lifecycle
#include <iostream>
#include <string>
#define DEBUG_TRACE
#ifdef DEBUG_TRACE
#pragma message "Logging Enabled"
#define TRACE(msg) \
std::cerr << __FILE__ << ":" << __LINE__ << ": - fun = " << __FUNCTION__ << " ; " << msg << "\n"
#else
#... | true |
dd91d7d0b8e637b0b4240d88a8a722befa64a88d | C++ | MonsieurWilson/cpplearn | /apue/ch4/lstat.cpp | UTF-8 | 1,047 | 2.84375 | 3 | [] | no_license | /**
* Copyright(C), 2017, Nsfocus
* Name:
* Author: Wilson Lan
* Description:
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <iostream>
int main(int argc, const char **argv) {
struct stat buf;
std::string mode;
for (int i = 1; i < argc; ++i) {
std::cout <<... | true |
1203762e6e02adf5da44ecc4b47082b22ed2471c | C++ | Adicesa05/Arduino | /Variable_LED_Blinker/Variable_LED_Blinker.ino | UTF-8 | 799 | 3.046875 | 3 | [] | no_license | int ledPin = 13; //declares variable(s)
int delayVar = 2000;
void setup() {
pinMode(LED_BUILTIN, OUTPUT); //turns on the LED
Serial.begin(9600); //always start this
}
void loop()
{
digitalWrite(ledPin, HIGH);
delay(delayVar); // th... | true |
bdc19aa63668b6871b01ad63a8b58d90b9985911 | C++ | tianskylan/Zombie-Simulator | /exceptions.h | UTF-8 | 744 | 3.203125 | 3 | [] | no_license | #pragma once
#include <exception>
class InvalidOp : public std::exception
{
public:
const char* what() const throw() { return "Invalid OP code or parameters."; }
};
class AccessViolation : public std::exception
{
public:
const char* what() const throw() { return "Machine tried to access outside available memory."; }... | true |
2a5c6d4d9791c83039d4d298bfc1ddee6fccf0d1 | C++ | eglrp/Alchemy | /test/test_pooling_layer.cpp | UTF-8 | 1,116 | 2.640625 | 3 | [] | no_license | #include <alchemy.h>
using namespace alchemy;
int main()
{
Global::mode(Global::GPU);
Blob<float> input({2, 3, 6, 5});
Blob<float> output;
Filler<float>::uniform_fill(input.count(), input.mutable_data_cptr(), 0, 10.0);
print_cpu(input.count(), input.data_cptr());
PoolingLayer<float> poolin... | true |
fb49deb58fa949dfd7e078efb174454b247a92d5 | C++ | Anubhav12345678/competitive-programming | /TILINGWITHDOMINOESVVIMP.cpp | UTF-8 | 1,764 | 4.21875 | 4 | [] | no_license | /*Given a 3 x n board, find the number of ways to fill it with 2 x 1 dominoes.
Example 1
Following are all the 3 possible ways to fill up a 3 x 2 board.
Example 2
Here is one possible way of filling a 3 x 8 board. You have to find all the possible ways to do so.
Examples :
Input : 2
Output : 3
Input : 8
Output : ... | true |
6e0c9441511691f6b39e4be519949e6ffec99592 | C++ | joelmacias/CS135Lab | /lab8/bookex.cpp | UTF-8 | 1,738 | 3.8125 | 4 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main(){
cout << "Enter a number: ";
int userInput;
cin >> userInput;
userInput = abs(userInput);
int counter = 10;
int total = 0;
// keep looping until original input is zero
while(userInput != 0){
// when this condition is true we know that w... | true |
751f91475154022cc8bdb63bc474028abab62282 | C++ | gsalmeida/Estrutura-de-Dados-II | /lista04_Arquivos/04/04.cpp | UTF-8 | 5,057 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
//argc deve ser o mesmo do método main para que a função
//funcione passando como parâmetros os nomes de todos os arquivos de uma vez apenas.
void concatena1(int argc, char *argvArquivos[]) {
// printf("\nArgc na função concatena: %d\n", argc);
FILE *arquivoR... | true |
3417223fbfd66fac4cddd194c419ead837d52ac4 | C++ | mfkiwl/ARTSLAM | /include/ukf/robot_control_input.h | UTF-8 | 1,213 | 2.75 | 3 | [] | no_license | /** @file robot_control_input.h
* @brief Declaration of class IMUControlInput
* @author Matteo Frosi
*/
#ifndef ARTSLAM_ROBOT_CONTROL_INPUT_H
#define ARTSLAM_ROBOT_CONTROL_INPUT_H
#include <slam_types.h>
/**
* @class IMUControlInput
* @brief This class is used hold the measurements of an IMU, used as control in... | true |
f8b2b1666f5a9dc2b72b6b0e7c4c74158e5826fc | C++ | rezanour/randomoldstuff | /Main/Shooter1/ImportFile/utilities.cpp | UTF-8 | 459 | 2.75 | 3 | [] | no_license | #include "precomp.h"
void ReadFileToBuffer(_In_ const char* path, _Inout_ std::vector<uint8_t>& buffer)
{
buffer.clear();
std::ifstream inputfile(path, std::ios::in | std::ios_base::binary | std::ios::ate);
if (inputfile.is_open())
{
buffer.resize((uint32_t)inputfile.tellg());
inputfile... | true |
8898d35bc64f02042a2e34bc48306f20024e55f9 | C++ | PiotrPalczewski/Zadania-domowe | /zad 1.cpp | UTF-8 | 1,037 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
int main() {
int a;
int b;
int c;
int d;
int e;
int f;
double x;
double y;
double W;
double Wy;
double Wx;
cout << "Wpisz zmienna a:" << endl;
cin >> a;
cout << "Wpisz zmienna b:" << endl;
cin >> b;
cout << "Wpisz zmienna c:" << endl;
cin >... | true |
75757f7e108389fe2645e5f78bc6760bbc79e39f | C++ | coding-blocks-archives/Launchpad2_17_Summer_Pitampura | /17-Jun_04/reverse.cpp | UTF-8 | 287 | 2.96875 | 3 | [] | no_license | //Deepak Aggarwal, Coding Blocks
#include <iostream>
using namespace std;
int main() {
int arr[10];
//input val
for (int i = 0; i < 10; ++i) {
cin >> arr[i]; //[0, 9]
}
//reverse printing
for (int i = 9; i >= 0; --i){
cout << arr[i];
cout << " ";
// cout << arr[i] << " ";
}
} | true |
b26e5805b6e4a20a591af1b7105b989caabc69d6 | C++ | bbritva/CPP_D1 | /ex03/Weapon.hpp | UTF-8 | 310 | 2.78125 | 3 | [] | no_license | //
// Created by Gregorio Velva on 8/29/21.
//
#ifndef WEAPON_HPP
#define WEAPON_HPP
#include <string>
#include <iostream>
class Weapon
{
private:
std::string _type;
public:
Weapon();
Weapon(std::string type);
~Weapon();
void setType(std::string type);
const std::string &getType();
};
#endif //WEAPON_HPP
| true |
71a7ae092fa415ac40f0723e20efba4cce777ebd | C++ | idvr/starviewer | /starviewer/src/core/volumerepository.h | UTF-8 | 1,941 | 3.234375 | 3 | [] | no_license | #ifndef UDGVOLUMEREPOSITORY_H
#define UDGVOLUMEREPOSITORY_H
#include "repository.h"
#include "volume.h"
#include "identifier.h"
#include <QObject>
namespace udg {
/**
Aquesta classe és el repositori de volums. En aquesta classe es guarden tots els volums que hi ha oberts durant
l'execució del programa. Nomé... | true |