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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
177ce34280310c74c7014e19f6475d695f62eda6 | C++ | scarensac/SPlisHSPlasH_for_cuda | /SPlisHSPlasH/MathLib/Point3d.h | UTF-8 | 3,846 | 2.9375 | 3 | [
"MIT"
] | permissive | /*
Simbicon 1.5 Controller Editor Framework,
Copyright 2009 Stelian Coros, Philippe Beaudoin and Michiel van de Panne.
All rights reserved. Web: www.cs.ubc.ca/~van/simbicon_cef
This file is part of the Simbicon 1.5 Controller Editor Framework.
Simbicon 1.5 Controller Editor Framework is free software: you can
... | true |
b431fb97e3b4d1baec3a9a56b6d075d21759e80e | C++ | dpeng/smallApps | /Calendar/Calendar/Lunar.cpp | GB18030 | 24,468 | 2.515625 | 3 | [] | no_license | #include "StdAfx.h"
#include "Lunar.h"
//1900굽2100ÿеϢ
//ÿֻ2930죬һ1213λʾӦλΪ130죬Ϊ29
const int CLunar::m_lunarInfo[]={ //ũϢ
0x4bd8,0x4ae0,0xa570,0x54d5,0xd260,0xd950,0x5554,0x56af,0x9ad0,0x55d2,//1900-1909
0x4ae0,0xa5b6,0xa4d0,0xd250,0xd255,0xb54f,0xd6a0,0xada2,0x95b0,0x4977,//1910-1919
0x497f,0xa4b0,0xb4b5,0x6a50,0... | true |
2c25350910605212939f90789d63b4840c3942ae | C++ | Qazwar/ParabellumFramework | /ParabellumEngine/ParabellumFramework/InputDevice.cpp | UTF-8 | 7,287 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "InputDevice.h"
// ----------------------------------------------------
// Constructors and destructors
// ----------------------------------------------------
ParabellumFramework::IO::InputDevice::InputDevice()
{
m_keyStateSwitch = false;
for (EUINT32 i = 0; i < 256; ++i)
{
m_curre... | true |
2938bf3d7ed949cf8326bfbea3503a923c374aeb | C++ | snega1003/cpp-tasks | /task9/src/test/trait_test.cc | UTF-8 | 510 | 2.734375 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include <random>
#include "project/trait.hh"
#include "project/group.hh"
#include "project/man.hh"
TEST(Traits, size)
{
using namespace my;
Man m("aaa", "bbb");
EXPECT_EQ(trait<Man>::size(m), 11);
Group g("NAME")... | true |
31a18b1b0c314073cfd8d7953a481898541bbb5e | C++ | luchunabf/Cplusplus | /test_6_30_static/test_6_30_static/static.cpp | GB18030 | 1,360 | 3.625 | 4 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
#if 0
//ʵһ࣬д˶ٸ
class A
{
public:
A()//캯һαʾһ
{
++_getCount;
}
A(const A& t)//캯һαʾһ
{
++_getCount;
}
static int GetCount()//̬Ա
{
return _getCount;
}
private:
static int _getCount;
};
int A::_getCount = 0;
int main()
{
cout << A:... | true |
ff84156a5384128bef8f9b571d6c7dec508e937c | C++ | OverFlame/bi | /JSOIT1-233.cpp | UTF-8 | 332 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<stdio.h>
using namespace std;
char s[233];
int sum, i = 0;
int main()
{
freopen("title.in","r",stdin);
freopen("title.out","w",stdout);
while (cin >> s[i] && s[i] != EOF)
{
++i;
if (s[i] != ' ')
++sum;
}
cout << sum << endl;
fclose(stdin);
fclose(stdout);
re... | true |
74ccac9b51a21cb3c137beedb45d82ff56ee9663 | C++ | actor-framework/actor-framework | /libcaf_core/caf/detail/sync_ring_buffer.test.cpp | UTF-8 | 3,190 | 3.03125 | 3 | [] | permissive | // This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#include "caf/detail/sync_ring_buffer.hpp"
#include "caf/test/caf_test_main.hpp"
#include... | true |
1825e1fc2d42c74dca6ab119fcf4f57dde6fa42c | C++ | francoisferland/hbba_base | /iw_tools/src/exploitation_matcher.cpp | UTF-8 | 3,523 | 2.625 | 3 | [] | no_license | #include <iw_tools/exploitation_matcher.hpp>
using namespace iw_tools;
ExploitationMatcher::ExploitationMatcher(
ros::NodeHandle& n, ros::NodeHandle& np)
{
sub_intention_ = n.subscribe("intention", 10,
&ExploitationMatcher::intentionCB, this);
sub_priority_ = np.subscribe("priority", 10,
... | true |
7048c26ed27e6484963a466bfa6e46107e56d6e3 | C++ | DogAddan/FTPClient | /socket.h | UTF-8 | 723 | 2.640625 | 3 | [] | no_license | #ifndef SOCKET_H
#define SOCKET_H
#include <string>
#include <arpa/inet.h>
#include <QtDebug>
using namespace std;
class Socket
{
public:
//构造
Socket(int port,const char* ip_addr);
//析构
~Socket(void);
//发送
void sendMsg(const char* command,const char* content);
void sendMsg(const char* com... | true |
d79899d38f98f3de45202be03d12284d0afc41fa | C++ | danielbjorkman88/Cpp | /OpenGL/NbodyVis/Visualizer.cpp | UTF-8 | 7,870 | 2.546875 | 3 | [] | no_license |
#include <iostream>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <cassert>
#include <nbody/Body.h>
#include <nbody/Vector3.h>
#include <chrono>
#include <thread>
#include "Renderer.h"
#include "VertexBuffer.h"
#include "IndexBuffer.h"
... | true |
e9b5d80ef611955d2dc2ffe1d31a24b7112bdb52 | C++ | kwansu/3DGraphicsFramework_Practice | /3D_Game_API1.2/3D_Game_API/cVector3.cpp | UTF-8 | 1,538 | 3.25 | 3 | [] | no_license | #include "StdAfx.h"
#include "cVector3.h"
cVector3::cVector3()
: x(0), y(0), z(0)
{
}
cVector3::cVector3(float _x, float _y, float _z)
: x(_x), y(_y), z(_z)
{
}
cVector3::~cVector3()
{
}
bool cVector3::operator==(const cVector3& vec)
{
if (!EqualFloat(x, vec.x))
return false;
if (... | true |
0c2b1c5493254a2f8d3c9df4681feb39ce30f392 | C++ | thefullarcticfox/ft_containers | /algorithm.hpp | UTF-8 | 5,551 | 3.125 | 3 | [] | no_license | #ifndef ALGORITHM_HPP
#define ALGORITHM_HPP
#include "adapted_traits.hpp"
#include "functional.hpp"
namespace ft {
template <class T1, class T2>
struct _equal_twotypes : binary_function<T1, T2, bool> {
bool operator()(const T1& x, const T2& y) const
{ return (x == y); }
};
template <class T1, class T2>
stru... | true |
733b77c6aa5af76a7ba38b372ae273dbb862e5aa | C++ | LukMercury/Simple-Programs | /Converters/cel.cpp | UTF-8 | 708 | 3.375 | 3 | [] | no_license |
// Convert height in cm to feet and inches
// Usage: cm <value1> <value2> ...
#include "std_lib_facilities.h"
constexpr int offset = 32;
constexpr double scale = 1.8;
double cstring_to_double(char* s)
{
istringstream is {s};
double d;
if (!(is >> d))
error("Couldn't get double argument");
re... | true |
89cdc603757f6efd0d6519747891c5c1b255525d | C++ | fadeto404/dynamixel-p2 | /src/dynamixel_p2/Matlab_Comms_V2/Matlab_Comms_V2.ino | UTF-8 | 1,940 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <dynamixel_p2.h>
Dynamixel_p2 TEST(13);
bool receive = true; // Used to switch between recieve and transmit mode.
byte rxpacket[8]; //Holds Current1,2,3 and Event.
void setup() {
Serial.begin(57600);
TEST.begin(57600);
TEST.setTorqueEnable(0xFE,true);
//Debug
}
void loop() {
if(receive) ... | true |
017db3d3a10ce28cee9c03b45f921cd53a40f846 | C++ | safwankdb/Leetcode-Patterns-Cpp | /Word Search II.cpp | UTF-8 | 2,031 | 3.1875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
struct TrieNode {
bool isWord = false, counted = false;
TrieNode* children[26];
string word;
TrieNode() {
for (int i = 0; i < 26; i++) children[i] = NULL;
}
};
struct Trie {
... | true |
b6a9686bf9f890f9d44395d8dc746d422beb3c17 | C++ | qianlv/learning | /cplusplusprimer/9/9_5.cpp | UTF-8 | 1,028 | 3.09375 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: 9_5.cpp
*
* Description: 9.5
*
* Version: 1.0
* Created: 2015年12月21日 20时57分14秒 CST
* Revision: none
* Compiler: gcc
*
* Author: qianlv (), qianlv7@gmail.... | true |
bee04ab615822d91c446eeb14491fcc9ad9e5abc | C++ | sl950313/SEDA-framework | /sender.cpp | UTF-8 | 1,417 | 2.671875 | 3 | [] | no_license | #include "sender.h"
#include "log.h"
#include <assert.h>
#include <zmq.h>
#include <unistd.h>
sender::sender() {
//init();
running = true;
}
bool sender::sendMsg(IElement *ie) {
LogUtil::debug("sender : [sendMsg] ie : %s, %d", ie->getElement(), ie->length());
int ret = zmq_send(publisher, ie->getElement(... | true |
550d96cab4bb55c22cfc3422f5741ab2e8c95b76 | C++ | rummens1337/programmeertalen | /week7-team/evaluator/Matrix.h | UTF-8 | 6,544 | 3.75 | 4 | [
"MIT"
] | permissive | /*
* Names: Michel Rummens, Thomas Vos
* StudentIDs:13108093, 12829501
* This program defines a matrix with doubles, and the operations +,-,~,* and
* transpose.
*/
#ifndef MATRIX_INCLUDED
#define MATRIX_INCLUDED
#include <vector>
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#incl... | true |
a7800342d41585bea6a4c4b2a999f6c2672be975 | C++ | lvningyuan/pdlbox | /threadpool.cpp | UTF-8 | 4,824 | 3.390625 | 3 | [] | no_license | //#ifndef __M_POOL_H__
#define __M_POOL_H__
#include <iostream>
#include <queue>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#define MAX_THREAD 3 //最大线程数
#define MAX_QUEUE 10 //队列长度
class MyTask
{
private:
int data;
public:
MyTask(){}
~MyTask(){}
void SetDa... | true |
f217e5862a597c5c18b3748595ac1acd9c0b0b77 | C++ | ChristianLebeda/HomSub | /homomorphism/src/iterator_introduce_handler.cpp | UTF-8 | 1,589 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "homomorphism/iterator_introduce_handler.h"
#include <memory>
#include <vector>
#include "homomorphism/graph.h"
#include "homomorphism/mapping_iterator.h"
std::vector<size_t>& IteratorIntroduceHandler::introduceLast(std::vector <size_t> &input, std::vector <size_t> &output,
... | true |
e6eaca5bccc4df2ed8f2cd95792429aeb0412baa | C++ | TehWeifu/SMR | /Programacion/1st Quarter/Ej 46 - 49/Ejercicio 47 - Julian.cpp | UTF-8 | 1,472 | 3.8125 | 4 | [] | no_license | #include <iostream>
int main() {
const short SIZE{ 40 };
float vecGrades[SIZE];
int sum{ 0 };
int max{ -1 };
int maxPos{ 0 };
int min{ 11 };
int minPos{ 0 };
int menu{ -1 };
for (int i = 0; i < SIZE; i++) {
do {
std::cout << "Introduzca la nota del alumno (" << i + 1 << "/" << SIZE << "): ";
std... | true |
be48ee78feab9ee0c02dfa9b9af663789c62d4b2 | C++ | zhangbo-tj/2048InQT | /2048InQt/GameOverWindow.cpp | GB18030 | 1,322 | 2.8125 | 3 | [] | no_license | #include "GameOverWindow.h"
#include <QVBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QDebug>
/*
* Ϸʧܽ
*/
GameOverWindow::GameOverWindow(QWidget* parent):QWidget(parent){
setStyleSheet("GameOverWindow{background: rgb(237,224,200);}");
setFixedSize(425, 200);
//ʼؼ
QVBoxLayout* layout = new QVB... | true |
2c16130b33605978c969ca3b3b816f6884b48e43 | C++ | VinInn/ctest | /bitcompress.cpp | UTF-8 | 3,907 | 2.6875 | 3 | [] | no_license | /*
* bitcompress.cpp
*
*
* Created by Vincenzo on 29-03-2006.
* Copyright 2006 __MyCompanyName__. All rights reserved.
*
*/
// #include "bitcompress.h"
#include <cstdio>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <vector>
#include <string>
bool debug() {
return... | true |
eaed52301542aaf0c95a44d8eb7ff1379d3a8c3d | C++ | Kangulu/plt | /src/client/render/PlayerRenderer.cpp | UTF-8 | 7,886 | 2.578125 | 3 | [] | no_license | #include "PlayerRenderer.h"
using namespace render;
using namespace std;
std::string dif2string(int ressource){
if(ressource>=0){
return string("+") + to_string(ressource);
}
else{
return to_string(ressource);
}
}
PlayerRenderer::PlayerRenderer(std::shared_ptr<state::Player> player, s... | true |
e1e0095f86cb71137aa3eed80e95fa58af43bd7c | C++ | accb529/Kassiopeia | /KGeoBag/Source/Extensions/Mesh/Complex/Source/KGRotatedSurfaceMesher.cc | UTF-8 | 12,101 | 2.8125 | 3 | [] | no_license | #include "KGRotatedSurfaceMesher.hh"
#include "KGMeshTriangle.hh"
namespace KGeoBag
{
void KGRotatedSurfaceMesher::VisitWrappedSurface( KGWrappedSurface< KGRotatedObject >* rotatedSurface )
{
std::shared_ptr< KGRotatedObject > rotatedObject = rotatedSurface->GetObject();
double length = 0.;
... | true |
485f17a360d7268d946d1a92c11ac59e0c0ad06e | C++ | nfwaldron/CPlayground | /RandomNumberGenerator/RandomNumberGenerator/Generator.h | UTF-8 | 701 | 2.640625 | 3 | [] | no_license | // Generator.h
// RandomNumberGenerator
// Created by Admin on 2/27/15.
// Copyright (c) 2015 Admin. All rights reserved.
//
#ifndef __RandomNumberGenerator__Generator__
#define __RandomNumberGenerator__Generator__
#include <stdio.h>
class Generator
{
public:
Generator(); // Constructor
unsigned long int... | true |
120bbb54925b35640d7b688ffbd5f93a04991031 | C++ | natanelia/grafika | /Line.cpp | UTF-8 | 13,839 | 3.109375 | 3 | [] | no_license | #include "Line.h"
Line::Line(vector<Point>& points) : Drawing(points) {}
Line::Line(Point points[], int n) : Drawing(points, n) {}
Line::Line(Point p1, Point p2){
points.push_back(p1);
points.push_back(p2);
}
void Line::draw(ShadowBuffer& sb) {
int x1 = (int)points[0].x;
int y1 = (int)points[0].y;
... | true |
28e5f88c1c21c7000b473c4a74048f6e8f94ddda | C++ | Eduardo2712/Estrutura_de_dados | /Insertion sort.cpp | UTF-8 | 854 | 3 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<conio.h>
#include<cstdio>
#include<ctime>
using namespace std;
const int TAM = 12;
int vetor[TAM] = {9, 27, 14, 6, 2, 8, 9, 17, 25, 17, 15, 6};
void gerar()
{
for(int i=0; i<TAM; i++)
{
vetor[i]=rand();
}
}
void insertion()
{
int atual = 0;
i... | true |
78c744ca9478a73fd96e66425b93694489f959fc | C++ | VarickQ/ACM | /HaveDone/HDU/最优页面调度算法(贪心+优先队列)4398.cpp | GB18030 | 1,560 | 2.53125 | 3 | [] | no_license | /*
еƫ⡣ϵͳеҳ㷨̰ġҪ̭ijģʱ̭ǰԶĽŻᱻõԺԶõǸ
*/
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ... | true |
a18a7e2a0118d8f0064f8e7f067390172f32085c | C++ | RabbitMC/MixingCppObjC | /MixingCppObjC/MixingCppObjC/C++/Cat.hpp | UTF-8 | 429 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// Cat.hpp
// MixingCppObjC
//
// Created by Miralem Cebic on 27.07.17.
// Copyright © 2017 Miralem Cebic. All rights reserved.
//
#ifndef Cat_hpp
#define Cat_hpp
#include <stdio.h>
#include <iostream>
class Cat
{
public:
Cat(int initialAge);
Cat(const Cat& copy_from);
~Cat();
int GetAge(... | true |
d1c7670a5197a004a2199f625997b3c190412a2a | C++ | Albertogk/competitive_programming | /uva/621-secret.cpp | UTF-8 | 608 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
int t;
string read;
cin >> t;
cin.ignore();
for(int i=0; i < t; i++) {
getline(cin, read);
const int n = read.size();
if (read == "1" || read == "4" || read == "78") {
cout << "+" << endl;... | true |
d8f80d895c348578e13d5a8cf52fc9a5446fada2 | C++ | Ali-externe/Epitech-Second-Year | /CCP_plazza_2018/main.cpp | UTF-8 | 4,914 | 2.84375 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** plazza
** File description:
** main
*/
#include "reception.hpp"
/*
int incrementCounter(int &counter)
{
while (counter != 10) {
std::cout << "Turns : " << counter << std::endl;
counter++;
}
return (counter);
}
int main(void)
{
std::mutex mtx;
mtx.lock();
int i... | true |
dbbc9efd09255c5017aafe8b051c1858691f850b | C++ | maguilo11/locus | /xgen/include/OptimalityCriteria/Locus_OptimalityCriteriaTestInequalityOne.hpp | UTF-8 | 3,384 | 2.671875 | 3 | [] | no_license | /*
* Locus_OptimalityCriteriaTestInequalityOne.hpp
*
* Created on: Oct 17, 2017
* Author: Miguel A. Aguilo Valentin
*/
#ifndef LOCUS_OPTIMALITYCRITERIATESTINEQUALITYONE_HPP_
#define LOCUS_OPTIMALITYCRITERIATESTINEQUALITYONE_HPP_
#include <cmath>
#include <memory>
#include <cassert>
#include "Locus_Criter... | true |
10430ed5fce35af095fe4437b31051b5134740c0 | C++ | FatemaOthman/Paint-For-Kids | /Figures/CFigure.cpp | UTF-8 | 1,645 | 2.96875 | 3 | [] | no_license | #include "CFigure.h"
#include<iostream>
#include<fstream>
CFigure::CFigure(GfxInfo FigureGfxInfo)
{
FigGfxInfo= FigureGfxInfo; //Default status is non-filled.
Selected = false;
ID=++ID;
}
void CFigure::SetSelected(bool s)
{ Selected = s; }
bool CFigure::IsSelected() const
{ return Selected; }
... | true |
8400c10f45821ba18420b69535978acc8fb4c539 | C++ | alexkeel/Bruskey | /Components/SyntaxTree/src/FunctionCall.cpp | UTF-8 | 794 | 3.0625 | 3 | [] | no_license | #include "FunctionCall.hpp"
FunctionCall::FunctionCall(Expression *ident, Expression *argument)
{
this->expression = ident->toCode() + "(" + argument->toCode() + ")";
}
FunctionCall::FunctionCall(Expression *ident, std::vector<Expression *> *arguments)
{
this->expression = ident->toCode();
this->expressio... | true |
f8a360c64bf82dfc8980d7028705f6793f1ad9a3 | C++ | junghoon88/starcraft | /tile.h | UHC | 1,736 | 3.03125 | 3 | [] | no_license | #pragma once
#include "gameNode.h"
class tile : public gameNode
{
private:
int _idX;
int _idY;
POINT _center;
RECT _rc;
//F = G + H
// F ==
// G == κ (Ÿ) κ
// H == (Ÿ) κ
float _totalCost; //F
float _costFromStart; //G
float _costToGoal; //H
bool _isOpen;
bool _isFind;
tile* _parentNode;
D... | true |
943e8cfc0c0bb0ba3d5d38cafad51a39401e3ac2 | C++ | evarnazi/CompPhyFinalC | /cpt/linalg.hpp | UTF-8 | 5,008 | 2.8125 | 3 | [] | no_license | #ifndef CPT_LINALG_HPP
#define CPT_LINALG_HPP
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <string>
#include "matrix.hpp"
namespace cpt
{
Matrix<double,2> transpose(const Matrix<double,2>&);
double inverse( Matrix<double,2> m, Matrix<double,2> & minv);
void s... | true |
1487f921861efc6dce2887958380493c2956de45 | C++ | caojiying002/Source_Code_of_Books | /C++_for_Java_Programmers_Mark_A_Weiss/leak.cpp | UTF-8 | 380 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
// leaks memory on systems that don't garbage collect
void leak( int i )
{
vector<int> *ptrToVector = new vector<int>( i );
if( i % 2 == 1 )
return;
ptrToVector->push_back( i );
delete ptrToVector;
}
int main( )
{
for( int i = 0... | true |
2a932628a2e05eb8f2e66e369c62cfe8d383a513 | C++ | edgarreb/ee355 | /lab/PA1/PA1/helper.cpp | UTF-8 | 311 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string func(string str1, string str2)
{
string res = str1 + str2;
transform(res.begin(), res.end(), res.begin(), tolower);
};
int main()
{
string fname = "Edgar Roy";
string lname = "Martinez";
func(fname, lname);
}
| true |
0d7769843a6c332fef5c33f6a4459a8c64f20f12 | C++ | mveregge23/Cpp-Projects | /Langtons Ant/Location.cpp | UTF-8 | 656 | 3.59375 | 4 | [] | no_license | // Program name: Location.ccp
// Author: Max Veregge
// Description: This is an implementation of the Location class, used to represent the location of an Ant
// on a Board
#include "Location.h"
// setX takes an int to set the xC
void Location::setX(int x) {
xC = x;
}
// setY takes an int to set the yC
void Locatio... | true |
307e00ec311350a9df41dfe2545aac0fa80820b3 | C++ | chiahsun/problem_solving | /HackerRank/Algorithms/Sorting/Closest Numbers/solve1.cc | UTF-8 | 975 | 3.15625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector <int> closestNumbers(vector <int> arr) {
std::vector<int> ans;
ans.push_back(arr[0]);
ans.push_back(arr[1]);
// Complete this function
std::sort(arr.begin(), arr.end());
int dmin = arr[1] - arr[0];
for (int i = 2; i < arr.size(); ++... | true |
ab6213ee78405c66388b3bc6d973c3a42f8b95e1 | C++ | stranger900/abramian | /Proc/Proc38/main.cpp | UTF-8 | 965 | 2.9375 | 3 | [] | no_license | # include <iostream>
# include <windows.h>
# include <cmath>
# include <cmath>
#include <vector>
using namespace std;
double Power2(double a, int n);
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
//srand(time(NULL));
double a, k, L, m;
cout << "Внесіть число A : " << endl;
... | true |
7df5fae43c84487a474db3258dd08c0c6c0b678d | C++ | vladimir-nazarenko/spbu | /Homeworks1/mergeSortList/mergeSortList/List.h | UTF-8 | 2,797 | 3.9375 | 4 | [] | no_license | #pragma once
#include <iostream>
template <typename T>
class List
{
public:
struct Node
{
T item;
Node* next;
};
typedef Node* Position;
List()
{
count = 0;
head = new Node();
head->next = nullptr;
e = nullptr;
}
//Constructor, initializes list with value
List(T value)
{
head = new Node... | true |
0de55bb3f5dbbb6b642751d4a40810a84ce08d8b | C++ | a62mds/exercism | /cpp/nucleotide-count/nucleotide_count.h | UTF-8 | 1,158 | 3.21875 | 3 | [] | no_license | #ifndef NUCLEOTIDE_COUNT_H
#define NUCLEOTIDE_COUNT_H
#include<stdexcept>
#include<map>
#include<string>
namespace dna {
class counter {
public:
std::string m_seq;
std::map<char,int> m_count;
counter(std::string seq) : m_seq(seq), m_count(seq_count(seq)) {}
std::map<char,int> nucleotide_counts() const ... | true |
15d57800661d3f29dea5a5a1674f28812fabf078 | C++ | roshankshaw/programming-challenges | /huffman_decoding.cpp | UTF-8 | 567 | 3.046875 | 3 | [] | no_license |
/*
The structure of the node is
typedef struct node {
int freq;
char data;
node * left;
node * right;
} node;
*/
void decode_huff(node * root, string s) {
string res="";
node *cur=root;
int len=s.length();
for(int i=0;i<len;i++)
{
if(s[i]=='0'... | true |
cc9cd1753021e4bc9952fe05213c8a064ae15f27 | C++ | a1q123456/H264Decoder | /H264Decoder/Data/NALU/SEI/MultiviewAcquisitionInfo.h | UTF-8 | 4,613 | 2.546875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <IO/BitstreamReader.h>
#include <Data/DecimalValue.h>
struct MultiviewAcquisitionInfo
{
struct ParamSet
{
DecimalValue focalLengthX;
DecimalValue focalLengthY;
DecimalValue principalPointX;
DecimalValue principalPointY;
DecimalValue skew;
... | true |
9f63308f62205ebdfcf0e04be1450dde38790a0b | C++ | arnabs542/leetcode-2 | /src/weekly/week193_2.cpp | UTF-8 | 909 | 3.390625 | 3 | [] | no_license | // 20200614
// 2. 不同整数的最少数目
/*
* 给你一个整数数组 arr 和一个整数 k 。现需要从数组中恰好移除 k 个元素,请找出移除后数组中不同整数的最少数目。
*/
/*
* 提示:
*
* 1 <= arr.length <= 10^5
* 1 <= arr[i] <= 10^9
* 0 <= k <= arr.length
*/
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution {
public:
int findLeas... | true |
4dd7e475b5fda78b193cc76118711e5ec962a373 | C++ | Bagja9102Kurniawan/TP-DAP-2019 | /C++/TP-DAP-MOD2-SelisihBeratModifikasi.cpp | UTF-8 | 665 | 3.1875 | 3 | [] | no_license | /* NIM : 1301194020
NAMA : BAGJA 9102 KURNIAWAN
Program ini adalah program pengecekan selisih
berat benda yang akan dibawa pada motor.
motor akan oleng ke satu bagian jika
selisihnya lebih dari sama dengan 9kg dengan output
bernilai true(motor oleng),
program akan berhenti jika isi kedua kantong melebihi 150... | true |
c503bcdb81c4fe60cf53042f641e49a20994cb22 | C++ | Psingh12354/Cpp-Codes | /PowerFunction.cpp | UTF-8 | 252 | 3.109375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int pow(int x,int y)
{
int res=1;
while(y>0)
{
if(y%2!=0)
{
res*=x;
y--;
}
else
{
y=y/2;
x=x*x;
}
}
return res;
}
int main()
{
cout<<pow(2,7);
return 0;
}
| true |
45c36840511286841a7a6182549f268f9dcd8766 | C++ | gaborcsardi/finmix | /src/rtruncnorm.h | UTF-8 | 5,517 | 2.546875 | 3 | [] | no_license | /******************************************************************************
*
* TODO: Project Title
*
* Copyright (C) 2003-2009 ascolab GmbH. All Rights Reserved.
* Web: http://www.ascolab.com
*
* Author: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
*
* This file is provided AS IS with NO WARRANTY OF ... | true |
384bcc8972921499fffb8f10b9e05609f2f13ad7 | C++ | jalexanderqed/cs280_repo | /john_alexander_proj5/Glitter/Glitter/Headers/light.hpp | UTF-8 | 1,667 | 2.984375 | 3 | [
"MIT"
] | permissive | #ifndef LIGHT_H
#define LIGHT_H
#include <glad\glad.h>
#include <string>
#include <sstream>
#include <iostream>
class Light {
private:
glm::vec3 position;
glm::vec3 ambient;
glm::vec3 diffuse;
glm::vec3 specular;
int index;
std::string myPre;
public:
Light() :
position(glm::vec3()),
... | true |
6857edef213555a8ca75d731cf818f5edadbab85 | C++ | gyulalaszlo/mkzbase | /maybe.h | UTF-8 | 1,896 | 2.890625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <memory>
#include "mkz.h"
namespace mkz {
template<typename A>
class Maybe;
template<typename A>
inline Maybe<A> just(A a);
template<typename A>
inline Maybe<A> nothing();
// shortcut for removing nothing<decltype(something)>() to nothing(something)
template<typ... | true |
314d9f2a3bbc75d4800c24b432f620eac302f867 | C++ | redizaar/safetyrepo | /Dolgozo , observer/main.cpp | UTF-8 | 6,945 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <thread>
#include <vector>
#include <ctime>
#include <mutex>
#include "dolgozo.h"
#include "programmer.h"
#include "workerregister.h"
#include "operator.h"
#include "thecompany.h"
#include "project.h"
#include "audiprojects.h"
#include "bmwprojects.h"
using namespace std;
void... | true |
f268482d8ed85719a823cf73a84d3ab8f0e0e796 | C++ | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/79/2379.c | UTF-8 | 447 | 2.578125 | 3 | [] | no_license | int killer(int n,int m)
{
int a[301]={0},i=0,j=1,k=n;
while(k>1)
{
if(a[i]==0)
if(j==m) {a[i]=1;k--;j=1;}
else j++;
i++;
if(i>=n) i=0;
}
for(i=0;i<n;i++)
if(a[i]==0) return i+1;
}
main()
{
int n,m;
scanf(... | true |
6d2ea3de4695296c11f0f6202a5d54584aae999f | C++ | kuflex/KuStudio | /KuStudio/src/kummon/kuButton.cpp | UTF-8 | 4,533 | 2.78125 | 3 | [] | no_license | #include "kuButton.h"
//---------------------------------------------------------------------
void kuButton::setup( string iconFile, float X, float Y ) {
X_ = X;
Y_ = Y;
ofLoadImage( icon_, iconFile );
W_ = icon_.getWidth();
H_ = icon_.getHeight();
toggle_ = false;
enabled_ = true;
v... | true |
4f4f854dfeb227074091f4d2429d571ec70c6694 | C++ | mbrock/moppe | /moppe/map/generate.hh | UTF-8 | 5,215 | 2.859375 | 3 | [] | no_license |
#ifndef MOPPE_GENERATE_HH
#define MOPPE_GENERATE_HH
#include <moppe/gfx/math.hh>
#include <boost/multi_array.hpp>
#include <boost/random.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
namespace moppe {
namespace map {
class NormalMap {
public:
NormalMap (int width, int height);
inline const ... | true |
1586a18dff3eaabc4f83eb58ec1833201cd2f3fe | C++ | aurtg/open-david | /src/cnv.h | UTF-8 | 14,272 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <memory>
#include <functional>
#include "./pg.h"
#include "./ilp.h"
#include "./json.h"
namespace dav
{
/** Enumerator to specify the direction of a unification-edge. */
enum unification_direction_e
{
FORWARD_DIRECTION = 1,
UNDEFINED_DIRECTION = 0,
BACKWARD_DIRECTION = -1
};
n... | true |
d9ada439e5b1ee620fc148c115230f5ef4831b34 | C++ | louen/QtFMP | /src/game/fmpWeather.h | UTF-8 | 674 | 3.25 | 3 | [] | no_license | #ifndef FMP_WEATHER_H
#define FMP_WEATHER_H
// This class is responsible to manage everything related to tides.
// There should be only one instance owned by the game.
class fmpWeather
{
public:
enum Tide
{
LOW =0,
NORMAL,
HIGH,
};
// Tells you the current tide (in... | true |
3dad2ab2e84d98cbc61277cbad6c00a9e16a3abb | C++ | AbdallahHemdan/DidUMean | /Spelling Checker/SpellingCorrector.cpp | UTF-8 | 4,357 | 3.09375 | 3 | [
"MIT"
] | permissive | #include "SpellingCorrector.h"
#define ALPHASIZE 26
SpellingCorrector::SpellingCorrector()
{
TotalWords = 0;
Root = new Trie();
ifstream BigFile;
BigFile.open("Dic.txt");
string Word;
// eof() is an Indecator of The End of The File
// If at The end of the file return (true)
// Else retu... | true |
9eb554ddab2cba8881d5f00f7194e0ea637b54a5 | C++ | jinyunx/CoSocket | /CoSocket/net/http/WebSocketParser.h | UTF-8 | 5,921 | 2.53125 | 3 | [] | no_license | #ifndef WEB_SOCKET_PARSER_H
#define WEB_SOCKET_PARSER_H
/*
0 1 2 3
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-------+-+-------------+-------------------------------+
|F|R|R|R| opcode|M| Payload len | Extended payload leng... | true |
a752bf4491fb238d086e8821e29f637162e678c9 | C++ | mjarret/Clifford-T-Project | /TOperators/Z2.cpp | UTF-8 | 4,069 | 3.875 | 4 | [] | permissive | #include <algorithm>
#include <iostream>
#include "Z2.hpp"
/**
* Constructor that initializes object corresponding to (a+sqrt(2)*b)/(2^c)
* @param a integer part of numerator
* @param b sqrt(2) part of numerator
* @param c log_2 of the denominator
*/
Z2::Z2(int a, int b, int c){
val[0] = a;
val[1] = b;
... | true |
c3c6528884250901fbc0eb22d4b75099b0bac194 | C++ | aristotelis-bobas/cpp_modules | /mod_08/ex02/mutantstack.ipp | UTF-8 | 1,515 | 2.6875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* :::::::: */
/* mutantstack.ipp :+: :+: ... | true |
85a9792588a9c34aa3924af12257e6ad7972ac97 | C++ | PaulBNolan/TankProgram | /LabProject1/LabProject1/src/Bolt.cpp | UTF-8 | 6,147 | 3.109375 | 3 | [] | no_license | /// <summary>
/// @Author: Paul Nolan
/// @Version 2.0
/// </summary>
#include "Bolt.h"
#include <iostream>
//The bolt and its values are set up here
Bolt::Bolt(KeyHandler const & object) :
m_keyHandler(object)
{
width = 10;
speedX = 4;
speedY = -4;
rectangle.setFillColor(sf::Color::Green);
rectangle.setSize(sf:... | true |
f1c7392b464c9ad0121839175dcc693e835b3bc0 | C++ | deepakchandh/My-files | /tax.cpp | UTF-8 | 1,008 | 3.34375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class employee
{
string name,dept;
int eno;
public:
void getdata()
{
cout<<"\nEMPLOYEE NAME: ";
cin>>name;
cout<<"\nEMPLOYEE NUMBER: ";
cin>>eno;
}
void putdata()
{
cout<<"\nDEPARTMENT:\t";
cin>>dept;
}
};
class PAY
{
protected:
float basic... | true |
2130ac3390371314df1cc89004124c05ddb1cad8 | C++ | xhewr/lab-04 | /main.cpp | UTF-8 | 5,214 | 4.21875 | 4 | [] | no_license | // CIS22b
// Lab04
// Name:
/*
Program description: This program demonstrates the functionality of
the minimum(), maximum(), getAbsolute() and total() template
functions when tested with with different data types.
The minimum() template returns the lowest of two passed values.
The maximium() template re... | true |
7fb349aad789333b40da04c5c2b4dc7f837db556 | C++ | GeorgiosGiagkas/practice-cpp | /chapter6_classes/lecture58a.cpp | UTF-8 | 715 | 4.0625 | 4 | [] | no_license | //Array of instances of a class
#include<stdio.h>
class integer//class name
{
private:
int number;//private data member
public:
void store(int);//mutator function
int print(void);//accessor function
};
void integer::store(int x){//function definition
number=x;
}
int integer::print(void){//function de... | true |
790f7cbb53a932f1751781c7425e9ed735cb97d3 | C++ | huobingli/boostProgram | /boost_test/boost_regex_search.cpp | UTF-8 | 1,436 | 2.625 | 3 | [] | no_license |
//********************************************************
//
// FileName: boost_regex_search.cpp
//
// Author: huobingli - huobingli@outlook.com
// Description:
// Create: 2016-12-29 20:03:20
// Last Modified: 2016-12-29 20:03:20
//************************************... | true |
effd9fa8f108cb002f0cf1aad56d921b2f6fee25 | C++ | allenARM/Cpp-Piscine | /Day07/ex01/iter.cpp | UTF-8 | 475 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <string>
template <typename T>
void iter(T const *arr, int num, void (*fun)(T const &))
{
int i = 0;
while (i < num)
{
(*fun)(arr[i]);
i++;
}
}
template <typename T>
void print_arr(T const & name)
{
std::cout << name << std::endl;
}
int main()
{
std::string keker[] = {"lol", "k... | true |
22888ddd98baba4489adf6b4c3fd8bf9eb58f7e5 | C++ | lhuang9703/SolutionsForLeetcode | /Linked_List_Cycle.cpp | UTF-8 | 1,352 | 3.34375 | 3 | [] | no_license | // Source : https://leetcode-cn.com/problems/linked-list-cycle/description/
// Number : 141
// Author : HL
// Date : 2018-09-03
// Kill : 98.85%,37.14%
/**********************************************************************************
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you so... | true |
5ccdc54826f90395de1329230d4592a4e2ace6b1 | C++ | EnapsTer/StudyCPP | /Day06/ex02/main.cpp | UTF-8 | 1,240 | 3.5 | 4 | [
"MIT"
] | permissive | //
// Created by Андре Шагиджанян on 20.07.2021.
//
#include <iostream>
#include <string>
#include "Base.hpp"
#include "A.hpp"
#include "B.hpp"
#include "C.hpp"
Base * generate() {
Base *base = NULL;
int rand_num = rand() % 3;
if (rand_num == 0) {
base = new A();
std::cout << "Create A class" << std::... | true |
b63a78a995988a4930e71a5cdfdd3c40908d43a7 | C++ | masami87/coroutine-cxx | /coroutine.h | UTF-8 | 1,605 | 2.703125 | 3 | [] | no_license | #pragma once
#include <functional>
#include <ucontext.h>
#include <vector>
#define COROUTINE_DEAD 0
#define COROUTINE_READY 1
#define COROUTINE_RUNNING 2
#define COROUTINE_SUSPEND 3
#define STACK_SIZE (1024 * 1024)
#define DEFAULT_COROUTINE 64
class Coroutine;
class Scheduler;
using coroutine_func = std::function<v... | true |
be2e2eb2ba9ae636e4b5f068f6711dfce12d0c95 | C++ | dstrube1/playground | /misc/aooswd/ex/composite/composite.cpp | UTF-8 | 1,809 | 2.953125 | 3 | [] | no_license | class Equipment
{
public:
virtual ~Equipment ();
const char* Name () (return _name;}
virtual Watt Power ();
virtual Currency NewPrice ();
virtual Currency DiscountPrice ();
virtual void Add (Equipment*);
virtual void Remove (Equipment*);
virtual Iterator<Equipment*>* CreateIterator ();
protec... | true |
8d8fdc3ca2cba370fba055ecdc7bbe171e341cfe | C++ | PaulaOlivan/2-Evaluacion | /Cuadrado.cpp | ISO-8859-10 | 538 | 2.765625 | 3 | [] | no_license | /*Vamos a hacer un programa que dibuje un cuadrado del tamao que desee el usuario*/
#include<iostream>
int main(){
//Definicion de variables
char salir;
int lado, col, fil;
std::cout<< "Cual el lado del cuadrado? ";
std::cin>>lado; //nested
for(col=1;col<=lado;col++){
... | true |
156689b772d7a85b01e52732a2ef8b7204b9b23c | C++ | autonomobil/SDCND-P8_Particle-Filter | /src/particle_filter.cpp | UTF-8 | 7,605 | 2.640625 | 3 | [
"MIT"
] | permissive | /*
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include <random>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <math.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include "particle_filter.h"
using namespace std;
//... | true |
04a9fdbbad98007d3687c72e8825eabd7091453d | C++ | burakbayramli/books | /GPU-Gems-Book-Source-Code/GPU-Gems-3-CD-Content/content/08/demo/RenderableTexture2D.hpp | UTF-8 | 1,966 | 2.796875 | 3 | [] | no_license | #pragma once
//--------------------------------------------------------------------------------------
// Simple class to encapsulate a Texture2D, a render target view and a shader resource
// view. Used to simplify the creation and management of the fairly common single
// render target/shader resource view per textur... | true |
c2a52138777ef317c2cad028b70bfc6cfbde9984 | C++ | rootonchair/CV_Lab1 | /Converter.h | UTF-8 | 7,426 | 3.34375 | 3 | [] | no_license | #pragma once
#define R 2
#define G 1
#define B 0
#define H 0
#define S 1
#define V 2
#include "opencv2/opencv.hpp"
#include <math.h>
#include "opencv2/highgui.hpp"
using namespace std;
double max(double a, double b)
{
if (a > b)
return a;
return b;
}
double min(double a, double b)
{
if (a < b)
return a;
retur... | true |
acb9d50dc20749405be345a2ab6230bbda1be565 | C++ | Toebin/Lab-Advanced-Programming---Final | /Lab Advanced Programming - Final/Source.cpp | UTF-8 | 1,891 | 3.828125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
class Ship
{
public:
Ship(string n, int sp, int pDmg, int sDmg)
{
name = n;
structuralPoints = sp;
primaryDmg = pDmg;
secondaryDmg = sDmg;
}
void takeDamage(int amount) { structuralPoints -= amount; }
int getPrimaryAttack() co... | true |
1a47b1322881dbc92b19f02f8fa497e6079b0bd2 | C++ | mamunhpath/leet-code | /string-to-integer-atoi-2.cpp | UTF-8 | 763 | 3.28125 | 3 | [] | no_license | // https://leetcode.com/problems/string-to-integer-atoi/description/
class Solution {
public:
int myAtoi(string s) {
bool sign = false;
int i = 0, n = s.length();
int ans = 0;
while(i < n && (s[i] == ' '))
i++;
if (s[i] == '+' || s[i] == '-')
... | true |
c111cabd8e9757ad78405f6479b74d1063ffc3c8 | C++ | lewicki-pk/one_program_a_day | /by_month/02-luty/lut05.cpp | UTF-8 | 1,759 | 3.6875 | 4 | [] | no_license | /*
* lut05.cpp
*
* Created on: Feb 5, 2016
* Author: lewiatan
*/
#include <algorithm>
#include <vector>
#include <list>
#include <iostream>
using namespace std;
template <typename T>
void DisplayContents (const T& Input)
{
for (auto iElement = Input.cbegin();
iElement != Input.cend();
... | true |
5e949729bead5ed01c82964d6d31c851c8de9f1b | C++ | su519/test | /week5.cpp | UTF-8 | 320 | 3.1875 | 3 | [] | no_license | #include <iostream>
using namespace std;
float product(float a, float b){
return a*b;
}
float _negate(float x){
return -x;
}
float negated_product(float a, float b){
return -(a*b);
}
int main(){
float x, y;
cin >> x >> y;
float neg_xy = negated_product(x,y);
cout << neg_xy;
}
float a = product(x,y);
| true |
acaaa1130bcfacfc4a2e4b7e59f23ae9603faffb | C++ | CarolineZhu/Leetcode | /leetcode105.cpp | UTF-8 | 829 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespaces std;
TreeNode* buildTree(vector<int>& preorder, vector<int>& inorder) {
if (preorder.size() == 0) return NULL;
TreeNode* root = new TreeNode(preorder[0]);
if (preorder.size() == 1) return root;
int i;
for (i = 0; i < inorder.size(); i++) {
... | true |
8eed6b1b9076ecfe2bf9b19b595dea304f3b9dff | C++ | Zilleplus/cpp_templates | /chapter19/elementtype.cpp | UTF-8 | 375 | 2.984375 | 3 | [] | no_license | #include"elementtype.hpp"
#include<vector>
#include<iostream>
#include<typeinfo>
template<typename T>
void printElementType (T const& c)
{
std::cout << "Container of "
<< typeid(typename ElementT<T>::Type).name()
<< " elements. \n";
}
int main()
{
std::vector<bool> s;
printElementType(s);
... | true |
c539d2674cbdc39658425e0be0bf8e9f0b58a070 | C++ | yvomenezes/cpp_polytech | /td3/testComplexe.cpp | UTF-8 | 929 | 2.59375 | 3 | [] | no_license | #include "complexe.hpp"
#include <iostream>
int main(int argc, char const *argv[]) {
// Complexe c1(2.1,-6.7);
// Complexe c2;
// Complexe c1 = Complexe();
// Complexe c2 = Complexe(4.5);
// Complexe c3 = Complexe(3.2, 8.9);
Complexe c1;
Complexe c2(4, 5);
Complexe c3(3, 10);
Complexe c4(3,10);
// ... | true |
8a58f7e173250fa8c38a022130feff2f15b06ae2 | C++ | haved/DafCompiler | /Old/OldCpp/Compiler/src/parsing/ast/Type.cpp | UTF-8 | 3,847 | 2.625 | 3 | [] | no_license | #include "parsing/ast/Type.hpp"
#include "parsing/semantic/ConcreteType.hpp"
#include "parsing/ast/FunctionSignature.hpp" //To get FunctionType
#include "parsing/lexing/Token.hpp"
#include "parsing/semantic/NamespaceStack.hpp"
#include "parsing/ast/Definition.hpp"
#include "parsing/ast/Expression.hpp"
#include "parsing... | true |
caf18d755e2ee52cc518e45328db8b30873fdb13 | C++ | deadelus/Chess | /include/Echiquier.h | UTF-8 | 915 | 2.71875 | 3 | [
"Unlicense"
] | permissive | #ifndef ECHIQUIER_H
#define ECHIQUIER_H
#include <vector>
#include "Pieces.h"
//#include <memory>
//#include <array>
class Echiquier
{
public:
Echiquier();
virtual ~Echiquier();
void placerPiece(Piece *p);
bool deplacerPiece(Piece *p, int oldX, int oldY);
void addPiece(Pie... | true |
51397071ef20f16f7869866347111905d92fb922 | C++ | positoy/study-cpp | /cpp/chap04.cpp.reference와const.cpp | UTF-8 | 5,496 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include "include/util.hpp"
class MousePoint {
private:
int x,y;
public:
void setx(int x) { this->x=x; }
void sety(int y) { this->y=y; }
int getx() { return x; }
int gety() { return y; }
void setxy(int x, int y) { this->x=x, this->y=y; }
void print();
void nothing() ... | true |
911078330f94abf31897b6b11a256b3a677f5bc9 | C++ | rajulrs13/SPOJ | /EDIST_6219.cpp | UTF-8 | 1,134 | 3.078125 | 3 | [] | no_license | // Rajul Saxena
// rajulrs13@gmail.com
#include <string.h>
#include <iostream>
using namespace std;
char from[2001];
char to[2001];
int dp_mat[2001][2001];
int main() {
int t;
cin >> t;
while (t) {
cin >> from;
cin >> to;
int i, j;
int n = strlen(from);
int m = strlen(to);
// Initial s... | true |
5875a47ea80ca206b252f1880b8920347bdf8219 | C++ | CESARIUX2596/cpp-crash-course | /Tetris/tetris.cpp | UTF-8 | 2,730 | 2.90625 | 3 | [] | no_license | /*
Tutorial From:
javidx9
https://www.youtube.com/watch?v=8OK8_tHeCIA
*/
#include <iostream>
#include <thread>
#include <vector>
using namespace std;
#include <stdio.h>
wstring tetromino[7];
int nFieldWidth = 12;
int nFieldHeigh = 18;
unsigned char *pField = nullptr;
int nScreenWidth = 80; // Console S... | true |
7415713bb4391dde706590967502b9eb99c2d49c | C++ | ewanbarr/peasoup | /include/transforms/peakfinder.hpp | UTF-8 | 2,827 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <iostream>
#include "data_types/candidates.hpp"
#include "data_types/fourierseries.hpp"
#include "kernels/kernels.h"
#include <thrust/device_vector.h>
#include "utils/utils.hpp"
#include <cmath>
#include <algorithm>
class PeakFinder {
private:
float threshold; //Sigma threshold
float min_freq... | true |
68d8367d2a4c619373179c92a1b8fb2cf0a05a2b | C++ | smileszhang/674datastructure | /674homework2/674homework2/Data.h | UTF-8 | 286 | 2.625 | 3 | [] | no_license | #pragma once
#include<iostream>
#include<vector>
using namespace std;
class Data
{
public:
int key;
int value;
void swap(vector<Data> v, int i, int j);
int leftChild(int i);
int rightChild(int i);
int parent(int i);
bool comp(vector<Data> v, int i, int j);
}; | true |
4d47005061a8bd1e1c1083166ff99d1779cb591f | C++ | MD-Mahbub-Ul-Haque/NSU_CSE_250 | /stacktype08/main.cpp | UTF-8 | 2,550 | 3.515625 | 4 | [] | no_license | #include <bits/stdc++.h>
#include "stacktype.cpp"
using namespace std;
bool IsOperator(char c){
if(c == '+' || c == '-' || c == '*' || c == '/')
return 1;
else
return 0;
}
int prefarance(char ope){
int val = 0;
if(ope == '+' || ope == '-')
val = 1;
if (ope == '*' || ope =... | true |
0f3c81ef6f4ebaf5351db0ede75e6b709e7ff844 | C++ | menegais1/VulkanRenderer | /src/Refactoring/CreateInfoHelpers.h | UTF-8 | 46,768 | 2.546875 | 3 | [] | no_license | //
// Created by menegais on 16/01/2021.
//
#ifndef VULKANBASE_CREATEINFOHELPERS_H
#define VULKANBASE_CREATEINFOHELPERS_H
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <vector>
#include <iostream>
namespace vk {
inline VkBufferCreateInfo bufferCreateInfo(VkDeviceSize size, const std::vector<uint... | true |
cc678e1eff867d706cd7da75f8695ff05ff9f705 | C++ | wangyileipku/ACM | /Google Code Jam/2012round2_D.cpp | UTF-8 | 3,145 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <utility>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <time.h>
#include <stdio.h>
#define FORST(X,S,T) for(int X=S; X<=T; X++)
#define RFORST(X,S,T) for(int X=S; X>=T; X--)
#define ... | true |
6f1c02abc488bf2975833c19276bfdb4370feaf9 | C++ | farmerboy95/CompetitiveProgramming | /SPOJ/SPOJ LASTDIG.cpp | UTF-8 | 594 | 3.0625 | 3 | [] | no_license | /*
Author: Nguyen Tan Bao
Status: AC
Idea: Simply (a^b) % 10
*/
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
using namespace std;
using ll = long long;
ll binPowMod(ll a, ll b, ll m) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1LL) res = res * a % m;
... | true |
aa9fba41f6ea5ffe69c8384ba1506a0c800bf29a | C++ | cf-zhang/design_patterns | /MultipleDispatchingByVisit/multiple_dispatching_by_visit.cpp | UTF-8 | 2,106 | 2.875 | 3 | [] | no_license | #include "mainwindow.h"
#include "temperature.h"
#include <boost/algorithm/string.hpp>
#include <QDebug>
#include <QApplication>
#include <iostream>
#include <typeinfo>
using namespace std;
class Gladiolus;
class Renuculus;
class Chrysanthemum;
class Visitor{
public:
virtual void visit(Gladiolus *f) = 0;
virt... | true |
5509e96748cdbbbcdaaf4e07b82e1bc4717da5d7 | C++ | jakesauter/acm | /sorting.cpp | UTF-8 | 468 | 3.75 | 4 | [] | no_license | #include <iostream>
#include <array>//size
#include <algorithm>
using namespace std;
int main()
{
/*sorting an array*/
int a_size = 10;
int a[a_size] = {4,3,2,9,1,7,6,5,4,4};
sort(a,a+a_size);
for(int i=0;i<a_size;i++)
{
cout << a[i] << " ";
}
cout << endl;
/*sorting a vector*/
vector<int> ... | true |
4acc507f580d2d0261b88944b064e2c251d3c925 | C++ | ericgu/ESP8266Animation | /RGBColorFade.h | UTF-8 | 993 | 2.546875 | 3 | [] | no_license | class RGBColorFade: public Animation
{
private:
Adafruit_NeoPixel* _pStrip;
Mapper* _pMapper;
Chunk* _pChunk;
Chunk* _pColors;
int _currentColor;
Pixel _pixel;
public:
RGBColorFade(Adafruit_NeoPixel* pStrip, String rgbValues)
{
_pStrip = pStrip;
_pColors = new Chunk(rgbV... | true |
2fae4d2173ca63f2ffcc7176a47e59045382520e | C++ | fanqo/CppPrimer | /Ch11/ex11.16.cpp | UTF-8 | 454 | 3.15625 | 3 | [] | no_license | #include <iostream>
using std::cout;
using std::endl;
#include <map>
using std::map;
#include <utility>
using std::pair;
int main()
{
map<int, int> mii {pair<int, int> {3, 1}};
for (auto index : mii)
cout << index.first << ", "
<< index.second << endl;
auto beg = mii.begin();
be... | true |
b8ef998fd1b1e49971f5ef299a3e490df9a5c367 | C++ | quanghuy0497/Competitive-Programing | /Friends_10608_UVA.cpp | UTF-8 | 1,003 | 2.828125 | 3 | [] | no_license | //https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1549
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX 500000
int parent[MAX], friends[MAX];
//=============================================================
int findSet(int u)
{
while (u != parent[... | true |
f7957bf761d26179e4f26883097bbb3f1edbe361 | C++ | Kaustic/KLib | /Include/KLib/String.hpp | UTF-8 | 2,777 | 2.9375 | 3 | [
"MIT"
] | permissive | #pragma once
//TODO: Create a universal String class like sf::String
//TODO: UTF-8 support
#include <algorithm> // std::transform
#include <sstream> // stringstream
#include <stdlib.h> // atoi, atol, atof
#include <string>
#include <KLib/Config.hpp>
#include <KLib/ArrayList.hpp>
#include <KLib/Number.hpp>
namespace... | true |