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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
66fdc50752bf9933f40ec92330e21553e4358f46 | C++ | andreip/sdl2_playground | /src/Game.h | UTF-8 | 676 | 2.640625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <SDL2/SDL.h>
#include "SlotMachine.h"
class Game {
public:
// initializes SDL logic.
Game()
: mWindow(nullptr),
mRenderer(nullptr)
{
}
// cleanup SDL logic.
~Game() { free(); }
void init();
void loop(); // game loop
private:
void free();
// rend... | true |
c24b2fe9ea40451ee60faec4045c4e485da608d8 | C++ | sgzwiz/misc_microsoft_gamedev_source_code | /misc_microsoft_gamedev_source_code/misc_microsoft_gamedev_source_code/extlib/Rockall/Code/Rockall/Tests/TestHeaps.cpp | UTF-8 | 7,237 | 2.59375 | 3 | [] | no_license |
// Ruler
// 1 2 3 4 5 6 7 8
//345678901234567890123456789012345678901234567890123456789012345678901234567890
/********************************************************************/
... | true |
9ba7f10ffb972818f8b84dbd07d0ac0e3c1a21ea | C++ | LengdonB/Pipelined-AVL | /AVL OOP/Temp/LeafNode.cpp | UTF-8 | 642 | 3.03125 | 3 | [] | no_license | #include "LeafNode.h"
#include<iostream>
//initializes the instance of LeafNode
LeafNode::LeafNode()
{
parent = NULL;
}
LeafNode::LeafNode(IPipe * pipe)
{
parent = NULL;
nextFunction = pipe;
}
void LeafNode::executePipe(int value, Node * current)
{
nextFunction->start(value, current);
}
void LeafNode::setPipe(IP... | true |
de25e03ca91378a674a31210b77e737dc36dce50 | C++ | Junchi-Liang/AI_assignment1 | /demo_ui.h | UTF-8 | 1,776 | 3.0625 | 3 | [] | no_license | #ifndef DEMO_UI_H
#define DEMO_UI_H
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
namespace demo_ui_ns
{
int main_menu()
{
int input_num;
while (1)
{
printf("Please input your choice:\n1. Create new map\n2. Read map from file\n3. Execute A* (WA* etc)\n4. Save result in file\n5.... | true |
6b3b83cb3c47bf0163db54940756c604daec9196 | C++ | HarryLong/CubeInSpace | /gl_core/camera.h | UTF-8 | 2,910 | 3.015625 | 3 | [] | no_license | #ifndef CAMERA_H
#define CAMERA_H
#include "glm_wrapper.h"
#include <QObject>
class QTimer;
class Camera : public QObject{
Q_OBJECT
public:
enum Direction {
UP, DOWN, LEFT, RIGHT, FORWARD, BACK
};
enum Type {
ORTHO, FREE
};
Camera();
~Camera();
void reset();
//Giv... | true |
df666085eaea4e2eaa97e7eaf229b2decc5d240e | C++ | dorimeer/computer-graphics2 | /src/main.cpp | UTF-8 | 4,007 | 2.96875 | 3 | [] | no_license | #include <chrono>
#include <cmath>
#include <fstream>
#include <iostream>
// #include <thread>
#include <vector>
#include <file_representation.h>
#include <point.h>
#include <tree.h>
// #include <triangle.h>
using namespace std::chrono;
int main(int argc, char *argv[])
{
if (argc != 3)
{
std::cerr <<... | true |
aa278fba835132010fa043b6a6c9d5699f09d9a9 | C++ | kushagraSahu/Coding | /a12q1.cpp | UTF-8 | 1,705 | 4.15625 | 4 | [] | no_license | //Reverse a stack using a stack.
#include<iostream>
using namespace std;
struct node{
node* next;
char data;
};
void printList(node *head){
while(head){
cout << head->data << "-->";
head = head->next;
}
cout << "Null" << endl;
return ;
}
void push_into_newstack(nod... | true |
bfd4f290d029cc6ac884eb01b3cce16a5eb4bc6d | C++ | LingtaoKong/cppmetrics | /src/meter.h | UTF-8 | 1,957 | 2.75 | 3 | [] | no_license |
#ifndef METRICS_METER_H_
#define METRICS_METER_H_
#include "atomic.h"
#include <iostream>
#include <math.h>
namespace com
{
namespace xiaomi
{
namespace mfs
{
namespace metrics
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Class EWMA
... | true |
b752feb7cd1ef4e7b522b2bc7b0b630e79db629b | C++ | lisaRen/cocos2dx | /Classes/EnemyAI.cpp | UTF-8 | 1,366 | 2.75 | 3 | [] | no_license | #include "EnemyAI.h"
EnemyAI::EnemyAI(EnemyType enemyType, Point heroPos):m_enemyType(enemyType),m_heroPos(heroPos)
{
}
EnemyAI::~EnemyAI()
{
}
Point EnemyAI::moveTo()
{
Size winSize = Director::getInstance()->getWinSize();
Point pos = m_heroPos;
switch (m_enemyType.type)
{
case 0:
pos.x = pos.x + CCRANDOM_... | true |
f8acc111e9d5ebd3874d579b5e7ed4687719c3d1 | C++ | ffauskanger/DAT154_Assignment-2 | /Assignment2/Assignment2.cpp | UTF-8 | 10,162 | 2.78125 | 3 | [] | no_license | // Assignment2.cpp : Defines the entry point for the application.
//
#include "framework.h"
#include "Assignment2.h"
#include "Draw.h"
#include <list>
#include "Car.h"
using namespace std;
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
WCHAR szT... | true |
0880e3c9707f7dea030352ebec35de131af94a54 | C++ | Emil88PL/Cpp | /open a file/main.cpp | UTF-8 | 1,546 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <fstream> //cooperation with files
#include <cstdlib> // for exit
using namespace std;
string firstname, lastname;
int phone;
int main()
{
string line;
int nr_line = 1;
fstream file;
file.open("data.txt", ios::in );
if (file.good() == false)
... | true |
fa9db0e23d7812c2e83d96817e91dca110444496 | C++ | mstojcevich/threadmentor-docker | /projects/example/thread.cpp | UTF-8 | 352 | 3.015625 | 3 | [] | no_license | #include "thread.h"
#include <cstdio>
HelloThread::HelloThread(char *name) : name(name) {
ThreadName.seekp(0, ios::beg);
ThreadName << name << '\0';
}
void HelloThread::ThreadFunc() {
Thread::ThreadFunc();
char buf[256];
int written = sprintf(buf,
"Hello from thread %s!\n",
name);
write(STDOUT_FILENO, bu... | true |
378c644b7a7f85146dc694e0f2120dc9ccc51a0a | C++ | jhaberstro/joh-engine | /src/joh/graphics/Resource.hpp | UTF-8 | 1,783 | 2.6875 | 3 | [] | no_license | #ifndef JOH_GRAPHICS_RESOURCE_HPP
#define JOH_GRAPHICS_RESOURCE_HPP
#include "joh/graphics/GraphicsForwards.hpp"
#include "joh/graphics/ResourceDescription.hpp"
namespace joh
{
namespace graphics
{
class Resource
{
public:
Resource();
... | true |
a359249da869fc7550662fb3645015a1b72fb7ad | C++ | Zuldruck/indie_studio_2018 | /Src/Component/ParticleComponent/ParticleComponent.hpp | UTF-8 | 10,781 | 2.796875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** tek2
** File description:
** ParticleComponent
*/
#ifndef PARTICLECOMPONENT_HPP_
#define PARTICLECOMPONENT_HPP_
#include "Component.hpp"
namespace ind {
class IObject;
/**
* @brief ParticleComponent is a Class which allows to create and manipulate a IParticleSystemSceneNo... | true |
629ee598a06137cd659bcd06fe303d40bbe7a7c5 | C++ | stephangerve/matrix-class | /LinearSystemSolver.cpp | UTF-8 | 1,521 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include "Matrix.h"
#include "Vector.h"
#include "LinearSystemSolver.h"
LinearSystemSolver::LinearSystemSolver(){
}
LinearSystemSolver::~LinearSystemSolver(){
}
Vector* LinearSystemSolver::naiveGaussian(Matrix* A, Vector* b){
int n = A->numColumns();
//Matrix* Ab = augment(A,b);
double ... | true |
92d4acd2bb396b18b083dd8230589ca1b82adbc2 | C++ | intel/riggingtools | /kp2rig/src/KpSolidObject.hpp | UTF-8 | 2,589 | 2.859375 | 3 | [
"MIT"
] | permissive | #ifndef KpSolidObject_hpp
#define KpSolidObject_hpp
#include <vector>
#include "Pose.hpp"
#include "RigPose.hpp"
class KpSolidObject : public Pose
{
public:
KpSolidObject() = default;
KpSolidObject( std::string kpType,
const std::map< KEYPOINT_TYPE, int > & kpLayout );
KpSolidObject( const KpSolidObjec... | true |
0a59c0aee570d11939ed74bfe841a57412f1b094 | C++ | Maldela/Macrodyn-Qt | /Jobs/floathisto2d.cpp | UTF-8 | 5,290 | 2.75 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
//
// Module name: floathisto_2d.C
// Contents: member functions of the class floathisto_2d
//
// Author: Andreas Starke
// Last modified:
// By:
//
///////////////////////////////////////////////////////////////////////////////
#in... | true |
ac7c4cd90c1c4512430177914790a7934a218c71 | C++ | Just4yk4a/LabWork | /OAIP/lab 10/Project 5.12/Source.cpp | UTF-8 | 1,087 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <ctime>
using namespace std;
void Random(int **array, int &size)
{
int a, b;
cout << "Enter interval: ";
cin >> a >> b;
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
array[i][j] = a + rand() % (b - a);
}
}
}
void Print(int **array, int &size)
{
for (int... | true |
9cee3a809bf00032d1f59e3e52e42f4a427cce23 | C++ | ghensto/Cpp | /AdvancedfileIO.cpp | UTF-8 | 1,182 | 4.15625 | 4 | [] | no_license | // This program will read a file and compare the numbers
// inside it
#include <iostream>
#include <fstream>
using namespace std;
int const SIZE = 12;
int main()
{
// Variables
fstream iFile;
int numbers;
int array[SIZE];
int highest;
int lowest;
int count = 0;
float sum = 0;
float ave;
iFile.open("C:\\te... | true |
7888542f1b7b525e1e17f19045db4d0b953bd79b | C++ | Neverous/team | /CODES/convexGraham.cpp | UTF-8 | 1,353 | 3.5 | 4 | [] | no_license | /* Otoczka wypukła algorytmem Grahama */
std::pair<int, int> ref;
inline static const long long int cross(const std::pair<int, int> &A, const std::pair<int, int> &B, const std::pair<int, int> &C);
inline static const bool specialSort(const std::pair<int, int> &A, const std::pair<int, int> &B);
inline static void conv... | true |
72b43bd754410c04972ad4d51511bbbb72435bbd | C++ | sdolard/fcgi_js_web_server | /fcgi_js_web_server_core/abstract_socket.h | UTF-8 | 2,301 | 2.609375 | 3 | [] | no_license | #ifndef ABSTRACTSOCKET_H
#define ABSTRACTSOCKET_H
#include <QSslSocket>
#include <QTimerEvent>
// Abstract socket
class AbstractSocketPrivate;
class AbstractSocket : public QSslSocket
{
Q_OBJECT
public:
// Server read mode
enum ReadMode {
rmStream = 0x00, // as stream > no end
rmLine = 0x0... | true |
96f599d91b55c13f633639f6f7c204108dc0953a | C++ | baijiasheng/muduotest | /include/EventLoop.h | UTF-8 | 1,999 | 2.890625 | 3 | [] | no_license | #pragma once
#include <vector>
#include <atomic>
#include <functional>
#include <memory>
#include <mutex>
#include "NonCopyable.h"
#include "TimeStamp.h"
#include "CurrentThread.hpp"
#include "Poller.h"
#include "Channel.h"
using namespace std;
using Functor = function<void()>; //一种函数封装
using ChannelList = vector<Ch... | true |
1cc991695dbe369d64f5dd9a20ef1b6ce7578273 | C++ | krajeshshau/CPP | /bitwise.cpp | UTF-8 | 1,938 | 4.0625 | 4 | [] | no_license | #include <stdio.h>
#include<iostream>
using namespace std;
int main(void) {
int x = 19, y = 20;
cout<<(x << 1)<<endl; //Left shift i.e multiplication by 2 => 38
cout<<(x >> 1)<<endl; //Right shift i.e division by 2 => 9
(x & 1) ? cout<<"Odd"<<endl : cout<<"Even"<<endl; //To check ... | true |
f65d3b5e10462031faf3f16d9e22dc7f2dea3709 | C++ | Cem-Alagozlu/MyEngine | /Minigin/PhysicsManager.cpp | UTF-8 | 1,336 | 2.515625 | 3 | [] | no_license | #include "MiniginPCH.h"
#include "PhysicsManager.h"
namespace cem
{
PhysicsManager::PhysicsManager()
{
}
PhysicsManager::~PhysicsManager()
{
}
void PhysicsManager::AddComponent(std::shared_ptr<CollisionComponent> collisionComponent)
{
m_pCollisionComponents.push_back(collisionComponent);
}
void Physic... | true |
39e8fe4463a4c3c742e3f263a13221a093e37fc3 | C++ | royeom/Algorithm | /SWEA/1251.cpp | UTF-8 | 2,109 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#define MAX 1001
int island_num;
double E;
long long island[MAX][MAX];
long long parents[MAX];
long long find(long long first){
if(parents[first] == first)
return first;
else
return parents[first] = find(parents[first... | true |
d23ca1ae813e0f895a225b18edb380e1ea752d92 | C++ | notdatboi/Matrices | /ShapeWrapper.hpp | UTF-8 | 635 | 2.640625 | 3 | [] | no_license | #ifndef SHAPE_WRAPPER_HPP
#define SHAPE_WRAPPER_HPP
#include"Matrix.hpp"
const int SCREEN_HEIGHT = 600;
const int SCREEN_WIDTH = 800;
class ShapeWrapper
{
private:
std::vector<sf::Vertex> vertices;
public:
ShapeWrapper(const double posX = 0, const double posY = 0);
std::vector<sf::Vertex>& getVertices();
... | true |
1b1979e76d5aea576fc4d463d38199111694982d | C++ | MrPickle311/QuickCurses | /tests/Core/TestingGoodies.hpp | UTF-8 | 2,262 | 3.765625 | 4 | [] | no_license | #pragma once
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
template<typename T>
std::vector<T> mergeVectors(const std::vector<T>& left_vector,const std::vector<T>& right_vector)
{
std::vector<T> new_values;
size_t const new_size {left_vector.size() + right_vector.size()};
ne... | true |
d9f4c2cfabb6ca9e4529c30804cdf04f5303aab0 | C++ | alexmeier2828/project_1 | /source/view/squareView.cpp | UTF-8 | 555 | 2.578125 | 3 | [] | no_license | #include "squareView.hpp"
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace project_1::view;
SquareView::SquareView(int x, int y){
this->p_x = x*10;
this->p_y = y*10;
this->frame = 1;
_animatedSprite = new AnimatedSprite(10, 10, 2, "/Users/alexmeier/Desktop/workspace/project_1/resources... | true |
8f20ed8865d53c18cf2c0aed37e87767d7778e29 | C++ | carrot77/EasyWindows | /EasyWindows/Control.h | UTF-8 | 3,482 | 2.875 | 3 | [] | no_license | #pragma once
#include <Windows.h>
#include <string>
#include <functional>
#include <list>
#define DEEP_COPY_DECL(T) \
T(T&&) noexcept = default; \
inline Control *deep_move(Control&& c) noexcept override { \
return new T(std::move(dynamic_cast<T&>(c)));\
}
template <class ...Params>
class EventHandler {
std::l... | true |
0939457c0f7cfbf4dbcc3edd6a8ed2f7418b3910 | C++ | avinashvrm/Data-Structure-And-algorithm | /Dynamic Programming/Longest String Chain.cpp | UTF-8 | 886 | 2.734375 | 3 | [] | no_license | class Solution {
public:
int longestStrChain(vector<string>& words)
{
sort(words.begin(), words.end(), [](string a, string b) {
if(a.length() == b.length())
return a>b;
else
return a.length() < b.length();
});
unordered_ma... | true |
8789aaa9fb0a2143c20baf86ae93c518a54f4a71 | C++ | me1lopig/Recursividad | /sumaCifras/sumaCifras.cpp | UTF-8 | 1,126 | 3.84375 | 4 | [] | no_license | // sumaCifras.cpp
// comparacion entre rcursion e iteracion
// uma de las cifras de un numero entero
//
#include <iostream>
using namespace std;
int sumaRecursiva(long n)
{
if (n <= 9)
{
// caso base
return n;
}
else
{
// caso recursivo
return sumaRecursiva(n / ... | true |
db1f47272ac384ff2125e8af4d08438d6c13bb8c | C++ | ali-alaei/RRT | /RRT algorithm/Navigator.h | UTF-8 | 951 | 2.515625 | 3 | [] | no_license | #ifndef NAVIGATOR_H
#define NAVIGATOR_H
#include <cmath>
#include "Nodes.h"
#include "Obstacles.h"
#include <iostream>
#include <vector>
#define baseSize 100
#define radius
class Navigator
{
Nodes* nearestNode;
Nodes* randomNode;
Nodes* newNode;
Nodes* startNode;
Nodes* destNode;
Nodes* flagNode;
std::vecto... | true |
da12ed36d0831b8796cd394a725af3a020b58f9a | C++ | williamkosasih19/bob | /source/prins.cpp | UTF-8 | 451 | 2.90625 | 3 | [] | no_license | /* prins.cpp *
* prints string */
#include "include/prins.h"
#include <iostream>
#include <string>
using namespace std;
extern bool fault;
prins::prins(string new_to_print, int new_mode)
{
to_print=new_to_print;
mode=new_mode;
}
void prins::run()
{
if(fault)
return;
switch(mode)
{
... | true |
34e85ce242be1d4aa6b6a8ee1171c4f93a55bc9d | C++ | ChokMania/Old_CPP-Modules | /Old-CPP Module 01/ex03/Zombie.hpp | UTF-8 | 449 | 2.671875 | 3 | [] | no_license | #ifndef OLD_CPP_MODULES_ZOMBIE_HPP
# define OLD_CPP_MODULES_ZOMBIE_HPP
# include <iostream>
class Zombie
{
public:
Zombie(std::string name, std::string type = "default");
~Zombie(void);
Zombie(void);
void setType(std::string type);
void setName(std::string name);
std::string getType(void);
std::string getNa... | true |
96996ac8c494ac990114b50e1e93e64a06f95ff3 | C++ | smacinnes/CGLab | /raytrace/Separated/imageplane.h | UTF-8 | 596 | 2.59375 | 3 | [] | no_license | #ifndef IMAGEPLANE_H
#define IMAGEPLANE_H
#include "OpenGP/Image/Image.h"
#include "camera.h"
using namespace OpenGP;
using Colour = Vec3;
// Class defining all properties of the image plane
class ImagePlane {
private:
int wResolution,hResolution; // default is 640x480
float viewingAngle... | true |
c4104f28f8f6d25f167769cda64ffd699b5caa0b | C++ | connormanning/arbiter | /arbiter/util/util.hpp | UTF-8 | 7,062 | 3.09375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>
#ifndef ARBITER_IS_AMALGAMATION
#include <arbiter/util/exports.hpp>
#include <arbiter/util/types.hpp>
#endif
#ifdef ARBITER_CUSTOM_NAMESPACE
namespace ARBITER_CUSTOM_NAMESPACE
{
#endif
namespace arbiter
{
/**... | true |
c6f3fb86ec30194f1fc9741f1006b1e72948df94 | C++ | SchlarmanUlster/COM326 | /Week3Lab1/Week3Lab1/Main.cpp | UTF-8 | 563 | 3.15625 | 3 | [] | no_license | //Week 3 Lab 1
//Author: Joe Schlarman
#include <iostream>
#include <string>
#include "Student.h"
using namespace std;
int main() {
//use default constructor
Student test{};
//use custom constructor
Student me{ "Billy Bragg", "B00578985", "Music theory", 3, 87, 92, 47 };
me.ToString();
//print module grad... | true |
50551d7ec1318a6cfd4c59404da17e37c76df994 | C++ | liat92/TetrisGame | /Tetris/Header Files/StatusGame.h | UTF-8 | 1,090 | 2.765625 | 3 | [] | no_license | #ifndef __STATUS_GAME_H
#define __STATUS_GAME_H
#include <iostream>
using namespace std;
#include "Gotoxy.h"
#include <fstream>
class StatusGame
{
//Class attributes:
public:
enum eScore {HARD_DROP = 2,BOMB_EXPLOSION = 50, SINGELE_LINE_CLEAR = 100, ADDITION_LINE = 200};
private:
int xStatusPositionCord;
int yStatu... | true |
178a364db02d0d444dec6dbcdfc990a489c2dd09 | C++ | DerThorsten/zgraph | /include/zgraph/algorithm/zbfs.hpp | UTF-8 | 5,629 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#ifndef ZGRAPH_ALGORITHM_ZBFS_HPP
#define ZGRAPH_ALGORITHM_ZBFS_HPP
#include <range/v3/view/filter.hpp>
#include <range/v3/functional/identity.hpp>
#include <range/v3/view/transform.hpp>
#include "zgraph/graph/zgraph_base.hpp"
#include <queue>
namespace zgraph
{
// template<
// clas... | true |
c36677811a7dd71e98ac9214a28aaae476ed0e62 | C++ | Qiyd81/shenlan | /camera_slam/slam14/lesson3/trajectory/draw_trajectory.cpp | UTF-8 | 4,750 | 2.8125 | 3 | [] | no_license | #include <sophus/se3.h>
#include <string>
#include <iostream>
#include <fstream>
// need pangolin for plotting trajectory
#include <pangolin/pangolin.h>
using namespace std;
// path to trajectory file
string trajectory_file = "./trajectory.txt";
// function for plotting trajectory, don't edit this code
// start poi... | true |
4c44ed4a201d86dfa6b90500cbc0aff7d4bdb377 | C++ | wencanis/martian_revolutionary_war | /Mars_War/Base.h | UTF-8 | 3,862 | 2.9375 | 3 | [
"MIT"
] | permissive | #ifndef BASE_H_INCLUDED
#define BASE_H_INCLUDED
#include <list>
#include <cmath>
#include "Spaceship.h"
#include "Bullet.h"
#include "Global.h"
// A structure for the shields.
struct Shield
{
bool down; // Whether or not it's been destroyed.
float distance, hp; // Its distance from the side of the map and its... | true |
a045b7c5d7fe619b16fe515512433ac543824309 | C++ | jfrancisco-neto/deimos | /include/Deimos/VBO.hpp | UTF-8 | 2,914 | 2.828125 | 3 | [] | no_license |
#ifndef DEIMOS_VBO_H_INCLUDED
#define DEIMOS_VBO_H_INCLUDED
#include <Phobos/BaseAPI.h>
#include <vector>
#include <iterator>
namespace deimos
{
enum VBODataType
{
SHORT,
INT,
FLOAT,
DOUBLE
};
enum VBOType
{
ARRAY,
INDEX //not supported yet
... | true |
d7703c4297210652141d343fc648209a1296762c | C++ | mitshan1994/Graph-Related | /main.cpp | UTF-8 | 565 | 3.046875 | 3 | [] | no_license | //#include <iostream>
//#include <vector>
//#include <utility>
//#include "graph.h"
//
//int main()
//{
// Graph<double> g;
// g.Print();
// //g.AddVertex(3.5);
// //g.AddVertex(4.5);
// //g.AddEdge(3.5, 4.5, 10);
// //g.Print();
// g.AddVertex({ 1, 2, 3 });
// g.Print();
// std::vector<std::... | true |
f0cede5c4df8d038035ee67eb84e1ba8a969561b | C++ | Rahul-Bhargav/TestHarness | /TestUtilities/ITest.h | UTF-8 | 1,663 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
///////////////////////////////////////////////////////////////////////
// ITest.h - Provides the interface for writing the tests //
// ver 1.0 //
// Language: C++, Visual Studio 2017 //
// Application: Most Projec... | true |
1be5ecae6dc5284abbfb8bc0bbb168aa606f343a | C++ | ahvova/hinkaku | /dz1/main.cpp | UTF-8 | 3,633 | 3.25 | 3 | [] | no_license | #include<iostream>
#include<math.h>
#include<fstream>
double sina(double a=2.7,double b=3.1);
double function (double );
int numberofsteps(double,double,double);
int factorial (int);
int main() {
////////// ZADACHA1
double x;
double y;... | true |
19644657e1e97bea7a43ce88e834197fbd2133c1 | C++ | jsshao/straights2 | /View.h | UTF-8 | 1,796 | 2.75 | 3 | [] | no_license | #ifndef VIEW_H
#define VIEW_H
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include <gtkmm/image.h>
#include <gtkmm/table.h>
#include <gtkmm/button.h>
#include <gtkmm/entry.h>
#include <gtkmm/frame.h>
#include <vector>
#include "DeckGUI.h"
#include "Controller.h"
#include "Model.h"
class View : public Gtk::Windo... | true |
bdc63cc68bb24ac9397c823ae4d7796bb9933d45 | C++ | smallkirby/bdm-nekomanju | /main/mains/main_bluetooth.ino | UTF-8 | 355 | 2.75 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | void setup() {
//11520bpsでポートを開く
Serial.begin(115200);
}
void loop() {
//シリアルポートに到着してるデータのバイト数が0より大きい場合
if (Serial.available() > 0) {
int input = Serial.read();
//受信確認でログ吐かせてみた
Serial.println(input);
Serial.println("hello");
}
}
| true |
b6df675e5297acf609b13f792ee3b04703a39233 | C++ | manohar2000/DSA_450 | /Arrays/Medianof2Arr.cpp | UTF-8 | 1,861 | 3.546875 | 4 | [] | no_license | /*
Given two sorted arrays nums1 and nums2 of size m and n respectively,
return the median of the two sorted arrays.
Example 1:
Input: nums1 = [1,3], nums2 = [2]
Output: 2.00000
Explanation: merged array = [1,2,3] and median is 2.
Example 2:
Input: nums1 = [1,2], nums2 = [3,4]
Output: 2.50000
Explanation: merged arr... | true |
931e6896efa74c054db1ca1aeab2b391a08ee129 | C++ | DCSR/SA200 | /FeatherM0/Device.h | UTF-8 | 432 | 2.828125 | 3 | [] | no_license |
/*
* Device.h - Library for timed devices such as pumps, LEDs and food hoppers
* Created by David Roberts, Mar 6, 2019
*/
#ifndef Device_h
#define Device_h
#include "Arduino.h"
class Device {
public:
Device(int num);
void switchOn();
void switchOff();
void switchOnFor(long duration);
void... | true |
7e857de38ddc758af70ca1ec3f9b00879883a949 | C++ | mxm001/UNLaM | /Programacion Basica I/clase 8/clase8-3.cpp | UTF-8 | 259 | 2.875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
main()
{
int num,mayor;
while(num!=99)
{
printf("\nIngrese un numero: ");
scanf("%d",&num);
if((num>mayor)&&(num!=99))
{
mayor=num;
}
}
printf("\nEl mayor numero es: %d",mayor);
getch();
return(1);
}
| true |
804116218355a9d3f99945335814962d89dff132 | C++ | deadzora/Zorlock | /Zorlock/src/Zorlock/Editor/Assets.cpp | UTF-8 | 1,917 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #include "ZLpch.h"
#include "Assets.h"
#include <rpc.h>
namespace Zorlock
{
void Asset::GetUUID()
{
#ifdef ZL_PLATFORM_WINDOWS
UUID uuid;
RPC_STATUS s = UuidCreate(&uuid);
HRESULT hr = HRESULT_FROM_WIN32(s);
if (SUCCEEDED(hr))
{
RPC_STATUS ss = UuidToStringA(&uuid, (RPC_CSTR*)&m_uuid);
HRESULT hrr = ... | true |
c63cffca9d3b024e3597fc74f01de80c630daffc | C++ | arnonzilca/steganos | /src/file_permissions_covert_channel.cpp | UTF-8 | 2,650 | 3.296875 | 3 | [] | no_license | #include <sys/stat.h>
#include <stdlib.h>
#include <fstream>
#include "file_permissions_covert_channel.h"
#include "message_exception.h"
using namespace std;
const char FilePermissionsCovertChannel::FILE_NAME[] = "/tmp/innocent_file";
const int FilePermissionsCovertChannel::SYNC_BIT_POS = 0;
const int FilePermissi... | true |
12484101096c3cb6041d09ae019f8744b8e90e06 | C++ | Ayush32/Cpp-Data-Structures | /Linked List/inser_middle_list.cpp | UTF-8 | 572 | 3.59375 | 4 | [] | no_license | /*
* Copyright (c) 2020
* All rights reserved.
*/
#include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int d)
{
data = d;
next = NULL;
}
};
void print(node *head)
{
while (head != NULL)
{
cout <<... | true |
92cf6acaa052192aafbf39c5ef24366a13f99de9 | C++ | aprilvkuo/leetcode | /leetcode/cpp/src/1024.cpp | UTF-8 | 817 | 3.140625 | 3 | [] | no_license | //
// Created by April Kuo on 2020/10/24.
//
/*
* https://leetcode-cn.com/problems/video-stitching/
* 1024. 视频拼接
* 1. 动态规划
* 2. 贪心
*/
class Solution {
public:
int videoStitching(vector<vector<int>>& clips, int T) {
vector<int> left_to_right(T+1, 0);
for (auto &item: clips) {
if (it... | true |
13f151050057117e2aade403bd9633763faf3d69 | C++ | d0ctr/infotecs-cpp-task | /program2/connectionhost.cpp | UTF-8 | 1,506 | 3.0625 | 3 | [] | no_license | #include "connectionhost.hpp"
ConnectionHost::~ConnectionHost()
{
unlink(server_socket_name.sun_path);
close(server_socket);
close(client_socket);
}
std::string ConnectionHost::readFromSocket()
{
read_stream = fdopen(client_socket, "r");
std::string new_line("");
char c;
while((c = fgetc(read_stream)) !... | true |
e053df53fad5186ea42aea59ee8b4d9eb23a2ca6 | C++ | hexu1985/cpp_book_code | /cpp.adts.data/Chap14/Figure14.3/Employee.h | UTF-8 | 2,360 | 4.03125 | 4 | [] | no_license | /* Employee.h --------------------------------------------------------------
Header file for a class Employee that encapsulates the attributes common
to all employees.
Operations are: A constructor and an output operation.
-----------------------------------------------------------------------*/
#include <... | true |
004e41311e1d89f2889003fc1cccfb1ee3048cbe | C++ | codedazzlers/DSA-Bootcamps | /Arya Chakraborty/Strings/concatenate.cpp | UTF-8 | 587 | 3.03125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int length(string s)
{
int i = 0;
while (s[i])
{
i++;
}
return i;
}
int main()
{
char s[100], s1[100];
cin.getline(s, 100);
cin.getline(s1, 100);
int length1 = length(s), length2 = length(s1), addLen = length1 + length2;
char s2[a... | true |
a02a049046f5267c0c77d3f65e317543360252db | C++ | telishev/sneakPic | /src/editor/base_handle.cpp | UTF-8 | 2,407 | 2.578125 | 3 | [] | no_license | #include "editor/base_handle.h"
#include <QTransform>
#include "renderer/anchor_handle_renderer.h"
#include "path/geom_helpers.h"
base_handle::base_handle ()
{
m_handle_type = handle_type::SQUARE;
m_renderer.set_visible (true);
}
base_handle::~base_handle ()
{
}
int base_handle::distance_to_mouse (QPoint scr... | true |
5ef5fd506c758bf452e21236bec63cb183c8471d | C++ | Kapurichino/AvoidStar-Refactoring- | /setting.cpp | UTF-8 | 914 | 2.65625 | 3 | [] | no_license | #include "header.h"
int Setting::need = 0;
int Setting::count = 0;
int Setting::avoid = 0;
int Setting::fallenStar = 0;
int Setting::remain = 0;
int Setting::level = 0;
int Setting::speed = 0;
int Setting::require()
{
need = 20 + getLevel() * 20;
return need;
}
void Setting::starUp()
{
count = 5 + getLevel() * L... | true |
4d478b36c91fced544a640e7d27a7395c3481be0 | C++ | Avijit7102/LeetCode-Problem-Solving | /maxAreaOfIsland.cpp | UTF-8 | 1,297 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
void countGrid(vector<vector<int>> &grid, int x, int y, int r, int c, int &count)
{
if(x < 0 || x >= r || y < 0 || y >= c || grid[x][y] != 1)
{
return;
}
grid[x][y] = 2;
count++;
cou... | true |
01cbf400990ed274c1f4e0a9bbfe1b9175627aa8 | C++ | kjnh10/pcw | /work/atcoder/abc/abc027/A/dump.hpp | UTF-8 | 1,186 | 3.359375 | 3 | [] | no_license | // http://www.creativ.xyz/dump-cpp-652
using namespace std;
#include <iostream>
#include <bits/stdc++.h>
// デバッグ用変数ダンプ関数
void dump_func() {
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail)
{
DUMPOUT << head;
if (sizeof...(Tail) == 0) {
DUMPOUT << " ";
}
else {
... | true |
bb3a2a4dab391a82fa1447f66f8f76a0af68ac12 | C++ | Wycers/Codelib | /Lydsy/P1617 [Usaco2008 Mar]River Crossing渡河问题/P1617.cpp | UTF-8 | 594 | 2.78125 | 3 | [
"MIT"
] | permissive | #include <cstdio>
#include <cstring>
#include <algorithm>
const int N = 2500 + 10;
using namespace std;
int n,s[N];
void Readin()
{
int temp;
scanf("%d%d",&n,&s[0]);
for (int i=1;i<=n;++i)
{
scanf("%d",&temp);
s[i] = s[i - 1] + temp;
}
}
int f[N];//f[i] - the cost of carrying i cows;... | true |
e98d8d99be601349143ac98378bd63cc0ffeb937 | C++ | rdieno/lostmines | /LostMines/LostMines/Game/UI/TextInputUI.cpp | UTF-8 | 2,594 | 2.921875 | 3 | [] | no_license | #include "TextInputUI.h"
#include "../../Engine/Game.h"
#include "../../Engine/Texture/TextureManager.h"
#include "../../Engine/AssetManager/AssetManager.h"
TextInputUI::TextInputUI() {}
TextInputUI::TextInputUI(std::string id, UILabels type, std::string fontName, SDL_Rect position, SDL_Color color, std::string place... | true |
5350ccdd05cdcb9267c063a023fdecadb7fc8b50 | C++ | CAgAG/DataStructure_CPP | /String/SeqString.cpp | UTF-8 | 3,538 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive |
#include "SeqString.h"
void InitString(SeqString &Str) {
clear(Str);
Str->length = 0;
}
int StrLength(SeqString Str) {
int length = 0;
for (length = 0; Str->ch[length] != '\0'; length++) {}
return length;
}
void StrConcat(SeqString &Str1, SeqString Str2) {
for (int i = 0; i < Str2->length; +... | true |
1f1c7168f0d4b87fe3602e2ec1116f493304572b | C++ | MoriartyShan/PythonModuleWithCpp | /src/class.cpp | GB18030 | 2,982 | 2.859375 | 3 | [] | no_license | #include <string>
#include <Eigen/Dense>
#include <Python.h>
#include <structmember.h>
#include <iostream>
#include <sstream>
typedef struct _EigenUtil{
PyObject_HEAD;
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> a;
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen... | true |
2fd7c25208d91221b8cd3e294c35da648e6e223d | C++ | TonyChouZJU/c---primer | /ex926.cpp | UTF-8 | 870 | 3.234375 | 3 | [] | no_license | /*
*copy dynamic array to vector and list
*erase odd elements in the list and
*erase even elements in the vector
*by zhoudaxia
*see c++ primer(5th)
*/
#include <vector>
#include <list>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
int main()
{
int ia[]={0,1,2,3,4,5,6,7,8,13,21,... | true |
6e18390f31ab4ed499a2d1a08d37757b350e10d9 | C++ | masonicgryphon7/AuroraEngine | /Vector3.h | UTF-8 | 414 | 2.734375 | 3 | [] | no_license | #pragma once
#include <string>
#include <DirectXMath.h>
class Vector3
{
public:
Vector3() = default;
Vector3(float x_in, float y_in, float z_in);
Vector3(DirectX::XMVECTOR in);
Vector3 operator+ (const Vector3& vec3) const;
bool operator!= (const Vector3& vec3) const;
bool operator== (const Vector3& vec3) const... | true |
ab387a8626925ae951e3e5f750c3f5c2f137b379 | C++ | i2070p/R-nd | /Operations/Condition.h | UTF-8 | 1,025 | 2.921875 | 3 | [] | no_license | #pragma once
#include "SimpleOperation.h"
#include <stack>
#include "../Elements/LiteralElement.h"
#include "../StackAdapter.h"
#include "Expression.h"
#include <sstream>
using namespace std;
class Condition : public SimpleOperation {
public:
Condition(Operation * parent) : SimpleOperation(parent) {
}
... | true |
38d7b86792aff4ba3a0a55944f0bd2bec7d1d7ac | C++ | zhuxb/C-ATTL3 | /C-ATTL3/neural_network/ResidualNeuralNetwork.hpp | UTF-8 | 5,387 | 2.75 | 3 | [
"MIT"
] | permissive | /*
* ResidualNeuralNetwork.hpp
*
* Created on: 25 Jul 2018
* Author: Viktor Csomor
*/
#ifndef C_ATTL3_NEURAL_NETWORK_RESIDUALNEURALNETWORK_H_
#define C_ATTL3_NEURAL_NETWORK_RESIDUALNEURALNETWORK_H_
#include <cassert>
#include <utility>
#include "neural_network/CompositeNeuralNetwork.hpp"
namespace cattle... | true |
41ba9b968c5ca1fa6a4e0b4f69bb82d2261b98b4 | C++ | faerytea/Warlocks | /Settings.h | UTF-8 | 1,008 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
class Settings {
private:
std::map<std::string, std::string> settingsMap;
std::string fileName;
void save();
void checkFile();
public:
/**
* Construct settings store
* and load data from file (if exists)
*... | true |
67cbc3905b3dc3dbca34d4577ac08c9ad2ed70ef | C++ | UnluckyHeroes/Idarax | /SDL8_Handout/ModuleScene1.cpp | UTF-8 | 1,586 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "Globals.h"
#include "Application.h"
#include "ModuleTextures.h"
#include "ModuleRender.h"
#include "ModulePlayer.h"
#include "ModuleCollision.h"
#include "ModuleParticles.h"
#include "ModuleEnemies.h"
#include "ModuleScene1.h"
// Reference at https://www.youtube.com/watch?v=OEhmUuehGOA
ModuleScene1::ModuleS... | true |
053d613f6756249c8770de3122f0fa74ae7d6a7c | C++ | Zanzal/X-Studio2-Mirror | /Logic/MapIterator.hpp | UTF-8 | 1,863 | 3.390625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <iterator>
namespace Logic
{
namespace Utils
{
/// <summary>Forward only iterator for accessing the values in a map collection</summary>
template <typename OBJ, typename COLL, typename ITER>
class MapIterator : public std::iterator<std::forward_iterator_tag, OBJ>
... | true |
f33ae202ebd3dc215ba2ccdaf23552b263df36f2 | C++ | JavaZhangYin/coding | /general/const.cpp | UTF-8 | 984 | 3.90625 | 4 | [] | no_license | #include<iostream>
// const int const * const func(const int const * const &p) const;
// the function can be reduced to ==>>
// int const * const func(int const * const &p) const;
// from left to right,
// const 1: return value can not be changed.
// const 2: return pointer can not be changed.
// const 3: paramete... | true |
ebfd0e734594fb011bade71d92a6957b8aa553cb | C++ | LordBones/EvoLisaBetter | /TestWin32/FastFunctions2.cpp | UTF-8 | 2,320 | 2.625 | 3 | [] | no_license | #include "stdafx.h"
#include "FastFunctions2.h"
FastFunctions2::FastFunctions2(void)
{
}
FastFunctions2::~FastFunctions2(void)
{
}
void FastFunctions2::FastRowApplyColor(unsigned char * canvas, int from, int to, int colorABRrem, int colorAGRrem, int colorARRrem, int colorRem)
{
//unsigned int * ptrColor = (uns... | true |
6a8af0d88727a334b90258aec72878c22c8c792f | C++ | redturtlepower/openapi-generator-integration | /server/qt/demo/logger.h | UTF-8 | 501 | 2.828125 | 3 | [] | no_license | #ifndef LOGGER_H
#define LOGGER_H
#include <QPlainTextEdit>
class Logger{
Logger() = default;
QPlainTextEdit *output_;
public:
Logger(const Logger &) = delete;
void operator=(const Logger &) = delete;
static Logger &getLogger(){
static Logger logger;
return logger;
}
void s... | true |
33568e13c0c165e80880ec5c2725c49899a77103 | C++ | RGBRYANT24/AlgorithmPractice | /Tiantisai/5.cpp | UTF-8 | 562 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int num[30];
for(int i=0; i < 24; i ++)
{
cin >> num[i];
}
int time;
int count = 0;
while (cin >> time )
{
if(time >= 24 || time < 0)
{
break;
}
if (count)
... | true |
0d6849367c09c797ab262de816b1d55f7c12a6ad | C++ | maximaximal/Spacegasm | /src/CTextureManager.cpp | UTF-8 | 1,755 | 2.90625 | 3 | [] | no_license | #include "CTextureManager.h"
#include <iostream>
#include <CTexture.h>
#include <CStringExt.h>
using namespace std;
CTextureManager::CTextureManager()
{
//ctor
}
CTextureManager::~CTextureManager()
{
//dtor
}
void CTextureManager::loadTexture(std::string filename, std::string textureID)
{
if(m_textures.co... | true |
a2ab807e13a8cd54c55e83199c4bd04c6f248d1e | C++ | fmilburn3/DigitalPot_MCP41010 | /DigiPot.cpp | UTF-8 | 980 | 2.734375 | 3 | [] | no_license | /*
DigiPot.cpp - Library for MCP41010 digital potentiometer.
Created by Frank Milburn, 17 June 2015
Released into the public domain.
*/
#include <Energia.h>
#include "DigiPot.h"
DigiPot::DigiPot(int digiPotPin)
{
_digiPotPin = digiPotPin;
pinMode(_digiPotPin, OUTPUT);
}
void DigiPot::setValue(byte potValue)... | true |
dffa109f5c665b6847a199664354d8c816bdc18f | C++ | chasebroder/SWDevProj | /src/utils/args.h | UTF-8 | 3,295 | 3.046875 | 3 | [] | no_license | #pragma once
#include "object.h"
#include <stdio.h>
/**
* A class to parse and hold all of the command line arguments. This object will end up being exposed to
* the entire program.
* IMPORTANT: Need to call parse() to actually read in the commandline args. Otherwise it will be all defaults
*
* @authors... | true |
dc47a200afeb79ed39712c78675130eab6db5ee1 | C++ | jeanpimentel/fsm66 | /erro.cpp | ISO-8859-1 | 2,047 | 2.953125 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include "lexico.h"
#include "erro.h"
int quantidade_erros = 0;
const char* erro_mensagem(int);
const char* tipo_erro(int);
void erro(int tipo, int erro, int linha) {
quantidade_erros++;
fprintf(stderr, "ERRO%s: %s na linha %d.\n", tipo_erro(tipo), erro_me... | true |
7553497cfa5b35d6e6ebf6d0951a8cb9c1395492 | C++ | Kuailun/Leetcode | /_167_Two_Sum_II/_167_Two_Sum_II.cpp | UTF-8 | 1,492 | 3.328125 | 3 | [] | no_license |
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<int> twoSum(vector<int>& nums, int target);
int main()
{
vector<int> input, output;
int target;
input.push_back(2);
input.push_back(7);
input.push_back(9);
input.push_back(11);
target = 13;
output = twoSum(input, target)... | true |
4ce5c8305a64c1b0f4db78bb483d0111414bd89e | C++ | RajKamal2013/DSA | /C++Source/flags.cpp | UTF-8 | 12,616 | 3.171875 | 3 | [] | no_license | // Test the efficiency of various implementations for storing and
// manipulating 32 boolean values. Methods tested are arrays of ints,
// shorts, chars, and one-bit boolean values.
#include "book.h"
// 32 one-bit values using the C++ bit-flag operators
struct btype {
int f0 : 1;
int f1 : 1;
int f2 : 1;
int f3 : 1;
i... | true |
0fe8e53234e011c5762f1a74c343f6cfd797f25a | C++ | KyleWilliford/Blackjack | /Blackjack/Blackjack/Game.cpp | UTF-8 | 18,024 | 3.140625 | 3 | [] | no_license | /*
Kyle Williford
Blackjack [WIP]
*/
#include <stdlib.h>
#include <iostream>
#include "Game.h"
#include "math.h"
bool Game::playAgain = false;
/*
@execRound
Controls a round of blackjack, dealer AI calls, card display calls, and player menu display, and input parse calls
*/
const void Game::execRound()
{
bool r... | true |
f09ddd5c88aac5c5febc27179b510abe9622fe0e | C++ | LeverImmy/Codes | /比赛/2019暑假中山纪念中学模拟测/2019.08.07【NOIP提高组】模拟 B 组/T2 排序/未命名1.cpp | GB18030 | 4,906 | 2.734375 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <cctype>
#include <algorithm>
#define ll long long
#define il inline
#define rgi register int
using namespace std;
const int N = 100000 + 10;
int n;
int a[N], rev[N];
int Less[N], Greater[N];
struct Seg_Tree
{
int lc, rc;
int val, add;
} t[N << 2], L[N << 2], G[N << 2... | true |
6b9cbb8119bf5635d572eafad57b2bd5b20fa843 | C++ | minorleaguegrayonassociates/GrayonSlam | /app/src/utils/parser.cpp | UTF-8 | 2,957 | 3.4375 | 3 | [] | no_license | #include <fstream>
#include <sstream>
#include <iostream>
#include "parser.hpp"
#include "exceptions.hpp"
std::vector<std::vector<std::string>> loadData(const std::string& path)
{
// Initializing - vector will hold all lines of data within the document
std::vector<std::vector<std::string>> allRows;
std::if... | true |
b5fef0d50bb64cd5702d17c9abcf44ad25d78030 | C++ | emprice/cyvtk | /unstructuredGrid.cc | UTF-8 | 3,699 | 2.609375 | 3 | [
"MIT"
] | permissive | #include <unstructuredGrid.hh>
#include <vtkPoints.h>
#include <vtkCellData.h>
#include <vtkPointData.h>
#include <vtkDoubleArray.h>
#include <vtkXMLUnstructuredGridWriter.h>
#include <string>
#include <sstream>
UnstructuredGrid::UnstructuredGrid(double *x, double *y, double *z, size_t N)
{
// initialize a new gr... | true |
0b7f706032b3963010ee7a45b9b517922ea42c1e | C++ | MarcGroef/CSVM | /SvmCodeMarco/PYTHON_OPT_CLASSIFICATION_SVM/SVM/utils.cpp | UTF-8 | 2,346 | 3.453125 | 3 | [] | no_license | /* input: line
output: array of words, function returns amount of words
ALLOCATES MEMORY NEEDS malloc.h
The amount of words in the line should not exceed MAX_WORDS
*/
#include <cstdlib>
#include <math.h>
#include <limits.h>
#include <stdio.h>
#include "utils.h"
#define MAX_WORDS 10000
using namespace std;... | true |
2b559bb58e89452f358f35c7f2e0a0a15ef4525a | C++ | yazici/MinecraftD3D | /Coursework/DirectSound.cpp | UTF-8 | 2,944 | 2.59375 | 3 | [] | no_license | #include "DirectSound.h"
DirectSound::DirectSound()
{
m_directSound = 0;
m_listenerBuffer = 0;
m_listener = 0;
}
DirectSound::DirectSound(const DirectSound& other)
{
}
DirectSound::~DirectSound()
{
}
bool DirectSound::initialise(HWND hwnd)
{
HRESULT result;
DSBUFFERDESC bufferDesc;
WAVEFORMATEX waveFormat;
... | true |
74400dc501e3366df1b67e54f4740873d68d13d2 | C++ | emaha/SFML2 | /SFML2/Game.cpp | WINDOWS-1251 | 4,556 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include "Game.h"
#include "Constants.h"
#include "ObjectManager.h"
#include "NetworkClient.h"
Game::Game() : running(true)
{
networkClient = new NetworkClient();
}
Game::~Game()
{
window.close();
}
void Game::creat... | true |
622c7ee27368074544a2c2fdc1ab702e0c487e78 | C++ | incarnadined/reg_parse_v2 | /src/FastLeaf.cpp | UTF-8 | 845 | 2.953125 | 3 | [] | no_license | #include "FastLeaf.h"
FastLeaf::FastLeaf(std::ifstream* fs, unsigned int offset)
{
Helper::Read(fs, 0x1000 + offset, sizeof(int), &m_size);
Helper::Read(fs, 0x1000 + offset + 0x4, sizeof(short), &m_signature);
Helper::Read(fs, 0x1000 + offset + 0x6, sizeof(short), &m_entries_count);
// if the signature is not 'lf... | true |
610d38f5b5d301b6873c4c5207686833fc96bca9 | C++ | vadim-cherepanov/monkeyrooms | /main.cpp | UTF-8 | 1,902 | 2.890625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include "monkeyrooms.h"
#include "timer.h"
using namespace std;
vector<MonkeyRooms> vpMonkeyRooms;
void printMonkeyRoomsStatistics(const MonkeyRooms &monkeyRooms, const string& sAdditionalInfo = "") {
uint32_t iChecksNumber = monkeyRooms.getChecksNumber();
cout << "Roo... | true |
879c8b26368c9ed8a9a3ad9791ea6706e56225ae | C++ | NimeshJohari02/CppProjects | /constructor(explicit call).cpp | UTF-8 | 338 | 3.109375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class test
{
int a,b;
public:
test(int c,int d);
void showdata()
{
cout<<a<<endl<<b<<endl;
}
};
test::test(int c=12,int d=69)
{
a=c;
b=d;
}
int main()
{
test o1(69,699);
o1.showdata();
test o2=test(90,99);
o2.showdata();
test o3;
o3.showdata()... | true |
abed1893affe1d92971dd6478e8c5daa4fecd677 | C++ | Chainsawkitten/Deathcap | /src/Video/Geometry/Geometry2D.hpp | UTF-8 | 2,022 | 2.59375 | 3 | [
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | #pragma once
#include <GL/glew.h>
#include <glm/glm.hpp>
namespace Video {
namespace Geometry {
/// Interface for renderable 2D geometry.
class Geometry2D {
public:
/// A vertex point.
struct Vertex {
/// Position.
... | true |
55f85f97014cc23e6511de80ae8befd512a412ac | C++ | turesnake/leetPractice | /src/_leetcode/leet_322.cpp | UTF-8 | 2,814 | 3.0625 | 3 | [
"MIT"
] | permissive | /*
* ====================== leet_322.cpp ==========================
* -- tpr --
* CREATE -- 2020.06.16
* MODIFY --
* ----------------------------------------------------------
* 322. 零钱兑换
*/
#include "innLeet.... | true |
26b9c6ec185c8b407c42a9208f730d3c2301aacf | C++ | vaish-agarwal/c- | /lab5_q9.cpp | UTF-8 | 228 | 3.015625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
//declare the variables
int a,b;
//print the odd numbers less than 100 using while loop
a =0;
while(a<50){
b = ((2*a)+1);
a++;
cout<<b<<endl;
}
return 0;
}
| true |
a01721441b5bfe821faa29fc9a8eb1d112796146 | C++ | shumin215/misc | /algorithm/dijkstra/src/main.cpp | UTF-8 | 6,490 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <queue>
#define NUM_VERTEX 8+1
#define MAX_W 9999999
using namespace std;
class Dijkstra
{
public:
Dijkstra(): visited(false), w(0), prev(0) {}
bool visited;
int w;
int prev;
};
int graph[NUM_VERTEX][NUM_VERTEX];
int dtable[NUM_VERTEX];
priority_queue<pair<int, int>> pq;
... | true |
83634fb6e47aa33c68a60f1a5a098c49b71d3234 | C++ | ZacharyJ97/File-Reader-Mapper | /Student Class/Student.cpp | UTF-8 | 1,396 | 3.40625 | 3 | [] | no_license | #include "stdafx.h"
#include "Student.h"
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
using namespace std;
//Default Student
Student::Student()
{
name = "Unknown";
stu_major = "Undecided";
stu_id = 11111111;
stu_year = "0";
}
//Overloaded/4-par... | true |
9a9673720cb9f1cd0ebc5270c6ccb94eb8358159 | C++ | dustin-thewind/cpp_sandbox | /grad/grad/grad-main.cpp | UTF-8 | 895 | 2.96875 | 3 | [] | no_license | #include "grad.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
string n;
double tut;
int nc;
double fees;
cout << "Enter the undergraduate students name: ";
cin >> n;
cout << "Now enter the number of classes they'll be taking: ";
cin >> nc;
cout << "N... | true |
460ae5c7b4ce58044ea08268d03f76a41c2b76ce | C++ | ananyapati/LiftOffC-Solutions | /week3_Q3.cpp | UTF-8 | 360 | 3.203125 | 3 | [] | no_license | #include<stdio.h>
int fun(int a,int b);
int main()
{
int n1,n2,LCM,HCF;
printf("\nEnter two numbers:");
scanf("%d %d",&n1,&n2);
HCF=fun(n1,n2);
LCM=(n1*n2)/HCF;
printf("\nGCD of the numbers is:%d",HCF);
printf("\nLCM of the numbers is:%d",LCM);
return 0;
}
int fun(int a,int b)
{
if(b==0)
re... | true |
37b5a4f939133c06ad31f3e8d4be6b2485855064 | C++ | kverty/homeworks | /semester1/3 homework/5/sortedlist.cpp | UTF-8 | 2,016 | 3.859375 | 4 | [] | no_license | #include "sortedlist.h"
#include <iostream>
#include <cstdlib>
using namespace std;
void createList(SortedList &l)
{
ListElement *guard = new ListElement;
guard->next = nullptr;
guard->value = 0;
l.head = guard;
}
void printElement(ListElement *element)
{
if (element != nullptr)
{
cou... | true |