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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4085e3869c0f591d6eb02a526fbe713a02e2cb7e | C++ | RonakKhandelwal/Algorithim | /Lab/warshal.cpp | UTF-8 | 651 | 3.03125 | 3 | [] | no_license | #include <iostream>
using namespace std;
void warshal(int a[][4],int n){
int sol[4][4];
for(int i=0;i<4;i++){
for(int j=0;j<4;j++){
sol[i][j]=a[i][j];
}
}
for(int i=0;i<4;i++){
for(int j=0;j<4;j++){
for(int k=0;k<4;k++){
sol[i][j]=sol[i][j] || (sol[i][k] && sol[k][j]);
... | true |
72753284a92dc16ec1009f2015c32b1297e8b3ca | C++ | jxzhsiwuxie/cppPrimer | /chap02/exercises/ex_2.24.cpp | UTF-8 | 275 | 3.171875 | 3 | [] | no_license | //练习 2.24:在下面这段代码中,为什么 p 合法而 lp 非法?
//int i = 42; void *p = &i; long *lp = &i;
/*
p 是 void* 类型的指针,它可以用来存放任意类型的对象的地址。
lp 是 long 型的指针无法存放 int 型对象的地址。
*/ | true |
073567a2310fe3f2b8468501f8017ff6ee8b2a79 | C++ | ArchivedPixLed/PixLedLanguage | /components/pixled/scene/scene.cpp | UTF-8 | 1,153 | 2.796875 | 3 | [] | no_license | #include "scene.h"
Scene::Scene() {
this->localTime = std::shared_ptr<Integer>(new Integer(0));
ESP_LOGI("SEQ", "init %li", this->localTime.get()->get());
}
void Scene::addLayer(std::shared_ptr<Layer> layer) {
this->layers.push_back(layer);
}
void Scene::setStopCondition(std::shared_ptr<Condition> stopCondition) ... | true |
f1e8d9373907b10d55e9a77fb37ab372e26148c6 | C++ | NadanKim/Direct-3D-Study | /LabProjects/LabProject10/Timer.h | UHC | 1,222 | 2.6875 | 3 | [
"MIT"
] | permissive | #pragma once
const ULONG MAX_SAMPLE_COUNT = 50; // 50ȸ óð Ͽ Ѵ.
class CGameTimer
{
public:
CGameTimer();
virtual ~CGameTimer();
void Tick(float fLockFPS = 0.0f);
void Start();
void Stop();
void Reset();
unsigned long GetFrameRate(LPTSTR lpszString = NULL, int nCharacters = 0);
float GetTimeElapsed();
float ... | true |
d5fe6d73f47f851f192dfbf84ede4a8dddb79a74 | C++ | mbryksin/stuff | /year2012/143grouptasks/sem-1/hometask-10/Task10_1/list.cpp | UTF-8 | 2,861 | 3.734375 | 4 | [] | no_license | #include <stdlib.h>
#include "list.h"
#include <stdio.h>
List *createList()
{
List *list = new List;
list->head = NULL;
return list;
}
bool isEmpty(List *list)
{
return list->head == NULL;
}
void destroyList(List *list)
{
while (! isEmpty(list))
{
ListElement *temp = list->head;
list->head = temp->next;
... | true |
fadd52b3bd1833b826a49977eac415b146d10692 | C++ | abenito343/eclipse-workspace | /Ejerc3/src/Ejerc3.cpp | UTF-8 | 650 | 3.265625 | 3 | [] | no_license | //============================================================================
// Name : Ejerc3.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <i... | true |
e23d13bb939098a616ab6d9a2cad6e8c8e23ebdc | C++ | tech4me/ANN-RL-reversi | /reversi/Player.h | UTF-8 | 256 | 2.609375 | 3 | [] | no_license | #pragma once
#include "Piece.h"
#include "Board.h"
class Player
{
protected:
color col;
virtual ~Player() {};
public:
color get_color() const;
void init_player(bool _is_black);
virtual void move(Board & board, bool & game_end) = 0;
}; | true |
ceb50211b453aaa0f0ad79d1244634be13ab302d | C++ | anthro2020/SPOJ-1 | /3377. A Bug’s Life/BUGLIFE.cpp | UTF-8 | 1,412 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <map>
#include <list>
#include <queue>
using namespace std;
int currentcolor;
int color[2000];
bool visited[2000];
bool suspicious;
queue<int> q;
list<int> *adj;
bool bfs(){
w... | true |
ba0f7fd965811c67b5167d72790e4b2e112f8826 | C++ | adong001/C-C-_NC_Day | /动态规划(1)/动态规划(1)/斐波那契数列.cpp | GB18030 | 606 | 3.546875 | 4 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
//Ҷ֪쳲УҪһn
//쳲еĵn0ʼ0Ϊ0
//n <= 39
class Solution
{
public:
int Fibonacci(int n)
{
int fn = 1,fn_1 = 1, fn_2 = 1;
if (n <= 0)
{
return 0;
}
if (n == 1 || n == 2)
{
return 1;
}
for (int i = 3; i <= n; i++)
{
fn_2 = f... | true |
656a25e610daac2945763d16c17aa3e993962ee0 | C++ | HeliumProject/Engine | /Source/Tools/EditorScene/Pick.h | UTF-8 | 11,490 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include "EditorScene/API.h"
#include "Math/Line.h"
#include "Math/Frustum.h"
#include "Foundation/SmartPtr.h"
#include "Foundation/Numeric.h"
#include "Reflect/Object.h"
#include "EditorScene/Visitor.h"
namespace Helium
{
namespace Editor
{
class Camera;
class PickHit;
typedef Helium::SmartPt... | true |
19931c4e72c192fa3cde522f01e57f77fc39fe1d | C++ | depp/terrestrial-collection-machine | /dev/loader.hpp | UTF-8 | 848 | 2.953125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #pragma once
#include <functional>
#include <memory>
#include <string>
#include <vector>
namespace tcm {
// Change the current directory to the Bazel workspace root.
void ChdirWorkspaceRoot(void);
// Read the contents of a file into a vector. Returns 0 on success, or the error
// code on failure.
int ReadFile(const... | true |
cb51e92fbdbc8f3b3559d7ec38224d2a2032ce40 | C++ | tangyiyong/coroutinecc | /test/test.cc | UTF-8 | 817 | 2.578125 | 3 | [
"MIT"
] | permissive | #include <cstdio>
#include "coroutine.h"
using namespace Coroutinecc;
using namespace std;
struct args {
int n;
};
static void
foo(Scheduler* s, void* ud) {
args* arg = reinterpret_cast<args*>(ud);
int start = arg->n;
for(int i = 0; i < 5; i++) {
::printf("coroutine %d : %d\n", s->running(),... | true |
0d9e2439e0efc40896af1b6ef9cf517ac4f6f58c | C++ | Momonyaro/RoguEngine | /olcRoguEngine/roguSrc/entities/entityManager.h | UTF-8 | 340 | 2.71875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "entity.h"
class EntityManager
{
public:
~EntityManager()
{
player->~Entity();
}
inline Entity* getPlayer() { return player; }
void setPlayer(Entity* playerEntity) { player = playerEntity; }
private:
Entity* player = new Entity("Player", { 1, 1 }, new rogu::Sprite({ 15, 0... | true |
54aaa28760d976e7a6a9b375c49201f9d07373a4 | C++ | jhass/project_helix | /src/objects/Torus.h | UTF-8 | 1,293 | 2.8125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef PH_TORUS_H
#define PH_TORUS_H
#include <string>
#include <osg/Geode>
#include <osg/Geometry>
using namespace std;
using namespace osg;
namespace ph {
class Torus : public Geode {
public:
enum Style {NORMAL, FLAT};
Torus(const double iRadius, const double tRadius, const in... | true |
7f1a632deeb8767e8de0c6b4e4cfe63adc0b3918 | C++ | orre1996/TankWarsNetworked | /network-protocol-CLIENT/source/TextString.h | UTF-8 | 597 | 2.515625 | 3 | [] | no_license | #pragma once
#include <vector>
#include "FontManager.h"
#include "TextTexture.h"
class DrawManager;
class TextString
{
public:
void GenerateText(std::string p_text, int m_x, int m_y);
void GenerateText();
void DrawText();
void SetText(std::string p_text);
TextString();
~TextString();
Draw... | true |
c89373169423c2fdf28be3d70b6d62f99b35188c | C++ | gbenga007/KinectCPP | /ServerClientComm/src/Client.cpp | UTF-8 | 6,035 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <iostream>
#include <string>
#define MSG_SIZE 400 // Message size
int n, sock;
unsigned int len... | true |
dda2be8e1e28b3dd3beff44bda3e434b24fa1462 | C++ | UTD-MrPeterson/VirtualTest | /main.cpp | UTF-8 | 549 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include "DerivedClass.h"
using namespace std;
void asBase(const BaseClass& baseObj) {
cout << "\"Base\" object:" << endl;
baseObj.nonVirtualMethod();
baseObj.virtualMethod();
baseObj.pureVirtualMethod();
}
void asDerived(const DerivedClass& derivedObj) {
cout << "Derived obj... | true |
bfd8d579e5ed7dc75d184e0a318547a3728de7f9 | C++ | anguszxd/video-segmentation | /reference-code/ViBe/vibe C++代码/BackGroundModel.cpp | GB18030 | 14,340 | 2.53125 | 3 | [
"BSD-2-Clause",
"BSD-2-Clause-Views"
] | permissive | /************
Ķ˳
BackGroundModel::classificationMThreadǴ
*************/
#include "StdAfx.h"
#include "BackGroundModel.h"
#include <iostream>
#include <time.h>
#include <fstream>
#define MAX_THREAD 10
using namespace std;
DWORD WINAPI ThreadClassification(LPVOID pParam)
{
ParameterClassificat... | true |
4fcc3d5ef76f5efdf214d3991ac05d79373c3b05 | C++ | rwhelan/Distance | /Distance.ino | UTF-8 | 1,560 | 3.03125 | 3 | [] | no_license |
// Output Pins, IN ORDER from LSB to MSB (hard coded currently to 10 pins)
int Pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 16};
// Which Analog pin is the sensor on
int SensorPin = 0;
// Number of samples to keep
const int numSamples = 10;
int Samples[numSamples];
int idx = 0;
// delay between readings
const int loopDelay... | true |
c1b87029f1bc7afa858e2244aac5efad99bacdb3 | C++ | yaoReadingCode/Uni_World | /2. adds/list/adds-pe.cpp | UTF-8 | 4,518 | 3.65625 | 4 | [] | no_license | #include<iostream>
using namespace std;
/* General instructions: Please modify this file and submit the modified one
via svn and then websubmission (under the entry "pracExam"). No design
documents or header files are needed. You only need to submit one file,
which is this one.
This exam is marked out of... | true |
95a5044cbcdb04e135489c363128c972654bb534 | C++ | DMU-XMU/PSR-MCTS-Offline | /POSyadmin/POMDP-MCTS/POMDP-MCTS-posy/src/planners/MDPutils.cpp | UTF-8 | 4,004 | 2.65625 | 3 | [] | no_license | #include "MDPutils.h"
#include "utils/utils.h"
namespace MDPutils{
void policyEvaluation(uint S,
uint A,
bool rsas,
double* P,
double* R,
double gamma,
double epsilon,
const uint* PI,
double* V){
assert(gamma > 0);
assert(gamma < 1); // != 1 to guarantee convergence
uint SA = S*... | true |
55891dc28f6dcc3b1169c4703dda4ee6c43b5cd8 | C++ | Tsun4mii/SYO-2020 | /SYO-2020/Generation/GenLib/GenLib.cpp | UTF-8 | 500 | 2.84375 | 3 | [] | no_license | #include<iostream>
extern "C"
{
int __stdcall outnum(int value)
{
std::cout << value;
return 0;
}
int __stdcall outstr(char* ptr)
{
setlocale(LC_ALL, "RUSSIAN");
if (ptr == nullptr)
{
std::cout << std::endl;
}
for (int i = 0; ptr[i] != '\0'; i++)
std::cout << ptr[i];
return 0;
}
int _std... | true |
a7bb1818ea6c89657de2852cd7e96655024d42e8 | C++ | kasuyaazura/FP2020 | /LaboratoriosFunda/Guia 6/Ejercicio_1.cpp | UTF-8 | 1,060 | 3.34375 | 3 | [] | no_license | #include "iostream"
#include "string"
#include "stdio.h"
using namespace std;
/*
Ejercicio #1
*/
int main(){
//declaramos el puntero para que el tamaño sea dinamico
int * numeros = NULL;
int datos,numero;
cout << "Que cantidad de da... | true |
dad066e249396ef34a4c6a08a16ef03a06169c1d | C++ | vsvipul11/Datastructres_CPP | /ARRAYS/Two_sum.cpp | UTF-8 | 652 | 2.984375 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
vector <int> sol(vector<int> &v , int target){
unordered_set<int> s;
vector<int> ans;
for(int i = 0 ; i < v.size() ; i++){
int x = target - v[i];
if(s.find(x) != s.end() ){
ans.push... | true |
bb2c08f3ec400f4a985a76314008a16463304352 | C++ | maashok/CS2 | /spanning_tree/src/binaryHeap.hpp | UTF-8 | 2,804 | 3.796875 | 4 | [] | no_license | #include "star.hpp"
/**
* A binary min-heap so that the stars with lowest distance to source
* are at the top of the heap
*/
class BHeap
{
std::vector <Star *> bheap;
public:
BHeap(std::map<int, Star *> stars, Star *src) {
// Distance from source to source is zero, all other
// distances infinity
s... | true |
2635befd4abc0c7d3c6ef8e35b4977b1a3ebd721 | C++ | smzztx/Cpp_Concurrency_In_Action | /testcode/chrono_test.cpp | UTF-8 | 374 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <chrono>
#include <unistd.h>
int main()
{
auto start = std::chrono::high_resolution_clock::now();
sleep(1);
auto end = std::chrono::high_resolution_clock::now();
std::cout << "in seconds time:";
std::chrono::duration<double,std::ratio<1,1>> duration_s(end-start);
std::cout << durati... | true |
b8408e43e4e9b093ded896f6a465961ddb521751 | C++ | jsanchez97/Assignment-5-Abstract-Class-and-Command-Line-Parameters | /main.cpp | UTF-8 | 5,311 | 3.890625 | 4 | [] | no_license | /******************************************************************************
* AUTHOR : Jesus Sanchez
* STUDENT ID : 1024834
* ASSIGNMENT #5 : Abstract Classes and Command Line Parameters
* CLASS : CS1C
* SECTION : MW: 1:30pm
* DUE DATE : 02/27/2017
* ************************************... | true |
9fa1fe675450d99feeac4d55d9de65d2e68348ae | C++ | lauedoucet/BlackJack | /main.cpp | UTF-8 | 1,524 | 3.34375 | 3 | [] | no_license | /*
Copyright 2020, Laurence Doucet, All rights reserved
*/
#include "blackjack.h"
using namespace std;
int main()
{
cout << "\t Welcome to the COMP322 Blackjack game!" << endl << endl;
/**************Game set up************************/
BlackJackGame game;
HumanPlayer player = HumanPlayer();
... | true |
b17ec78a0ab337334d35990b49c30c91b9d0c03a | C++ | chaidamu519/Algorithms | /C++/Character_Sequences/Project2/Project2/Source2.cpp | UTF-8 | 430 | 2.984375 | 3 | [] | no_license | #include<iostream>
#include<string.h>
#include<ctype.h>
using namespace std;
int main() {
char s1[80], s2[80];
char result;
cin.getline(s1, 80);
cin.getline(s2, 80);
int i = 0;
while (s1[i] != '\0' && (tolower(s1[i]) == tolower(s2[i]))) {
i++;
}
if (tolower(s1[i]) > tolower(s2[i])) {
result = '>';
}
e... | true |
f2ed6343f31bb0c47be3d842f880d9c8ca0fdd77 | C++ | mrowqa/siktacka | /common/network/UdpSocket.cpp | UTF-8 | 1,288 | 3.015625 | 3 | [] | no_license | #include <common/network/UdpSocket.hpp>
#include <cassert>
constexpr std::size_t max_datagram_size = 512;
Socket::Status UdpSocket::init(HostAddress::IpVersion ip_ver) noexcept {
return Socket::init(ip_ver, SOCK_DGRAM);
}
Socket::Status UdpSocket::send(const std::string &data, const HostAddress &dst_addr) no... | true |
72d2b5b8ab09d257f8b2962c0a7dbb532472dfa6 | C++ | scintillavoy/baekjoon-online-judge | /2292.cc | UTF-8 | 202 | 2.65625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
--N;
int distance;
for (distance = 1; N > 0; ++distance) {
N -= distance * 6;
}
cout << distance;
return 0;
}
| true |
5cdcb03e33db25b6638b1ba33dfabb82aefe2ca2 | C++ | zghanxiao/algorithm_finished_china | /advanced_algorithm/bytedance/SearchInRotatedArray_ck.cpp | UTF-8 | 1,379 | 3.515625 | 4 | [] | no_license | class Solution {
public:
/**
* @param A: an integer rotated sorted array
* @param target: an integer to be searched
* @return: an integer
*/
bool check(vector<int> & A, int index, int left, int right, int target) {
if (A[left] > A[right]) {
if (A[index] >= A[left]) {
... | true |
bf4f112406b4a2cc613665815121701727c84854 | C++ | haphuongn739/code | /baitapchuong3/unit1.cpp | UTF-8 | 806 | 3.703125 | 4 | [] | no_license | /* Name : Nguyen Thi Ha Phuong
Bai 1 : Viết chương trình đọc vào 2 số nguyên và in ra kết quả của phép (+), phép trừ
(-), phép nhân (*), phép chia (/). Nhận xét kết quả chia 2 số nguyên.
....
*/
#include <iostream>
using namespace std;
void main()
{
//Khai bao bien
int nNum1 = 0;
int nNum2 = 0;
int nTong = 0;
... | true |
4bd7075d48e1e9a9736c945a2500f0ee7c17cbcd | C++ | kiddos/notes | /codeforces/1700~1799/1766/d.cc | UTF-8 | 951 | 2.71875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
constexpr int MAX_VAL = 1e7;
vector<int> min_div(MAX_VAL+1);
void precompute() {
iota(min_div.begin(), min_div.end(), 0);
for (int i = 2; i <= MAX_VAL; ++i) {
if (min_div[i] != i) continue;
for (int j = i*2; j <= MAX_VAL; j += i) {
min_div[j] = i;
... | true |
1fbf8ea52c219a55c8189e21cbd6e62ff3ed54c4 | C++ | lmh760008522/ProgrammingExercises | /校程序设计比赛/c_ans.cpp | GB18030 | 1,223 | 3.09375 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int f[21][2001];
int n,a[21],b[21];
void input(){
cin>>n;
for(int i=1;i<=n;++i){
cin>>a[i]>>b[i];
}
}
/*
:n,ҪABɡÿABɣʱֱΪaibi
еҪʱ䡣
ǿp(i,j)ʾǰiAjʱBp(i,j)ʱɡ
ƷҲˣiɵi-1ƳģôiABɣ
AɣУp(i,j) = p(i-1,j-Ai) (Bʱ䲻䣩
BɣУp(i, j) = p(i-1,j)+ B... | true |
33d6a3c972dc6a376737c4935a04e82fc9199628 | C++ | oMalyugina/olimpiad_programming | /olimpiads/19-20/1777.cpp | UTF-8 | 3,260 | 2.96875 | 3 | [] | no_license | //
// Created by Olga Malyugina on 05.02.21.
//
#include <iostream>
#include <time.h>
#include <random>
#include <vector>
using namespace std;
void print(const vector<vector<int>> & map){
for (int i = 0; i < map.size(); ++i) {
for (int j = 0; j < map[0].size(); ++j) {
cout << map[i][j] << " ";... | true |
da323dae51fd8e2355e49f2bc61edd6201f9f289 | C++ | m4yers/mini-apple-debugger | /include/MAD/Prompt.hpp | UTF-8 | 4,925 | 2.65625 | 3 | [
"MIT"
] | permissive | #ifndef PROMPT_HPP_5CZETNAV
#define PROMPT_HPP_5CZETNAV
// Std
#include <deque>
#include <map>
#include <memory>
#include <string>
#include <vector>
// Prompt
#include "args/args.hxx"
#include "linenoise/linenoise.h"
// MAD
#include <MAD/Error.hpp>
namespace mad {
//------------------------------------------------... | true |
2536655a364488d9a6646237eec9db7cf5d38530 | C++ | SirRamEsq/LEngine | /Source/Engine/Components/CompPosition.cpp | UTF-8 | 9,834 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | #include "CompPosition.h"
#include "../Errorlog.h"
#include "math.h"
///////////
// MapNode//
///////////
MapNode::MapNode() { mParent = NULL; }
MapNode::~MapNode() {}
void MapNode::SetParent(MapNode *parent) {
if (mParent == NULL) {
mParent = parent;
if (parent == NULL) {
return;
}
positionL... | true |
103b0cf3c4b3bf958fe9df6792bd44b4e8d23075 | C++ | lyswty/nowcoder-solutions | /剑指offer/扑克牌顺子.cpp | UTF-8 | 436 | 2.9375 | 3 | [] | no_license | class Solution {
public:
bool IsContinuous( vector<int> numbers ) {
if (numbers.size() < 5) return false;
int _max = 0, _min = 14;
unordered_map<int, bool> vis;
for (int x: numbers){
if (!x) continue;
if (vis[x]) return false;
vis[x] = true;
... | true |
eee42efffc18594533f66a9bc2731d1b47c0bfa3 | C++ | reznikovkg/nm-array | /include/nm-array-class.h | UTF-8 | 1,153 | 2.890625 | 3 | [] | no_license | #ifndef IPN_ARRAY__CLASS_H
/*
Author: reznikovkg
GitHub: https://github.com/reznikovkg
Email: kosrez1@yandex.ru
File: include/nm-array-class.h
GitHub Repository: https://github.com/reznikovkg/nm-array
*/
#define IPN_ARRAY__CLASS_H
#include <iostream>
using namespace std;
//class array for points on decard sy... | true |
c6314c1f9d0b478adf91fc5da21b2065cd6f112a | C++ | VasTsak/data-structures-algs | /CPP/foundations/basics/1.Basics/4_iomanip_module.cpp | UTF-8 | 395 | 3.6875 | 4 | [] | no_license | #include<iostream>
#include<iomanip>
int main()
{
std::cout<<"\n The text without any formatting \n";
std::cout<<"Ints"<<"Floats"<<"Doubles"<<"\n";
std::cout<<"\n The text with setw(15):\n";
std::cout<<"Ints"<<std::setw(15)<<"Floats"<<std::setw(15)<<"Doubles"<<"\n";
std::cout<<"\n The text with tab... | true |
38e7185e34039beeaf40aa2b0b3582c9d744796c | C++ | leejunwoo0202/1-2-CPLUSPLUS | /8-3/HMean.cpp | UHC | 588 | 3.484375 | 3 | [] | no_license | #include <iostream>
using namespace std;
double hmean(double a, double b)
{
if (a == -b) //
throw "ȭ !";
return 2.0 * a * b / (a + b);
}
int main(int argc, char* argv[])
{
double x, y, z;
cout << " ԷϽÿ:";
while (cin >> x >> y)
{
try {
z = hmean(x, y);
}
catch(const char* s){ // ó
cout << ... | true |
09e07ddf6520d70b63c564a26952d9253d84b5d2 | C++ | baid14/MetodyObliczeniowe | /Metody_roznicowe_r_zwyczajne/Metody_roznicowe_r_zwyczajne/main.cpp | UTF-8 | 5,049 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <Windows.h>
#include <fstream>
#include <math.h>
using namespace std;
double wzor_analityczny( double t )
{
return 1 - exp( -10.0 * ( t + atan( t ) ) );
}
double metoda_bezposrednia_eulera( double krok, int N )
{
double blad = 0.0, t = krok;
double y = 0.0; //warunek poczatkowy y(0) =... | true |
57f99f6ae6bde1e64e72917aa2cd06cc66be89f3 | C++ | RadioGeek/Fireball_v5 | /morse.cpp | UTF-8 | 3,788 | 2.890625 | 3 | [] | no_license | // ==========================================================================================//
// Fireball v5.0 source code
// Copyright 2015 by John Maca, AB5SS, all rights reserved.
// ==========================================================================================//
//
// This module contains the functio... | true |
44a831dd6809c62926a7df12f8d02d487578ee72 | C++ | TopHK/LeetCode-Mine | /PalindromePartitioningII.cpp | UTF-8 | 2,169 | 3.15625 | 3 | [] | no_license | /*************************************************************************
> File Name: palindromePartitioning.cpp
> Author:
> Mail:
> Created Time: 2015年06月27日 星期六 19时41分35秒
************************************************************************/
#include<iostream>
#include<vector>
#include<string>
#include<l... | true |
55d99fb4a3bfe337a878da3afc6614443db24dbd | C++ | federicoemartinez/algo3-2008 | /tp1/CD/ejercicio1/src/main.cpp | UTF-8 | 2,557 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <assert.h>
#include <math.h>
#include "FabricaCandidatos.h"
using namespace std;
void primoDeMayorPotencia(int n, int& primo, int& potencia) {
assert(n > 1);
int mejorPrimo = 1;
int mejorPotencia = 0;
FabricaCandida... | true |
7077ad704461a41b092352aeabe0b34a106cee3a | C++ | lock19960613/SCL | /Daily/CPP/Leetcode575-分糖果.h | UTF-8 | 236 | 2.8125 | 3 | [] | no_license | class Solution {
public:
int distributeCandies(vector<int>& candies) {
unordered_set<int> candy;
for(auto i:candies){
candy.insert(i);
}
return min(candy.size(),candies.size()/2);
}
}; | true |
45ba6fb65101b8ad898eea6f7164c7d5c4ed28b1 | C++ | harryking001/JZoo | /ArchiveFile.h | GB18030 | 3,176 | 3.25 | 3 | [] | no_license | #pragma once
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <iterator>
#include "Zoo.h"
using std::endl;
using std::ifstream;
using std::ofstream;
using std::stringstream;
using std::string;
using std::size_t;
/**
* 浵ļ࣬ͱ涯Ϣ
* Archieve file class which used to load ... | true |
8fc9ebb4820340ba3f6c7c54f3c334f993a591e0 | C++ | viacheslavpleshkov/unit-factory-ucode-half-marathon-cpp | /sprint06/t00/app/src/AbstractWizard.h | UTF-8 | 1,083 | 3.28125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Food.h"
#include <iostream>
#include <map>
class AbstractWizard {
protected:
virtual void deductFoodType(FoodType food) = 0;
};
class MightyWizard : public AbstractWizard {
public:
MightyWizard(std::string &&name) : m_name(name) {};
void checkFood(FoodItem *foodPtr) {
if (... | true |
8ae32f35cc2c1e766e275a75b7d97a4a517cf822 | C++ | s011075g/Playground | /WestWorld/Miner.h | UTF-8 | 961 | 2.671875 | 3 | [] | no_license | #pragma once
#include "Actor.h"
#include "Locations.h"
//Definition declared else where
class State;
#define COMFORT_LEVEL 5u;
#define MAX_NUGGETS 3u;
#define THIRST_LEVEL 5u;
#define TIREDNESS_THRESHOLD 5u;
class Miner : public Actor
{
private:
State* _mCurrentState;
Locations _mCurrentLocation;
uint _mGold;
... | true |
974e63a65b4adfb480231c8304b1f0f7f837e3c6 | C++ | dimitarkole/CPlusPlusTasks | /C++/cake.cpp | UTF-8 | 898 | 2.8125 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int height,width;
cin>>height>>width;
long scqire=height*width;
//cout<<"scqire= "<<scqire<<endl;
char ch;
long letter;
do{
cin>>ch;
letter=ch-'0';
if ((letter>=0)&&(letter<=9))
{
... | true |
17b7feade9f9dfbfd7ccfcc1841dccf60bef9d9d | C++ | Hana897TRX/Astrologia3D | /Moon.cpp | UTF-8 | 1,460 | 2.515625 | 3 | [] | no_license | #include <windows.h>
#include <GL/gl.h>
#include <glut.h>
#include <time.h>
#include <math.h>
//###################
#include "Planet.h"
#include "Moon.h"
#include "Disk.h"
//###################
static RGBpixmap myText[1];
static GLuint name[1];
void Moon::SetTexture(char * file) {
glGenTextures(1, name);
myText[0]... | true |
3d173592b6e9968362e3afb1733fd8ee38dfb975 | C++ | AvansMartijn/Game-Engine | /GameEngine/AbstractUiElement.h | UTF-8 | 1,428 | 2.703125 | 3 | [] | no_license | #pragma once
#ifdef GAMEENGINE_EXPORTS
#define GAMEENGINE_AbstractUiElement __declspec(dllexport)
#else
#define GAMEENGINE_AbstractUiElement __declspec(dllimport)
#endif
#include "Window.h"
#include "Rect.h"
#include <functional>
/// <summary>
/// Element to be rendered on the screen.
/// </summary>
class Window;
clas... | true |
4f7e755fe84a8f9c1d1bb44054de1a94085ea8fd | C++ | ssynn/PAT_advanced | /1038. Recover the Smallest Number .cpp | UTF-8 | 676 | 2.671875 | 3 | [] | no_license | #include"stdafx.h"
#include<iostream>
#include<string>
#include<map>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
bool cmp(string a, string b)
{
return a+b < b+a;
}
int main()
{
int n,i=0,flag=0;
cin >> n;
vector<string>val(n);
for (int i = 0; i < n; i++)
cin >> val... | true |
eccde9d2d66621c8264abad3c66986690d5964e8 | C++ | dcauz/opus | /elf/dis_2.h | UTF-8 | 10,653 | 2.78125 | 3 | [] | no_license |
const char * dis_20(const char * code, unsigned prefix)
{
std::string op1;
std::string op2;
if( ( prefix & VEX ) == 0 )
{
if(code[1] == 0x25)
code = imm_reg_ops( code, prefix, 0, 32, true, op1, op2 );
else
code = mod_reg_rm_ops( code, prefix, OpRegs::AL, 0, op1, op2 );
printf( ... | true |
b3a83415db8fef400a19330a6cba37217e4dd51b | C++ | YuliangCai/gmapping_navigation | /src/save_client.cpp | UTF-8 | 1,680 | 2.796875 | 3 | [] | no_license | #include <ros/ros.h>
#include <gmapping_navigation/mark_location.h>
#include <iostream>
#include <std_msgs/String.h>
#include <std_msgs/Bool.h>
//the code is to create a subscriber/sericeclient to save the input location and data
//define a serviceclient pointer to use in the callback
ros::ServiceClient *clientPtr;
r... | true |
46055c7629d321b7f91d20663c37ed74598f87d1 | C++ | jonigata/caper | /caper/samples/cparser/Main.h | UTF-8 | 3,188 | 3.171875 | 3 | [
"LicenseRef-scancode-public-domain",
"BSD-3-Clause"
] | permissive | #ifndef MAIN_H_
#define MAIN_H_
////////////////////////////////////////////////////////////////////////////
// CR_DeqSet<ITEM_T> -- deque and set
template <typename ITEM_T>
class CR_DeqSet : public std::deque<ITEM_T>
{
public:
CR_DeqSet()
{
}
CR_DeqSet(const CR_DeqSet<ITEM_T>& vs) : std::deque<ITEM_... | true |
7147f909e8ea5d5ab80ebdc23336dda8458e07e3 | C++ | victor-timoshin/Switch | /src/Switch.System/include/Switch/System/Media/SystemSound.hpp | UTF-8 | 1,497 | 2.65625 | 3 | [
"MIT"
] | permissive | /// @file
/// @brief Contains Switch::System::Media::SystemSound class.
#pragma once
#include <Switch/Is.hpp>
#include <Switch/Types.hpp>
#include <Switch/System/Object.hpp>
#include "../../SystemExport.hpp"
/// @cond
struct __opaque_sound_access__;
/// @endcond
/// @brief The Switch namespace contains all fundament... | true |
0ce137dbfb076cf9df7d66cabaae5cc6ec49c6d7 | C++ | riverraft/MCCI-Catena-HS300x | /src/Catena-HS300x.h | UTF-8 | 5,722 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
Module: Catena-HS300x.h
Function:
Definitions for the Catena library for the IDT HS300x sensor family.
Copyright and License:
See accompanying LICENSE file.
Author:
Terry Moore, MCCI Corporation June 2019
*/
#ifndef _CATENA_HS300X_H_
# define _CATENA_HS300X_H_
# pragma once
#include ... | true |
9018d70e52a055f4de7fe37ee6d5c26d0f568a13 | C++ | AJAbanto/KinectXRobot | /arduino/Community_robot_firmware/robotArm_v0.41/byj_gripper.cpp | UTF-8 | 2,363 | 2.953125 | 3 | [
"MIT"
] | permissive | #include "byj_gripper.h"
#include <Arduino.h>
BYJ_Gripper::BYJ_Gripper(int pin0, int pin1, int pin2, int pin3, int steps){
grip_steps = steps;
byj_pin_0 = pin0;
byj_pin_1 = pin1;
byj_pin_2 = pin2;
byj_pin_3 = pin3;
step_cycle = 0;
pinMode(byj_pin_0, OUTPUT);
pinMode(byj_pin_1, OUTPUT);
pinMode(byj_pi... | true |
fc9f5aee47a1f2c3cddb3f510c8c3286697fca06 | C++ | eddiebarry/cp_code | /saving_universe.cpp | UTF-8 | 4,183 | 2.671875 | 3 | [] | no_license | #include<queue>
#include<stack>
#include<set>
#include<iostream>
#include<unordered_map>
#include<vector>
#include<list>
#include<climits>
#define INF 0x3f3f3f3f
#define FOR(i, j, k, in) for (long i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (long i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i... | true |
93a9cca5bb7a764366c8a903457d2f3cdcc7419a | C++ | maverick439/DataStructures | /Greedy/MaxMin.cpp | UTF-8 | 531 | 2.78125 | 3 | [] | no_license | //https://www.hackerrank.com/challenges/angry-children/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=greedy-algorithms
#include <bits/stdc++.h>
using namespace std;
// Complete the maxMin function below.
int maxMin(int k, vector<int> arr) {
int n = arr.size();
sort(... | true |
627c53523d908984f6722581681bf89fbee9ba40 | C++ | MeteorIOT/Equipo1 | /Veleta/viento-veleta/viento-veleta.ino | UTF-8 | 843 | 2.578125 | 3 | [] | no_license | int sumaVeleta=0;
const byte pinDireccion = A2; //pin Analógico
int direccion = 0;
int tiempoEnvio=30;
int leerDireccion(int suma){
suma=suma/tiempoEnvio;
if(suma>=415 && suma< 440) return 0;
if(suma>=440 && suma< 490) return 45;
if(suma>=490 && suma< 510) return 90;
if(suma>=540 && suma< 550) r... | true |
d1e2433cbc48439db0219cb2e8c18d588abb7b7f | C++ | juliocmontes/bcc_course | /Lab 1/lab1_distancebtwnpoints.cpp | UTF-8 | 811 | 3.84375 | 4 | [] | no_license | /*
Title: Lab 1 - Distance Between Points
Author: Julio Montes
Date: 08.29.19
Description: prints the distance between coordinates
*/
#include <iostream>
#include <cmath>
#include <sstream>
using namespace std;
int main()
{
int x1, x2, y1, y2, result;
// comment in/out below to ask for input
x1 = 2;
... | true |
56f4c5ed86ffc5ea8ed443aa22e41686826779b5 | C++ | TraceIvan/backup-copy-of-my-acm-code | /TINA集训(九)/51Nod 1202 子序列个数.cpp | GB18030 | 1,018 | 2.640625 | 3 | [] | no_license | //dp[i] = (dp[i - 1] * 2 + 1) % MOD; Ԫ״γ
//dp[i] = (dp[i - 1] * 2 - dp[pos[val[i]] - 1] + MOD) % MOD; Ԫط״γ
#include<iostream>
using namespace std;
const int maxn = 100010;
const int MOD = 1e9 + 7;
int num[maxn];
long long dp[maxn];
int vis[maxn];
int main()
{
int n;
while (~scanf("%d",&n))
{
for (in... | true |
9bcf765cbc0f7bf50357cf73bd85ec077aa1b039 | C++ | MDOBreno/BMOAulasCpp28TheNewKeywordInCpp | /BMOAulasCpp28TheNewKeywordInCpp/main.cpp | UTF-8 | 2,483 | 4.1875 | 4 | [] | no_license | //
// main.cpp
// BMOAulasCpp28TheNewKeywordInCpp
//
// Created by Breno Medeiros on 10/06/21.
//
#include <iostream>
#include <string>
//Lembrando que 'new' instancia em um construtor(outro escopo que não é o que o new está escrito), e retorna
// um ponteiro pra instancia. Lembre-se tb que, como 'new' aloca no 'H... | true |
bf5dfb6158d8d6b623f742a03e4095701c10f5c2 | C++ | jsbien/rcin-index4djvu | /METS/fiszki/cards.cpp | UTF-8 | 3,906 | 2.671875 | 3 | [] | no_license | #include "cards.h"
Cards::Cards()
{
}
void Cards::parse(const QString &filename)
{
Card card;
if (card.parse(filename))
m_cards.append(card);
else qDebug() << "Error parsing" << filename;
}
void Cards::sort()
{
qStableSort(m_cards);
for (int i = 0; i < m_cards.count(); i++)
m_cards[i].setSequence(i+1);
}
v... | true |
09090df3d1b1962bf72a8a7558e6f1ce5b446acc | C++ | bbb125/leetcode | /august-2021-challenge/max-product-of-splitted-binary-tree/main.cpp | UTF-8 | 2,985 | 3.53125 | 4 | [] | no_license | #include <gtest/gtest.h>
#include <gmock/gmock.h>
/**
* url:
* https://leetcode.com/explore/challenge/card/august-leetcoding-challenge-2021/615/week-3-august-15th-august-21st/3903/
* problem:
* Given the root of a binary tree, split the binary tree into two subtrees by
* removing one edge such that the product of ... | true |
7de0dae6a7546d08201e902c99013b07450c93d7 | C++ | Phuocpr1998/HeDieuHanh | /Source/nachos-3.4/code/threads/FileManage.h | UTF-8 | 1,162 | 2.796875 | 3 | [
"MIT-Modern-Variant"
] | permissive | #ifndef _FILEMANAGE_H
#define _FILEMANAGE_H
#include "copyright.h"
#define MAXFILE 10
class OpenFile;
struct FileCustom {
OpenFile* file;
int type;
int pos;
};
class FileManage {
private:
FileCustom** arrayFile;
int size;
public:
FileManage(int maxFile);
// trả về vị trí còn trống (ID)
// nếu không còn vị ... | true |
e4848f84806b324587a36e04fc5bd83ba165e3f3 | C++ | hexu1985/Data.Structures.With.Cpp | /include/spooler.h | UTF-8 | 4,307 | 3.40625 | 3 | [] | no_license | #include <iostream.h>
// include the random number generator and LinkedList class
#include "random.h" // simulate print times
#include "link.h"
// printer speed is 8 pages per minute
const int PRINTSPEED = 8; // pages per minute
// record containing information for each print job
struct ... | true |
e9fdff8b0a335a02d163213febffff6b976bf87f | C++ | Muneeb147/Data-Structures | /PA4/check.cpp | UTF-8 | 9,672 | 2.984375 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <vector>
#include "list.cpp"
#include <cstdlib>
using namespace std;
class HashC
{
protected:
long int tableSize;
int collisions;
int a;
public:
List<long>*hashTable;
HashC()
{
hashTable=new List... | true |
cec2d12237208eb678d2fa678d2cf936a458f0fa | C++ | harmonilarrabee/C_Tutorials | /function/inputPower.cpp | UTF-8 | 588 | 3.78125 | 4 | [] | no_license | #include <stdio.h>
int power(int m, int n);
/*computes exponential input in the form [single-digit, positive base]^[single-digit, positive exponent]*/
main()
{
int c, base, exp, i;
c = getchar();
if (c >= '0' && c <= '9')
base = c - '0';
else
printf("invalid input\n");
c = getchar();
c = getchar();
if (... | true |
69db57b3e00c709fa8af94951aeb801bcba81404 | C++ | abersailbot-archive/bottleboat-boaty-mcboatface | /TheControlSystem/TheControlSystem.ino | UTF-8 | 2,209 | 2.9375 | 3 | [] | no_license | #include <Wire.h>
#include <Servo.h>
int HMC6352Address = 0x42;
int slaveAddress = HMC6352Address >> 1;
int compassOffset = 120;
const int MIDPOINT = 96;
const int RANGE = 30;
int DESIREDHEADING = 50;
const int SPEED = 128;
Servo rudder;
void setup() {
Serial.begin(9600);
rudder.attach(9);
Wire.begin();
d... | true |
df00db8126d9cfbde4f648ebc9fc7358f5024f65 | C++ | Linzertorte/LeetCode | /RemoveDuplicatesFromSortedList.cpp | UTF-8 | 619 | 3.28125 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *deleteDuplicates(ListNode *head) {
// IMPORTANT: Please reset any member data you declared, as
// the same... | true |
faae200b4392af3182a450cd3bb9e8402715c04d | C++ | KyleNBurke/openGLGame | /src/engine/math/quaternion.cpp | UTF-8 | 2,176 | 3.3125 | 3 | [] | no_license | #include "quaternion.hpp"
#include "vector3.hpp"
#include "euler.hpp"
#include <cmath>
Quaternion::Quaternion() : Quaternion(0, 0, 0, 1) {}
Quaternion::Quaternion(float x, float y, float z, float w) : x(x), y(y), z(z), w(w) {}
Quaternion::Quaternion(const Quaternion& q) : Quaternion(q.x, q.y, q.z, q.w) {}
Quaternio... | true |
3279ddef0eb3fcc8738006062ea29659431bcacc | C++ | micamarietta/assignment4 | /queue.hpp | UTF-8 | 1,042 | 3.5 | 4 | [] | no_license | #include <iostream>
#include "DoublyLinkedList.hpp"
using namespace std;
template<typename t>
class queue{
public:
queue(){
//nothing yet
}
queue(int maxSize){
list = new DoublyLinkedList<t>[maxSize];
mSize = maxSize;
front = 0;
rear = -1;
numElements = 0;
}
~queue(){
delete lis... | true |
cf939db323514fe76dddf7b917e8e36863ad2233 | C++ | skyleet/Arduino | /INO Codes/manish/manish.ino | UTF-8 | 1,106 | 2.578125 | 3 | [] | no_license | const int numReadings = 10;
int readings[numReadings];
int readIndex = 0;
int total = 0;
int average = 0;
int inputPin = A0;
unsigned long previousMillis = 0;
const long interval = 1000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A0, INPUT);
pinMode(13, OUTPUT);
fo... | true |
b9ed1ce60f4c31fc4bd65efefdda21d2d0faebec | C++ | daibiaoxuwu/PM3 | /plane.cpp | UTF-8 | 1,097 | 2.5625 | 3 | [] | no_license | #include "plane.h"
#include <cmath>
Plane::Plane() : Primitive() {
}
void Plane::Input( std::string var , std::stringstream& fin ) {
if ( var == "N=" ) N.Input( fin );
N = N.GetUnitVector();
if ( var == "R=" ) fin >> R;
if ( var == "Dx=" ) Dx.Input( fin );
if ( var == "Dy=" ) Dy.Input( fin );
P... | true |
15a325a41819346f7cbe82fc67db975518103259 | C++ | codingsunchen/simpleChat | /ser/pthread.cpp | UTF-8 | 3,941 | 2.546875 | 3 | [] | no_license | #include"pthread.h"
#include "control.h"
#include "public.h"
#include <assert.h>
#include <event.h>
#include <jsoncpp/json/json.h>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <iostream>
#include <string.h>
#include <functional>
#include <algorithm>
using namespace std;
extern Control control_sever;
... | true |
f8b9f79e61a051ee3e68f66ef6360a18b309fa5c | C++ | Xuchaoxiong/homework-of-data-structure | /作业/第五次专题实验之寻找指缝/pixelFunction.cpp | GB18030 | 3,005 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | /*
* pixelFunction.cpp
*
* Created on: 20141219
* Author: kohill
* ȨûУӭð
*/
#include <cstddef>
#include <stdint.h>
#include <iostream>
#include <windows.h>
/*ͼ*/
typedef struct {
uint32_t x;
uint32_t y;
} Coordinate;
/*
* @Function: findStartPixel
* @Description:Ѱҿʼ
* @param
* @return ɹشַΪNU... | true |
7855aa04ee97851d27048a7eb49ee1db7493ff09 | C++ | IamFlowZ/Cracking-The-Coding-Interview-Anwsers | /Stacks&Queues/StackWithMin/StackWithMin/StackWithMin/Stack.cpp | UTF-8 | 642 | 3.21875 | 3 | [] | no_license | #include "stdafx.h"
#include "Stack.h"
Stack::Stack()
{
}
void Stack::push(Node n)
{
if (n.value < min_value->value)
{
min_value = &n;
n.next = top;
top = &n;
count++;
}
else
{
top = &n;
count++;
}
}
Stack::Node Stack::pop()
{
Node temp = *top;
if (top == min_value)
{
Node* new_min = temp.nex... | true |
42b383ce638c2e22283597f883e36953e061a074 | C++ | zxlwbi199101/ACM | /1003 Hangover.cpp | UTF-8 | 1,410 | 4.0625 | 4 | [] | no_license | /*
http://poj.org/problem?id=1003
Description
How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum
overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.)
With two cards you can make the top card overhang the bottom... | true |
70146c3eff0539ea868755af5485282a52fd86c2 | C++ | Fateha9106/Computer-Graphics | /home.cpp | UTF-8 | 1,227 | 2.6875 | 3 | [] | no_license | #include <GL/gl.h>
#include <GL/glut.h>
void display(void)
{
/* clear all pixels */
glClear (GL_COLOR_BUFFER_BIT);
/* draw white polygon (rectangle) with corners at
* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)
*/
glColor3ub (204,102,0);
glBegin(GL_POLYGON);
glVertex2d (150,800);
glVertex2d (250,800);
glVertex... | true |
b1065a8bc6ee4433c953d06eaffdefcaabdc295f | C++ | sandeepshiven/cpp-practice | /hashing/count distinct/better.cpp | UTF-8 | 455 | 3.265625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int s,temp;
cout << "Enter the size of the array: ";
cin >> s;
unordered_set<int> arr;
cout << "Enter the elements of the array: ";
for(int i=0; i < s; i++){
cin >> temp;
arr.insert(temp);
}
cout<< "There are "<<... | true |
fbabf75ba5d50626fe3310fc171d27bba46581af | C++ | linuxmap/nazhiai | /shortvideo/MuxCleanService/Server/Configuration.h | UTF-8 | 616 | 2.578125 | 3 | [] | no_license |
#ifndef _CONFIGURATION_HEADER_H_
#define _CONFIGURATION_HEADER_H_
#include <string>
class Configuration
{
public:
static bool Load(std::string& err);
static void Unload();
public:
struct ActionInfo
{
int hostid = 0;
std::string host = {};
std::string root = {};
int f... | true |
c3856c73502f32f0c80e5c9dbcac867931401865 | C++ | CartoDB/mobile-sdk | /all/native/datasources/TileDownloadListener.h | UTF-8 | 1,387 | 2.671875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright (c) 2016 CartoDB. All rights reserved.
* Copying and using this code is allowed only according
* to license terms, as given in https://cartodb.com/terms/
*/
#ifndef _CARTO_TILEDOWNLOADLISTENER_H_
#define _CARTO_TILEDOWNLOADLISTENER_H_
#include "core/MapTile.h"
#include <memory>
namespace carto {
... | true |
5502c6484a630b3644c720231ea0d9e1697995bb | C++ | carrascomj/disopred | /src/weights.cpp | UTF-8 | 1,072 | 2.546875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain"
] | permissive | #include "weights.h"
#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
const float Weights::A =-2.01;
const float Weights::B =1.63;
const float Weights::A2=-2.00;
const float Weights::B2=2.1535;
const float Weights::M2= 0.0783;
const float Weights::C2= 0.104;
long double* Weights::read_... | true |
bc985219ef7100187fee073428021805877cb7b0 | C++ | Tiriree/TiriWhitney_TY | /allTESTcode/testingCode/capacitiveTouch/capacitiveTouch.ino | UTF-8 | 1,692 | 2.859375 | 3 | [] | no_license | #include <ADCTouch.h>
int ref0, ref1, ref2, ref3, ref4; //reference values to remove offset
void setup()
{
// No pins to setup, pins can still be used regularly, although it will affect readings
Serial.begin(9600);
ref0 = ADCTouch.read(A0, 500); //create reference values to
ref1 = ADCTouch.read(A1, 5... | true |
208177b271160296fe3b048d1eb368644bd1f61c | C++ | GabMeloche/Networking | /UDP/Main/Main.cpp | UTF-8 | 707 | 3.09375 | 3 | [] | no_license | #include <Client.h>
#include <Server.h>
#define PORT 8755
int main()
{
std::string option;
std::getline(std::cin, option);
if (option == "s")
{
std::cout << "server selected\n";
Server* server = RunServer();
while (true)
{
std::string ip;
std::getline(std::cin, ip);
std::cout << "people connec... | true |
f628ec113cde31a5221705a4b35c5d20f3390960 | C++ | cgramming/Checkers | /main.cpp | UTF-8 | 1,456 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include<conio.h>
#include <windows.h>
using namespace std;
char a[33]={' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
int c[42]={8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8,... | true |
5806899b096a93763c1c40afc3663a80c7791286 | C++ | Caceresenzo/42 | /CPP Modules/05/ex02/Bureaucrat.cpp | UTF-8 | 4,433 | 2.96875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Bureaucrat.cpp :+: :+: :+: ... | true |
10301780f4d0f8f846ce18d5fc29d86b17d6a9d8 | C++ | jk983294/CommonScript | /cpp/lib/protobuf/add_person.cc | UTF-8 | 2,002 | 2.828125 | 3 | [] | no_license | #include <google/protobuf/util/time_util.h>
#include <ctime>
#include <fstream>
#include <iostream>
#include <string>
#include "addressbook.pb.h"
using namespace std;
using google::protobuf::util::TimeUtil;
// Main function: Reads the entire address book from a file,
// adds one person based on user input, then ... | true |
0c0c6e332a536ef327d61776c2b7cc89d6f35ea5 | C++ | juicyluv/Tanks | /Tanks/Entities/Tank.h | UTF-8 | 870 | 2.828125 | 3 | [] | no_license | #ifndef TANK_H
#define TANK_H
#include "../States/State.h"
#include "../Projectiles/StandartBullet.h"
enum class TankType
{
Player = 0,
Enemy
};
class Tank : public Entity
{
public:
Tank(ResourceHolder<sf::Texture, Textures>* textures,
std::vector<Projectile*>* projectiles);
virtual ~Tank();
virtual void r... | true |
4e22ea5b0fe50c853fa0729c3af2e4af423c6c7a | C++ | Blizzard-Code/DateStruct | /8.cpp | UTF-8 | 406 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
struct Student
{
int sid;
char name[200];
int age;
};
void f(struct Student* pst)
{
(*pst).sid = 20;
pst->age = 20;
strcpy(pst->name, "zs");
}
void g(struct Student* pst)
{
printf("%d %s %d", pst->age, pst->name, pst->sid);
}
int main()
{
struct ... | true |
1add6d1e44cab31e7cef9adff81e28dba17e1d5b | C++ | ivanovdimitur00/programs | /Programs/zadachi praktikum 4/guess the card.cpp | UTF-8 | 384 | 3.046875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
string Cards[13] = {"2","3","4","5","6","7","8","9","10","Jack","Queen","King","Ace"};
string Paints[4] = {"Of Clubs","Of Diamonds","Of Hearts","Of Spades"};
int card_guess;
cin>>card_guess;
card_guess--;
cout<<Cards[card_guess%13]<<" ";
... | true |
1d859032806ca4f19d7cdea9f365d5670280bd94 | C++ | mholtkamp/SuperKappaKatBallParty2Deluxe3D | /Source/Library.Desktop.Test/AttributedTest.cpp | UTF-8 | 13,107 | 2.59375 | 3 | [] | no_license | #include "pch.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace FieaGameEngine;
using namespace TestingUtilities;
namespace LibraryDesktopTest
{
TEST_CLASS(AttributedTest)
{
public:
TEST_METHOD_INITIALIZE(Initialize)
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF);
_CrtMemCheckpoi... | true |
5a9a6e34ad50b51dd6c40b3c9b9aaa0404cbc85e | C++ | ztk4/NJIT | /cs356/p2/src/message_flow.cpp | UTF-8 | 7,499 | 2.84375 | 3 | [] | no_license | #include "message_flow.h"
#include <thread>
#include <utility>
using namespace std;
using util::ThreadPool;
using util::Timeout;
using util::TimeoutFactory;
namespace router {
namespace {
// RepeatedSend object for repeatedly sending on timeout if needed.
class RepeatedSend {
public:
RepeatedSend(uint16_t router_... | true |
bd68180a920625e9072f93566831b5be6b2688ef | C++ | Laskina/3laba12 | /file.h | WINDOWS-1251 | 1,827 | 2.765625 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <fstream>
#include <iostream>
using namespace std;
#define SECTOR 4;
typedef struct date_time
{
int day;
int month;
int year;
int hour;
int mins;
int sec;
} date_time;
enum attribute {open,... | true |
3f78fcd90f5d50f12a02554f131b0482e4e9bb4d | C++ | joshkimmel16/scalable-clustering | /include/reporter.h | UTF-8 | 947 | 2.71875 | 3 | [] | no_license | #ifndef REPORTER_H
#define REPORTER_H
#include <string>
#include <iomanip>
#include <vector>
#include <algorithm>
#include "clustergraph.h"
class Reporter {
public:
Reporter(Config *c, ClusterGraph * g) {
config = c;
graph = g;
threshold = c->GetThreshold();
}
//used to compress... | true |
ec1718dda0b5b02d8869340c7788645cff497600 | C++ | epaqu/bio_data_structure | /HW2.cpp | UTF-8 | 5,108 | 3.625 | 4 | [] | no_license | // homework2.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <string>
using namespace std;
int size = 0;
int firstOrSecond = 1;
int **getpoly()
{
int **poly;
int **temp;
int term = 1;
int order, coefficient;
cout << "If you want to stop, please enter -1... | true |