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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
401fc43375c1a47b629bef5884ea4698f50e459c | C++ | CSLP/Cpp-Primer-5th-Exercises | /ch10/10.15.cpp | UTF-8 | 295 | 3.3125 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
int main() {
int x, y;
std::cin >> x >> y;
auto sum = [x](int i) { return x + i; };
// The lamda must be defined after we read x, otherwise it will capture the
// undefined value of x.
std::cout << x << " + " << y << " = " << sum(y) << std::endl;
return 0;
}
| true |
8553580dbbd6a71ff9d06533137f2a2ecbfbcdd8 | C++ | trooperli/my-leetcode | /problems/Insert_Delete_GetRandom.cpp | UTF-8 | 1,729 | 4 | 4 | [] | no_license | /**
* This problem is actually test what data structure to use to achieve
* O(1) complexity. Here, we used a unordered_map<data, idx> and a
* vector. The unordered_map actually records the element and its
* index, which makes delete O(1) possible, otherwise we need to loop
* throught the array. In remove method, w... | true |
97b892c9f5dea1b3df5e080cc60436367e5be603 | C++ | drlongle/leetcode | /algorithms/problem_1297/solution.cpp | UTF-8 | 3,436 | 3.1875 | 3 | [] | no_license | /*
1297. Maximum Number of Occurrences of a Substring
Medium
Given a string s, return the maximum number of ocurrences of any substring under the following rules:
* The number of unique characters in the substring must be less than or equal to maxLetters.
* The substring size must be between minSize and maxSize inclus... | true |
82e3d192da404cd110487684774c8d2a89b5f4e8 | C++ | xinfushe/gpuflow-opencl | /src/Image.h | UTF-8 | 2,832 | 3.125 | 3 | [] | no_license | #pragma once
#include <string>
// Linux declaration
#ifndef _WIN32
#include <cstring>
#endif
#define IND(X, Y) (((Y) + m_by) * m_pitch + ((X) + m_bx))
class Image
{
private:
int m_width; // Image width
int m_height; // Image height
int m_actual_width; // Actual image width
int m_actual_height;// Actual image... | true |
7e858438e077f05e7682c2afda3a9a2c16e46234 | C++ | yvznvr/ServerClient-Tutorial | /UdpClient/udpclient.h | UTF-8 | 701 | 2.640625 | 3 | [] | no_license | #ifndef UDPCLIENT_H
#define UDPCLIENT_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
class UdpClient
{
public:
UdpClient();
bool createSocket();
// isSocketCreated() returns tru... | true |
cf74874a66f4a549e7c8a94475e9e8aa1357c98e | C++ | mahdi2561/farm-project | /chickenmarket.cpp | UTF-8 | 7,475 | 2.59375 | 3 | [] | no_license | #include "chickenmarket.h"
#include "ui_chickenmarket.h"
ChickenMarket::ChickenMarket(User* _user, Aviculture* _aviculture, QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ChickenMarket)
{
ui->setupUi(this);
setFixedSize(1000,570);
setWindowTitle("Chicken market");
pix = new QPixmap(":/new/... | true |
eeeb7e61b87cb0f37853f12a48e08830ae7c9784 | C++ | dinopants174/SoftSys2015 | /Sprint5/trinket_master/trinket_master.ino | UTF-8 | 2,824 | 2.96875 | 3 | [] | no_license | #include <Wire.h>
#define I2C_SLAVE_ADDR 0xE // i2c slave address (38)
int i;
int nodeAddress;
byte arr1[4] = {};
byte arr2[4] = {};
byte arr3[4] = {};
byte arr4[4] = {};
byte res[4] = {};
//put matrices here
float A[2][2];
float B[2][2];
byte byteReceived;
bool finished_transmit = false;
void setup() {
... | true |
889f8cc755c927b07e9df12e22f51cca71d2ad14 | C++ | shunak/cpp-sandbox | /practical/virtual/chicken.h | UTF-8 | 318 | 2.734375 | 3 | [] | no_license | #ifndef _CHICKEN_H_
#define _CHICKEN_H_
#include "bird.h"
// define chicken class
class CChicken : public CBird{
public:
void sing(){
cout << "こけっこ" << endl;
}
void fly(){
cout << "CHICKENS can`t fly" << endl;
}
};
#endif | true |
2e3e1d011a162c92954aced753f6ac98fbb16d2b | C++ | unt4m1nh/Tic_Tac_Toee | /Player1.cpp | UTF-8 | 4,674 | 2.859375 | 3 | [] | no_license | #include"Player1.h"
#include<iostream>
Player1::Player1(SDL_Renderer* &gRenderer)
{
}
Player1::~Player1()
{
}
void Player1::input(SDL_Event& e)
{
bool inside_box[3][3] = {{true,true,true},
{true,true,true},
{true,true,true}};
while( SDL_PollEvent(... | true |
e357859ffc29581f52d58222d3f16f560c4d682f | C++ | BinyuHuang-nju/leetcode-implement | /all684/all684/main.cpp | UTF-8 | 1,243 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include <vector>
class UFSet {
private:
int* parent;
int size;
public:
UFSet(int num) {
size = num + 1;
parent = new int[num + 1];
for (int i = 0; i <= num; i++)
parent[i] = -1;
}
int find(int x) {
while (parent[x... | true |
98b08df6fe98b051322ba034723a4fa4a0af820a | C++ | Snowapril/GoonRenderer | /Extensions/GoonMath/(deprecated)/Includes/gm/details/type_mat4x4.inl | UTF-8 | 5,347 | 3.125 | 3 | [
"MIT"
] | permissive | #include "../matrix.h"
namespace gm
{
template <typename Type>
mat<4, 4, Type>::mat() noexcept
: value { row_type(), row_type(), row_type(), row_type() }
{
}
template <typename Type>
mat<4, 4, Type>::mat(Type _val) noexcept
: value { row_type(_val), row_type(_val),... | true |
7a7a69fd222dc9f5b8336f401fd3f881fbcdbfb2 | C++ | afperezm/background-location-recognition | /Common/StringUtils.cpp | UTF-8 | 1,352 | 3.125 | 3 | [] | no_license | #include "Common/StringUtils.h"
#include <sstream>
#include <string>
#include <vector>
#include "Common/Constants.h"
using std::string;
using std::vector;
vector<string> StringUtils::split(const string &s, char delim) {
vector<string> elems;
split(s, delim, elems);
return elems;
}
vector<string> &StringUtils::s... | true |
ea87c6a51f746bc5b679cb469f45f13d3cfd8496 | C++ | wangyongliang/nova | /poj/2583/POJ_2583_2246418_AC_0MS_24K.cpp | UTF-8 | 209 | 2.625 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int a,b,c,x1,x2;
while(scanf("%d %d %d",&c,&x1,&x2)!=EOF)
{
a=(x2-2*x1+c)/2;
b=x1-c-a;
printf("%d %d %d\n",a*9+3*b+c,a*16+4*b+c,a*25+5*b+c);
}
return 0;
}
| true |
225d7266472757ab4efd9d16b593567b901cc526 | C++ | thirtiseven/CPPex | /2-3.cpp | UTF-8 | 317 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[]) {
float temperature = 0;
cout << "华氏温度?";
cin >> temperature;
cout << "华氏 " << temperature << " 度 = 摄氏 " << fixed << setprecision(1) << 5.0 / 9.0 * (temperature - 32) << " 度" << endl;
return 0;
} | true |
b41d53c3f08b8969b6033b2e49a88a559d9736e8 | C++ | mubasshir00/competitive-programming | /LeetCode/1143. Longest Common Subsequence.cpp | UTF-8 | 724 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int longestCommonSubsequence(string text1, string text2) {
int temp_arr[text1.size()+1][text2.size()+1];
memset(temp_arr,0,sizeof(temp_arr));
int max_index = 0;
int min_index = 0;
for(int i=0;i<=text1.size();i++){
for(int j=0;j<=text2.size();j++){
... | true |
995a9fda863fb62e0f7c074f64b5a5424c1f3123 | C++ | Nirajn2311/cplusplus | /Pointers1.cpp | UTF-8 | 292 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
char a = '1',b = 'a';
float c = 1,d = 2;
float *r, *s;
char *p, *q;
p = &a;
q = &b;
r = &c;
s = &d;
cout<<p;
cout<<"\n"<<q;
cout<<"\n"<<r;
cout<<"\n"<<s;
return 0;
} | true |
2866bfef0d5e5e7b3b8b16538e5c705141e654df | C++ | yoonioncho/OOPG-with-C | /Library System/Person.cpp | UTF-8 | 428 | 3.5 | 4 | [] | no_license | //Person.cpp
//Member and friend function definitions of class Person
#include "Person.h"
#include "Date.h"
Person::Person(Date d, string n)
:DOB(d)
{
setName(n);
}
Person::~Person()
{
}
string Person::getName()
{
return Name;
}
void Person::setName(string n)
{
Name = n;
}
void Person:... | true |
512b9017dd379cf008e2a23c29cdc18baca42c9f | C++ | khodand/spbsu-homework | /semester_1/hometask_4/Source_4.4/main.cpp | UTF-8 | 419 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include "postfixNotation.h"
#include "stack.h"
#include "queue.h"
using namespace std;
int main() {
Queue inStr;
cout << "Enter an expression in postfix notation" << endl << "Don't forget to put '=' at the end!!!" << endl;
char curToken = ' ';
cin >> curToken;
while (curToken != '=') {
p... | true |
4135a8d54dbcf4887d9df96c07e6dbbf5c9333f5 | C++ | foool/nclib | /tests/test04.cc | UTF-8 | 1,355 | 2.875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "../galois.h"
#include "../nc.h"
/* Test Insert_matrix{2} Append_matrix{2} Replace_matrix{2}
* Slice_matrix{1}
*/
int main(void){
GMatrix m1;
GMatrix m2;
int r1, r2;
NOTE(" m1 Matrix ");
m1.Make_random(4, 4, 16);
m1.P... | true |
99327bd629f11021b61e3c41f3b61aa039c5a1f1 | C++ | langio/Jump | /server/3rd/yac/src/libutil/yac_config.cpp | UTF-8 | 16,711 | 2.5625 | 3 | [] | no_license | #include <errno.h>
#include <fstream>
#include "util/yac_config.h"
#include "util/yac_common.h"
namespace util
{
YAC_ConfigDomain::YAC_ConfigDomain(const string &sLine)
{
_name = YAC_Common::trim(sLine);
}
YAC_ConfigDomain::~YAC_ConfigDomain()
{
destroy();
}
YAC_ConfigDomain::YAC_ConfigDomain(const YAC_ConfigDoma... | true |
204fc92e5096e6f9fa5da756d668983e46cd8f50 | C++ | jiantao/LeetCode | /multiply_strings.cpp | UTF-8 | 1,510 | 3.34375 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: multiply_strings.cpp
*
* Description:
*
* Version: 1.0
* Created: 04/26/2013 05:45:33 PM
* Revision: none
* Compiler: gcc
*
* Author: Jiantao Wu (),
*... | true |
e10c1799c47542f7d865e303ddf7ee638ad77693 | C++ | abhineet99/btech-course-assignments | /CS-201-Data_Structures/assignment_1/item.cpp | UTF-8 | 1,306 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <ctime>
#include <fstream>
#include <cmath>
#include "item.h"
using namespace std;
long int purchase_id;
int location_x;
int location_y;
char* purchase_time;
item::item ()
{
location_x = 0;
location_y = 0;
purchase_id = -1;
purchase_time = "default";
}
voi... | true |
75301044f227afff0b962119b4f6b42647752c0a | C++ | Ritacheta/OOP_1st_Sem | /Assignment3/struct.cpp | UTF-8 | 415 | 3.296875 | 3 | [] | no_license | #include<iostream>
using namespace std;
struct Student{
int roll;
int score;
void take_input(int &a,int &b)
{
cout<<"enter roll and score respectively:";
cin>>a>>b;
}
void show(int a,int b)
{
cout<<"roll:"<<a<<" score"<<b<<endl;
}
};
int main()
{
Student s;
s.take_input(s.roll,s.score);
s.show... | true |
0b6a5cef6302063ec855f086b06ff1e3b51f89e5 | C++ | CaiCui/Greedy | /cf-58A.cpp | GB18030 | 1,406 | 3.140625 | 3 | [] | no_license | /**CF-58A Chat room
*Greedy
*
*/
//Coders Code uses string-matching
//c++
#include<bits/stdc++.h>
int main()
{char i{0},c;
while(std::cin>>c&&i!=5)i+=c=="hello"[i];
std::cout<<((i==5)?"YES":"NO");}
//c
#include<stdio.h>
int main()
{
char str[]="hello";
char s[110];
int p;
int i... | true |
b11367b8655f87ccf54a68843d49cf5052b6e5be | C++ | dormon/prj | /newCld/NetworkConfiguration/src/NetworkConfiguration/Dense.h | UTF-8 | 3,807 | 3.21875 | 3 | [] | no_license | /**
* @file
* @brief This file contains dense layer configuration.
*
* @author Tomáš Milet, imilet@fit.vutbr.cz
*/
#pragma once
#include<Tensor/Tensor.h>
#include<NetworkConfiguration/Layer.h>
#include<NetworkConfiguration/ActivationType.h>
/**
* @brief This class represents Dense layer.
*
* @tparam TYPE b... | true |
aa0c76c2874e431c85960728c167a17f87e71ea9 | C++ | Rogan003/Aktivnost | /KrsevVezba11/main.cpp | UTF-8 | 395 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int password;
int username;
cout<<"Username:";
cin>>username;
cout<<"Password:";
cin>>password;
if(password!=181818){
cout<<"password or username is incorrect";
}
else if(username!=171717)
cout<<"password or user... | true |
bdff2b67a687854d3b3b515aa165b69fa67eef6e | C++ | Mindful/sos | /data_structures/fall/week_1/ex_15.cpp | UTF-8 | 1,851 | 4.125 | 4 | [] | no_license | #include <functional>
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
class Employee
{
public:
void setValue( const string & n, double s )
{ name = n; salary = s; }
const string & getName( ) const
{ return name; }
void print( ostream & out ) const
{ out << ... | true |
217617c3fcfca8509858666580a3bf80add3a473 | C++ | danielzkng/codeforces | /1500/1521A.cpp | UTF-8 | 407 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int cases;
cin >> cases;
for(int iter = 0; iter < cases; ++iter){
long long a, b;
cin >> a >> b;
if(b == 2) b = 4;
if(b == 1) cout << "NO\n";
else{
cout << "YES\n";
cout <... | true |
bb79911d65b552494de525ddbf146986ea43a9be | C++ | popon-01/procon_lib | /grl/warshall_floyd.cpp | UTF-8 | 1,410 | 2.703125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, ll> P;
const ll inf = numeric_limits<ll>::max()/2;
int v,e;
vector< vector<P> >graph;
vector< vector<ll> > dist;
void warshall_floyd(){
dist.clear();
dist.resize(v);
for(int i = 0;i < v;++i){
dist[i].resize(v);
fill(d... | true |
d244aee6420504677eedb21b7bd27bf1ed004d5d | C++ | mingyuefly/C_Primer_Plus- | /C_Primer_Plus++/dishiqizhang/dishiqizhang/manip.cpp | UTF-8 | 579 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// manip.cpp
// dishiqizhang
//
// Created by mingyue on 16/2/2.
// Copyright © 2016年 G. All rights reserved.
//
#include <iostream>
int main(int argc, const char * argv[]){
using namespace std;
cout << "Enter an integer:";
int n;
cin >> n;
cout << "n n*n\n";
cout << n << " ... | true |
5cdc0ade977190627a34442f63e50a4525406d46 | C++ | Louis5499/leetcode-practice | /647/solution.cpp | UTF-8 | 449 | 3.03125 | 3 | [] | no_license | class Solution {
public:
int count = 0;
int countSubstrings(string s) {
if (s.length() < 2) return 1;
for (int i=0; i<s.length()-1; i++) {
finding(s, i, i);
finding(s, i, i+1);
}
return count+1;
}
void finding(string s, int i, int j) {
... | true |
3ed3a9bab82a3627200d693349bbbec48be16a1f | C++ | jjedmondson/RGB-CLOCK | /voidmatrix.ino | UTF-8 | 5,581 | 2.8125 | 3 | [] | no_license | /*
* Created by Pi BOTS MakerHub
*
* Email: pibotsmakerhub@gmail.com
*
* Github: https://github.com/pibotsmakerhub
*
* Join Us on Telegram : https://t.me/pibots
* Copyright (c) 2020 Pi BOTS MakerHub
*/
// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafru... | true |
537bb20833ccd4a0fb31df19e763b119bf0acf28 | C++ | dictcore/paragon_slovoed_ce | /data/Compiler/Compiler/AbstractItemManager.h | WINDOWS-1251 | 783 | 2.5625 | 3 | [] | no_license | #pragma once
#include "AbstractItemContainer.h"
///
class CAbstractItemManager
{
public:
///
CAbstractItemManager() = default;
///
UInt32 GetItemsCount() const { return c.count(); }
///
AddedFileResourceMap AddAbstractItemContainer(const CAbstractItemContainer &aAbstractItemContainer);
/// ... | true |
722a4d0224cd8d8a2d1c3898f02d97c4d1ac84f3 | C++ | shushengyuan/PAT | /遍历/1079.cpp | UTF-8 | 1,149 | 2.78125 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
struct node
{
double data;
vector<int> child;
};
vector<node> v;
double tolres = 0.0;
int n;
double r, p;
void dfs(int index, int depth)
{
if (v[index].child.size() == 0)
{
double res;
res = p *... | true |
f7b917842f6b10cd378c822e739b7099ea46eb44 | C++ | mathieumg/hockedu | /trunk/Sources/C++/Reseau/UsinePaquet.h | ISO-8859-1 | 2,351 | 2.640625 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////
/// @file UsinePaquet.h
/// @author Mathieu Parent
/// @date 2012-12-30
/// @version 1.0
///
/// @addtogroup razergame RazerGame
/// @{
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <st... | true |
efbe26ef1187183528430423fba3411e0c96c88a | C++ | yuravashuk/PatternsDesignCxx | /Source/Core/World.cxx | UTF-8 | 867 | 2.9375 | 3 | [] | no_license |
#include "World.hpp"
bool World::Load(const std::string &inFileName)
{
// load files (JSON, TXT, Binary etc.)
// parse file
// create actors and append them to mActors variable
return true;
}
void World::Initialize()
{
for (auto actor : mActors)
{
actor->Initialize();
}
}
void W... | true |
e7532260f6d0689b9d09c3bc1b08d68c29f16d8a | C++ | PrakharJain/MyPrograms | /DataStructures/trie/trie.h | UTF-8 | 432 | 2.671875 | 3 | [] | no_license | /*
* trie.h
*
* Created on: 19-Feb-2013
* Author: swati
*/
#ifndef TRIE_H_
#define TRIE_H_
#include <string>
#include <iostream>
#include <vector>
using namespace std;
struct Node
{
vector<Node *> children;
char data;
bool isWord;
string word;
};
class Trie
{
public:
void insert(string &s);
Trie();
... | true |
891f8987f9f4c4b94c4067b87746eddb2456e0ac | C++ | cnsuhao/sc2bot | /D3D9CallbackSC2/Programs/ProgramPressKey.cpp | UTF-8 | 1,835 | 3 | 3 | [] | no_license | #include "Main.h"
void ProgramPressKey::Init(WORD _Key, bool _Shift, bool _Ctrl)
{
CurState = PressKeyPressKey;
Type = PressKeyNormal;
WaitKey = 0;
Key = _Key;
Shift = _Shift;
Ctrl = _Ctrl;
Name = String("PressKey <") + String(Key);
if(Shift)
{
Name = Name + " Shift";
}... | true |
02b63f077a08cd864034e9bba00e1c6969439354 | C++ | tiqwab/atcoder | /abc246/e/main.cpp | UTF-8 | 4,076 | 2.984375 | 3 | [] | no_license | #include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <limits.h>
using namespace std;
typedef long long ll;
template<class T>
inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
... | true |
f2f83093c4c2f463911fb8cc58a165f469fdb545 | C++ | wangyongliang/nova | /poj/3581/POJ_3581_3307043_AC_485MS_1772K.cpp | UTF-8 | 924 | 2.640625 | 3 | [] | no_license | #include<stdio.h>
#include<algorithm>
using namespace std;
#define maxn 401000
int st[maxn];
int getmin(int s,int m)
{
int j,a,b,k,flag;
for (j=0;j<m;++j)
st[j+m]=st[j];
a=s,b=s+1,k=0,flag=1;
if (b>=m)
return a;
while (flag)
{
if(st[a+k]==st[b+k])
{
++k;
if (k>=m) break;
}
... | true |
0f63f7cb73e527d72ca7e4270bd569b5d1eb1564 | C++ | buckeye-cn/ACM_ICPC_Materials | /solutions/kattis/spotify12/evenland_hcz.cpp | UTF-8 | 1,022 | 2.75 | 3 | [] | no_license | // https://open.kattis.com/problems/evenland
#include <cstdlib>
#include <cstdint>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#define MOD(x) ((x) % 1000000009)
using namespace std;
int n, m;
int uf[100000];
int find(int i) {
if (uf[i] == i) return i;
return... | true |
3cf2d625f765d587724270b34994f250504007d5 | C++ | ronj/teensy-dash | /source/PeripheralLayer/FrequencyCounter.h | UTF-8 | 434 | 2.78125 | 3 | [] | no_license | #pragma once
#include <cinttypes>
namespace HardwareLayer
{
class FrequencyCounter;
}
namespace PeripheralLayer
{
class FrequencyCounter
{
public:
FrequencyCounter(HardwareLayer::FrequencyCounter& counter);
virtual float GetFrequency();
private:
static const uint8_t NUMBER_OF_ITERATIONS = 1;
Hardware... | true |
e2c27cb4e399d907994dc1414a17bf399731c640 | C++ | marccane/Projectes-CPP | /Exercicis EDA/ArbresBinaris1/ArbreBinari.h | UTF-8 | 1,172 | 2.53125 | 3 | [] | no_license | /*******************************************************************************
* Arbre Binari Caracters
*
* Conte totes les operacions, pero nomes cal implementar les necessaries
* Si no es demana el contrari, millor no implementar el destructor.
*
* 2008
* JSS - Actualitzats els metodes
*********************... | true |
cc91194c590c6ee14d1d9da93d9c0d9876c2ef66 | C++ | SurajKalsiSky/AdvancedProgramming | /Task 2/Server.cpp | UTF-8 | 2,724 | 2.796875 | 3 | [] | no_license | #include <winsock2.h>
#include <ws2tcpip.h>
#include <iostream>
#include "stdafx.h"
#include "Server.h"
int Server::Run() {
SOCKET serverSocket;
Server server;
SERVICEPARAMS serviceParams;
this->SetupWinsock();
serverSocket = this->SetupSocket();
this->CreateServiceBinding(serverSocket);
this->ListenForClient(... | true |
a5311431958fe32bc65daedfb8fee44b569e5ad0 | C++ | Akeepers/algorithm | /leetcode/120.cpp | UTF-8 | 795 | 2.84375 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <climits>
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
int minimumTotal(vector<vector<int>> &triangle)
{
long long m = triangle.size(), res = INT_MAX;
if (m == 0)
return 0;
vector<vector<long long>> dp(2, ... | true |
17031f57823897f0ce5f98d22c10ae966df41656 | C++ | ordinary-developer/education | /cpp/std-11/r_lischner-exploring_cpp_11-2_ed/ch_51-names_and_namespaces/04-comparing_a_using_directive_with_a_using_declaration/main.cpp | UTF-8 | 307 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <iostream>
void demonstrate_using_directive() {
using namespace std;
typedef int ostream;
ostream x{ 0 };
std::cout << x << '\n';
}
void demonstrate_using_declaration() {
using std::ostream;
// typedef int ostream; // here an error will be
}
int main() {
return 0;
}
| true |
74721c46a00d4038529135d4b49e78dd04578e84 | C++ | jfgr27/Object-Oriented-Chess-Game | /piece.h | UTF-8 | 635 | 3.171875 | 3 | [] | no_license | #ifndef PIECE_H
#define PIECE_H
#include <string>
class ChessBoard;
class Piece {
public:
/* DECLARATION OF CONSTRUCTOR */
//constructs the piece
inline Piece(int colour_p, std::string n) : colour(colour_p), name(n){ };
/* DECLARATION OF DESTRUCTOR */
virtual ~Piece(){}
/* need to be public for the he... | true |
943c3989344ecc70104f85c1c6d4d4524c9359e6 | C++ | ShirleyDi/CPSC_221 | /Project1/dynmatrix.cc | UTF-8 | 5,341 | 3.03125 | 3 | [] | no_license | #include "dynmatrix.h"
#include <iostream>
using namespace std;
void addCluster(ClusterNode *&head,ClusterNode *&tail,const std::string& name)
// adds a cluster (at the tail) and the corresponding row and column to data structure
// distance of all added DistanceNodes should be initialized to 0.0
// at the end, tail... | true |
86bc3cabf451577232058bee678201502a6a0c59 | C++ | sladkehs/Ohjam | /test/test/class.cpp | UTF-8 | 1,288 | 3.234375 | 3 | [] | no_license | #include <iostream>
//#include "Box.h"
//#include "Circle.h"
#include "GeometricObject.h"
#include <string>
#include <vector>
using namespace std;
class Test {
public:
int a_;
Test(const int& _a) : a_(_a) {
std::cout << "int Constructor" << std::endl;
}
Test(const Test& _test) : a_(_test.a_) {
std::cout <<... | true |
3f10680012176d588e102fa08f45d3488c51f935 | C++ | tjdwn6459/C- | /Project1/피라미드 역-2.cpp | UTF-8 | 250 | 2.6875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int i, j, h;
for (i = 0; i < 6; i++)
{
/*for (j = 0; j<i; j++ )*/
for (j = i ; j > 0; j--)
{
printf(" ");
}
for (h = 0; h < (11 - 2 * i); h++)
{
printf("*");
}
printf("\n");
}
return 0;
} | true |
421b1c8480bfcd61ba9c702de3a5ffab74613dff | C++ | djh-sudo/Stone-Interpreter | /source/ASTLeaf.h | GB18030 | 922 | 2.890625 | 3 | [] | no_license | #pragma once
#include "ASTree.h"
#include "Object.h"
#include "Environment.h"
#include <vector>
// Ҷ
/*
ASTLeaf
-> StringLiteral
-> Name
-> NumberLiteral
*/
class ASTLeaf :public ASTree {
protected:
// token
Token::cptr mToken;
public:
// ĬϹ캯
ASTLeaf() = default;
~ASTLeaf() = default;... | true |
58a2b01f8882742bf9c4654d06f02bd0031c9b94 | C++ | Yokeagoni/DataStructure-Algorithm | /source/stack/sqstack.h | UTF-8 | 984 | 3.015625 | 3 | [
"MIT"
] | permissive | /*
* @Author: yanxinhao
* @Email: 1914607611xh@i.shu.edu.cn
* @LastEditTime: 2020-12-05 14:03:29
* @LastEditors: yanxinhao
* @Description:
*/
#pragma once
#include "vector/vector.h"
template <typename T>
class sqstack : public Vector<T>
{
private:
/* data */
public:
sqstack(/* args */);
sqstack(cons... | true |
fad71d2a27846f85e31720cde6be214d945d194e | C++ | HristoHristov95/C-- | /124-str c++/124-str c++/Source3.cpp | UTF-8 | 437 | 3.046875 | 3 | [] | no_license | #include<iostream>
using namespace std;
class base
{
int a;
public:
void load_a(int n){ a = n; }
int get_a(){ return a; }
};
class derived :public base
{
int b;
public:
void load_b(int n){ b = n; }
int get_b(){ return b; }
};
int main()
{
int ret_a1;
int ret_gg;
base a1,a2;
derived gg,gg1;
a1.load_a(10);
re... | true |
83ccbe51a937ee785433d1ac892c346739d904a3 | C++ | Din-Avrunin/cpp5b | /Test.cpp | UTF-8 | 3,742 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "range.hpp"
#include "chain.hpp"
#include "zip.hpp"
#include "product.hpp"
#include "powerset.hpp"
#include "badkan.hpp"
using namespace std;
using namespace itertools;
template<typename Iterable>
string iterable_to_string( Iterable& iterable) {
ostringstream ostr;
... | true |
c42a52d04524948be57db5e102ae403467f13d1d | C++ | umbcdavincilab/pathBubbles | /PathBubbles1.0_1/winQt_Test/Diagram.h | UTF-8 | 1,118 | 2.578125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
#include <string>
#include <QPainter>
#include "Point.h"
#include "Label.h"
#include "SimData.h"
using namespace std;
class Diagram
{
public:
//Diagram(Label *label, SimData *simdata, double max_var, double min_var);
Diagram(Label *label, double max_var, double m... | true |
5febbdfb3d964dccc0486c89cec73f1509177ffc | C++ | zixuanwang/QtRoom | /Trainer.cpp | UTF-8 | 4,860 | 2.71875 | 3 | [] | no_license | #include "Trainer.h"
Trainer::Trainer()
{
}
void Trainer::train_hog(const std::string& train_directory){
SVMClassifier classifier;
HoGDescriptor hog_descriptor;
std::string positive_directory = train_directory + "/positive";
std::string negative_directory = train_directory + "/negative";
std::vect... | true |
432dc22aafb36a9672ace0cba0f7f1d7cddb9560 | C++ | Daria-Donina/spbu1stYear | /sem1/hw9/hw9.1/hw9.1/list.cpp | UTF-8 | 1,379 | 3.53125 | 4 | [
"Apache-2.0"
] | permissive | #include "list.h"
#include <string>
#include <iostream>
using namespace std;
using namespace list;
struct list::Node
{
std::string data = 0;
int counter = 0;
Node *next{};
};
struct list::List
{
int length = 0;
list::Node *head{};
};
list::List *list::createList()
{
return new List;
}
bool isEmpty(List *list... | true |
5b7fdeb983b6cf773ec5e06dd00b72f4ab7523b0 | C++ | rishup132/My-Codes | /spoj/MKTHNUM - K-th Number.cpp | UTF-8 | 1,672 | 2.9375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
set <int> segtree[4000010];
int a[1000010];
set <int> merge(set <int> x, set <int> y)
{
if(x.size() > y.size())
{
set <int> :: iterator it;
for(it = y.begin();it != y.end();it++)
... | true |
a959bbef60585df694d3ef99d99c3e8f3146e8d0 | C++ | jpan127/compiler | /unused/wci/intermediate/symtabimpl/SymTabImpl.h | UTF-8 | 1,934 | 2.921875 | 3 | [] | no_license | /**
* <h1>SymTabImpl</h1>
*
* <p>An implementation of the symbol table.</p>
*
* <p>Copyright (c) 2017 by Ronald Mak</p>
* <p>For instructional purposes only. No warranties.</p>
*/
#ifndef SYMTABIMPL_H_
#define SYMTABIMPL_H_
#include <string>
#include <map>
#include "../SymTab.h"
#include "SymTabEntryImpl.h"
n... | true |
e2449c5fd720178336d86a3fc11a91e19061de84 | C++ | IDMNYU/shelfisizer | /arduino/09_ENVY/myfscale.ino | UTF-8 | 2,150 | 3.046875 | 3 | [
"MIT"
] | permissive | float myfscale( float inputValue, float originalMin, float originalMax, float newBegin, float
newEnd, float curve) {
float OriginalRange = 0;
float NewRange = 0;
float zeroRefCurVal = 0;
float normalizedCurVal = 0;
float rangedValue = 0;
boolean invFlag = 0;
// condition curve parameter... | true |
088cad3eb4aeec9d5aab2a6cd2d11f56421a8a3e | C++ | holly12ann/OSU-CS261 | /Assignment 9/PostfixEval.cpp | UTF-8 | 2,326 | 3.90625 | 4 | [] | no_license | /****************************************************************************************
Author: HOLLY SWITZER
Date: 6/2/17
Description: This program will calculate postfix equations
****************************************************************************************/
#include <iostream>
#include <stack>
u... | true |
604ecca7d0a44ee8a303556a20b9547d9d91a6a0 | C++ | yuji5296/ethiocalendar | /src/date.cxx | UTF-8 | 15,775 | 2.75 | 3 | [] | no_license | /** \file date.cxx
* \brief Class for having a date class
*
* \author Yuji DOI<yuji5296@gmail.com>
* \date 2008-2009
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "date.h"
#include "yaecob.h"
/* Base point */
//const int BASE[2]={1600,1596};
const int BASE[3]={1600,1600,1020};
/* ... | true |
33c215fdd01b7185a0fc0129442fe96ecb0b0570 | C++ | i-aki-y/CarND-Path-Planning-Project | /src/Utils.cpp | UTF-8 | 1,318 | 2.90625 | 3 | [
"MIT"
] | permissive | //
// Created by AkiyukiIshikawa on 2018/03/28.
//
#include <iostream>
#include <math.h>
#include <vector>
#include "Utils.h"
using namespace std;
constexpr double pi() { return M_PI; }
// Transform from Frenet s,d coordinates to Cartesian x,y
vector<double> Utils::getXY(double s,
double... | true |
6275212dd27dab6e22460b0ddbf0dd2257c76272 | C++ | novice9/Algorithm-and-Data-Structure | /DataStructure/2D-SegmentTree.cpp | UTF-8 | 5,397 | 3.421875 | 3 | [] | no_license | // code of a 2D segment tree (initialized with a matrix)
// operation
// 1. update: change the value of a slot in the matrix - O(logn)
// 2. query: check the sum of any sub-matrix - O(logn)
class SegmentTreeNode2D {
public:
int left, right, top, bottom;
int sum;
// top-left, top-right, bottom-left,... | true |
d371ee8aad6bc8c6b00402f191226c511e571d28 | C++ | thedavekwon/algo-projects | /baekjoon/1671/1671.cpp | UTF-8 | 1,742 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
typedef long long llong;
llong stat[1000][3];
struct MaximumFlow {
int n;
vector<vector<int>> graph;
vector<bool> check;
vector<int> pred;
MaximumFlow(int n) : n(n) {
graph.resize(n);
check.resize(n);
pred.re... | true |
0847300b98dd991a3da3fcfa5dd45d95651dbc20 | C++ | liumaolin/Solution | /Exercise.cpp | GB18030 | 1,855 | 3.21875 | 3 | [] | no_license | #include "Exercise.h"
void ShareManager::AddItem(const InputInfo& input)
{
if (result_map_.count(input.symbol_))
{
auto item = result_map_.find(input.symbol_);
MiddleInfo* info = item->second;
info->max_time_gap_ = max(info->max_time_gap_, input.time_ - info->last_time_);
info->last_time_ = input.time_;
in... | true |
f93d633ccd1313e43cc496c0fef72d8f197ea403 | C++ | dinimar/Projects | /c++/primer_plus_s_pratt/ch_13/pe_1/src/cd.cc | UTF-8 | 1,460 | 3.34375 | 3 | [
"MIT"
] | permissive | #include "cd.h"
#include <cstring>
#include <iostream>
void Cd::InitCharArrays()
{
for(size_t i=0; i<49; ++i)
performers[i]='0';
performers[49] = '\0';
for(size_t i=0; i<19; ++i)
label[i]='0';
label[19] = '\0';
}
void Cd::CopyString(char * dest, char * src)
{
// check that length... | true |
e7cf44156e93f33f14451c16b7454acf25ff29f9 | C++ | NicGanon/Voronoi-based-SweepLine | /source/BeachLine.h | UTF-8 | 860 | 2.671875 | 3 | [] | no_license | #pragma once
#include "BeachNode.h"
#include "EventNode.h"
class BeachLine
{
public:
BeachLine():root(NULL){};
~BeachLine(){};
void LeftRotation(BeachNode* subTree);
void RightRotation(BeachNode* subTree);
void Insert(BeachNode*pos,BeachNode* subTree);
void InsertFixup(BeachNode *newNode);
BeachNode* FindAr... | true |
e680e2d700fe0c7e68fda81cfa2435a4c264fc26 | C++ | FormylMethionine/lab8-group1 | /string.cpp | UTF-8 | 4,967 | 3.28125 | 3 | [] | no_license | #include "./string.h"
//============================================================================
// Non member useful functions
//============================================================================
int strlen(const char* str){
int i = 0;
for (i; str[i] != '\0'; i++){}
return i;
}
int min(int arg1, in... | true |
eb7f93ebc501aafd8d6481a4e1d44fab681eb404 | C++ | kslinguistics/spellchecker | /spellchecker.cpp | UTF-8 | 2,435 | 3.078125 | 3 | [] | no_license | /********* simple spell checker *********/
/** for 2018A-Tue-02 linguistics class **/
#include <bits/stdc++.h>
struct ToLower{
char operator()(char c){
return std::tolower(c);
}
};
// calculate 'distance' between s1 and s2
int d(std::string s1, std::string s2)
{
int m = int(s1.size()), n = int(s2.size());
... | true |
245a18dc14d618474f0bf5e7272ce80f4e89832c | C++ | CacoFFF/XC_Core | /Src/XC_Globals.cpp | UTF-8 | 3,979 | 2.765625 | 3 | [] | no_license | /*=============================================================================
XC_Globals.cpp:
Implementation of some globals
=============================================================================*/
#include "XC_Core.h"
#include "XC_CoreGlobals.h"
#include "UnLinker.h"
//**********************************... | true |
05a839864ac75708c3ae2d963a692cf1261cdf67 | C++ | mbourand/webserv | /incs/Request.hpp | UTF-8 | 1,552 | 2.59375 | 3 | [] | no_license | #ifndef REQUEST_HPP
#define REQUEST_HPP
#include <map>
#include <string>
#include "Logger.hpp"
#include "Methods.h"
#include "Headers.h"
#include "Factory.hpp"
#include "ConfigContext.hpp"
#include "URL.hpp"
#include <vector>
class Request
{
public:
typedef std::vector<Header*> HeadersVector;
public:
std::st... | true |
6a38476c07609102be44b8b5bcc938e8321519dd | C++ | Niraka/ThirdYearProject | /Include/ServerDatabase/Database.h | UTF-8 | 4,828 | 3.203125 | 3 | [] | no_license | /**
ONLY SUPPORTS WINDOWS!
@author Nathan */
#ifndef DATABASE_H
#define DATABASE_H
#include <map>
#include <vector>
#include <string>
#include <iostream>
#include "StoreLoader.h"
#include "StoreAccessor.h"
class Database
{
private:
enum class StoreStates
{
MOUNTED, // The Store is detected but no loaded
... | true |
59bbd5c4ea1ede7a0f09ba6dcf2b85bfdab7d69e | C++ | danchesler/Problems | /rangeSumBSTwithDFSandBFS.cpp | UTF-8 | 1,277 | 3.640625 | 4 | [] | no_license | // By Bernoulli on LeetCode
// DFS
class Solution {
public:
int rangeSumBST(TreeNode* root, int L, int R) {
if(root == nullptr)
return 0;
int sum = 0;
if(root->val >= L && root->val <= R){
sum+=root->val+rangeSumBST(root->left, L, R)+rangeSumBST(root->right,... | true |
0c8933326651fe9bb7cc46cebc465bcbc2b87b98 | C++ | AndreNolliViana/Kevaomilenar | /FINAL/IBGE/main.cpp | UTF-8 | 848 | 3.21875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int d, cd;
int h, m;
float sm, sh, c, cT, smT, shT = 0.0;
cout << "Dias trabalhados: "; cin >> d;
cout << "Cota diaria: "; cin >> cd;
for(int z=0; z < d; z++){
cout << "Dia " << z+1 << endl;
cin >> h >> m;
while ( h... | true |
aa1fc8aa5975fdd6cf4393ae3c14047847f4a827 | C++ | nhthucdtvt/CPP | /1000btC_Cpp/s2/source_442.cpp | UTF-8 | 6,546 | 2.65625 | 3 | [] | no_license |
#include "stdio.h"
#include "conio.h"
#include "time.h"
#include "Windows.h"
struct hocsinh
{
char HoTen[30];
float Toan;
float Van;
float TrungBinh;
};
typedef struct hocsinh HOCSINH;
struct node
{
HOCSINH Data;
struct node*pNext;
};
typedef struct node NODE;
struct list
{
NODE*pHead;
NO... | true |
d95df13da817cfc99897f0a228ac44280220c649 | C++ | Aditya1788/DataStructuresAndAlgorithms | /Amazon-Geeks/Arrays/InfiniteGridProblem.cpp | UTF-8 | 805 | 3.703125 | 4 | [] | no_license | // Important: The assumption made in this question is that the length taken through the hypotenuse is same as taken
// through the x or y axes i.e 1 unit for a unit square grid
// Problem Link:
//https://www.geeksforgeeks.org/minimum-steps-needed-to-cover-a-sequence-of-points-on-an-infinite-grid/
#include<bits/stdc++... | true |
708412dbc80e9bfd5b1c2fc24d556c2bde01eb92 | C++ | personaluser01/Algorithm-problems | /20130510/tabletraveling/GenerateSpecialTestType1.cpp | UTF-8 | 659 | 2.578125 | 3 | [] | no_license | #include<cstdio>
#include<ctime>
#include<cstdlib>
#include<algorithm>
using namespace std;
int a[5007][5007];
int main() {
int m = 1000, n = 1000;
int p = 1;
for(int j = 0; j < n; ++j) a[0][j] = p++;
for(int i = 1; i < m; ++i) a[i][n-1] = p++;
for(int i = 1; i < m; ++i)
for(int j = 0; j < n-1; ++j)
a[i][j]... | true |
65475b26e62dbd7b1d8dba8c4919244afb8b8d4f | C++ | ondrej-vesely/GEO1015-hw2 | /c++/src/DatasetASC.cpp | UTF-8 | 1,973 | 3.21875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <fstream>
#include "DatasetASC.h"
DatasetASC::DatasetASC(std::string ifile) {
std::cout << "Reading file: " << ifile << std::endl;
std::ifstream infile(ifile.c_str(), std::ifstream::in);
if (!infile)
{
std::cerr << "Input file not found." << std::endl;
va... | true |
e00c1f9a8b8a24114f9705a2efd02988cbebf9d9 | C++ | viktorb1/Protein-Sequence-Comparison | /program/Blosum.h | UTF-8 | 349 | 2.546875 | 3 | [] | no_license | #ifndef _BLOSUM_H_
#define _BLOSUM_H_
#include <unordered_map>
class Blosum {
const static int num_aa = 20;
// stores the blosum62 matrix
double blosum[num_aa][num_aa];
// used to retrieve column/row for amino acid
unordered_map<char, int> aarowcol;
public:
Blosum();
double getValue(ch... | true |
d9d03a43870692e0f0207b9a996aa48ac3900f2a | C++ | llebron/arduino | /libraries/Potentiometer/Potentiometer.h | UTF-8 | 896 | 3.03125 | 3 | [
"BSD-2-Clause"
] | permissive | /**
Potentiometer.h
Larry LeBron
A simple library for a potentiometer connected between 5V, ground and an an analog input
*/
#include "Arduino.h"
#ifndef POTENTIOMETER_H
#define POTENTIOMETER_H
const int MAX_POT_VALUE = 1023;
// only considered a value change if the jump is at least of this delta
// prevents noise... | true |
fbfaf714cd5c91bda4c91ce85e92288bc89b149d | C++ | CaterTsai/C_Ballon | /src/BallBoid.h | UTF-8 | 3,748 | 2.671875 | 3 | [] | no_license | #ifndef BALL_BOID
#define BALL_BOID
#include "ofMain.h"
class BallBoid{
public:
static float REFLECT;
ofVec2f location;
BallBoid(float x_,float y_,float rad_,int tag_){
location=ofVec2f(x_,y_);
acc=ofVec2f(0,0);
maxSpeed=12.0;
maxForce=5.0;
shrinking=false;
dest_shrink=1;
vel=ofVec2f(m... | true |
799f147f6b7096461e74f328a793867502883a8c | C++ | christopherwade/PRG_422 | /Week1/PRG423/main.cpp | UTF-8 | 1,167 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include "BubbleSort.hpp"
#include "Test.hpp"
#include "Node.hpp"
#include "LinkedList.hpp"
using namespace std;
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
//void BubbleSort(int array[],... | true |
2ee3f0090ed165088b335fda864887198965e296 | C++ | uilianries/config | /include/tao/config/internal/phase2_add.hpp | UTF-8 | 5,524 | 2.5625 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2018-2020 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/config/
#ifndef TAO_CONFIG_INTERNAL_PHASE2_ADD_HH
#define TAO_CONFIG_INTERNAL_PHASE2_ADD_HH
#include <utility>
#include "concat.hpp"
#include "entry.hpp"
#include "format.hpp"
#include "va... | true |
a0df47c0653eb6e99ad6bf381158e8d4df423263 | C++ | LibertAntoine/Minecraft_editor | /Minecraft/src/GraphicEngine/Texture.cpp | UTF-8 | 2,306 | 2.6875 | 3 | [] | no_license | #include "Texture.h"
#include "stb_image/stb_image.h"
#include "GLerror.h"
Texture::Texture()
:m_LocalBuffer(nullptr),
m_Width(0), m_Height(0), m_BPP(0),
m_TextureID(0)
{}
Texture::Texture(const std::string& path, const std::string& name)
: m_FilePath(path), m_Name(name),
m_LocalBuffer(nullptr),
m_Width(0), m_H... | true |
5b152ac3f99b55534db050fce63565d2ea862b91 | C++ | Asupi/C_plusplus | /4_16/4_16/test.cpp | GB18030 | 2,589 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
//class Person
//{
//public:
// void Print()
// {
// cout << "name:" << _name << endl;
// cout << "age:" << _age << endl;
// }
//protected:
// string _name = "peter"; //
// int _age = 18; //
//};
//
//class Student : public Person
//{
//protected:
// int _s... | true |
2decc103922182bb16d8e87ecd9e998c9dad90b1 | C++ | famafka/smallest-enclosing-disc | /lab_TK3_Mikhno/segment.cpp | UTF-8 | 342 | 3.234375 | 3 | [] | no_license | #include "segment.h"
segment :: segment()
{
a = point(0, 0);
b = point(0, 0);
}
segment :: segment(const point & a, const point & b) : a(a), b(b)
{
}
point segment :: middle() const
{
return point((a.getX() + b.getX()) / 2., (a.getY() + b.getY()) / 2.);
}
double segment :: length() const
{
return p... | true |
4d8e65143d70c7d7383a03876b9f6be2be826fca | C++ | angeluriot/Chess_AI | /sources/OpeningBook.cpp | UTF-8 | 2,870 | 2.9375 | 3 | [] | no_license | #include "OpeningBook.h"
#include <stdexcept>
OpeningBook::OpeningBook(const std::string& name) : book_size(0)
{
file.open(name, std::ifstream::binary);
if (!file.good() || !file.is_open())
throw std::runtime_error("A");
file.seekg(0, std::ios::end);
if (!file.good())
throw std::runtime_error("B");
book_si... | true |
c1b4c09f28a9c75fb2ec49b217f79687956cac8f | C++ | giacomomodica/MyCode | /virtual_machine_gui_test.cpp | UTF-8 | 3,622 | 2.5625 | 3 | [] | no_license | #include <QTest>
#include <QPlainTextEdit>
#include <QTableView>
#include <QLineEdit>
#include <QPushButton>
#include <iostream>
#include "virtual_machine_gui.hpp"
#include "test_config.hpp"
class VirtualMachineGUITest : public QObject {
Q_OBJECT
private slots:
void initTestCase();
void testCa... | true |
f52953ae2576ab309b3f3c726c22c7f6f6b954e5 | C++ | ianms17/CSCE121 | /hw11/DoublyLinkedList.h | UTF-8 | 7,855 | 3.640625 | 4 | [] | no_license | #ifndef DOUBLYLINKEDLIST_H
#define DOUBLYLINKEDLIST_H
#include "Node.h"
#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
//////////////////////////////////////////////////////////////////////////////
// class template definition //
/////////////... | true |
74ca6247aaf9c9ba1f16aa2bd30c1f3e970ad2f3 | C++ | andreitudose2000/SQLinCPP | /ProiectPOO/ProiectPOO.h | UTF-8 | 24,073 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <sstream>
#include <algorithm>
#include <fstream>
using namespace std;
class Tabel
{
string nume_tabel;
vector<tuple<string, string, int>> coloane; // tuplul contine: <nume, tip, dimensiune>
vector<vector<string>> date;
public:
frie... | true |
7ad1f3d3b9224410f7e8478e09b3ae64dbeaa7da | C++ | guoyu07/oj-leetcode | /set-matrix-zeroes/set_matrix_zeroes.cpp | UTF-8 | 1,864 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
// O(n)
void setZeroes(vector<vector<int>>& matrix) {
int m, n;
if( ( m = matrix.size() ) == 0 || ( n = matrix.front().size() ) == 0) return;
int rows[m] {};
int cols[n] {};
for( int i = 0; i < ... | true |
9f2eef8e97f9a08ceb9083c41f30d3ba8fcea8fd | C++ | kaba2/pastel | /pastel/sys/allocator/pool_allocator/pool_allocator.hpp | UTF-8 | 9,758 | 2.734375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #ifndef PASTELSYS_POOL_ALLOCATOR_HPP
#define PASTELSYS_POOL_ALLOCATOR_HPP
#include "pastel/sys/allocator/pool_allocator.h"
#include "pastel/sys/ensure.h"
#include "pastel/sys/generic/addressof.h"
#include <compare>
namespace Pastel
{
inline PoolAllocator::PoolAllocator(
integer unitSize)
: unitSi... | true |
80b54be92ed2287e471b8fc4732f74ab3cd74b9f | C++ | jJayyyyyyy/OJ | /LeetCode/101-200/P136_Single_Number.cpp | UTF-8 | 1,082 | 3.734375 | 4 | [] | no_license | /*
* https://leetcode.com/problems/single-number/description/
* 给定一个数组, 其中只有一个数是单独的, 其他所有的数都会出现2次. 找出那个单独的数
* 同类题目 P136
*
* 线性时间复杂度, 要求空间复杂度为O(1).
* 思路: 异或, ^=
*/
// #include <iostream>
// #include <vector>
// #include <algorithm>
// using namespace std;
// io加速
// static const auto io_speed_up = []() {
// st... | true |
fb900bf4b2b35c9e770cc63f3ecbbddab1d16c6f | C++ | XnorTheUnforgiven/ELE778 | /main.cpp | UTF-8 | 3,887 | 2.828125 | 3 | [] | no_license | /**************************************************************************************
* Name: main.cpp
*
* Written by: Tomy Aumont
* Xavier Mercure-Gagnon
*
* Descritpion:
* 1ère partie: Fait le pré-traitement des données. Termine avec un vecteur de
* de données prêtes à être apprises par le réseau de neuron... | true |
b1a4194f8c488300f0a136bedc6fa2a97cecce03 | C++ | rezanour/nativegame | /SliderPuzzle/Tile.h | UTF-8 | 669 | 2.625 | 3 | [] | no_license | #pragma once
#include <d3d11.h>
#include <SimpleMath.h>
class Tile
{
public:
Tile();
Tile(int difficulty, DirectX::SimpleMath::Vector2 initialPosition);
~Tile();
void SlideUp();
void SlideDown();
void SlideLeft();
void SlideRight();
DirectX::SimpleMath::Vector2 GetPosition() const;
... | true |
88863ed9d582d85b1ae97352592e1366f8b8c7e4 | C++ | alearley26/Programming_Projects | /Image_Processing_Project/Header.cpp | UTF-8 | 1,327 | 3.046875 | 3 | [] | no_license | #include "Header.h"
#include<iostream>
#include <fstream>
using namespace std;
Header::Header() {
idLength = 0;
colorMapType = 0;
imageType = 2;
colorMapOrigin = 0;
colorMapLength = 0;
colorMapDepth = 0;
xOrigin = 0;
yOrigin = 0;
imageWidth = 0;
imageHeight = 0;
bitsPerPixel = 24;
imageDes... | true |
36737fcd5b3ab7d98657c1a64305bd7d01c6cf45 | C++ | Chung-god/add-nbo | /main.cpp | UTF-8 | 1,261 | 2.6875 | 3 | [] | no_license | #include <stddef.h> // for size_t
#include <stdint.h> // for uint8_t
#include <stdio.h> // for printf
#include <stdlib.h>
#include <string.h>
char file0[50] = "/home/chung/workspace/HW/add-nbo/";
char file1[50] = "/home/chung/workspace/HW/add-nbo/";
char temp[50];
FILE* fp0;
FILE* fp1;
uint8_t buffer[20];
uint8_t add... | true |
f51270d85502916ff17427f10bd580daad9fcddc | C++ | IgorYunusov/Mega-collection-cpp-1 | /Windows内核安全编程从入门到实践/Projects/chapter 5 磁盘/QueryPerformance/QueryPerformance/main.cpp | UTF-8 | 1,349 | 2.53125 | 3 | [] | no_license | #include "stdio.h"
#include "windows.h"
int main()
{
HANDLE hFile;
DISK_PERFORMANCE OutBuffer = {0};
ULONG OutBufferSize = sizeof(DISK_PERFORMANCE), dwRet;
BOOL bRet;
hFile = CreateFileA("\\\\.\\PhysicalDrive0", GENERIC_READ,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
... | true |
dfbb61675ce5ba40840cee1507fc113be36c8b84 | C++ | longcule/BT-LTNC-INT2215-22 | /BT10-LTNC/A1,2,3-BT10.cpp | UTF-8 | 539 | 3.734375 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct Point
{
int x,y;
void Print()
{
cout<<x<<" "<<y;
}
};
void print1(Point p)
{
cout<<"\nDia chi p ham 1: "<<&p;
}
void print2(Point &p)
{
cout<<"\nDia chi p ham 2: "<<&p;
}
Point mid_point(const Point p1, const Point p2)
{
Point p3;
... | true |