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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
fbdefb118b2b1cd2ff2d1800ce5678612df2d1e7 | C++ | Kanazawanaoaki/atcoder_memo | /abc/abc116/abc116c2.cpp | UTF-8 | 1,686 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
/*hantei(int num,int *h){
... | true |
469d2e65128f48e549d773137577b3bab99fb724 | C++ | chetui/libvsf | /src/framework/vm.cpp | UTF-8 | 10,117 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | #include "framework/vm.h"
#include <map>
#include "utils/log.h"
using namespace std;
VmSet::VmSet()
{
func_option_ = FuncOption::get_instance();
vm_base_ = VmBase::get_instance();
vm_cpu_usage_ = VmCpuUsage::get_instance();
vm_cache_miss_ = VmCacheMiss::get_instance();
}
VmSet::~VmSet()
{
delete_... | true |
d3748a1faa9b2913c3d532d4676bb1c4029bdf09 | C++ | GP101/DiconServer | /boostTest/boostTest/boostTest_CriticalSection RAII.cpp | UTF-8 | 1,196 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <typeinfo>
#include <windows.h>
#include <boost/assert.hpp>
#include "KGen.h"
struct KCriticalSection : public CRITICAL_SECTION
{
KCriticalSection( ) { InitializeCriticalSection( this ); }
~KCriticalSection( ) { DeleteCriticalSection( this ); }
};
class KCriticalSectionLock
{
publ... | true |
b506959f0b3bec1847ca9d2a7e9d1dd3bd73cced | C++ | jayekub/glToy | /src/include/Camera.h | UTF-8 | 859 | 2.640625 | 3 | [] | no_license | #ifndef CAMERA_H_
#define CAMERA_H_
#include "Node.h"
#include "Visitor.h"
#include "Vec.h"
class Light;
struct Camera : public Node
{
enum ProjectionType { FLAT, ORTHO, PERSP };
ProjectionType projection;
// common params
float nearClip, farClip;
Vec3 position, center, up;
// ortho params... | true |
c06300a5343f8fb0b16b0702833db22c9b9f97b7 | C++ | fritzo/kazoo | /src/synthesis_profile.cpp | UTF-8 | 691 | 2.546875 | 3 | [
"MIT"
] | permissive |
#include "synthesis.h"
using namespace Synthesis;
void profile_chorus (
float duration_seconds = 10.0f,
size_t num_voices = 8)
{
size_t T = roundi(duration_seconds * DEFAULT_SAMPLE_RATE);
size_t dT = DEFAULT_FRAMES_PER_BUFFER;
Chorus synth;
Ids ids(num_voices);
Vector<float> energies(num_voices);... | true |
b559c1ae2d3b608d5f79f8402adea18c2eb53138 | C++ | ankit-akp/DS-Algo-Cp_Codes_CN | /RangeQuery/OrderSet - Problem.cpp | UTF-8 | 1,002 | 3.671875 | 4 | [] | no_license | /*
In this problem, you have to maintain a dynamic set of numbers which support the two fundamental operations
INSERT(S,x): if x is not in S, insert x into S
DELETE(S,x): if x is in S, delete x from S
and the two type of queries
K-TH(S) : return the k-th smallest element of S
COUNT(S,x): return the number of elem... | true |
003d1c692ac9ab932ed8ebb92d832302424d8149 | C++ | qualificationalitated/Start_git | /Algorithm/5000~5999/5972/5972.cpp | UTF-8 | 1,772 | 3.046875 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<queue>
#define HUTS 50002
#define LINE 50002
#define LIM 2147483647
using namespace std;
vector<pair<int,int>> map[LINE];
int minCost[HUTS]={0,};
int dijkstra(int start){
priority_queue<pair<int,int>> pq;
minCost[start]=0;
pq.push({0,start}); // 시작 위치의 거리 & 지점 설정... | true |
75efa6abf599e3313389d2e2fcfbf1311b3c9fb0 | C++ | shieldscr/FizzBuzzCPP | /tests/FizzBuzzTest.cpp | UTF-8 | 298 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
#include "FizzBuzz.h"
TEST(FizzBuzz, FizzBuzz_returns_number_passed) {
FizzBuzz fizzBuzz = FizzBuzz();
ASSERT_EQ("1", fizzBuzz.Fizz(1));
}
TEST(FizzBuzz, FizzBuzz_returns_Fizz_When_Given_3) {
FizzBuzz fizzBuzz = FizzBuzz();
ASSERT_EQ("fizz", fizzBuzz.Fizz(3));
} | true |
697bb5ff15266518a616a00f90e34322cf546d27 | C++ | adas-eye/cpp_algorithm | /chapter3/书面作业/exercise3-8.cpp | GB18030 | 2,348 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int ToolRandInt(int min, int max)
{
srand((unsigned)time(NULL));
int r = rand() % (max - min + 1) + min;
return r;
}
class CardDeck
{
private:
int cards[52];
int currentCrd;
public:
//캯
CardDeck(void);
//ϴ
void Shuffle(void);
//һ... | true |
5b798e5ca0cb2715e94438c296244b78ef1e4be3 | C++ | jonike/Conception | /src/ConceptStream.cpp | UTF-8 | 310 | 2.53125 | 3 | [] | no_license | #include "Main.h"
ConceptStream::ConceptStream()
{
}
ConceptStream::~ConceptStream()
{
}
ConceptStream & ConceptStream::operator << (ConceptStream & (* Function)(ConceptStream &))
{
(*Function)(*this);
return *this;
}
ConceptStream & endl(ConceptStream & stream)
{
stream.NewLine();
return stream;
}
| true |
c50e85657d4149925de92e5321a07f658ed59f21 | C++ | jsn0716/Software | /src/software/proto/message_translation/ssl_simulation_robot_control_test.cpp | UTF-8 | 4,409 | 2.65625 | 3 | [
"LGPL-3.0-only"
] | permissive | #include "software/proto/message_translation/ssl_simulation_robot_control.h"
#include <gtest/gtest.h>
TEST(SSLSimulationProtoTest, test_create_robot_move_command_stationary)
{
auto move_command = createRobotMoveCommand(0, 0, 0, 0);
ASSERT_TRUE(move_command);
// Expect that the local velocity has some pos... | true |
7394bb9c131362b74be15f6aaec9d2021df57e70 | C++ | Shadow1329/spacebattles | /SpaceBattles/Server/UserInformation.h | UTF-8 | 313 | 3.125 | 3 | [] | no_license | #pragma once
#include <string>
#include <stdio.h>
#include <iostream>
class UserInformation
{
private:
int ID;
std::string Name;
public:
UserInformation(int ID, std::string Name)
{
this->ID = ID;
this->Name = Name;
}
int getUserID() { return ID; };
std::string getUserName() { return Name; };
}; | true |
e656be43459d085994ea1e064dfa0477f98a5bfb | C++ | rspiegel/cppProjects | /maze/maze.h | UTF-8 | 2,652 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
class maze
{
private:
int rows;
int cols;
int begin;
int end;
vector<char> map;
public:
maze()
{
rows=0;
cols=0;
begin = -1;
end = -1;
}
void parse_board(istream& r)... | true |
ad2fcefde5318519dce2307e9610974a348fa7f8 | C++ | ismailartun00/Tutorials | /C++/Comp315/Lesson3/sudoInheritance.cpp | UTF-8 | 779 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <string>
class Vehicle{
public:
std::string idnumber;
virtual std::string gettype() = 0;
virtual std::string idnumber(){
return idnumber;
}
};
class Car{
public:
Car(std::string idnumber){
this->idnumber = idnumber;
... | true |
79a5e7a03c14fdfa169ab6f360ff6f4d8c6b9e58 | C++ | betallcoffee/leetcode | /old/Swap Nodes In Pairs/Swap Nodes In Pairs/main.cpp | UTF-8 | 2,098 | 3.859375 | 4 | [
"Apache-2.0"
] | permissive | //
// main.cpp
// Swap Nodes In Pairs
//
// Created by liang on 6/22/15.
// Copyright (c) 2015 tina. All rights reserved.
// Problem: https://leetcode.com/problems/swap-nodes-in-pairs/
//Given a linked list, swap every two adjacent nodes and return its head.
//
//For example,
//Given 1->2->3->4, you should return ... | true |
9816d76828ae88537a08157fb5d8352dd51106fa | C++ | brandoryan/process-scheduler | /process-scheduler.cpp | UTF-8 | 5,612 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <vector>
#include <iterator>
#include <string>
using namespace std;
struct process {
string pid;
int burst_time;
int wait_time = 0;
};
struct compPID {
bool operator()(process const &a, process const &b) {
return a.pid < b.pid;
}
};
struct co... | true |
cc8c91f76c6ee1a00772b0e55421edc3d4eec6ba | C++ | Program0/CS_100_Software_Construction_rshell | /src/header/semicolon_connector.h | UTF-8 | 1,104 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | //Marlo Zeroth mzero001@ucr.edu 861309346
//Emmilio Segovia esego001@ucr.edu 861305177
/*
* Emmulates the behavior of the binary ; operator in the
* Bourne Again Shell.
* class.
*/
#ifndef SEMICOLON_CONNECTOR_H
#define SEMICOLON_CONNECTOR_H
#include "base.h"
#include "connector_b.h"
class Semico... | true |
74769b6f79e69d6f5a745f2e0af516d618f6bdee | C++ | jc6w/CompSci-Class-Projects | /9 Card Tile Project/ola4-Campos/CardBoardGame.h | UTF-8 | 676 | 2.890625 | 3 | [] | no_license | #ifndef CARDBOARDGAME_H
#define CARDBOARDGAME_H
#include "Card.h"
/**********************************
cardBoardGame class stores the tiles,
and solves for a solution for the puzzle
***********************************/
class cardBoardGame
{
private:
Card cardTiles[9]; //to store cards
bool solved; //f... | true |
553c20709a0c1ce8e9040165f2d435335a559e13 | C++ | andrewlai61616/face-ball | /track.cpp | UTF-8 | 5,557 | 2.5625 | 3 | [] | no_license | #ifndef OPENCV_HPP
#include <opencv2/opencv.hpp>
using namespace cv;
#define OPENCV_HPP
#endif
#include <wiringSerial.h>
#include <wiringPi.h>
#include "ball_detection.hpp"
#include <iostream>
using namespace std;
#define RESIZE_WIDTH 320
#define RESIZE_HEIGHT 240
#define PREV_DIFF_RATIO 1.3
void stop_for_a_while(i... | true |
a7d7bbbb3733a408c9c10c5e8bacde44d4b3c2bd | C++ | cowtony/ACM | /LintCode/c++/0428. Pow(x, n).cpp | UTF-8 | 554 | 3.375 | 3 | [] | no_license | class Solution {
public:
/**
* @param x: the base number
* @param n: the power number
* @return: the result
*/
double myPow(double x, int n) {
double result = 1;
if (n < 0) {
n = -n - 1; // prevent n = -2^31
x = 1 / x;
result = x;
... | true |
ffba4858b5cd248df788ae00f9f4054cd3fa3a0e | C++ | aghman/gardenbase-arduino | /garden_sensors/garden_sensors.ino | UTF-8 | 2,715 | 2.59375 | 3 | [] | no_license |
/* Austin Hill
* Garden Base Station
* Purposes:
* * Read temperature and humidity from AHT20
* * Read Light readings from BH1750
* * Use Sparkfun qwiic mux to read multiple soil moisture sensors
* * detect multiple soil moisture sensors
* * send data readings to InfluxDB over Wifi
*
* All of these ... | true |
2c5925703d1fd2aa9ba936109d204e9b7a65352f | C++ | harshitagarwal2/CS122 | /LAB/Trees/bintree.cpp | UTF-8 | 2,620 | 3.984375 | 4 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<ctype.h>
using namespace std;
#include "stack.h"
class Bintree;//forward decln
class Node{
friend class Bintree;
friend class Queue;
private:
int data;
Node *rchild;
Node *lchild;
public:
Node(int x =0){ data = x; rchild=NULL;lchild=NULL;}
};
class... | true |
2bd6302a1c1b05e0a3248ed6c7c7d00db45c0954 | C++ | jacoblchapman/No-MASS | /FMU/Source/Contract_Negotiation.cpp | UTF-8 | 3,231 | 3.046875 | 3 | [
"MIT"
] | permissive | // Copyright 2016 Jacob Chapman
#include <vector>
#include <utility>
#include <limits>
#include <iostream>
#include "Contract_Negotiation.hpp"
Contract_Negotiation::Contract_Negotiation() {
difference = 0;
}
void Contract_Negotiation::calcDifference(const Contract & c) {
difference += (0.0 - (c.requested - c.r... | true |
fe7490e487fb96faad51793495e7e67ba926b037 | C++ | foxox/foxtracer | /foxtracer/VanDerCorputSobolSampler2D.cpp | UTF-8 | 817 | 2.625 | 3 | [] | no_license | #include "VanDerCorputSobolSampler2D.h"
VanDerCorputSobolSampler2D::~VanDerCorputSobolSampler2D(void)
{
}
Sample2D VanDerCorputSobolSampler2D::getNextSample()
{
Sample2D returnme;
returnme.x = static_cast<float>(VanDerCorput(this->samplenum, 0));
//equivalent to...
//returnme.x = static_cast<float>(VanDerCorput2... | true |
66a2e35697e29e50f33d56310f130468a56952b2 | C++ | gawainx/buptac | /272.cpp | UTF-8 | 1,426 | 2.75 | 3 | [] | no_license | //试玩简单图问题
//邻接矩阵的方式储存
//试玩二维矩阵.
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<climits>
using namespace std;
int g[51][51];
int dist[55];
int main(){
int T;
scanf("%d",&T);
while(T--){
memset(dist,0,sizeof(dist));
int N,M;//N for nodes,M for edges
scanf("%d%d",&N,&M)... | true |
e8ef3c7c5412ef347ba88c034604aaa9d906fec5 | C++ | itrivacchiani/ING1_ProjetIFI | /TrinomialTree.cpp | UTF-8 | 5,352 | 2.578125 | 3 | [] | no_license | //
// TrinomialTree.cpp
// C++ IFI
//
// Created by Itri-Raphaël Vacchiani on 21/05/2016.
// Copyright © 2016 Itri-Raphaël Vacchiani. All rights reserved.
//
#include "TrinomialTree.hpp"
using namespace std;
void TrinomTree::setValeur(double _T, int _N, double _S0, double _K, double _sig, double _r){
T... | true |
f8a2a0fe36bab9ee2d0697be0a49cc682b31a33f | C++ | ZhengweiLi/_LeetCode | /18_4Sum.cpp | UTF-8 | 1,287 | 3.359375 | 3 | [] | no_license | /*Given an array nums of n integers and an integer target,
are there elements a, b, c, and d in nums such that a + b + c + d = target?
Find all unique quadruplets in the array which gives the sum of target.
Note:
The solution set must not contain duplicate quadruplets.
Example:
Given array nums = [1, 0, -1, 0, -2, 2],... | true |
1b0fc573ca4c7d1b3e1bdaf878f0640c0f7d8cf0 | C++ | joker-yt/c- | /XX_template/s_00_exercise/non-type_template_param.cpp | UTF-8 | 448 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <typeinfo>
using namespace std;
class MyClass
{
public:
MyClass() = default;
~MyClass() = default;
};
template <int i>
void f()
{
cout << typeid(i).name() << endl;
return;
}
int main(int argc, char const *argv[])
{
f<0>();
int n;
float f;
MyClass cl;
... | true |
56ce7d29c2ffc2d5d98baec26e57eff26b01a9b3 | C++ | pankajkumar9797/Data-Structures-and-Algorithms | /Algorithms/week5_dynamic_programming1/4_longest_common_subsequence_of_two_sequences/lcs2.cpp | UTF-8 | 980 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using std::vector;
int lcs2(vector<int> &a, vector<int> &b) {
//write your code here
if (a.empty() && b.empty())
return 0;
int D[a.size() + 1][b.size() + 1];
D[0][0] = 0;
for (unsigned int i = 0; i < a.size() + 1; ++i) {
for (int j = 0; j < b.size() + 1; ++j)... | true |
11bfa194261060cbe911d7ec8e651d72a2fe41ca | C++ | N4bi/Pinball | /ModulePhysics.cpp | UTF-8 | 15,682 | 2.53125 | 3 | [] | no_license | #include "Globals.h"
#include "Application.h"
#include "ModuleInput.h"
#include "ModuleRender.h"
#include "ModulePhysics.h"
#include "p2Point.h"
#include "math.h"
#ifdef _DEBUG
#pragma comment( lib, "Box2D/libx86/Debug/Box2D.lib" )
#else
#pragma comment( lib, "Box2D/libx86/Release/Box2D.lib" )
#endif
ModulePhysics::M... | true |
0aff30997f19bea1d999510ae4867e53cabb147a | C++ | VladimirVasilijevic/Sudoku-Solver | /sudoku/ml_util/ReadMnist.cpp | UTF-8 | 3,405 | 2.875 | 3 | [] | no_license | #include "ReadMnist.h"
#include <fstream>
#include <cmath>
using namespace cv;
using namespace std;
ReadMnist::~ReadMnist()
{}
ReadMnist::ReadMnist(std::string filenameimages, std::string filenamelabels)
: m_filenameimages(filenameimages)
, m_filenamelabels(filenamelabels)
{}
vector<cv::Mat> ReadMnist::read_Mnist_i... | true |
87e4c625ca4ac33f14a3fe2d878ac0afc4d5fbbd | C++ | Hongyunpyo/L_study | /study/study/eight.cpp | UHC | 2,926 | 3.640625 | 4 | [] | no_license | #include "header.h"
class Circle {
int radius;
public :
Circle(int radius = 0) { this->radius = radius; }
int getRadius() { return radius; }
void setRadius(int radius) { this->radius = radius; }
double getArea() { return 3.14*radius*radius; }
};
class NamedCircle : public Circle {
string name;
public:
NamedCir... | true |
318753b4411de3b5264a6ee3df1ea72e971fe5a6 | C++ | Meng-Gen/USACOTraining | /numtri/main.cc | UTF-8 | 599 | 2.953125 | 3 | [] | no_license | /*
ID: plover1
TASK: numtri
LANG: C++
*/
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ofstream fout("numtri.out");
ifstream fin("numtri.in");
int R;
fin >> R;
int triangles[1000][1000] = {0};
for (int i = 0; i < R; i++) {
for (int j = 0; j <= i; j++) {
... | true |
11415d358a951b3dd45436becb6e2ead18f64e9c | C++ | cpv-project/cpv-cql-driver | /include/CQLDriver/Common/Utility/MathUtils.hpp | UTF-8 | 304 | 3.09375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <cstdint>
namespace cql {
/** The fast integer pow function */
template <class T>
T powInteger(T base, std::size_t exponent) {
T result(1);
while (exponent > 0) {
if (exponent & 1) {
result *= base;
}
base *= base;
exponent >>= 1;
}
return result;
}
}
| true |
f63e1c070e45a86adf3c1e2ff8a8ded8df9f185e | C++ | loganpadon/Observer-Implementation | /Homework6/src/Homework6.cpp | UTF-8 | 1,202 | 3.203125 | 3 | [] | no_license | //============================================================================
// Name : Homework6.cpp
// Author : Logan Padon
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//===========================================================================... | true |
7b531dc535f7382df68445902bfb71d81402f271 | C++ | SwagSoftware/Kisak-Strike | /vscript/languages/squirrel/testSqPlus2/testSqPlus2.cpp | UTF-8 | 47,869 | 2.5625 | 3 | [
"Zlib",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // testSqPlus2.cpp
// Created by John Schultz 9/21/2005
// Free for any use.
// Step through the code with a debugger (setting breakpoints in functions)
// to get an idea how everything works.
#include <stdarg.h>
#include <stdio.h>
#if 0
#include <string>
//#define SQPLUS_SUPPORT_STD_STRING
#define SQPLUS_SUPPORT_SQ... | true |
77020014dabefeabaf2a3c83cb2504eb8d347eb2 | C++ | CoreRobotics/CoreRobotics | /src/noise/Gmm.cpp | UTF-8 | 3,541 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (c) 2017-2019, CoreRobotics. All rights reserved.
* Licensed under BSD-3, https://opensource.org/licenses/BSD-3-Clause
* http://www.corerobotics.org
*/
#define _USE_MATH_DEFINES
#include "Gmm.hpp"
#include "Eigen/Dense"
#include "math/Matrix.hpp"
#include "math/Probability.hpp"
#include <cmath>
na... | true |
30b0776b3f850dac78fe6601c5d08246630b606c | C++ | faxinwang/DataStructure | /cpp/Matrixs/SparseMatrix_Tests.cpp | UTF-8 | 2,593 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "SparseMatrix.hpp"
#include "Matrix.hpp"
using namespace std;
using namespace wfx;
template<typename T>
void print(Matrix<T>& m, string str=""){
int row = m.row(), col = m.column();
cout<<"//"<<str<<endl;
printf("[%d X %d]:\n", row,col);
for(int i=0; i<row; ++i){
fo... | true |
a6c50684fa12b72713837b3a9f3683d8ada68d16 | C++ | adnanlari/OOP-Lab-4thsem-2019 | /matrix_complex.cpp | UTF-8 | 3,354 | 3.21875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class comp
{
public:
int real,imag;
comp(int r=0,int i=0)
{
real=r;
imag=i;
}
comp(comp const &x)
{
real=x.real;
imag=x.imag;
}
friend comp operator + (comp const &x,comp const &y)
{
return comp(x.real+y.real,x.imag+y.imag);
}
friend comp operator -... | true |
00e4388511477ce29ffd80969f5e91e3a26fd340 | C++ | chicolismo/Cesar | /program_table.cpp | UTF-8 | 2,243 | 2.84375 | 3 | [] | no_license | #include "program_table.h"
ProgramTable::ProgramTable(wxWindow *parent, wxWindowID id)
: wxListCtrl(parent, id, wxDefaultPosition, wxSize(380, 500),
wxLC_REPORT | wxLC_VIRTUAL | wxLC_HRULES | wxLC_VRULES) {
show_decimal = false;
#ifdef _WIN32
long list_style = wxLIST_FORMAT_LEFT;
int font_s... | true |
5b55b7c509d4c2bb9c9794354231bb83f0ccd7a9 | C++ | ashishnegi/Process-Scheduling-Algo-Implemented | /memory/Memory.cpp | UTF-8 | 1,240 | 2.6875 | 3 | [] | no_license | #ifndef MEMORY_H
#define MEMORY_H
class Memory;
#include "FindEmptyAlgo.cpp"
#include "Process.cpp"
#include <list>
#include <vector>
using namespace std;
class Memory {
FindEmptyAlgo * findAlgo;
list<Process> procList;
list<int> startPos;
list<int> endPos;
int totalSize;
... | true |
7176652fe5a86d247bc5cb1dfa5ee89e1bedb6fc | C++ | Armandur/Hnefatafl | /Hnefatafl/BoardEntity.hpp | UTF-8 | 1,103 | 3.46875 | 3 | [] | no_license | /*!
* \file BoardEntity.hpp
*
* \author Rasmus Pettersson Vik
* \date juni 2013
*
* Declaration of the abstract baseclass BoardEntity
*/
#ifndef BOARDENTITY_H
#define BOARDENTITY_H
#include <SFML/System.hpp>
/*!
* \class BoardEntity
*
* \brief Abstract baseclass for an entity with a position on the gameb... | true |
cd10345a9a0d3713a193aed007318fc65b70a4ff | C++ | mike-tr/CommunicationsFinal | /src/NodeRelay.cpp | UTF-8 | 5,687 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "headers/Utilities.hpp"
#include <iostream>
#include <string>
#include <unistd.h>
#include "headers/Node.hpp"
using namespace std;
using namespace Utilities;
void Node::send_message(vector<string> userinput) {
// here we handle sending message
// in general we break it into send directly or send via ... | true |
cf5b02d13fe29f7dbd1ee983e8561781b8b767a6 | C++ | SamuelWeiss/150IDS-RPC | /RPC.samples/simplefunction.stub.cpp | UTF-8 | 1,848 | 2.609375 | 3 | [] | no_license | #include "simplefunction.idl"
#include "rpcstubhelper.h"
#include "data_packing.h"
#include <cstdio>
#include <cstring>
#include "c150debug.h"
using namespace C150NETWORK;
void __func3(){
func3();
string output = "Done";
RPCSTUBSOCKET->write(output.c_str(), output.length()+1);
}
void __func2(){
func2()... | true |
b784a3548a8cd08fb7d3038d4b40758134a406b8 | C++ | Lososin/OGLEngine | /include/CameraManager.hpp | UTF-8 | 764 | 3 | 3 | [] | no_license | #pragma once
#include <vector>
#include "Camera.hpp"
class CameraManager
{
public:
unsigned long CreateCamera()
{
Cameras.push_back(new Camera());
return Cameras.size();
}
void NextCamera()
{
CurrentCameraIndex++;
if (CurrentCameraIndex == Cameras.size())
... | true |
950f1489b3f2c9faed428b188f74550bcd1304bc | C++ | Anthima/Hack-CP-DSA | /InterviewBit/Number of 1 bits/solution.cpp | UTF-8 | 180 | 2.5625 | 3 | [
"MIT"
] | permissive | int Solution::numSetBits(unsigned int A) {
int rem,count = 0;
while(A)
{
A= A&(A-1); //this finds the next 1 position
count++;
}
return count;
} | true |
a47b4949462d1d5730788bacf571089bdfb40256 | C++ | dotnfc/arducleo | /scripts/samples/ticker/ticker_main.cpp | UTF-8 | 529 | 2.75 | 3 | [
"MIT"
] | permissive | // Basic example of how to blink a led using the Ticker object.
// https://developer.mbed.org/teams/ST/code/Nucleo_ticker/
//
// Assembled by dotnfc as Arducleo Sample
// 2016/08/23
#include "mbed.h"
Ticker toggle_led_ticker;
DigitalOut led1(LED1);
void toggle_led() {
led1 = !led1;
}
int main() {
// I... | true |
2d81a5123a1ce7a1d6f952e846b19e30ac1001c6 | C++ | chenx/oj | /leetcode/LongestPalindromicSubstring.cpp | UTF-8 | 5,000 | 3.265625 | 3 | [] | no_license | //
// http://www.leetcode.com/onlinejudge#
// @Author: Xin Chen
// @Created on: 12/20/2012
// @Last modified: 1/20/2013
//
/*
* Note:
* 1) change string abc to #a#b#c#, at each position, search toward two sides.
* 2) can't use: t += s[i] + "#";
* This is O(n^2).
* For O(n) solution, see http://www.ak... | true |
a2744935c11465e18d04020ea657580229b2d7fc | C++ | Arturjssln/project_prog_wolf_sheep | /partie3/src/Random/Random.cpp | UTF-8 | 618 | 2.890625 | 3 | [] | no_license | /*
* prjsv 2015, 2016
* 2014, 2016
* Marco Antognini
*/
#include <Random/Random.hpp>
bool bernoulli(double p)
{
std::bernoulli_distribution dist(p);
return dist(getRandomGenerator());
}
double normal(double mu, double sigma2)
{
std::normal_distribution<double> dist(mu, std::sqrt(sigma2));
retur... | true |
b10a7e1294316511bbb8dffef20bb52ed416757e | C++ | bitlucky/cpp | /Array/11.cpp | UTF-8 | 839 | 3.96875 | 4 | [] | no_license | Given an unsorted array arr[] and two numbers x and y, find the minimum distance between x and y in arr[].
Create a variable m = INT_MAX
Run a nested loop, the outer loop runs from start to end (loop counter i),
the inner loop runs from i+1 to end (loop counter j).
If the ith element is x and jth el... | true |
29b142bf85e650c045cdf3336ca549abe7ee34d4 | C++ | alela/bombertux | /bonus.cpp | UTF-8 | 893 | 2.921875 | 3 | [] | no_license | #include "bonus.h"
#include <vector>
#include <string>
#include <random>
#include <ctime>
Bonus::Bonus(int _x, int _y, int _tile):x(_x), y(_y), tile(_tile){
choose_bonus_type();
init();
}
void Bonus::choose_bonus_type(){
std::default_random_engine generator;
std::uniform_int_distribution<int> distributi... | true |
9be53eef5ea56fea590f6be130ae6fbc903c9fd4 | C++ | Amazing168/My-free-code-repo | /clo_code/test/test.cpp | UTF-8 | 716 | 2.71875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a[100][100]={0}, n, i, j, r, c, rows=0, columns=0;
cin >> n;
for (i=1; i<=n; i++)
for (j=1; j<=n; j++){
cin >> a[i][j];
a[0][j] = (a[0][j]+a[i][j])%2;
a[i][0] = (a[i][0]+a[i][j])%2;
}
for (i=1; ... | true |
e2497db229dbd416a1b868770fcb777e779c4bc4 | C++ | Lang4/LDBase | /LDBase.h | GB18030 | 6,432 | 3.015625 | 3 | [] | no_license | #pragma once
/**
* ݳ־û Author jijinlong
* email jjl_2009_hi@163.com
*/
#include <stdio.h>
#include <string.h>
#define IDLES_BLOCK_SIZE 1024
#pragma pack(1)
/**
* ƫֵ
*/
class LDPos{
public:
unsigned long value; // ļеλ
void *pointer; // ڴ
LDPos(unsigned long value)
{
this->value = value;
pointer = NULL;
... | true |
90fdacc79f4ad7ae1320e340381b1fc1ad791d72 | C++ | moevm/oop | /8381/Pochaev_Nikita/code/Units/CompositeUnit.cpp | UTF-8 | 4,474 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include "CompositeUnit.h"
#include "AuxiliaryFunctionality/TextColoring.h"
size_t CompositeUnit::getHealth() const
{
size_t total = 0;
for(const auto & unit : units)
{
total += unit->getMeleeAttackStrength();
}
return total;
}
size_t CompositeUnit::getArmor() const
{... | true |
a7e7bd6083a441961da552494ad2b51856e14e3a | C++ | Qazwar/MemoryHandler | /MemoryHandler/src/MemoryHandler.cpp | WINDOWS-1252 | 2,859 | 2.65625 | 3 | [
"MIT"
] | permissive | /*******************************************************************/
/* Original File Name: MemoryHandler.cpp */
/* Date: 07-07-2018 */
/* Developer: Dionysus Benstein */
/* Copyright 2018 Dionysus Benstein... | true |
5333580444153f52ee02e6ae5f00fb0705555347 | C++ | Batyan/Eliminator | /iteration 2/Prototype/gestionMap/personnage.h | UTF-8 | 690 | 2.78125 | 3 | [] | no_license | #ifndef PERSONNAGE_H
#define PERSONNAGE_H
#include "elementmap.h"
class personnage : public elementMap
{
public:
personnage(personnage const& cp);
personnage(int x, int y,int type,int vie);
personnage();
// info sur l'objet
QString print();
// serial de l'objet
QVariant serial();
public:... | true |
7e637071a5b77db2d97ec40784737246fc62d1a9 | C++ | jhpy1024/Mazel | /Source/Game.cpp | UTF-8 | 5,116 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "Game.hpp"
#include <iostream>
#include <memory>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "Utils.hpp"
#include "Shader.hpp"
#include "MenuState.hpp"
#include "PlayState.hpp"
#include "WinGameState.hpp"
#include "FinishLevelState.hpp"
#include <GL/freeglut.h>
Game::G... | true |
3fd84aa318a5d4ae29487a1cd0b51ee1af178bb7 | C++ | OpenVE/scripts | /Cpp/BasicExamples/FILE21.cpp | UTF-8 | 1,971 | 4.125 | 4 | [] | no_license | /*
In the context of programming, polymorphism allows you to refer to objects of different classes by means of the same program item and to perform the same operation in different ways, depending on which object is being referred to.
In C++, one way polymorphism is implemented is through the use of virtual functions.
W... | true |
8eb4c09faee7d8de2fa6674acc99a42ed0e771ff | C++ | Gast91/Pacman | /src/Tile.h | UTF-8 | 1,047 | 2.984375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Config.h"
class Level;
struct Node
{
sf::Vector2i gridPosition;
int f = 0, g = 0, h = 0; // score, cost, heuristic
Node* parent = nullptr;
Node() {}
Node(const sf::Vector2i pos, Node* p = nullptr) : gridPosition(pos), parent(p) {}
Node(const Node* other) : gridPosit... | true |
24499b87c0df1d4462e1b258fe63d804964a11e3 | C++ | TylerTheFox/CS260-Project-4 | /CS260 Proj 4/vendor.cpp | UTF-8 | 3,304 | 3.375 | 3 | [] | no_license | /*
* File: vendor.cpp
* Author: Brandan Tyler Lasley
*
* Created on November 15, 2014, 10:51 AM
*/
#include "vendor.hpp"
vendor::vendor() {
this->phone = NULL;
this->name = NULL;
this->event = NULL;
this->product = NULL;
}
vendor::vendor(const vendor& obj) {
this->phone = NULL;
this-... | true |
5b32eb000f24a96ac3d5c162650e51809ae28e03 | C++ | kvanderlaag/CSC_305_Ray_Tracer | /CSC_305_Ray_Tracer/Triangle.cpp | UTF-8 | 1,505 | 3.09375 | 3 | [] | no_license | #include "Triangle.h"
#include "Plane.h"
#include "Lambertian.h"
#include <cfloat>
#include <cmath>
#include <cstdio>
/*
Triangle.cpp
Defines functionality for computing intersection between a ray and a triangle,
and barycentric coordinates on that triangle.
*/
void Triangle::Barycentric(const Vector3& p, doubl... | true |
3f72883b4987fd7cce302594e5403e89e69bc3dc | C++ | MosheGroot/Fund_Algorithms_4sem | /lab01/headers/matrix_nn.hpp | UTF-8 | 1,809 | 2.859375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <initializer_list>
#include <exception>
#include <algorithm>
#include <memory>
#include "tex_convertible.hpp"
#define EPS 1e-6
class Matrix_NN : public TeX_convertible
{
private:
std::vector<std::vector<double>> data;
size_t N;
void alloc_memory(size_t N);
void free_mem... | true |
572bf88378132b0086a81459394246d3f8e94b1f | C++ | kris-Git11/3TG | /Rekurzivne_funkcije_6_Ispisuje_broj_unatrag.cpp | UTF-8 | 278 | 2.71875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int BrojUnatrag ( int x )
{
cout << x % 10;
if ( x / 10 > 0 )
return BrojUnatrag ( x / 10 );
}
int main()
{
int iBroj;
cout << "Unesite broj: ";
cin >> iBroj;
BrojUnatrag ( iBroj );
}
| true |
14b9d7eab16308f4a42867b6c819d5bef9eab04e | C++ | pr0g/cpp-sky-down-example | /drawing.hpp | UTF-8 | 613 | 2.640625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | #pragma once
#include "polymorphic.hpp"
#include <vector>
struct Draw {};
using DrawSignature = void(Draw) const;
struct Update {};
using UpdateSignature = void(Update);
using Drawable = polymorphic::object<DrawSignature>;
using DrawableRef = polymorphic::ref<DrawSignature>;
using Updatable = polymorphic::object<... | true |
2c988577613b2ea9462c18f32cbf48ab1351252d | C++ | rezwanh001/LightOj-Solutions-in-Cpp | /1166 - Old Sorting/main.cpp | UTF-8 | 495 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
scanf("%d", &T);
for(int cas = 1; cas <= T; cas++){
int n;
scanf("%d", &n);
vector <int> v(n);
for(int i = 0; i < n; i++){
cin >> v[i];
}
int cnt = 0;
for(int i = 0; i < n; i++){
int j = i;
while(j < n && v[j] != (i + 1)){
... | true |
7de9dd331d655240540e21f449c01a3d98bd21e1 | C++ | seokwoongchoi/GameEngine | /Framework/BehaviorTree/BehaviorTree.h | GB18030 | 1,889 | 2.828125 | 3 | [] | no_license | #pragma once
#include<stack>
#include "Behavior.h"
//namespace BT
enum class EActionMode
{
Attack,
Patrol,
Runaway,
};
enum class EConditionMode
{
IsSeeEnemy,
IsHealthLow,
IsEnemyDead,
};
class BehaviorTree
{
public:
explicit BehaviorTree(Behavior* InRoot) :Root(InRoot) {}
BehaviorTree(c... | true |
1f38155aa52b986f0d9aef5d4a391bd23b18703f | C++ | sntwr/UVa-Solved-Problems | /solved/UVa11364/11364.cpp | UTF-8 | 947 | 2.703125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define MAXN 30
int
main ()
{
int T;
for (scanf ("%d", &T); T--;) {
int N;
int store[MAXN];
scanf ("%d", &N);
for (int i = 0; i < N; i++)
scanf ("%d", store + i);
if (N <= 1) {
printf ("0\n");
continue;
}
int max_st, min_st;
if (store[0] > store[1]) {
max_st ... | true |
0be6b6ddc380e8e437a92ec0b02695b5796a73eb | C++ | Thecatkiller/AN.DE-ALGOR.Y-ESTRAT.-DE-PROG | /Semana 05/main.cpp | UTF-8 | 1,544 | 3.46875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define OPC_SUMAR '1'
#define OPC_PROMEDIO '2'
#define OPC_MAYOR '3'
#define OPC_SALIR '9'
char menuPrincipal();
int sumar(int lista[],int n);
double promedio(int lista[],int n);
int mayor(int lista[], int inicio, int fin);
int main() {
char mopc;
in... | true |
02088ace1bc2c98d5e61fb08231e9940e79e3732 | C++ | zhaoxing-zstar/Quantnet-C | /Level_3/2.3/2.3.5/Point.cpp | UTF-8 | 1,344 | 3.78125 | 4 | [] | no_license | /*
Point.cpp
Implement member functions for Point class
*/
#include "Point.hpp"
#include <sstream>
#include <iostream>
#include <cmath>
using namespace std;
// Initialize with 0
Point::Point() : x(0), y(0)
{
cout << "Point created\n" << endl;
}
// a constructor with x-y coordinates
P... | true |
61444ad1fe1fb1aac39cae4b5e8a385baee94667 | C++ | qyb225/LeetCode | /Problem-004/P4.cpp | UTF-8 | 683 | 3.1875 | 3 | [] | no_license | #include <vector>
using namespace std;
class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2);
};
double Solution::findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
vector<int> v;
int i = 0, j = 0;
while (i < nums1.size() && j < nums2.size()) {
... | true |
723eb532c9f55b164e25a9770d24cb3fc09e6f01 | C++ | battisq/OOPLabs | /Lab4/Fraction.h | WINDOWS-1251 | 1,564 | 3.078125 | 3 | [] | no_license | #pragma once
#include <ostream>
namespace Mathematics
{
class Fraction
{
private:
int numerator;
int denominator;
void reduce(void);
public:
Fraction(int _numerator = 0, int _denominator = 1);
int getNumerator(void) const;
int getDenominator(void) const;
std::pair<int, Fraction> toProper(void);... | true |
365e37278199c1cfd0533debc1ef21e234199e81 | C++ | bobrippling/alleged | /client/netobj.cpp | UTF-8 | 232 | 2.546875 | 3 | [] | no_license | #include <string.h>
#include <arpa/inet.h>
#include "netobj.h"
NetObj::NetObj(struct sockaddr_in *addr)
: addr()
{
if(addr)
memcpy(&this->addr, addr, sizeof this->addr);
else
memset(&this->addr, '\0', sizeof this->addr);
}
| true |
f14d321f3c529c9541211606d307c61ddab69faa | C++ | romeoyacobs/HackerRank | /30Days/C++/day8.cpp | UTF-8 | 696 | 2.9375 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
int main() {
int N;
cin >> N;
unordered_map<string, long long> phoneBook;
while (N--)
{
long long number;
string name;
cin >> name;
... | true |
46af1564d816f53868de549cd2082d86d47f38f0 | C++ | linhanyu/ACM | /acm_practice_1/acm_practice_1/File_2.cpp | UTF-8 | 871 | 3.15625 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cstdlib>
#define NUM 101
using namespace std;
template<class T>
void Insert_Sort(T * a, int size) {
int i, j;
T temp;
for ( i = 1; i < size; i++)
{
temp = a[i];
for (j = i;j>0 && temp < a[j-1]; j--)
{
a[j] = a[j - 1];
}
a[j] = temp;
}
}
struct T_v
{
i... | true |
b72512952bb49e460c0fe6421776c94547930c24 | C++ | algrandjean1/CST316Embedded | /airAutomation/embeddedSystems/Methane/.build/uno/src/mq4Code.cpp | UTF-8 | 1,217 | 2.734375 | 3 | [] | no_license | #include <Arduino.h>
void setup();
void loop();
#line 1 "src/mq4Code.ino"
/**
* Original author found at
* http://arduinotronics.blogspot.com/2012/03/gas-sensor-tutorial.html
* Code used and modified by 316 Air project team
**/
// to the pins used:
const int analogInPin = A0; // Analog input pin that the potenti... | true |
eb6e8cd3306390a6b603614bbf895db8052b310f | C++ | kipdec/ArduinoConductanceProject | /ArduinoResistanceOhmExperiment/OhmVolt/OhmVolt.ino | UTF-8 | 1,376 | 3.234375 | 3 | [] | no_license | // Arduino Ohm Voltage Experiment
// Kip DeCastro
// July 18th
//
// This program is designed to compare the equations gleaned from the Arduino
// ohm voltage experiment to each other.
// Initialize variables...
double a = 0; // Our value read from the arduino
double va = 0; // Arduino to volt
double ra = 0; // Ardui... | true |
b2aac1ceacc13259436d3d6c8184e253b354531b | C++ | TuanAnhNguyen69/MegamanX3 | /MegamanX3/MegamanX3/HelitFlying.cpp | UTF-8 | 2,577 | 2.609375 | 3 | [] | no_license | #include "pch.h"
#include "HelitFlying.h"
#include "Roof.h"
HelitFlying::HelitFlying(HelitStateHandler *handler, Entity *entity) : HelitState(handler, entity)
{
sprite = new AnimatedSprite(15, 1, true);
sprite->Initialize(Engine::GetEngine()->GetGraphics()->GetDevice(), "helit",
0, 4, 5, 50, 50);
}
HelitFlying:... | true |
ef02c0b884d555335df9cd3c3738d2a423a9ea88 | C++ | yleblanc/opencine | /Source/OpenCine/Model/MediaExplorerModel.cpp | UTF-8 | 1,745 | 2.515625 | 3 | [] | no_license | #include "MediaExplorerModel.h"
#include <QDir>
/*ClipInfo::ClipInfo(QObject *parent)
: QObject(parent)
{
}*/
ClipInfo::ClipInfo(const QString &path, const QString &name, const unsigned int& width, const unsigned int& height, const unsigned int& fps, QObject *parent):
QObject(parent),
_path(path),
_name(name),
_... | true |
760bbf41c6de2a615b8c062ea38205f66de4b34b | C++ | sajidhasanapon/URI-Solutions | /Codes/URI 1217.cpp | UTF-8 | 655 | 3.03125 | 3 | [] | no_license |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
double total_money = 0, total_weight = 0;
for ( int i = 1; i <= t; i++ )
{
double v;
cin >> v;
total_money += v;
getchar();
int cnt = 0;
string str;
getline ( cin, str );
stringstream ss ( str );... | true |
ea7a23f1c2e59b23733d4e05a66fa8cfd1c67a18 | C++ | yzq986/cntt2016-hw1 | /TC-SRM-568-div1-250/Remilia.cpp | UTF-8 | 963 | 2.6875 | 3 | [] | no_license | #include<bits/stdc++.h>
#define rep(x,a,b) for (int x=a;x<=(int)b;x++)
#define drp(x,a,b) for (int x=a;x>=(int)b;x--)
#define cross(x,a) for (int x=hd[a];~x;x=nx[x])
#define ll long long
#define inf (1<<29)
#define PII pair<int,int>
#define PDD pair<double,double>
#define mk(a,b) make_pair(a,b)
#define fs first
#defin... | true |
f1fa21859d0f7ec65b9b7c6eb7256944cad1bbd5 | C++ | JinRLuo/solution-of-algorithm | /acwing/算法基础课/基础算法/801 二进制中1的个数.cpp | UTF-8 | 209 | 2.609375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int n;
int main(){
cin>>n;
int a,res;
for(int i=0;i<n;i++){
res=0;
cin>>a;
while(a){
if(a&1){
res++;
}
a>>=1;
}
cout << res << " ";
}
}
| true |
79cb12dc6f10e5df7ff9d63c45bb2fd3af17332b | C++ | ysonggit/roschat | /src/rostalker/src/rostalker.h | UTF-8 | 1,029 | 2.71875 | 3 | [] | no_license | #ifndef ROS_TALKER_H
#define ROS_TALKER_H
#include <ros/ros.h>
#include "std_msgs/String.h"
#include <sstream>
#include <string>
#include <unordered_map>
using namespace std;
struct ListenerAgent{
ListenerAgent(int i){
id = i;
stringstream ss;
ss<<id;
string topic_name = "listener"+... | true |
4ed34eb034cc28d94a7ed51b979cb7aeac8e660a | C++ | KraftOreo/Bilevel-Differential-Grasp-Optimization | /Utils/internal/SOSPolynomialNrVar.h | UTF-8 | 2,117 | 2.703125 | 3 | [] | no_license | //meta-template function to count max number of variables
template <typename T,char LABEL,char LABEL2>
struct NrVar
{
static sizeType nrVar(const SOSPolynomial<T,LABEL>& s) {
if(LABEL==LABEL2) {
sizeType nrVar=0;
for(sizeType i=0; i<(sizeType)s._terms.size(); i++)
nrVar=std::max<sizeType>(nrVa... | true |
3d0b201d9986883e60f9f8a90f551583e3c2b2cc | C++ | rahuljain/playground_CPlusPlus | /high_school/Extra programs/Z.CPP | UTF-8 | 262 | 2.5625 | 3 | [] | no_license | #include<iostream.h>
#include<conio.h>
void main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
cout<<"*";
cout<<endl;
for(int j=n-2;j>0;j--)
{
for(int k=j;k>0;k--)
cout<<" ";
cout<<"*";
cout<<endl;
}
for(i=1;i<=n;i++)
cout<<"*";
} | true |
dd87666ad609e81bb64054951d8122f55ebd94be | C++ | filipeguimaraes/CG1920 | /engine/structs/transformation.cpp | UTF-8 | 6,047 | 2.90625 | 3 | [] | no_license | #include <stdlib.h>
#include <GL/glut.h>
#include <stdio.h>
#include <vector>
#include <math.h>
#include "transformation.h"
#include "catmull.h"
struct transformacao_3d {
float var[4][4];
float time;
std::vector<float> * pontos;
};
float * invert_order_matrix(float m[4][4]){
static float r[4*4];
... | true |
2bc952e590d36f163e14b318d0122dad6d9eeeb6 | C++ | RomanArzumanyan/Rustling | /main.cpp | UTF-8 | 1,689 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include <vector>
#include "Rustling.hpp"
using namespace rustling;
using namespace std;
int main()
{
PlatformMgr plt_mgr;
Platform my = plt_mgr.makePlatform(CL_DEVICE_TYPE_GPU);
cout <<
my.getExtensions() << endl <<
my.getID() << endl <<
my.getName()... | true |
7200cbf4918f0b28fd7a017106dab1dc04ccd166 | C++ | dean11/NoEdge | /source/Game/GameLogic/PickupSystem/Pickup.h | UTF-8 | 837 | 2.515625 | 3 | [] | no_license | #ifndef PICKUP_H
#define PICKUP_H
#include "../StaticObject.h"
#include "../Player.h"
#include "WinTimer.h"
typedef void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss);
namespace GameLogic
{
class Pickup : public StaticObject
{
p... | true |
24b322ebfc99962d3a04efafc187b82c0505b581 | C++ | zvanjak/MiscProjects | /CSharp/Code Plagiarism Detector/OLD Code/astdiff+c2ast/c2ast/ast.h | UTF-8 | 3,759 | 2.59375 | 3 | [] | no_license | #ifndef _AST_
#define _AST_
#include "stdafx.h"
#include "source.h"
#include "ast_alloc.h"
typedef enum {
ASTnt_block = 0,
ASTnt_function,
ASTnt_function_code,
ASTnt_if,
ASTnt_if_true,
ASTnt_if_false,
ASTnt_for,
ASTnt_while,
ASTnt_do,
ASTnt_root,
ASTnt_switch,
ASTnt_label,
ASTnt_undefined
} AST_node_typ... | true |
6badeff6efab21257d3efed2c93af70e046ae8a9 | C++ | Javanaise/mrboom-libretro | /ai/bt/composites/Sequence.hpp | UTF-8 | 1,006 | 3.515625 | 4 | [
"MIT"
] | permissive | #pragma once
#include "../Composite.hpp"
namespace bt
{
/*
* The Sequence composite ticks each child node in order.
* If a child fails or runs, the sequence returns the same status.
* In the next tick, it will try to run each child in order again.
* If all children succeeds, only then does the sequence succee... | true |
190dd88de8883fdf378026b4fd22b2893f799d3e | C++ | mshah12/cs225-sp20 | /mp_stickers/main.cpp | UTF-8 | 589 | 2.96875 | 3 | [] | no_license | #include "Image.h"
#include "StickerSheet.h"
int main() {
//
// Reminder:
// Before exiting main, save your creation to disk as myImage.png
//
Image baseImage, corn, ramchip, computer;
baseImage.readFromFile("illinois.png");
computer.readFromFile("computer.png");
ramchip.readFromFile("ramchip.png");... | true |
0b49c06b01b8c36105c990872a5f0999712cab26 | C++ | ADDD0/C- | /C++面向对象程序设计(第2版) 谭浩强/第3章 怎样使用类和对象/习题/5.cpp | UTF-8 | 873 | 4.15625 | 4 | [] | no_license | /**
* 建立一个对象数组,内放5个学生的数据(学号、成绩),设立一个函数max,用指向
* 对象的指针作函数参数,在max函数中找出5个学生中成绩最高者,并输出其学号。
*/
#include <iostream>
using namespace std;
class Student {
public:
Student(int n, float s): sno(n), score(s) {}
void showSno();
int sno;
float score;
};
void Student::showSno() {
cout <... | true |
b5df90702f0ca9529ff11ace90afd3876969155b | C++ | shuhaowu/nottetris2 | /original/love2d072/src/modules/image/devil/ImageData.cpp | UTF-8 | 8,926 | 2.703125 | 3 | [
"Zlib"
] | permissive | /**
* Copyright (c) 2006-2011 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* includin... | true |
7093084f4a57d9aae6016efafa608e87e66943d5 | C++ | edweenie123/competitive-programming-solutions | /CF/519D-A-and-B-and-Interesting-Substrings.cpp | UTF-8 | 1,792 | 3.265625 | 3 | [] | no_license | /*
~~~ 519D - A and B and Interesting Substrings ~~~
Key Concepts: PSA, Map, Insight?
Weird problem
Let's contructs a PSA for the values of the string
The condition for an interesting subarray is as follows:
Let the subarray be defined as [i, j]
The subarray is interesting if:
1. s[i] = s[j] AND
... | true |
6d3b334a65643d899ca82a6261f3e8f1537760b1 | C++ | cstrainge/basically | /source.cpp | UTF-8 | 2,197 | 3.21875 | 3 | [] | no_license |
#include "basically.h"
namespace basically::source
{
void Location::next() noexcept
{
++column;
}
void Location::next_line() noexcept
{
++line;
column = 1;
}
std::ostream& operator <<(std::ostream& stream, Location const& location)
{
stream << lo... | true |
129d01e34329d6feebf3559b25c9a19d877fa9ea | C++ | Redleaf23477/ojcodes | /acmicpc/2015-Singapore/A.cpp | UTF-8 | 1,748 | 2.5625 | 3 | [] | no_license | //
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long int ll;
const int N = 220;
struct Node
{
int r, c, idx;
};
bool operator < (const Node &lhs, const Node &rhs)
{
if(lhs.r != rhs.r) return lhs.r < rhs.r;
if(lhs.c != rhs.c) return lhs.c < rhs.c;
return lhs.idx < rhs.... | true |
9ba236efec6ba17849588471bc1e1e7718402645 | C++ | Prateek4658/ACM-ICPC-Algorithms | /Data Structures/Stack/BalancedParanthesis/BalancedParanthesisStack.cpp | UTF-8 | 736 | 2.734375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
stack<string>s1,s2;
int n,i;
string s;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>s;
for(i=0;s[i]!='/0';i++)
{
if(s[i]=='[' || s[i]=='(' || s[i]='{')
s1.push(s[i]);
else
{... | true |
c37625b7243053e77815f84147b76a95f62ad80d | C++ | quyang19/Mytest | /link/link/link/link1.cpp | UTF-8 | 1,500 | 2.578125 | 3 | [] | no_license | //
// link1.cpp
// link
//
// Created by 李应鹏 on 2018/11/13.
// Copyright © 2018 李应鹏. All rights reserved.
//
#include "link1.hpp"
#include <stack>
#include <iostream>
using namespace std;
typedef struct LinkNode
{
int value;
struct LinkNode *pNext;
}LinkNode, *Link;
typedef struct doubleLink
{
int va... | true |
59e0be59c33cbc7a2981b73ba8d382fd08f82926 | C++ | TBueter/CS328_Final_Project | /test_symmetricalMatrix.cpp | UTF-8 | 3,162 | 3.453125 | 3 | [] | no_license | /************************************************************
Filename: test_SymmetricalMatrix.cpp
Programmer: Paul Sites
Class: CS5201
Assignment: 6 - An Abstract Matrix Class w/ More Derivatives
Date: 2015.04.22
Desc:
This is the SymmetricalMatrix unit-test file. It contains methods to test the SymmetricalMa... | true |
550cfeefa40fc54eac1f404482b6268280416aea | C++ | minhquanym/SlidingPuzzle | /RandomStart.cpp | UTF-8 | 2,280 | 2.515625 | 3 | [] | no_license | namespace RandomStart {
const int limitTimeSwap = 1e6;
int h[4] = { 0, -1, 1, 0 };
int c[4] = { -1, 0, 0, 1 };
void randomStart(Board &board) {
srand(time(NULL));
int TimeSwap = limitTimeSwap + 1, preDir = -1;
for (int i = 1; i <= TimeSwap; ++i) {
int x = board.Spac... | true |
4e919d8c49bd32fbe478f2377e250b3ebf26578c | C++ | snikk/Junk | /test/glfw/engine/actor/Actor.h | UTF-8 | 1,247 | 2.671875 | 3 | [] | no_license | #ifndef __ACTOR_H__
#define __ACTOR_H__
#include "../common.h"
#include "ActorComponent.h"
typedef unsigned int ActorId;
class Actor {
friend class ActorFactory;
public:
typedef std::map<ComponentId, StrongActorComponentPtr> ActorComponents;
private:
ActorId m_id;
ActorComponents m_components;
... | true |