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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
03971dcbd16f75c68c0c46c3ce820742b6dced7d | C++ | Alexis211/Melon | /Source/Library/Common/IStream.proto.h | UTF-8 | 571 | 2.890625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #ifndef DEF_ISTREAM_PROTO_h
#define DEF_ISTREAM_PROTO_h
#include <String.class.h>
#include <SimpleList.class.h>
#include <Mutex.class.h>
class IStream : private Mutex {
private:
SimpleList<String> *m_buffer;
int m_ptr;
void operator =(IStream& other);
bool m_eof;
bool populate();
protected:
virtual String r... | true |
3ccd5226c1eff83faddbeff320dfbcc187c1d769 | C++ | SOFTK2765/PS | /BOJ/15815.cpp | UTF-8 | 612 | 2.96875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
char s[101];
stack<int> stk;
int main()
{
int a, b;
char tmp;
scanf("%s", s);
int l = strlen(s);
for(int i=0;i<l;i++)
{
if('0'<=s[i] && s[i]<='9') stk.push(s[i]-'0');
else
{
b = stk.top();
stk.pop()... | true |
0c83c544625ac68db00e1510947932f01fcdbe02 | C++ | shreysingla11/ssl-project | /Backend/Parser/submissions/Assignment 6/53.cpp | UTF-8 | 1,515 | 2.546875 | 3 | [] | no_license | #include<string>
#include<iostream>
using namespace std;
int main(){
string main;
cin>>main;
int l,min_len,min_pos,length_w,i,j,m,a,n,b;
n=main.size();
//cout<<n;
l=1;
min_len=n;
min_pos=n;
a=0;b=0;
for(l=1;l<n;l=2*l){
for(m=0;m+l<n;){
//cout<<"2\n";
for(i=m,j=m+l-1;i<m+l&&j<m+4*l-1;){
//cout... | true |
b20a98e491ce54ae63564734ef347ed771b525b5 | C++ | Atloas/ProjektGrafika3d | /ProjektGrafika3d/Effect.cpp | UTF-8 | 221 | 2.609375 | 3 | [] | no_license | #include "Effect.h"
Effect::Effect(sf::Vector2f position) : GameObject(position)
{
height = 70.0f;
}
Effect::~Effect()
{
}
bool Effect::operator<(Effect * effect)
{
return this->getHeight() < effect->getHeight();
}
| true |
65eae1fe19dc24875525aa4b240eb822b7467586 | C++ | ShadowArkitecht/sparky-game-engine | /include/sparky/rendering/directionalshader.hpp | UTF-8 | 4,233 | 2.609375 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Sparky Engine
// 2016 - Benjamin Carter (benjamin.mark.carter@hotmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any ... | true |
c14ca837c10da366e61db642db822a7500bbc965 | C++ | donghee11/Algorithm_Solve | /c++/15686.cpp | UTF-8 | 1,970 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int N, M;
int arr[51][51];
int visit[51][51];
vector <pair<int, int> > v; //치킨위치 넣어져있는 함수
int answer=100000; //최종답
//치킨거리 계산 함수
void calculate()
{
int finaldist = 0;
for(int i=1; i<=N; i++)
for (int j = 1; j <= N; j++)
{
int dis... | true |
c20d980b199528e73451d866a95b42f838ab0fdb | C++ | ancues02/Redes_P2 | /P2.2/serializacion/ejercicio2.cc | UTF-8 | 2,468 | 3.25 | 3 | [] | no_license | #include "Serializable.h"
#include <iostream>
#include <string>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
//el comando od representa en octal por defecto el archivo
//
class Jugador: public Serializable
{
public:
Jugador(const char * _n, int16_t _x, ... | true |
a9aefdc159237d8539e99cec11f09e258a7b0599 | C++ | DragonJoker/ShaderWriter | /include/ShaderAST/Stmt/StmtInOutVariableDecl.hpp | UTF-8 | 1,907 | 2.765625 | 3 | [
"MIT"
] | permissive | /*
See LICENSE file in root folder
*/
#ifndef ___AST_StmtInOutVariableDecl_H___
#define ___AST_StmtInOutVariableDecl_H___
#pragma once
#include "Stmt.hpp"
namespace ast::stmt
{
class InOutVariableDecl
: public Stmt
{
public:
SDAST_API InOutVariableDecl( var::VariablePtr variable
, uint32_t location
, uin... | true |
52b2a77cf255a265b0d609c9298b2266f41ff327 | C++ | wilzegers/CounterMachine | /CounterMachine/Source/Transformation/TransformationRules.cpp | UTF-8 | 6,180 | 2.515625 | 3 | [] | no_license | #include <algorithm>
#include <vector>
#include "BoostIncludes.h"
#include "Transformation/TransformationRules.h"
#include "Descriptors/Computation.h"
namespace Transformation
{
void Skip(TransformedComputation& comp, std::unique_ptr<Descriptors::Instruction>&& instr)
{
comp.SkipInstruction(std::mo... | true |
5b0c8343da55350b6f63a3a53d65fd13706fa738 | C++ | vishalbelsare/XDATA | /textstructure/topic/src/chowtree/ChowLiuTree.h | UTF-8 | 3,297 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef CHOWLIUTREE_H_
#define CHOWLIUTREE_H_
#include <map>
#include <limits>
#include <cfloat>
#include <iostream>
#include <fstream>
#include <ctime>
#include "math.h"
#include "InterfaceObservationLikelihood.h"
#include "InterfaceDetectorModel.h"
//#include "InterfacePlaceModel.h"
//const std::string CLTreeFilenam... | true |
981dc06f7af19eb1a08718c3e0219b84d2aaf711 | C++ | gcem/pathtracer | /src/AccelerationStructures/BoundingBox.hpp | UTF-8 | 2,730 | 3.265625 | 3 | [] | no_license | /**
* @file BoundingBox.hpp
* @author Cem Gundogdu
* @brief
* @version 1.0
* @date 2021-04-18
*
* @copyright Copyright (c) 2021
*
*/
#pragma once
#include "BruteForce.hpp"
namespace AccelerationStructures {
/**
* @brief Checks intersection with a bounding box before doing brute-force
* search
*
* Create... | true |
fbc73da56c5f1792ba84142142a9c147f8fc1852 | C++ | marco-c/gecko-dev-comments-removed | /third_party/libwebrtc/third_party/abseil-cpp/absl/container/internal/test_instance_tracker.h | UTF-8 | 6,019 | 2.734375 | 3 | [
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
#ifndef ABSL_CONTAINER_INTERNAL_TEST_INSTANCE_TRACKER_H_
#define ABSL_CONTAINER_INTERNAL_TEST_INSTANCE_TRACKER_H_
#include <cstdlib>
#include <ostream>
#include "absl/types/compare.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace test_internal {
class BaseCountedInstance {
public:
explicit B... | true |
177400bceda405c3e42566e4476efa7f5a367e05 | C++ | apacewi/BudgetApp | /User.cpp | UTF-8 | 561 | 2.875 | 3 | [] | no_license | #include "User.h"
string User::getName(){
return name;
}
string User::getSurname(){
return surname;
}
string User::getLogin(){
return login;
}
string User::getPassword(){
return password;
}
int User::getId(){
return id;
}
void User::setId(int newId){
id = newId;
}
void User::setName(string user... | true |
c29e6b20736b579774c44312370283497fdedf66 | C++ | rlodina99/Learn_cpp | /Diverse/42pe342.cpp | UTF-8 | 579 | 2.53125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream f("42pe342.in");
int n;
f >> n;
int arr[n];
for(int i=0;i<n;i++){
f >> arr[i];
}
int nrzerouri=0;
for(int i=0;i<n;i++){
if(arr[i]==0)
nrzerouri++;
}
while(nrzerour... | true |
b3934deaff99955644d3bafed2c50365d0cf12d1 | C++ | una1veritas/Workspace | /classes/otest.h | UTF-8 | 497 | 3.453125 | 3 | [] | no_license | class Object {
public:
long size;
Object() {
size = 4;
}
void test() {
cout << "Ok!\n";
}
virtual void print() {
cout << "Object\n";
}
};
class Integer : public Object {
public:
long value;
Integer(int & i) {
size = sizeof(value);
value = i;
}
Integer(Integer & i) {
... | true |
a150753e05f45e1fb974a092f6ab0356d12302b1 | C++ | RobertPeng/RobertTD1 | /Classes/MultiDirTower.cpp | UTF-8 | 2,146 | 2.546875 | 3 | [] | no_license | /*******************************
MultiDirTower.cpp
Robert 2014/09/23
*******************************/
#include "MultiDirTower.h"
#include "GameManager.h"
MultiDirTower::MultiDirTower()
{
}
MultiDirTower::~MultiDirTower()
{
}
bool MultiDirTower::init()
{
if (!TowerBase::init())
{
return false;
}
setScope... | true |
935d68d9e4318081bb247859f86447d4ff10482e | C++ | gaoxiangluke/algorithmsGroupProject | /point.h | UTF-8 | 3,114 | 3.75 | 4 | [] | no_license | #ifndef GROUPPROJECT_POINT_H
#define GROUPPROJECT_POINT_H
#include "SDL_Plotter.h"
class point {
public:
point();
point(int x_coordinate, int y_coordinate);
point(const point& p);
virtual ~point();
void setY(int y);
void setX(int x);
int getX();
int getY();
point& operator=(cons... | true |
7a456ce35ced055c0ebfb193dc40e0b36ed10090 | C++ | rizemon/NUS-CS2040C | /Kattis/aaah.cpp | UTF-8 | 253 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
string first,second;
cin >> first;
cin >> second;
if(first.size()>=second.size()){
cout<<"go"<<endl;
}else{
cout<<"no"<<endl;
}
return 0;
} | true |
e895fd884e6a0e740db0db92cb8dc1382b4f71e9 | C++ | lrwlf/acmcpp | /first/7_11.cpp | UTF-8 | 1,571 | 2.90625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Tree
{
int data;
Tree *lchild;
Tree *rchild;
};
int n;
int pre[31], mid[31];
string res = "";
Tree *creatTree(int pre[],int mid[],int n)
{
if(n==0)
return NULL;
Tree *t = (Tree *)malloc(sizeof(Tree));
t->data = pre[0];
int pos;
... | true |
f6b3d965abeec999a7b55734ad91fef1705a8203 | C++ | trymnilsen/Nithris | /Nithris/Nithris/Playboard.cpp | UTF-8 | 2,201 | 3.203125 | 3 | [] | no_license | //PG4400 - INNLEVERING 1 - TRYM NILSEN
#include "Playboard.h"
//initalizes the board and the array
Playboard::Playboard()
{
initalizeBoard();
}
//returns the color of the tile a position
const ETileColor Playboard::colorOfTileAt(int collum, int row )
{
const ETileColor returnColor = boardArray[collum][row];
return... | true |
4522e7abc15bfb782ad4d2601e8e7aef9006caf6 | C++ | hellocomrade/happycoding | /matrix/rotateMatrix90.cpp | UTF-8 | 3,224 | 3.953125 | 4 | [] | no_license | #include <cassert>
#include <vector>
#include <iostream>
#include <iomanip>
using namespace std;
/*
Given an image represented by an NxN matrix, where each pixel in the image is
4 bytes, write a method to rotate the image by 90 degrees. Can you do this in
place?
1, 2, 3, 4 13, 9, 5, 1
5, 6, 7, 8 ==> 14,... | true |
8bc800cf4d9f858b85f4a65789b5e0e4e4335e44 | C++ | girl-6/C- | /小米 二面/小米 二面/s.cpp | UTF-8 | 400 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
int n;
vector <int> v;
cin >> n;
int flag=0;
if (n < 0)
{
flag = -1;
n *= flag;
}
v.push_back(n%10);
n /= 10;
while (n != 0)
{
v.push_back(n % 10);
n /= 10;
}
if (flag == -1)
cout << '-';
for (int i = 0; ... | true |
981597ee4a93e30fc2477752c83dafbbb2279175 | C++ | pd0220/1DStringSimulation | /main.cpp | UTF-8 | 11,348 | 3.265625 | 3 | [] | no_license | // 1D elastic string simulation (solving the wave equation numerically)
// including useful headers and/or libraries
#include <iostream>
#include <fstream>
#include <math.h>
#include <string>
#include <vector>
// Eigen library for matrices
#include <Eigen/Dense>
// -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_... | true |
0429c9618bbe29f46098ef55663758a632c9ce72 | C++ | h4hany/yeet-the-leet | /algorithms/Hard/1088.confusing-number-ii.cpp | UTF-8 | 1,355 | 3.390625 | 3 | [] | no_license | /*
* @lc app=leetcode id=1088 lang=cpp
*
* [1088] Confusing Number II
*
* https://leetcode.com/problems/confusing-number-ii/description/
*
* algorithms
* Hard (44.24%)
* Total Accepted: 15.2K
* Total Submissions: 34.4K
* Testcase Example: '20'
*
* We can rotate digits by 180 degrees to form new digits.... | true |
df6acd59f1402fb0864f6970cad28156f7027d11 | C++ | ginkgo/AMP-LockFreeSkipList | /pheet/primitives/PerformanceCounter/Time/TimePerformanceCounter.h | UTF-8 | 3,476 | 2.671875 | 3 | [] | no_license | /*
* TimePerformanceCounter.h
*
* Created on: 10.08.2011
* Author(s): Martin Wimmer
* License: Boost Software License 1.0 (BSL1.0)
*/
#ifndef TIMEPERFORMANCECOUNTER_H_
#define TIMEPERFORMANCECOUNTER_H_
#include <stdio.h>
#include <iostream>
#include <chrono>
#include "../../../settings.h"
#include "../.... | true |
b4aea894f3db17552e360663126a074d3eece41e | C++ | Tonyyytran/Polynomial1.0 | /polynomial.cpp | UTF-8 | 8,088 | 3.703125 | 4 | [] | no_license | //
// Created by Tony Tran on 11/20/19.
//
#include "polynomial.h"
Polynomial::Polynomial(){
head = new Term;// 0th node is a dummy.
head->next = head;
head->prev = head;
size = 0;
}
Polynomial::Polynomial( const Polynomial &rhs ) {
head = new Term; // create a dummy
head->next = ... | true |
a8c6671c6b30535274c26f92fc7f2525b7f3cbfd | C++ | tangjz/c0-compiler | /scanner.cpp | UTF-8 | 7,964 | 2.515625 | 3 | [] | no_license | #include "scanner.h"
const char *reserver[] = {"int", "char", "const", "void", "main", "scanf", "printf", "return", "if", "else", "for", "switch", "case", "default", NULL};
const char *pattern = "+-*/=,;:()[]{}";
char buffer[BUF_SIZE];
char ch = ' ', token[TOKEN_MAX] = {}, *tokenTail = token;
unsigned number = 0;
en... | true |
672ee5e70c6539dd36a35e9ebb3da315e9010846 | C++ | njzhangyifei/oj | /leetcode/PowerOfTwo_cpp/solution.cpp | UTF-8 | 614 | 2.515625 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <queue>
#include <iterator>
#include <numeric>
#include <memory>
#include <set>
#include <map>
#include <bitset>
#include <unordered_map>
#include <cstring>
#include <climits>
#include <iostream>
#include <algorithm>
using namespace std;
class Solution {
pu... | true |
0d634aa61b4e4e34fc9207cd8a7db9bc4874c550 | C++ | stratoseus1998/axastoi | /askisi2.cpp | UTF-8 | 624 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
main(){
int num;
printf("Give your AFM \n");
num=scanf("%d",&num);
int array[8];
int i=0;
array[i] = num % 10;
array[i+1] = ( num / 10 ) % 10;
array[i+2] = ( num / 100 ) % 10;
array[i+3] = ( num / 1000 ) % 10;
array[i+4] ... | true |
93ad0987216bf7ebaac16549931e88b391c3f68f | C++ | jcoughlan/new_layout_eyelevel2 | /MZFormSheetController-master/Example/Xcode5 iOS 7 Example/Xcode5Example/Xcode5Example/EyeLevelSource/include/VertexBuffer.h | UTF-8 | 1,113 | 2.71875 | 3 | [
"MIT"
] | permissive | //\=====================================================================================
///
/// @file VertexBuffer.h
/// @author Jamie Stewart
/// @date 9 Oct 2010
///
//\=====================================================================================
#ifndef __VERTEX_BUFFER_H__
#define __VERTEX_BUFFER_H__
#if... | true |
72472aff38425f7a21b67653be36499d25751b2f | C++ | Du0ngkylan/C-Cpp | /TKDGTT/Bai Tap/Bai Tap Giua Ky/TL.Nhom05.LamThiHang.TranThiThuHang.VuMinhHang.TranManhHung/Tiểu luận giữa kì/bubbleSort.cpp | UTF-8 | 489 | 2.734375 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
void bubbleSort( int a[], int n){
int i,j,temp;
for(i=2;i<n;i++)
for(j=n;j>=i;j--)
if(a[j-1]>a[j]){
temp = a[j-1];
a[j-1] = a[j];
a[j] = temp;
}
for(i=1;i<=n;i++)
printf("%4d",a[i]);
}
int main(){
int a[100],n,i;
printf("Nhap do dai day so: ");
sca... | true |
64b5d31468e9965adaf28dd129f5c5147a38bc9e | C++ | vmihaylenko/omim | /generator/filter_interface.hpp | UTF-8 | 462 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
struct OsmElement;
namespace feature
{
class FeatureBuilder;
} // namespace feature
namespace generator
{
// Implementing this interface allows an object to filter OsmElement and FeatureBuilder1 elements.
class FilterInterface
{
public:
virtual ~FilterInterface() = default;
virtual bool IsAccepted(... | true |
b9e7e77922ce7bf5c10697daba6937752b2f0e1a | C++ | nslo/path-planning-2d | /src/geometry/triangle.cpp | UTF-8 | 3,718 | 3.203125 | 3 | [] | no_license | #include "triangle.hpp"
namespace nslo
{
Triangle::Triangle(std::vector<Vector2> _pts)
{
assert(_pts.size() == 3);
// init default triangle
num_points = _pts.size();
pts = _pts;
drag_point = -1;
radius = get_radius();
centroid = get_centroid();
}
Triangle::~Triangle() {}
void Triangle::... | true |
1f08ce6b064d6e262a5685d6e89c2543af34892c | C++ | cRyanPMcN/batch_launcher | /batch_lancher/batch_lancher/batch_launcher_main.cpp | UTF-8 | 1,367 | 3.28125 | 3 | [] | no_license | /*
File: LaunchTimes_main.cpp
Author: Ryan McNamee
Date Created: Tuesday, 19, September, 2017
Date Updated: Monday, 9, October, 2017
Purpose: Start the program
*/
#include "rm_Launcher.hpp"
#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
using namespace std;
int main(int argc, char* argv[]... | true |
4c65fe733db14e2746f37681cbe033a87911b17c | C++ | FSWL98/OOP | /Factorizer-lab4-5/headers/exceptions.h | UTF-8 | 316 | 3.109375 | 3 | [] | no_license | #pragma once
#include <exception>
#include <string>
class IOException : public std::exception
{
public:
IOException() = default;
explicit IOException(const std::string& filename)
{
this->filename = filename;
}
const char* what() const throw() override;
private:
std::string filename;
}; | true |
50d03e6fc17874b80b432455f26671c7c3b7d0b2 | C++ | Growb0y/IncomeAndChargeList | /table.cpp | UTF-8 | 383 | 2.828125 | 3 | [] | no_license | #include "table.h"
Table::Table(){}
Table::Table(QList <TableEntry> en_)
: entries(en_){}
Table::~Table(){}
void Table::addItem(TableEntry en_){
entries.push_back(en_);
}
void Table::deleteItem(int i){
entries.removeAt(i);
}
TableEntry Table::getItem(int i){
return entries[i];
}... | true |
75e0acab7b0b2d77bb085a333f234113db687b0e | C++ | XutongLi/Leetcode-Solution | /386. Lexicographical Numbers/solution_1.cpp | UTF-8 | 508 | 2.75 | 3 | [] | no_license | class Solution {
private:
void dfs(int num, int n, vector<int> &res) {
for (int k = 0; k <= 9; ++ k) {
if (k > n)
return;
int cur = num * 10 + k;
if (cur > n)
continue;
if (cur != 0) {
res.push_back(cur);
... | true |
ab139929b5be2110429db1c711b21d7bed2c7365 | C++ | DerNerger/CppProjects | /cppLearn/IO/Read.cpp | UTF-8 | 362 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
int main(void){
//lesen aus datei
ifstream ifs;
ifs.open("output.txt");
if(ifs){
string line;
while(!ifs.eof()){
ifs >> line;
cout << line << endl;
}
}
else {
cout << "Datei konn... | true |
6f0b4d6903307b0a07e39ca4cc6d36480da52236 | C++ | llwwlql/Dictionary | /代码库/Dev c++/2059龟兔赛跑(1).cpp | UTF-8 | 647 | 2.5625 | 3 | [] | no_license | #include <stdio.h>
double dp[105];
int main()
{
int n,c,t,l;
int vr,v1,v2;
int i,j;
int a[105];
while(~scanf("%d",&l))
{
scanf("%d %d %d",&n,&c,&t);
scanf("%d %d %d",&vr,&v1,&v2);
for(i=1;i<=n;i++)
scanf("%d",a+i);
a[0]=0;
a[n+1]=l;
dp[0]=.0;
for(i=1;i<=n+1;i++)
{
dp[i]=1000000.0;
for(j=0... | true |
58218896e88a21dc5cf53bd7ea9a5d7214ddabaa | C++ | void-productions/arrows | /cpp/src/entity/bullets/SimpleArrow.hpp | UTF-8 | 591 | 2.53125 | 3 | [] | no_license | #ifndef __SIMPLEARROW_CLASS__
#define __SIMPLEARROW_CLASS__
class Mob;
class GameRect;
#include <entity/Bullet.hpp>
class SimpleArrow : public Bullet
{
public:
SimpleArrow(const GameVector& pos, const GameVector& speed, Mob* owner);
SimpleArrow(CompressBuffer*);
CompressID getCompressID() const override;
... | true |
aa7cbb2775ef298e0e4d02e17ef7754a6379f463 | C++ | hjcho7311/sticky-notes | /KeyActionCreator.cpp | UTF-8 | 5,389 | 2.65625 | 3 | [] | no_license | //KeyActionCreator.cpp
#include "KeyActionCreator.h"
#include "LeftArrowKey.h"
#include "UpArrowKey.h"
#include "DownArrowKey.h"
#include "RightArrowKey.h"
#include "CtrlLeftArrowKey.h"
#include "CtrlRightArrowKey.h"
#include "CtrlCKey.h"
#include "CtrlVKey.h"
#include "CtrlXKey.h"
#include "ShiftLeftArrowKey.h"
#incl... | true |
b08b067602b78eaba3c95d19071126136774bf5a | C++ | ntosta/genetic-tsp | /src/tsp.cpp | UTF-8 | 3,596 | 3.546875 | 4 | [] | no_license | // Nick Tosta
// August 2015
// tsp.cpp
// contains the implementation for functions related to the traveling salesman problem
#include <cmath>
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
#include "tsp.h"
using namespace std;
// Constructor that automatically read... | true |
4e994df4967ff9bd09e66740b989dd0324f6d17f | C++ | kiyoony/donga-university | /p10205.cpp | UTF-8 | 1,339 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
char suit[4][10] = { "Clubs", "Diamonds","Hearts","Spades" };
char value[13][10] = { "2","3","4","5","6","7","8","9","10","Jack","Queen","King","Ace" };
int get(char *x)
{
int sum = 0;
for (int i = 0; i<3; i++)
{
if (x[i] >= '0' && x[i] <= '9') {
if (sum)
sum = sum * 10;
sum += x[i] ... | true |
389af83743086d00cdff526fec8b39b1114da64f | C++ | Pangolin-hmt/DNU-CNTT08-02 | /vuongcanrong.cpp | UTF-8 | 295 | 2.6875 | 3 | [] | no_license | #include<iostream>
using namespace std;
void main()
{
int d, i, j;
cout << "nhap vao d, r : ";
cin >> d; cin.ignore();
for (j = 1; j <=d; j++)
{
for (i = d; i >=1; i--)
{
if (j == d || j == d - i + 1 || i == d) cout << "* ";
else cout << " ";
}
cout << "\n";
}
cin.get();
} | true |
452fbafd3587f3e6fa865857b99d8bad343d4020 | C++ | nikki93/thesis-2015 | /ds-ovr/scene.cpp | UTF-8 | 1,162 | 2.671875 | 3 | [] | no_license | #include "scene.h"
#include <GL/glew.h>
#include <SDL.h>
void Scene::add_cloud(std::shared_ptr<Cloud> cloud)
{
main_cloud.merge(cloud);
}
void Scene::update(void)
{
// pitch/yaw using mouse
int x, y;
auto state = SDL_GetMouseState(&x, &y);
if (state & SDL_BUTTON_LMASK)
{
m_yaw += 0.3f... | true |
4c76afca25eb69e64f62bff4bb53a3b38a61ffd0 | C++ | tinchop/tp-taller-1-2018 | /src/client/view/sprite-text.h | UTF-8 | 1,036 | 2.546875 | 3 | [] | no_license | #ifndef SPRITETEXT_H
#define SPRITETEXT_H
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#include "sprite-sheet.h"
#include "../../shared/logger.h"
class SpriteText : public SpriteSheet
{
public:
SpriteText(SDL_... | true |
98f39a8a8abf02496b79b16481fa54e52e288d3a | C++ | ZJUCADGeoSim/Hausdorff | /src/mesh/definition.hpp | UTF-8 | 1,189 | 2.671875 | 3 | [
"MIT"
] | permissive | /*
State Key Lab of CAD&CG Zhejiang Unv.
Author:
Yicun Zheng (3130104113@zju.edu.cn)
Haoran Sun (hrsun@zju.edu.cn)
Jin Huang (hj@cad.zju.edu.cn)
Copyright (c) 2004-2021 <Jin Huang>
All rights reserved.
Licensed under the MIT License.
*/
#ifndef _DEFINITION_HPP
#define _DEFINITION... | true |
62d48d587b03f41ed05b5d50e993fa681dd03c6e | C++ | dkdlel/DongA-University | /ProblemSolve/28번(crt)/crt.cpp | UTF-8 | 2,153 | 3 | 3 | [] | no_license | //
// crt.cpp
// ProblemSolve
//
// Created by JeJn on 2020/05/20.
// Copyright © 2020 JeJn. All rights reserved.
//
#include<fstream>
#include<vector>
using namespace std;
ifstream fcin("/Users/jejn/Desktop/ProblemSolve/ProblemSolve/crt.inp");
ofstream fcout("/Users/jejn/Desktop/ProblemSolve/ProblemSolve/crt.o... | true |
774cfba7a87b3d0afcef7c63ce9bdcbbd5891b6e | C++ | elados93/ex05 | /src/server/ThreadPool.h | UTF-8 | 1,192 | 3.125 | 3 | [] | no_license |
// Created by Elad Aharon on 14/01/18.
// ID: 311200786
//
#ifndef EX04_THREADPOOL_H
#define EX04_THREADPOOL_H
#include "Task.h"
#include <queue>
#include <pthread.h>
using namespace std;
class ThreadPool {
public:
/**
* constructor
* @param threadsNum is the number of threads that in the pool
*... | true |
4393c1660f53b20305ffc7a86336a5952918d9d3 | C++ | sachin-bisht/Data-Structures-And-Algorithms-1 | /advanced/segment_tree.cpp | UTF-8 | 1,565 | 2.8125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int tree[3*100000];
void build(int arr[], int node, int st, int en)
{
if(st == en)
{
tree[node] = arr[st];
}
else
{
int mid = (st + en) / 2;
build(arr, 2*node, st, mid);
build(arr, 2*node + 1, mid+1, en);
tree[no... | true |
1cd9bc7e755e2cae679086c781089e6ed0e669dd | C++ | WitoldKaczor/cpp_repo | /ScientificComputing/Chapter02_FlowControl/Chapter02_FlowControl/exercise02.cpp | UTF-8 | 803 | 3.765625 | 4 | [] | no_license | #include <iostream>
//1.Set the variable x to the value 5 if either p is greater than or equal to q, or the
//variable j is not equal to 10.
//2. Set the variable x to the value 5 if both y is greater than or equal to q, and the
//variable j is equal to 20. If this compound condition is not met, set x to take the
//sa... | true |
0ac354e82343f212a615b9a04c96a1c8c7dd3a6e | C++ | avakar/cpp2sir | /test/enum.cpp | UTF-8 | 203 | 2.734375 | 3 | [
"MIT"
] | permissive | enum s1 { s1_1, s1_2, s1_3 };
void e1();
void e2(s1);
s1 f1()
{
return s1_2;
}
void f2(s1 a)
{
switch (a)
{
case s1_1:
e1();
break;
default:
e2(a);
}
}
| true |
4517b59503611b5b1c8b34c9aaba9800bdbf8f2f | C++ | Susree/Lab-1 | /problem 4.cpp | UTF-8 | 225 | 3.203125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main ()
{
int l,b,p;
cout << "enter a length"<< endl;
cin >> l;
cout << "enter a breadth"<< endl;
cin >> b;
p=2*(l+b);
cout << "perimeter ="<< p;
return 0;
}
| true |
3b0ae2015dba2720e0e3eb6e32c51540be7e9ab8 | C++ | 1904477/CMP105_W6 | /Week6/CMP105App/Bullet.cpp | UTF-8 | 1,345 | 2.703125 | 3 | [] | no_license | #include "Bullet.h"
Bullet::Bullet()
{
mouseStartPos = sf::Vector2f(0.f, 0.f);
mouseEndPos = sf::Vector2f(0.f, 0.f);
mousedown = false;
activation = false;
bulletScale = 100.f;
gravity = sf::Vector2f(0,9.8)*bulletScale;
fired = false;
}
void Bullet::setTextureBullet()
{
bulletText.loadFromFile("gfx/Beach_Ball... | true |
d80d3736a727d542f247aeaeb0221ccd1b1accdf | C++ | tjniemi/GisToSWMM5 | /src/Grid.cpp | UTF-8 | 98,576 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "Grid.h"
Grid::Grid()
{
clear();
}
Grid::~Grid()
{
clear();
}
void Grid::clear()
{
cells = 0;
nCols = 0;
nRows = 0;
cellSize = 0.0;
xllCorner = 0.0;
yllCorner = 0.0;
urcorner[0] = urcorner[1] = 0.0;
llcorner[0] = llcorner[1] = 0.0;
gridType = -1;
delete [] cel... | true |
50ad3289fc163c128ac4ca681527bd1d5ce00e4f | C++ | SammyEnigma/tp_utils | /inc/tp_utils/Progress.h | UTF-8 | 5,588 | 2.796875 | 3 | [
"MIT"
] | permissive | #ifndef tp_utils_Progress_h
#define tp_utils_Progress_h
#include "tp_utils/CallbackCollection.h"
namespace tp_utils
{
class AbstractCrossThreadCallbackFactory;
//##################################################################################################
struct ProgressMessage
{
std::string message;
bool e... | true |
0ddacaea8a2afe7f5568d755a130384cf3cbb457 | C++ | aockie/03_Puzzle | /03_MyDobot/dobot_ws/src/dobot/src/DobotServer3.cpp | UTF-8 | 2,580 | 2.734375 | 3 | [] | no_license | //
#include "ros/ros.h"
#include "stdio.h"
#include "std_msgs/String.h"
#include "std_msgs/Float32MultiArray.h"
#include "DobotDll.h"
#include "time.h"
/****** まとめ ******/
//main関数が呼ばれる
//main関数は、InitPTPService関数を呼ぶ
//InitPTPService関数は、
//サーバノード作成
//サーバのインスタンス生成。同時に、コールバック関数として、SetPTPCmdService関数を登録する。
//SetPTPCmd... | true |
284d24184f98b1e90dbfcf689d18b4d8417e5a56 | C++ | danielgrigg/sandbox | /testing/bandit/example.cpp | UTF-8 | 1,530 | 3 | 3 | [
"WTFPL"
] | permissive | #include <bandit/bandit.h>
#include <memory>
#include <iostream>
using namespace bandit;
using namespace std;
struct fuzzbox {
void flip() { _flipped = true;}
bool _flipped = false;
};
enum class sounds {
clean,
distorted
};
struct guitar {
void add_effect(fuzzbox& f) { _effect = &f; }
sounds sound() {... | true |
f4592953ca2de2275fb9b6451388b7786b9cb80c | C++ | PeekLeon/Somfy-Library | /Arduino/exemple-MySomfy/exemple-MySomfy.ino | UTF-8 | 1,420 | 2.609375 | 3 | [] | no_license | #include <MySomfy.h>
MySomfy MySomfy(A5); //Instanciation de MySomfy avec le port TX utilisé
int rcTelecommande[3] = {97, 42, 856};
int telecommande;
void setup() {
Serial.begin(9600);
MySomfy.telecommande(0xBC, 0xDB, 0xCD);
pinMode(4, OUTPUT);
}
void loop() {
}
//*
void serialEvent() {
if(Serial.available(... | true |
ad9988a36473eacb36f32c2be73ac7b9d9670478 | C++ | m80126colin/Judge | /since2020/CodeForces/1321A.cpp | UTF-8 | 586 | 2.921875 | 3 | [] | no_license | /**
* @judge CodeForces
* @id 1321A
* @name Contest for Robots
* @contest CodeForces Round #625 div.2
*
* @tag Ad-hoc, Math
*/
#include <iostream>
using namespace std;
#define MAX 110
int a[MAX], b[MAX];
int solve(int n) {
int A, B, C;
A = B = C = 0;
for (int i = 0; i < n; i++) {
if (a[i] == 1)
... | true |
6ed76832628f7fa627cf79a1988b9464ffb40cd6 | C++ | yurifariasg/yuris-adventure | /YurisAdventure/YurisAdventure/Player.h | UTF-8 | 3,210 | 2.65625 | 3 | [] | no_license | #pragma once
// PREPROCESSOR INCLUDE STATEMENTS
#include "stdafx.h"
#include "SSSF_SourceCode\gsm\physics\Physics.h"
#include "SSSF_SourceCode\game\Game.h"
#include "SSSF_SourceCode\gsm\sprite\AnimatedSprite.h"
#include "PlayerComboState.h"
#include "Creature.h"
#include "YAGame.h"
#include "ImageShower.h"
... | true |
af9c3a70b80591503530308d6a0dfdea2105a5a4 | C++ | Muszek1996/METODY-NUMERYCZNE | /METODY NUMERYCZNE/Source.cpp | UTF-8 | 652 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include "Punkt.h"
#include "vector"
#include "LagrangeInterpolation.h"
#include "GetFromFile.h"
#include "NewtonianInterpolation.h"
int main()
{
std::vector<Punkt> points;
GetFromFile dane("dane.txt");
dane.fillPoints(points);
if (points.size() < 1)std::cout << "ERROR";
LagrangeInte... | true |
98c2d669733c468654537dbbad8bd0ddc558b259 | C++ | WhiZTiM/coliru | /Archive2/ab/5b6c3066a42851/main.cpp | UTF-8 | 1,066 | 3.78125 | 4 | [] | no_license | #include <cstring>
#include <cstdlib>
#include <iostream>
int main(int argc, char* argv[]) {
if (argc < 2) {
std::cout << "Usage: << " << argv[0] << " command\n";
exit(0);
}
size_t cmd_size = 0;
for (int i = 1; i != argc; ++i) {
// + 1 for separating spaces
cmd_size += ... | true |
74d0750d579598b5240f4fee9d4b05d4d371b240 | C++ | FreeButter/Team-Project-GP | /Project 1/BasicGameTemplate/Parser.h | UTF-8 | 680 | 2.578125 | 3 | [] | no_license | /**
Simple Json Parser
Parser.h
Purpose: Manages Json Document objects
@author Miguel Saavedra
@version 1.1 3/10/16
*/
#ifndef __PARSER_H__
#define __PARSER_H__
#include <string>
#include "document.h"
#include "filereadstream.h"
#pragma warning (disable : 4996)
using namespace std;
using namespace rapidjson;
class Pa... | true |
070d099e2c7f294113660e43ca40329aee9c50d0 | C++ | jpaterso/fire-engine | /src/WindowManagerWin32.h | UTF-8 | 4,386 | 2.734375 | 3 | [] | no_license | /**
* $Id: WindowManagerWin32.h 114 2007-10-04 04:57:03Z jpaterso $
* Author: Joseph Paterson
*
* The Win32 window manager.
**/
#ifndef __WINDOW_MANAGER_WIN32_H
#define __WINDOW_MANAGER_WIN32_H
#include <windows.h>
#include "CompileConfig.h"
#include "Types.h"
#include "dimension2.h"
#include "IWindowManager.... | true |
e5b6feff0392aed22d2df1f49bef69a8c9950c6e | C++ | HolyHooly/Biseul-ReadingRoom-Reservation | /Biseul ReadingRoom Reservation/DBInterface.h | UTF-8 | 2,616 | 2.65625 | 3 | [] | no_license | #pragma once
#include "DBsystem.h"
namespace biseul_rroom {
class Exception {
public:
Exception() {};
~Exception() {};
void scenario(int code) {
switch (code) {
case (int)signal::DBREMOVEERR:
std::cout << "From DBsystem: From DBsystem: Despite of data existence remove error.try again" << std::endl;
... | true |
553eac6c5b78b36a6dbeedd9264ef9729235ceb7 | C++ | andreasatle/DesignPatternsCpp | /SOLID/main.cpp | UTF-8 | 4,725 | 3.234375 | 3 | [] | no_license | #include "single_responsibility.h"
#include "open_closed.h"
#include "open_closed.hpp"
#include "liskov_substitution.h"
#include "interface_segregation.h"
#include "dependency_inversion.h"
using namespace std;
void single_responsibility() {
cout << endl << "== Single Responsibility Principle ==" << endl;
Jou... | true |
9e03413644e23acaa509da58eb49d64699a7d800 | C++ | rafal-tarnow/TEMPLATES | /GLUT/TexturesBMPGlut/main.cpp | UTF-8 | 7,225 | 3.09375 | 3 | [] | no_license | #include <GL/freeglut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <bmp_load.h>
/* ascii code for the escape key */
#define ESCAPE 27
/* The number of our GLUT window */
int window;
/* floats for x rotation, y rotation, z rotation */
float xrot, yrot, ... | true |
b92b4d2208412b7539a9c7d4012ac9c390f94807 | C++ | aeremin/Codeforces | /alexey/Solvers/6xx/611/Solver611A.cpp | UTF-8 | 909 | 3 | 3 | [] | no_license | #include <Solvers/pch.h>
using namespace std;
// Solution for Codeforces problem http://codeforces.com/contest/611/problem/A
class Solver611A
{
public:
void run();
};
void Solver611A::run()
{
vector<int> monthLengths = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int64_t n;
cin >> n;
strin... | true |
12e724e7138e74f92f949fd4976c575230591ceb | C++ | JosiasWerly/dllStudies | /ModularDLL/GeneralProgram/dynamicLoad/jDynamicLoad.cpp | UTF-8 | 790 | 2.8125 | 3 | [] | no_license | #include "jDynamicLoad.h"
#include <windows.h>
#include <iostream>
#include <tchar.h>
using namespace std;
list<jDll*> dynamicLoad::DynamicLibraries = list<jDll*>();
void dynamicLoad::load(wstring path, wstring name) {
wstring strg;
strg = path;
strg += name;
HINSTANCE instance = LoadLibrary((LPCWSTR)strg.c_str()... | true |
e8276761ec259b62962d1297ca1ce75424985583 | C++ | blighli/graphics2017 | /21651026王晓瑶/project01/homework1.cpp | GB18030 | 1,965 | 2.953125 | 3 | [] | no_license | // ConsoleApplication1.cpp : ̨Ӧóڵ㡣
//
#include <GL/glut.h>
static int day = 0;
void Display()
{
//Ȳ
glEnable(GL_DEPTH_TEST);
//ɫ
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//ʹͶӰ
glMatrixMode(GL_PROJECTION);
//ǰûϵԭƵĻ
glLoadIdentity();
//һ
gluPerspective(85, 1, 1, 500000);
glMatrixMode(GL_MO... | true |
5018af982fdcad2e25fc937c7264c8324a3c2948 | C++ | klemens-morgenstern/mw.test.gen | /include/mw/test/ast/code.hpp | UTF-8 | 1,366 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /**
* @file code.hpp
* @date 26.11.2015
* @author Klemens
*
* Published under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
*/
#ifndef MW_TEST_AST_CODE_HPP_
#define MW_TEST_AST_CODE_HPP_
#include <string>
#include <iterator>
#include <boost/spirit/include/support_line_pos_iterator.hp... | true |
a701ef6c99d3d511d31fc1e053e7f78805db1a9d | C++ | AndrewShkrob/KerberosDesCpp | /des/src/des_string.cpp | UTF-8 | 2,113 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <sstream>
#include <boost/algorithm/string/trim.hpp>
#include "../des_string.hpp"
#include "../des_data.hpp"
DesString::DesString(const std::string &key)
: des(0) {
assert(key.size() <= 7);
ui64 buffer = 0;
std::istringstream input(key);
input.read(reinterpret_cast<char *>(&buffer), 8)... | true |
395e7b88a13b5e24347a0be69921b33b52d41594 | C++ | lixpam/awesome-leetcode | /src/852.cc | UTF-8 | 900 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
static const int _ = [](){
ios::sync_with_stdio(false);
cin.tie(nullptr);
return 0;
}();
/* O(N)
class Solution {
public:
int peakIndexInMountainArray(vector<int>& A) {
int len = A.size();
for (int i = 0; i < len-1; ++i) {
... | true |
82d203ca5671638d3b6242e5619231101b111439 | C++ | OctupusTea/Online-Judge | /Zero Judge/a216.cpp | UTF-8 | 554 | 3.34375 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
unsigned long long int f(int);
unsigned long long int g(int);
int main(void)
{
int n = 0;
while( cin >> n)
{
cout << f(n) << " " << g(n) <<endl;
}
return 0;
}
unsigned long long int f(int i)
{
unsigned long long int tmp = i;
... | true |
43ac6f23ddf1367a5736cd529ec103ab979ad741 | C++ | JohnVithor/EDB1-2 | /Vector_EDB/include/vector.hpp | UTF-8 | 16,315 | 3.78125 | 4 | [] | no_license | /**
* @file vector.hpp
* @brief Definição das classes sc::MyIterator e sc::vector, seus atributos e métodos
* @details
*
* @author João Vítor Venceslau Coelho
* @since 18/10/2017
* @date 21/10/2017
*/
#ifndef VECTOR_H
#define VECTOR_H
#include <memory>
#include <initializer_list>
#include <iostream> //std::cout... | true |
9c9e9819f013674b5563113b10625755802e1c53 | C++ | PICdew/Turnado-Hardware-MIDI-Controller | /Code/TurnadoController/RotaryEncoder.cpp | UTF-8 | 3,750 | 2.90625 | 3 | [] | no_license | #include "RotaryEncoder.h"
RotaryEncoder::RotaryEncoder (uint8_t encPin1, uint8_t encPin2, int8_t switchPin)
{
encoder = new Encoder (encPin1, encPin2);
if (switchPin >= 0)
{
switchDebouncer = new Bounce (switchPin, DEBOUNCE_TIME);
pinMode (switchPin, INPUT_PULLUP);
}
else
{
switchEnabled = fa... | true |
1292af5c1db3aec8504102222cf3cd1e4876be1b | C++ | Spetsnaz-Dev/CPP | /Codechef/HXOR.cpp | UTF-8 | 1,220 | 2.703125 | 3 | [] | no_license | #include "bits/stdc++.h"
#define ll long long int
#define ull unsigned long long int
#define pb push_back
using namespace std;
// print ans
void printAns(vector<ll> arr){
for(ll i=0; i<arr.size(); i++)
cout<<arr[i]<<" ";
cout<<"\n";
}
// Krantiveer
int main()
{
ll t, n, x, z;
cin>>t;
while ... | true |
c7138c105178a50d1abba79d26a7ae3f4b3989da | C++ | liangjisheng/C-Cpp | /books/C++_Standard_Template_Library/Chapter6/stl_set1.cpp | GB18030 | 1,744 | 3.9375 | 4 | [
"MIT"
] | permissive |
#include <iostream>
#include <set>
#include <iterator>
using namespace std;
int main()
{
/* type of the collection : sets:
* no duplicates
* elements are integral values
* descending order
*/
typedef set<int , greater<int> > IntSet;
IntSet coll1; // empty set container
// insert elements in random order... | true |
eda2037276a54c1128dc30a353cd385d4ff9232a | C++ | gaoxiang007/chapter_nine | /chapter_6/N_Queens_I.cpp | UTF-8 | 1,894 | 3.8125 | 4 | [] | no_license | // https://oj.leetcode.com/problems/n-queens/
class Solution {
public:
vector<string> drawChessBoard(const vector<int>& C) {
vector<string> res;
int N = C.size(); // square matrix
for(int i = 0; i < N; ++i) {
res.push_back(""); // init the ith row
for(int j = 0; j <... | true |
393746dbda4edbd34d93b1d78591b8850688cde9 | C++ | GandhiGames/speedrunner | /speedrunner_win/speedrunner/AnimationGroup.cpp | UTF-8 | 1,384 | 3.0625 | 3 | [] | no_license | #include "AnimationGroup.h"
AnimationGroup::AnimationGroup() : m_goToState(ANIMATION_STATE::COUNT) {}
void AnimationGroup::AddAnimation(std::shared_ptr<Animation> animation)
{
m_animations.emplace_back(animation);
}
void AnimationGroup::SetFacingDirection(MOVEMENT_DIRECTION dir)
{
for (auto& a : m_animations)
{
... | true |
6b01967d3f143c2293ca667c67bc4334f84f75ac | C++ | Rohit-Jalari/Cpp | /Assignments/NOV 29 LAB-2/5.cpp | UTF-8 | 655 | 3.65625 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Laptop{
string brand_name;
string model;
int price;
public :
void getData()
{
cout<<"\nEnter the Name of the Brand : ";
getline(cin,brand_name);
cout<<"\nEnter the Model Name : ";
getline(cin,model);
... | true |
a11f593b7e2305da481f4aefe62df4e9cf9d92d6 | C++ | iYaphetS/CPP | /字符串类封装/MyString.h | UTF-8 | 974 | 3.34375 | 3 | [] | no_license | #pragma once
#include <iostream>
using namespace std;
class MyString
{
//字符串输出 cout << str
friend ostream& operator<<(ostream &os, const MyString &str);
//字符串输入 cout >> str
friend istream& operator>>(istream &in, MyString &str);
public:
//无参构造函数
MyString();
//有参构造函数 MyString str = "hello"
MyString(const char ... | true |
b30e4141ba77fc17ebd8a87d92c3605b50c31cc8 | C++ | apurv-sawant1506/Algorithms | /week4_divide_and_conquer/3_improving_quicksort/my_quick_sorting.cpp | UTF-8 | 1,286 | 3.4375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef struct pivot_index
{
int lower, higher;
} index;
// typedef struct pivot_index index;
index partition2(vector<int> &a, int l, int r)
{
int pivot = a[r];
index p_i;
p_i.lower = l;
p_i.higher = l;
int temp;
for (int i = l; i < r; i++)
{
if (a[... | true |
1bb3bef8d6d76f01d05e171a84c709a299c75702 | C++ | fruitbox12/Qt | /network.cpp | UTF-8 | 3,721 | 2.953125 | 3 | [] | no_license | #include "network.h"
Network::Network(QObject *parent) : QObject(parent) {
// 1. Create a TCP socket: set up the server and make it listen for new connections on server ip address and TCP port
server = new QTcpServer(this);
// 2. Bind: associate the socket with your adapter's IP address and a TCP port numbe... | true |
a1f0335322b7755331baf6edf869640d989a2774 | C++ | vikasdongare/DSA-SEM3 | /assignment9.cpp | UTF-8 | 997 | 3.703125 | 4 | [] | no_license | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
class stack
{
int top;
public:
char a[25];
stack()
{
top=-1;
}
bool push(char x);
char pop();
bool isempty();
};
bool stack::push(char x)
{
if(top>=24)
{
cout<<"Stack overflow";
return fal... | true |
83f97df3e4604cee544208a45afbea7fbc073c73 | C++ | adityanjr/code-DS-ALGO | /CodeForces/Complete/400-499/448B-SuffixStructures.cpp | UTF-8 | 875 | 3.0625 | 3 | [
"MIT"
] | permissive | #include <cstdio>
#include <iostream>
#include <vector>
int main(){
std::string first; getline(std::cin, first);
std::string second; getline(std::cin, second);
int index = 0;
for(int p = 0; p < first.size(); p++){
if(first[p] == second[index]){++index;}
}
if(index >= second.size()){... | true |
360292330ffb471a829e6c93f1cb3e71af1f221b | C++ | yahoo/tunitas-basics | /src/tunitas/time/ratio.xcpp | UTF-8 | 2,052 | 2.59375 | 3 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] | permissive | // This is -*- c++ -*- nearly C++23 with Modules TS but in the S.C.O.L.D. stylings that are so popular these days.
// Copyright Yahoo Inc. 2021.
// Licensed under the terms of the Apache-2.0 license.
// For terms, see the LICENSE file at https://github.com/yahoo/tunitas-basics/blob/master/LICENSE
// For terms, see the ... | true |
9f22af077c41395a0f22ddf93628693ca72f28f1 | C++ | PabloSzx/Estructura-de-Datos-INFO053 | /Clase 5/pila.h | UTF-8 | 1,171 | 3.203125 | 3 | [] | no_license | #ifndef LISTA_H
#define LISTA_H
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
typedef struct nodo {
int edad;
char nombre[100];
struct nodo *siguiente;
}nodo;
typedef struct lista {
nodo *inicio;
int largo;
} lista;
void insertar(lista **lista, int ed... | true |
dd59e8eb32302c8b502dc7b49156a6ca21cc858a | C++ | synchronized/gtd | /lang/c-cpp/practice/src/std-algo-find.cpp | UTF-8 | 1,052 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <deque>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
template<typename iterator>
void ergodic(iterator first, iterator last, string contName);
int main() {
int i;
const int n=10;
list<int> ilist;
list<int>::iterator elem1, elem2;
//d... | true |
b541c03af75ceb0328ff3de8c435838808716f61 | C++ | Bhitt/Hitt_Branden_CSC17A_48983 | /Hmwk/Assignment 5/Gaddis_Chap13_Prob4/PersonalInfo.cpp | UTF-8 | 476 | 2.71875 | 3 | [] | no_license | /*
* File: card.cpp
* Author: Branden Hitt
* Created on November 8th, 2015, 4:00 PM
* Purpose: Implementation for the Personal Info Class
*/
using namespace std;
//User Library for the Specification
#include "PersonalInfo.h"
void PrsInfo::setName(string n){
name=n;
}
void PrsInfo::setAdd(string a){
ad... | true |
591bc0bf0efd3b903aec6b6c0265b7a930af8f28 | C++ | tatiandu/MARP | /Semana 4 - FULL/10.Arbol Libre/Source.cpp | ISO-8859-1 | 1,707 | 3.125 | 3 | [] | no_license |
// Tatiana Duarte Balvs
// Comentario general sobre la solucin,
// explicando cmo se resuelve el problema
#include <iostream>
#include <fstream>
#include "Grafo.h"
void dfs(const Grafo& g, int v, std::vector<bool>& visit, std::vector<int>& ant, int& visitados) {
visit[v] = true;
for (int w : g.ady(v)) {
... | true |
bddb59e5b3325198074c7ee4896696a35e884941 | C++ | Fen99/Dipole | /Src/Common.cpp | UTF-8 | 929 | 3.109375 | 3 | [] | no_license | #include "Common.h"
//========================================================================
//========================================================================
double operator*(const Vector3D& first, const Vector3D& second)
{
return first[0]*second[0] + first[1]*second[1] + first[2]*second[2];
}
... | true |
2cc8ac08e4d79d64f1e9753a864c2c60bd682b87 | C++ | eric-zhao/leetcode | /BT_levelTraverse_Rec.cpp | UTF-8 | 1,870 | 3.9375 | 4 | [] | no_license | /*Binary Tree Level Order Traversal: Given a binary tree, return the bottom-up level order traversal of its nodes' values.
This is done by recursion. The problem can be divided as: (1) once level n-1 is traversed by level, then level n is just needed to
be appended at last.*/
/**
* Definition for binary tree
* struc... | true |
62395c5536161ee261f19900d204f841b758671f | C++ | zhenghongpeng/usacoepcpp | /usacoepcpp/convention/main.cpp | UTF-8 | 747 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int N,M,C;
int t[100000];
bool pos(int wait)
{
int buses = 1;
int fA = t[0];
int fI = 0;
for(int i=1;i<N;i++)
{
if(t[i] - fA > wait || i + 1 - fI > C)
{
buses += 1;
fA = t[i];
fI = i;
... | true |
962be1fe8ced507fb2328440707bccb26b288228 | C++ | hexu1985/cpp_book_code | /boost.intro/signals2/parking_lot_guard.h | UTF-8 | 1,618 | 3.40625 | 3 | [] | no_license | #ifndef PARKING_LOT_GUARD_INC
#define PARKING_LOT_GUARD_INC
#include <string>
#include <vector>
#include <iostream>
#include "boost/shared_ptr.hpp"
#include "boost/signals2.hpp"
class parking_lot_guard {
typedef
boost::signals2::signal<void (const std::string&)> alarm_type;
typedef alarm_type::slot_type slot_... | true |
18bdf1989a81047f9946317eea558505ed88b02d | C++ | FroxCode/Portfolio-MOSH | /Tesla.h | UTF-8 | 1,971 | 2.578125 | 3 | [
"MIT"
] | permissive | ////////////////////////////////////////////////////////////
//
// Created by Connor
// Worked on by Dale
//
////////////////////////////////////////////////////////////
#ifndef _TESLA_H_
#define _TESLA_H_
////////////////////////////////////////////////////////////
// Headers
//////////////////////////////////////////... | true |
4435c5d142e734dfd54dd4fe4e9fe5f9aa52378f | C++ | liuguoyou/retarget-toolkit | /shift_map/Common/traceback.cpp | UTF-8 | 1,289 | 3.203125 | 3 | [] | no_license |
/*
* Implementation for the Traceback class
*
* Author: Edward Alston Anthony
*
*/
#include <iostream>
#include <stdlib.h>
#include "traceback.h"
#ifdef USE_TRACEBACK
/* constructor */
Traceback::Traceback(int Levels)
{
Trace = new tracebackNodeType[Levels];
MaxTracebackLevels = Levels;
}
/* destru... | true |
1ad9aa5ea55f8179fdf6fea56bb1395341bf9514 | C++ | magicmoremagic/bengine-core | /test/test_a3_vmm_alloc.cpp | UTF-8 | 1,967 | 2.78125 | 3 | [
"MIT"
] | permissive | #ifdef BE_TEST
#include "a3_vmm_alloc.hpp"
#include <catch/catch.hpp>
#define BE_CATCH_TAGS "[core][core:a3][core:a3:VmmAlloc]"
using namespace be::a3;
TEST_CASE("be::a3::VmmAlloc", BE_CATCH_TAGS) {
REQUIRE(VmmAlloc::granularity >= VmmAlloc::alignment);
REQUIRE(VmmAlloc::granularity % VmmAlloc::alignment == 0... | true |
0a9ccfa66a94fbe1c0d9dfca0e52d4e1a3576295 | C++ | ejaandersson/EDA031 | /src/test/myclient.cc | UTF-8 | 6,698 | 3.3125 | 3 | [] | no_license | #include "clientmessagehandler.h"
#include <algorithm>
#include <iostream>
#include <cstdlib>
using namespace std;
int commandToInt(string &cmd) {
if (cmd.compare("help") == 0) {
return 0;
} else if (cmd.compare("listng") == 0){
return Protocol::COM_LIST_NG;
} else if (cmd.compare("createng") == 0) {
... | true |