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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f4f5a36189abf7c7adb709fe272f68533462da1f | C++ | ajbajb/ARTTECH3135-fall2018 | /code_day05/05_01_BouncingBallClass/src/Ball.cpp | UTF-8 | 1,474 | 3.15625 | 3 | [] | no_license | #include "Ball.h"
Ball::Ball()
{
// this is our contructor
// we give default values to our Ball object
// when it is created
px = ofGetWidth()/2;
py = ofGetHeight()/2;
topSpeed = 20;
vx = topSpeed;
vy = topSpeed;
ax = -0.09;
ay = -0.09;
dx = 1;
dy = -1;
radius = 20;
c = ofColor::fromHsb(ofRa... | true |
c9d1e6b5edcaa775bf37ea6b7a965b6a4b89946d | C++ | zsc1993916/AcmTemplate | /Math/常用.cpp | UTF-8 | 2,223 | 2.84375 | 3 | [] | no_license | /*
筛素数 O(n)
*/
const int N=100;
bool isPrime[N] ; //数组定义该数字是否为素数
int prime[N] ; // 存下素数
int total = 0 ; //第几个素数
void seive(){
memset( isPrime , true , sizeof( isPrime ));
memset( prime , 0 , sizeof( prime ));
isPrime[0 ] = false ;
isPrime[1] = false ;
for ( int i = 2 ; i <= N ; ... | true |
badf5c1f6a52e807724811501251912c5fc9baf4 | C++ | enfortune/OrcsMustDie | /D3D_base/cRay.cpp | UTF-8 | 896 | 2.765625 | 3 | [] | no_license | #include "stdafx.h"
#include "cRay.h"
cRay::cRay()
: m_vPos(0, 0, 0)
, m_vDir(0, 0, 0)
{
}
cRay::~cRay()
{
}
cRay cRay::RayAtViewSpace(int nScreenX, int nScreenY)
{
D3DVIEWPORT9 vp;
g_pD3DDevice->GetViewport(&vp);
D3DXMATRIXA16 matProj;
g_pD3DDevice->GetTransform(D3DTS_PROJECTION, &matProj);
cRay r;
r.m_vD... | true |
12c0999d1c14e7a4b3d2969d818cdbf1a4b7c5c7 | C++ | shabre/load_balancing | /ldServer_static partitioning/ldServer/map.hpp | UTF-8 | 678 | 2.65625 | 3 | [] | no_license | //
// map.hpp
// dynamic partitioning
//
// Created by Shabre on 2017. 10. 27..
// Copyright © 2017년 Shabre. All rights reserved.
//
#ifndef map_hpp
#define map_hpp
#include <iostream>
#include <list>
struct position{
float x;
float y;
float z;
};
class zone{
private:
int numOfMember;
struc... | true |
b1e9c7ba1adbedec597834d06996cc61b8f3e4e2 | C++ | ritik005/DataStructure-Implement | /Algorithm/Sorting/InsertionSort.cpp | UTF-8 | 531 | 3.203125 | 3 | [] | no_license | #include <iostream>
using namespace std;
void insertionSort(int arr[], int n){
int i,no,j;
for(i = 1; i < n; i++){
j = i - 1;
no = arr[i];
while(j >= 0 && arr[j] > no){
arr[j+1] = arr[j];
j--;
}
arr[j+1] = no;
}
}
void print(int arr[], int n){
int i;
for(i = 0; i < n; i++){
... | true |
16e0dd7d16acaa6c62ccd56c22aed1254e54eb0e | C++ | xumenger/xumenger.github.shit | /乱七八糟的实验性的代码/141118/duotai.cpp | UTF-8 | 752 | 3.296875 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
class TradesPerson{
public:
virtual void sayHi(){
cout<< "Just Hi" <<endl;
}
};
class Tinker : public TradesPerson{
public:
virtual void sayHi(){
cout<< "Hi, I Tinker!" <<endl;
}
};
class Tailor : public TradesPerson{
public:
v... | true |
e9dc923bea1146a0462cd7f6532efabf8f068711 | C++ | salisbury-robotics/jks-ros-pkg | /teleop_and_haptics/haptic_display_tools/include/haptic_display_tools/Graphics/VolumeRenderer.h | UTF-8 | 3,755 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef VOLUMERENDERER_H
#define VOLUMERENDERER_H
#include "Common/Volume.h"
#include "Common/Labelling.h"
#include "ProxyGeometry.h"
#include "TransferFunction.h"
#include <cml/mathlib/typedef.h>
#include <QGLShaderProgram>
typedef QGLShaderProgram ShaderProgram;
class VolumeRenderer
{
public:
enum VolumeRole {... | true |
c5a49b385d16f7ab85a0600e629cf41a0ba4b942 | C++ | malin666/MyProject | /Default_Delete/main.cpp | UTF-8 | 1,662 | 3.703125 | 4 | [] | no_license | // defaultDelete.cpp
// Methoden aktivieren oder deaktivieren.
// -----------------------------------------------------
// Achtung: Die neue Syntax von C++11 zum Aktivieren und
// Deaktivieren von Methoden mit default und delete wird
// von vielen Compilern noch nicht unterstütz!
// -----------------------------------... | true |
a66e4244ab77b4a6e32c4b665da1be833de2da9c | C++ | olsonadr/16x-work | /cs162/local/labs/lab-6-olsonadr/application.cpp | UTF-8 | 843 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include "Rectangle.hpp"
#include "Square.hpp"
#include "Circle.hpp"
int main()
{
Square square("Red", 5);
Circle circle("Blue", 3);
Rectangle rect("Green", 5, 10);
std::cout << "square is a "<< square.get_name()
<< ", is " << square.get_color()
<< ", has side length of " << squ... | true |
8774cd0b5ba3644d3d597dacefcfa0f9707cc4ce | C++ | hellosuzie/SuzieDeadByDaylight | /SSDEngine/DXHeader.cpp | UHC | 20,000 | 2.890625 | 3 | [] | no_license | #include"DXHeader.h"
const float _tagVEC2::Cross(const _tagVEC2& _Other)
{
return DirectX::XMVector2Cross(*this, _Other).m128_f32[0];
}
const float _tagVEC2::Dot(const _tagVEC2& _Other)
{
return DirectX::XMVector2Dot(*this, _Other).m128_f32[0];
}
_tagVEC2 _tagVEC2::operator=(const _tagVEC2& _Other)
{
x = _Other.x... | true |
d8d9876cfe8455596f5067419ad5b05542bce2a2 | C++ | ANoob0w0/CppPrimer | /StrBlob.h | UTF-8 | 3,770 | 3.140625 | 3 | [] | no_license | #ifndef STRBLOB_H
#define SRTBLOB_H
#include <string>
#include <iostream>
#include <memory>
#include <vector>
class StrBlobPtr;
class ConstStrBlobPtr;
class StrBlob
{
friend class StrBlobPtr;
// friend class ConstStrBlobPtr;
public:
typedef std::vector<std::string>::size_type size_type;... | true |
e435c143680f2545670186b8f9d82fdbb6645046 | C++ | Hyodar/jogo-tecprog | /jogo/src/utils/classes/collision_list.hpp | UTF-8 | 1,686 | 2.515625 | 3 | [
"MIT"
] | permissive |
#ifndef COLLISION_LIST_HPP_
#define COLLISION_LIST_HPP_
#include <vector>
#include <map>
#include <deque>
#include <game_config.hpp>
#include "collision_detecter.hpp"
namespace bardadv::core {
class LevelManager;
}
namespace bardadv::obstacles {
class Obstacle;
}
namespace bardadv::characters {
class Enemy;
clas... | true |
5245f888e895fa85e9fe7f96f7283f2613239db3 | C++ | pcx229/OpensslWrapper | /src/encoder/hex.h | UTF-8 | 948 | 2.890625 | 3 | [] | no_license |
#ifndef _HEX_H_
#define _HEX_H_
#include <sstream>
#include <iomanip>
#include <iostream>
using namespace std;
#include "encoder.h"
namespace crypto {
class Hex : public BlockEncoder {
public:
~Hex();
/**
* a wrapper for Encode() block function
* @param data a bytes object to encode
* @return... | true |
0f966fcc90e0bab5cc545a123da2a7448dd6d84f | C++ | dcamvik2020/Full-code-base | /Coursera C++/White/week 4/Files/PrintToBinFileFromSS/main.cpp | UTF-8 | 3,886 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
void PrintToBinFileFromSS(ofstream& output, stringstream& SS) {
char c; /// only '0' and '1'
char tmp = 0;
char cnt; /// counter of bits 0/1
for (cnt = 0; 1; ++cnt) {
SS >> c;
... | true |
02c423c37fdb680741b3455a13d616294cc636d5 | C++ | pokevii/GrizzellJoshua_CSC17A_43396 | /Hmwk/Gaddis Chapter 13 Classes/Ga9EdC13P7/TestScores.cpp | UTF-8 | 595 | 2.8125 | 3 | [] | no_license | class TestScores{
private:
int test1;
int test2;
int test3;
public:
TestScores(int t1, int t2, int t3){
test1 = t1;
test2 = t2;
test3 = t3;
}
TestScores(){
test1 = 0;
test2 = 0;
test3 = 0;
}
void setTest1(int t1) { test1 = t1; }
void setTe... | true |
1bb5be1fa40e4a3d98aa681f511b48676595bb1e | C++ | Andres-Alvarez-V/sintax-reader | /binario.cpp | UTF-8 | 372 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
#include "arbol.h"
#include "operador.h"
#include "binario.h"
using namespace std;
Binario::Binario(Operador oper, Arbol izq, Arbol der){
this->oper= &oper;
this->izq= &izq;
this->der= &der;
}
Operador* Binario::getOper(){
return oper;
}
Arbol* Binario::getIzq(){
return i... | true |
772c6868269a05179e8543e732a457a2d21b46c0 | C++ | kennyrkun/Atraxian | /Atraxian/Filesystem.cpp | UTF-8 | 3,353 | 3.3125 | 3 | [
"MIT"
] | permissive | #include "logger.hpp"
#include <filesystem>
#include <fstream>
namespace environment {
namespace filesystem
{
namespace fs = std::experimental::filesystem;
bool exists(std::string thing_that_may_or_may_not_be_real)
{
if (fs::exists(thing_that_may_or_may_not_be_real))
return true;
else
return false;
}
... | true |
803e8794be70e23d325d873c38232facd89bfbb2 | C++ | cies96035/CPP_programs | /TOJ/已註解,整碼/toj513.cpp | UTF-8 | 695 | 3.359375 | 3 | [] | no_license | #include<iostream>
using namespace std;
//record a time
struct CLOCK
{
int h;
int m;
}a,b,c={24,00};
//if A earlier than B
bool clockcompare(CLOCK A,CLOCK B)
{
if(A.h!=B.h)return A.h<B.h;
return A.m<B.m;
}
//two times' delta
CLOCK dclock(CLOCK A,CLOCK B)
{
CLOCK C;
//make A bigger than B
if(clockcompare(A,B))... | true |
c592f260be86c2f0f54ec7d71f073c36a9761195 | C++ | nNbSzxx/ACM | /cf/18.11.12 ed54 div2/C.cpp | UTF-8 | 709 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int MAX = 1005;
int d;
int main()
{
int t;
scanf("%d", &t);
while (t --) {
scanf("%d", &d);
double l = d / 2.0, r = d;
for (int i = 0; i < MAX; i ++) {
... | true |
482891008e88c4eeea5448740cfb79c92be50cff | C++ | slashvar/algolia-back-to-school | /DataStructures/lists/lists.h | UTF-8 | 1,396 | 3.640625 | 4 | [
"BSD-2-Clause"
] | permissive | /*
* lists.h: classical linked lists implementation
*/
#pragma once
template <typename T>
struct list
{
list() = default;
struct cell
{
cell* next = nullptr;
T value;
};
size_t size()
{
size_t s = 0;
for (auto cur = head.next; cur != nullptr; cur = cur->... | true |
c055586fc6eb63c6d1de8cdcd4a4573b0bdb76a6 | C++ | noorsingh/ds_library | /Cases_Graph.cpp | UTF-8 | 3,444 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
// function used for i/o in sublime text
void input() {
#ifndef ONLINE_JUDGE
freopen("C:/Users/noor/Documents/Sublime/input.txt", "r", stdin);
freopen("C:/Users/noor/Documents/Sublime/output.txt", "w", stdout);
#endif
}
vector<array<int, 3>> generate_graph(bool IS_DIRE... | true |
188a08bd1bfb6220481232484930fe3113332ce6 | C++ | SuhasChandrashekar/Order-Management-System | /FrontOfficeUser.cpp | UTF-8 | 14,447 | 2.75 | 3 | [] | no_license | #include "stdafx.h"
#include<PkFramework.h>
#include<DAL.h>
#include"FrontOfficeUser.h"
#include"Order.h"
#include"OMSException.h"
#include<fstream>
#include<string>
#include<iostream>
using namespace std;
Order *orderObj[25];
int orderCount;
std::ofstream ErrorFile("ErrorFile.txt",std::ofstream::out);
bool CheckIte... | true |
fe6db72cb0be4be83200053b058b0fc3224f8009 | C++ | PAL-ULL/software-metco | /oplink/algorithms/team/src/plugins/algorithms/SPEA/SPEA.h | ISO-8859-2 | 4,925 | 2.96875 | 3 | [] | no_license | /***********************************************************************************
* AUTHORS
* - Ofelia Gonzlez Prez
* - Gara Miranda Valladares
* - Carlos Segura Gonzlez
*
* DATE
* November 2007
*
* DESCRIPTION
* This class inherits from EA, in order the implement the evolutionary algorithm
* S... | true |
1aee30e064a9c197d46448d0ce4d13164ba497fe | C++ | Barush/IPK3 | /rdtclient.cpp | UTF-8 | 5,838 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/time.h>
#include <string>
#include <vector>
#include <time.h>
#include <sstream>
//soubor obsahujici funkce pro vyuziti udt pre... | true |
10ea5e812b256b58c395182dbc8160251e2e623c | C++ | suNrisEinMyeYes/hash | /Hash/hashTable.cpp | UTF-8 | 1,662 | 3.203125 | 3 | [] | no_license | #include "stdafx.h"
#include <iostream>
#include "hashFunction.h"
#include "fileReader.h"
#include "comparator.h"
#include "hashTable.h"
#include <list>
#include <iterator>
using std::list;
using namespace std;
template <typename T>
hashTable<T>::hashTable() {
table = new list<T>[100];
}
/*int getKey(string * ele... | true |
0bd7e43f185ee969625a3a107e5f164d89b41443 | C++ | kickflip0/injector | /injector/injector.h | UTF-8 | 3,368 | 2.859375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <cstdint>
#include <filesystem>
#include <windows.h>
#include <TlHelp32.h>
#include <Dbghelp.h>
namespace util
{
inline DWORD get_pid(const char* process_name)
{
HANDLE hSnap = CreateToolhelp32S... | true |
c2134e5c4095082a3bddcfdce97616c2bef3a6a8 | C++ | hu-zhiyu/cpp-interview-prep | /Algorithm/LeetCode/3.无重复字符的最长子串.cpp | UTF-8 | 725 | 3.21875 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=3 lang=cpp
*
* [3] 无重复字符的最长子串
*/
// @lc code=start
class Solution {
// 时间复杂度:O(n), 左右指针会分别遍历一次字符串
public:
int lengthOfLongestSubstring(string s) {
unordered_set<int> us;
int result = 0;
int lptr = 0, rptr = 0;
for(int i = 0; i < s.size(); i++) {
... | true |
84b3fd1b15ddccae8fa3f1f57a1ddccbd8b4345c | C++ | AndrewDTodd/SFML-Memory-Game | /MemoryGame/MemoryGame/Card.cpp | UTF-8 | 2,226 | 3.046875 | 3 | [] | no_license | //
// Card.cpp
// MemoryGame
//
// Created by Andrew Todd on 2/14/19.
// Copyright © 2019 Andrew Todd. All rights reserved.
//
#include "Card.hpp"
#include <SFML/Graphics.hpp>
std::string Card::cardNames[] = {"Ace of Clubs", "Two of CLubs", "Three of CLubs", "Four of Clubs", "Five of Clubs", "Six of Clubs", "Seve... | true |
477814e2b42780e369c968a2abd01e44d8a4258d | C++ | valeriaconde/competitive-programming | /unclassified/stack reverse string.cpp | UTF-8 | 487 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <stack>
#include <queue>
using namespace std;
string pinchesPutaFuncion(string putaString) {
string tuPincheRespuesta = "";
stack<char> reversazo;
for(int i = 0; i < putaString.size(); i++) {
reversazo.push(putaString[i]);
}
while (!reversazo.empty()) {
tuPincheRespuesta += ... | true |
9a8458357b314b78ec9f5664d366dcc4db80f6b3 | C++ | cuongcb/snekageam | /snake.h | UTF-8 | 769 | 2.796875 | 3 | [] | no_license | #pragma once
#include <cstdint>
#include <memory>
#include <vector>
namespace snake {
class Pixel;
class Snake {
public:
Snake();
// motion
void MoveLeft(uint32_t leftborder);
void MoveRight(uint32_t rightborder);
void MoveUp(uint32_t topborder);
void MoveDown(uint32_t bottomborder);
/... | true |
3364887c01773e3e8a2302a2625155c05d3d9d70 | C++ | Pimmez/Break-Out | /Break-out/Breakout/StartMenu.h | UTF-8 | 1,185 | 3.21875 | 3 | [] | no_license | #pragma once
#ifndef STARTMENU_H
#define STARTMENU_H
#define MAX_NUMBER_OF_ITEMS 3 //Maximum Number Of Items In The Array
#include <SFML/Graphics.hpp> //Required for variables with 'sf'
#include <iostream> //Required for use of std::cout, std::endl and more
class StartMenu
{
public:
StartMenu(); //Constructor
~S... | true |
9287c173dee8f1b50ea9abccecb08a5205425aef | C++ | ahorak8/CPP_Bootcamp | /day06/ex00/main.cpp | UTF-8 | 2,764 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
void isDouble(char** argv){
double d = static_cast<double>(atof(argv[1]));
std::cout << "double: " << d << std::endl;
if (!d)
std::cout << "double: impossible" << std::endl;
}
void isFloat(char** argv, int x){
int z = 0;
if(!argv[1][x])
z... | true |
ab634e9c0d3514356cd807c7303a76da6bc66621 | C++ | themicp/Project-Euler-Problems | /problem82/problem82.cpp | UTF-8 | 3,135 | 2.796875 | 3 | [] | no_license | #include <cstdio>
#include <stack>
using namespace std;
const int N = 80;
const bool debug = false;
const int UP = 0;
const int RIGHT = 1;
const int DOWN = 2;
long long int min( long long int a, long long int b ) {
if ( a < b ) {
return a;
}
return b;
}
void W( long long int w[ N ][ N ], long lo... | true |
bf0ebbc633ebaebded599ec5b0f70064d714d836 | C++ | Jas03x/cdep | /src/ascii.hpp | UTF-8 | 346 | 2.65625 | 3 | [] | no_license | #ifndef ASCII_HPP
#define ASCII_HPP
inline bool is_space(char c) { return (c == ' ') || (c == '\t'); }
inline bool is_text (char c) { return ((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || (c == '_'); }
inline bool is_path (char c) { return is_text(c) || (c == ' ') || (c == '/... | true |
076cfe0f85dac86352d61d22f9b6ddc4069b9593 | C++ | danielphil/epi | /src/dutch_national_flag_6.1.cpp | UTF-8 | 3,763 | 3.015625 | 3 | [] | no_license | #include "common.h"
#include "dutch_national_flag_6.1.h"
#include "test.h"
namespace Flag
{
static void ensure_next_indexes_valid(unsigned int next[4]);
std::vector<int> Partition(const std::vector<int>& input_elements, unsigned int partition_index) {
std::vector<int> result = input_elements;
... | true |
5fee413f8766b6eed97ef9b9d8bd48e129d9ce64 | C++ | ArtyomAdov/learning_sibsutis | /learning/thirdparty/САОД/Двор/laba12.cpp | UTF-8 | 5,344 | 2.609375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
struct spis {
spis *next;
char el;
};
struct tle {
spis *head;
spis *tail;
};
void Fillocheredrand(spis *head,int n){
srand((unsigned int) time(NULL));
int k=n; spis *p,*tail=head;
while ... | true |
ae2a0f34a6bb95b0fa5c05c34fe157e4c53759ee | C++ | Pandey-SaurabhP/Tic-Tac-Toe-Game | /main.cpp | UTF-8 | 7,284 | 3.1875 | 3 | [] | no_license | // This game is completely made by Saurabh Pandey alone...
#include <iostream>
#include <string>
#include <cstdlib>
#define p(x) std::cout << x << std::endl;
using namespace std;
string check(char board[9], string P1, string P2)
{
for (int i = 0; i < 3; ++i)
{
if (board[i] == 'X' &&
board[i]... | true |
31762c7967d5066bd73db6f1ad66e0c40ddd848d | C++ | brianzarzuela/CPP | /ContactList/ContactList.h | UTF-8 | 1,359 | 2.859375 | 3 | [] | no_license | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Title : ContactList.h
// Course : Computational Problem Solving II (CPET-321)
// Developer : Brian Zarzuela
// Date : Fall 2019 (2191)
// Description : Header file for ContactList.cpp containing all the
// proto... | true |
0322b59dcc4e080ca308e50e457cbdd0bdf6730b | C++ | mandalsudipti/competitive_programming | /codeforces/Dominant Piranha.cpp | UTF-8 | 724 | 2.671875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
int n ;
cin>>n;
vector<int>arr(n);
int maximum = 0 ;
for(int i=0;i<n;i++)
{
cin>>arr[i];
maximum = max( maximum , arr[i]);
}
... | true |
1648c6e3069319137b5522416561f3a69b62f89a | C++ | firstep710/coding-test | /프로그래머스/Level_1/45.cpp | UTF-8 | 922 | 2.9375 | 3 | [] | no_license | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool compare(pair<int, float> a, pair<int, float> b)
{
if (a.second == b.second)
return a.first < b.first;
else
return a.second > b.second;
}
vector<int> solution(int N, vector<int> stages) {
vector<int> answer(... | true |
cc155657749aefbe26d235d6f92b7782d0972191 | C++ | mln-lchs/Moteur3D | /Moteur3D/CollisionData.h | UTF-8 | 478 | 2.796875 | 3 | [] | no_license | #ifndef COLLISIONDATA_H
#define COLLISIONDATA_H
#include "Contact.h"
class CollisionData
{
public:
CollisionData(int contactsLeft);
CollisionData(Contact *contacts, int contactsLeft);
virtual ~CollisionData();
Contact* getContacts();
void setContacts(Contact *contacts);
int getSize();
int getContactsLe... | true |
e605376e751ceb585f5540f2d9221557c0097eb8 | C++ | QtWorks/SmartHome | /model/power.h | UTF-8 | 674 | 2.5625 | 3 | [] | no_license | #ifndef POWER_H
#define POWER_H
#include <QObject>
#include <QVector>
#include "singleton.h"
class Power : public QObject
{
Q_OBJECT
friend class Singleton<Power>;
QVector<bool> m_enabled{ true, false, false, false, false, true, false, true, true, true, false, true, false, false, false, false};
QVec... | true |
b903005bca0dcd5969424525b535ab86219c335b | C++ | pratyushsetu28/socket | /server.cpp | UTF-8 | 4,833 | 2.875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <string.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
int main()
{
int ssock,csock;
// creating server and client s... | true |
60f2f1f3576a14a5696712f0a0d0842a1c905667 | C++ | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/23/150.c | UTF-8 | 337 | 2.5625 | 3 | [] | no_license | void main()
{
char c,a[400],b[40][20];
int i=0,j,k=0,t=0;
c=getchar();
while(c!='\n')
{
a[i]=c;
i++;
c=getchar();
}
a[i]=' ';
for(j=0;j<=i;j++)
{
b[k][t]=a[j];
t++;
if(a[j]==' ')
{
b[k][t-1]='\0';
k++;
t=0;
}
}
for(i=k-1;i>0;i--)
printf("%s ",b[i]);
printf... | true |
a212f7356dee35d35a74a7c48995bc845ab3452d | C++ | principal6/DoubleBufferedConsole | /DoubleBufferedConsole/dbc.cpp | UTF-8 | 1,562 | 3.3125 | 3 | [] | no_license | #include "DoubleBufferedConsole.h"
#include <string>
#include <thread>
#include <atomic>
int main()
{
CDoubleBufferedConsole Console{ 130, 30, "Console" };
Console.SetClearBackground(EBackgroundColor::Black);
Console.SetDefaultForeground(EForegroundColor::LightYellow);
std::atomic<short> X{};
std::atomic<short> ... | true |
a6de75f8491fac855900e198b71d239b1305b31a | C++ | lenfien/LenOS | /src/LenOS/Screen/screen.h | GB18030 | 4,708 | 2.65625 | 3 | [] | no_license |
/*
ʾⲿû֮Ľӿ, ǰʾʹõSSD1289
Screenֻͼṩӵĺ, Щͼֱӵ
ScreenṩĻͼֺǺŻ
ƾ bitmap, .
ScreenṩӲصϢ, width()ʾĻ߶
ScreenԺõṩⲿ, ΪĽӿ, ûṩĺ㽫
Ӧ÷, ΪǶû
2013.3.30 lenfien
*/
#ifndef __SCREEN__
#define __SCREEN__
#define __CPlusPlus
#include "com.h"
#include "color.h"
#include "ssd1289.h"
#include "datas.h"
... | true |
b455929d55ba6c42d4e5e467cbe8d19a02bf130b | C++ | alok27a/CSE2011-Data-Structures-Algorithm | /Lab/Module 2/Assignment/Assignment 2/Practice/Q4.cpp | UTF-8 | 2,582 | 3.875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
using namespace std;
struct node
{
int age;
char name[20];
char disease[30];
char doctor_assigned[30];
struct node *next;
} *head = NULL;
int choice;
void enqueue();
void dequeue();
void display();
void enqueue()
{
... | true |
80fea92c2f1c42807e62610b8c55a75c2802d36c | C++ | greenfox-zerda-sparta/Ak0s | /Week-02/day-3/02.cpp | UTF-8 | 480 | 3.40625 | 3 | [] | no_license | //============================================================================
// Name : 02.cpp
// Author : Ak0s
//============================================================================
// print the value of number using the "number_pointer"
#include <iostream>
using namespace std;
int main() {
... | true |
b1803085eac13df34b17db5d17796e00c0b9975f | C++ | SofianeHamlaoui/Cours-Informatique | /IUT-Lyon-1/UML/C++/Parc Vehicules/vehicule.h | UTF-8 | 592 | 2.703125 | 3 | [] | no_license | #pragma once
class Vehicule
{
protected :
char Matricule[9];
int Annee;
int Km;
int Puissance;
public :
Vehicule();
Vehicule (char Unmatricule[], int UneAnnee, int UnKm, int UnePuissance);
~Vehicule();
virtual void affiche();
char* get_Unm... | true |
e61baf3d52b766ea11ac0bcadaa7dc3197424105 | C++ | biggoka/prac | /src/interface/Interface.cpp | UTF-8 | 1,506 | 3.125 | 3 | [] | no_license | #include "Interface.hpp"
#include "RequestMaker.hpp"
#include "Request.hpp"
#include <iostream>
#include <string>
#include <sstream>
void Interface::list_rooms() const {
std::cout << "Rooms: " << std::endl;
for (auto &room: bank->get_rooms()) {
std::cout << room << std::endl;
}
std::cout << s... | true |
aeb74ff5898a4dc7333d931162f167541f68f3e8 | C++ | ryandcyu/phosphor-net-ipmid | /integrity_algo.cpp | UTF-8 | 2,070 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | #include <openssl/hmac.h>
#include <openssl/sha.h>
#include "integrity_algo.hpp"
#include "message_parsers.hpp"
namespace cipher
{
namespace integrity
{
Interface::Interface(const Buffer& sik, const Key& addKey, size_t authLength)
{
unsigned int mdLen = 0;
// Generated K1 for the integrity algorithm with th... | true |
c78031ef7a38a4f8edab8885121b9aebd816ff65 | C++ | ickowzcy/paranoia | /include/netlink/error.h | UTF-8 | 547 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef PARANOIA_ERROR_H
#define PARANOIA_ERROR_H
#include <sys/errno.h>
#include <cstring>
#include <stdexcept>
#include "util/concat.h"
using Errno = int;
struct ErrnoException : public std::runtime_error {
template <typename... Args>
ErrnoException(Errno err, Args... args) : std::runtime_error(concat(args..... | true |
4174fbe5ea6c733ad07dc66ce189e071b937c508 | C++ | nmessa/CPP-2021 | /Lab Exercise 2.1.2021/Demo 3/Demo 3/main.cpp | UTF-8 | 831 | 3.203125 | 3 | [] | no_license | //Switch Demo
//Author: nmessa
//Date: 1/30/2021
#include <iostream>
using namespace std;
int main()
{
int score;
cout << "Enter a test score (1 - 100): ";
cin >> score;
if (score < 0 || score > 100)
{
cout << "Invalid score entered" << endl;
return 0;
... | true |
fcb3721d6680bfe8e852ff5190f1c3fd45561979 | C++ | novikov-ilia-softdev/thinking_cpp | /tom_1/chapter_16/22/main.cpp | UTF-8 | 424 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include "tvector.h"
int main()
{
TVector<std::string> vector;
vector.push_back( new std::string( "hello, "));
vector.push_back( new std::string( "wonderful "));
vector.push_back( new std::string( "world!"));
for( int i = 0; i < vector.size(); i++)
{
std::cout << *vector[ i];
}
std::cou... | true |
d92b09acb75ed9f0459ad83fee104b029a932e82 | C++ | ssfehlberg/MCC9_Validation_Codes | /CCInclusive_validation_Sep2018/CCInclusive_stuff/CCInclusive_validation_test/localProducts_larsoft_v06_26_01_10_e10_prof/uboonecode/v06_26_01_13/source/uboone/UBXSec/HitCosmicTag/Base/BaseDqDsSmootherAlgo.h | UTF-8 | 904 | 2.6875 | 3 | [] | no_license | /**
* \file BaseDqDsSmootherAlgo.h
*
* \ingroup Base
*
* \brief Class def header for a class BaseDqDsSmootherAlgo
*
* @author Marco Del Tutto
*/
/** \addtogroup Base
@{*/
#ifndef HITCOSMICTAG_BASEDQDSSMOOTHERALGO_H
#define HITCOSMICTAG_BASEDQDSSMOOTHERALGO_H
#include "BaseAlgorithm.h"
namespace cosmict... | true |
b175a427061459210753199fc5f69031624d6120 | C++ | ytchhh/code_of_me | /DataStruct/Tree/BTree/Tree.h | UTF-8 | 8,788 | 3.625 | 4 | [] | no_license | //二叉树头结点
#ifndef _TREE_H
#define _TREE_H
#include<iostream>
#include<stack>
#include<stdlib.h>
using namespace std;
template<class T>
struct BinTreeNode //二叉树结点类定义
{
T data; //数据域
BinTreeNode<T> *leftChild,*rightChild; //左子女,右子女链域
BinTreeNode():leftChild(NULL),rightChild(NULL) //无参构造函数
{}
BinTreeNode(T x... | true |
3a68ed3ba7b6984ce1242660dc6b4488c06b91af | C++ | watashi/AlgoSolution | /codeforces/ac/0/025/E.cpp | UTF-8 | 1,100 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
string comb(const string& lhs, const string& rhs) {
static int fail[1 << 20];
fail[(int)lhs.length() - 1] = lhs.length();
for (int i = (int)lhs.length() - 2; i >= 0; --i) {
fail[i] = fail[i + 1];
while (fail[i] < (int)lhs.length() && lhs[i] != lhs[f... | true |
2cf0501d548d9baf03afab0623cfc5dc90f445c2 | C++ | rohithv1997/C- | /Class12/prac20.CPP | UTF-8 | 810 | 4.0625 | 4 | [] | no_license | #include<iostream.h>
/*
Program #20:
To swap 2 pointers allocated dynamically
*/
int *a=new int;
int *b=new int;
int *p=new int;
int *q=new int;
int *tmp=new int;
void swap(int*p, int*q)
{ if(p && q && tmp)
{ *tmp=*p;
*p=*q;
*q=*tmp;
}
else
cout<<"Error in creating memory"<<endl;
}
void main()
{ if(a &&... | true |
4c4834ff99d8103b26abba691d3353b520557dd5 | C++ | mlomb/problems | /SPOJ/MST1 - Minimum Step To One/main.cpp | UTF-8 | 576 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <fstream>
using namespace std;
typedef long long int lli;
#define MAX 10000000 * 2 + 10
lli dp[MAX];
int main() {
// precompute
dp[1] = 0;
for(lli i = 2; i < MAX; i++){
lli steps = dp[i - 1];
if(i % 2 == 0 && dp[i / 2] < steps)
steps = dp[i / 2];
if(i ... | true |
bd0597273ba74681017cabaeff5ee97fc82dd1df | C++ | thianhe/assignment | /C++/105590050_HW6/105590050_HW6/Vector2D.cpp | UTF-8 | 367 | 3.078125 | 3 | [] | no_license | #include "Vector2D.h"
Vector2D::Vector2D()
{
_x = 0;
_y = 0;
}
Vector2D::Vector2D(int x, int y)
{
_x = x;
_y = y;
}
void Vector2D::SetXY(int x, int y)
{
_x = x;
_y = y;
}
int Vector2D::GetX()
{
return _x;
}
int Vector2D::GetY()
{
return _y;
}
int Vector2D::operator* (const Vector2D& ... | true |
818dc24e509d3ae22331bc59bfdf318a14864c5e | C++ | SantiagoGiraldo/Taller-1-Estruc-II | /2 valores nxm.cpp | UTF-8 | 601 | 3.21875 | 3 | [] | no_license | //Ejercicio 3/B Ingresar dos valores para un resultado de 0 Y 1
#include <iostream>
#include <conio.h>
int main(int argc, char *argv[])
{
int i,n,m,fin,j,k,band=0,band1=0;
printf("ingrese el primer valor: ");
scanf("%d",&n);
printf("ingrese el segundo valor: ");
scanf("%d",&m);
fin=n * m;
int ... | true |
09c1d288c18a27aef94278b2766bed078a000948 | C++ | seanbaxter/circle | /examples/scopes/scopes.cxx | UTF-8 | 774 | 2.71875 | 3 | [] | no_license | // circle -filetype=ll
#include <cstdio>
// Meta statements work in global scope.
@meta printf("%s:%d I'm in global scope.\n", __FILE__, __LINE__);
namespace ns {
// Or in namespace scope.
@meta printf("%s:%d Hello namespace.\n", __FILE__, __LINE__);
struct foo_t {
// Also in class definitions.
@meta... | true |
b3d67368ffaf9c3dc676bd0b43aaa31748e655fe | C++ | Ananasty11/git1 | /z5p4.cpp | WINDOWS-1251 | 822 | 3 | 3 | [] | no_license | // https://github.com/AnastasiaPugacheva/git1
// 4
#include <stdio.h>
#include <math.h>
#include <locale.h> //
int main() {
setlocale (LC_ALL, "Rus");
float x1, y1, x2, y2, d1, d2, p, s; //
scanf("%f", &x1);
scanf("%f", &y1);
scanf("%f", &x2);
scanf("%f", &y2); //
d1 = sqrt((y2 - y1) * (y2... | true |
91100390e414c3b8c8d8e9f834957471fd3086a8 | C++ | fenshitianyue/socketPracticce | /socket_cpp/tcp_server.hpp | UTF-8 | 1,466 | 3.046875 | 3 | [] | no_license | ///////////////////////////////////////////////////////
// 这是一个TCP通用服务器框架
///////////////////////////////////////////////////////
#pragma once
#include <iostream>
#include <functional>
#include "tcp_socket.hpp"
using Handler = std::function<void(const std::string& req, std::string* resp)>;
class TcpServer{
public:
... | true |
b80698f1c45b96d4eb1438b2df8fe9485f648f56 | C++ | Kazwyrm/AsteroidTanks | /AsteroidTanks/AsteroidTanks/Asteroids.cpp | UTF-8 | 868 | 2.78125 | 3 | [] | no_license | #include "Asteroids.h"
#include <Renderer2D.h>
#include <Texture.h>
#include <Input.h>
Asteroids::Asteroids()
{
}
Asteroids::Asteroids(glm::vec2 * pos)
{
m_texture = new aie::Texture("../bin/textures/rock_medium.png");
a_pos = pos;
}
Asteroids::~Asteroids()
{
delete m_texture;
}
float... | true |
a286f317380d75fc5c80646cb7e94baffc25262a | C++ | Uchihabo/OJ | /字母金字塔.cpp | GB18030 | 518 | 3.59375 | 4 | [] | no_license | #include<iostream>
using namespace std;
/*
ĸ
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
*/
int main()
{
for(int i=0; i<5; i++)
{
//ƿո
for(int s=8-i; s>0; s--) //s:space
cout<<" ";
//ǰ
for(int f=0; f<=i;f++) //f:forward
cout<<(char)('A'+f);... | true |
a03327d7b185c9c393755fb572898a3018fd75e9 | C++ | IntelligentRoboticsLab/DNT2013 | /NaoTH2011-light/NaoTHSoccer/Source/Core/Representations/Perception/GoalPercept.cpp | UTF-8 | 3,347 | 2.640625 | 3 | [] | no_license | /**
* @file GoalPercept.cpp
*
* Definition of class GoalPercept
*/
#include "GoalPercept.h"
#include "Messages/Representations.pb.h"
#include <google/protobuf/io/zero_copy_stream_impl.h>
using namespace naoth;
void Serializer<GoalPercept>::serialize(const GoalPercept& representation, std::ostream... | true |
f2c3076f65ea74d07c102bd80390282589c412a2 | C++ | ngangwar962/C_and_Cpp_Programs | /codevita/right_rotation.cpp | UTF-8 | 319 | 2.796875 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
int i,j,k;
int times;
char str[]="abcd";
cin>>times;
cout<<str<<endl;
int len=strlen(str);
for(k=0;k<times;k++)
{
char temp=str[len-1];
for(j=len-1;j>=1;j--)
{
str[j]=str[j-1];
}
str[0]=temp;
}
cout<<str<<endl;
return 0;
}
| true |
5d627cd45af6918c2806f568e575011e98c05d20 | C++ | Kullsno2/C-Cpp-Programs | /FormName.cpp | UTF-8 | 1,010 | 2.578125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<stdio.h>
#include<stack>
#include<vector>
#include<queue>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>
#include<map>
#include<algorithm>
#include<utility>
#define ll long long
#define p(a) printf("%d\n",a)
#define s(a) scanf("%d",&a)
#define sl... | true |
1421f1d787f4fc7ab4815fbbbabdb55d2ce5c02f | C++ | Joshua-Dunne/SDL2-Command | /include/Game.h | UTF-8 | 1,576 | 2.59375 | 3 | [] | no_license | #include <SDL2/SDL.h>
#include <iostream>
#include <string>
#include "TextureData.h"
#include "MacroCommand.h"
#include "LegoCommand.h"
#include "ClayCommand.h"
#include "ConcreteCommand.h"
#include "TimberCommand.h"
class Game
{
public:
Game();
~Game();
void run();
private:
//Loads media
void l... | true |
29bc8a3abc73bf780ce14701e0ca69a729bc25c3 | C++ | Marcussk/CellularAutomaton | /src/cell.h | UTF-8 | 310 | 2.53125 | 3 | [] | no_license | #ifndef CELL_H
#define CELL_H
#include <iostream>
class Cell
{
public:
Cell(){}
Cell(int init_status);
int status;
int slump_id;
int weight;
int time_vacant;
bool isSlump;
};
//Status:
//0 - vacant
//1 - moss
//2 - lichen
//If changed alter update, clear, statecopy
#endif | true |
8d13741ade80fadf8994367540cb867e5e888320 | C++ | not-ed/notmariobros | /notMarioBros/notMarioBros/textrenderer.cpp | UTF-8 | 2,558 | 3.1875 | 3 | [] | no_license | #include "textrenderer.h"
#include <iostream>
namespace Text {
void Initialize(SDL_Renderer* renderer) {
if (!initialized)
{
fonts[FONT::ID::REGULAR] = new Texture2D(renderer);
fonts[FONT::ID::REGULAR]->LoadFromFile("Fonts/font_regular.png");
fonts[FONT::ID::MARIO] = new Texture2D(renderer);
fonts[F... | true |
5f1a0810fccaf5ea8eb82fc522507aa734248bfe | C++ | clangen/musikcube | /src/musikcore/utfutil.h | UTF-8 | 2,575 | 2.953125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown"
] | permissive | #pragma once
#include <string>
#include <wchar.h>
#include <algorithm>
#include <memory>
#pragma warning(push, 0)
#include <utf8/utf8.h>
#ifdef WIN32
#include <wcwidth.h>
#endif
#pragma warning(pop)
#ifdef max
#undef max
#endif
inline std::wstring u8to16(const std::string& u8) {
std::wstrin... | true |
3cdd60bbeb6a2226abacb384b967658cb18e3ff4 | C++ | nathard/Palindrome | /Palindrome/Palindrome.cpp | UTF-8 | 1,476 | 4.1875 | 4 | [] | no_license | //
// palindrome.cpp
// Created by Nathan Harding on 11/08/11.
//
#include <iostream>
#include <stack>
#include <string>
#include <cctype>
using namespace std;
//Prototype
bool Palindrome(const string &phrase);
int main()
{
// Record input
string temp;
string pal;
cout << "Enter a word or phrase t... | true |
c63ffcd20210ce774b29a2fba2fb9249fe6280bc | C++ | FrancescoTerrosi/chip8emu | /CHIP8/main/game.cpp | UTF-8 | 6,110 | 2.859375 | 3 | [] | no_license | #include "chip8.h"
#include "chip8test.h"
#include "keymap.h"
#include <GL/gl.h>
#include <GL/glut.h>
/*
* Quì definisco le costanti per la finestra opengl
*/
const int PIXEL_SIZE = 10; //ciascun pixel di gfx sarà ripetuto 10 volte in basso e 10 volte a destra
const int SCREEN_ROWS = GMEM_ROWS * PIXEL_SIZE;
const in... | true |
5b66a28d3ffee7f7a00fab31495b45ca2fbf0632 | C++ | zhongfei2016/leetcode-cpp | /tree/Common.h | UTF-8 | 909 | 2.9375 | 3 | [] | no_license | //
// leetcode-cpp
//
#ifndef LEETCODE_CPP_COMMON_H
#define LEETCODE_CPP_COMMON_H
#include <clocale>
#include <vector>
#include <string>
#include <queue>
using namespace std;
class Node {
public:
int val;
std::vector<Node *> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(... | true |
d717c640220b4270931f13c0c5680a5de7fb0238 | C++ | manvendrakushwah/Project-Euler | /#005.cpp | UTF-8 | 779 | 2.703125 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int t;
cin>>t;
while(t){
int n;
cin>>n;
vector<int> v;
vector<int> v1;
for(int l=2;l<=n;l++){
v.push_back(l);... | true |
da6a2b739527a85d3860a7397537165cd2ef9520 | C++ | banjo13/mflib | /include/mflib/waveformTemplate.hpp | UTF-8 | 9,798 | 2.9375 | 3 | [
"MIT"
] | permissive | #ifndef MFLIB_WAVEFORMTEMPLATE_HPP
#define MFLIB_WAVEFORMTEMPLATE_HPP
#include <memory>
#include "mflib/enums.hpp"
namespace MFLib
{
class NetworkStationPhase;
/*!
* @brief Defines a waveform template.
* @copyright Ben Baker (University of Utah) distributed under the MIT license.
*/
class WaveformTemplate
{
public:
... | true |
1d8ef51cfc60c05548c136c6628f238e89f1124f | C++ | lifajun/algorithm | /AlgorithmStudy/DataStructure/BingChaJi/poj1988.cpp | GB18030 | 1,241 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
#define MAX 30005
int father[MAX], under[MAX], num[MAX];
//ÿһϣջĴջԪ
//fatherڼ¼
//underڼ¼Ԫصĸ
//numڼ¼ÿеԪصĸ
void init()
{
for(int i=0; i<MAX; i++)
{
father[i] = i;
under[i] = 0;
num[i] = 1;
}
}
int find(int x)
{
if(father[x] != x)
{
int t = father[... | true |
165ac5767507df28cf2063d536f6027d493ef5ba | C++ | rcurtis/RedSand | /Cruncher/PTRandom.cpp | UTF-8 | 557 | 2.578125 | 3 | [] | no_license | #include "PTRandom.h"
#include <stdlib.h>
namespace Cruncher
{
PTRandom::PTRandom()
{
}
PTRandom::~PTRandom()
{
}
// TODO: Hook this into our RNG DLL. This is for testing.
void PTRandom::Init(int seed)
{
srand(seed);
}
// TODO: Hook this into our RNG DLL. This is for testing.
int PTRandom::GenRando... | true |
c6501e5418de070b16d9498efbfec534429d9073 | C++ | Mugurell/Learning | /C++/C++ Primer 5th ed/Ch 3 - Strings, Vectors, and Arrays/middle_of_vector.cc | UTF-8 | 411 | 3.546875 | 4 | [
"Unlicense"
] | permissive | #include <iostream>
#include <vector>
int main()
{
std::vector<int> numar{1,2,3,4,888,6,7,8,9, 34567};
auto beg = numar.cbegin(), end = numar.cend();
auto mid =beg + (end - beg)/2; //(end-beg)/2 imi da un long int
std::cout << "So we have a vector of ints..\n\t";
for (auto nr : numar)
std::cout << ' ' << nr... | true |
abe1e6a894aa7d242c9902c77ce69d9106c5f010 | C++ | QLingx/TechieDelight | /DP/ideone_lqsNoq.cpp | UTF-8 | 931 | 3.90625 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
// Partition the set S into two subsets S1, S2 such that the
// difference between the sum of elements in S1 and the sum
// of elements in S2 is minimized
int minPartition(int S[], int n, int S1, int S2)
{
// base case: if list becomes empty, return the absolute
// d... | true |
33d2a2b976474086481856b27893f829cb6d09a3 | C++ | Anna-Joe/Coding-Exercise | /codes/LA1153/源.cpp | UTF-8 | 2,872 | 2.765625 | 3 | [] | no_license | #pragma warning(disable:4996)
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
struct stu
{
string patNo;
string level;
int site;
int date;
int no;
int score;
};
struct siteCnt
{
int no;
int cnt = 0;
};
stu records[10007];
bool cmp1(stu a, stu b)
... | true |
a5e6d261a7ff68d8b3a22f0eeea948608ceaa8dc | C++ | MattBrooks95/Andiamo | /text_box.h | UTF-8 | 5,419 | 2.828125 | 3 | [] | no_license | /*! \brief \file text_box.h this file describes a struct that
*has the information necessary for text boxes */
#pragma once
#include<SDL2/SDL.h>
#include<SDL2/SDL_image.h>
#include<SDL2/SDL_ttf.h>
#include<iostream>
#include<string>
//#include "sdl_help.h"
#include "cursor.h"
#include "asset_manager.h"
using std::s... | true |
921e48997c1407ec5bb78c4eef588e721a9829e7 | C++ | gzc/leetcode | /cpp/1001-10000/1781-1790/Maximize the Beauty of the Garden.cpp | UTF-8 | 562 | 2.984375 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int maximumBeauty(vector<int>& flowers) {
unordered_map<int, int> mymap;
int res = INT_MIN;
int sum = 0;
for (int beauty : flowers) {
if (mymap.count(beauty) > 0) {
res = max(res, sum - mymap[beauty] + 2 * beauty);
}
... | true |
1c6a5a5dfc08a6843bb548349c85df458d64164b | C++ | aanchal29/Robot-Localization-using-Deep-Learning-and-Particle-Filter | /localization/simulator/nodes/sensing_model_and_map.cpp | UTF-8 | 601 | 2.546875 | 3 | [] | no_license | #include "sensing_model_and_map.hpp"
namespace hmm
{
float gauss(float x, float mu, float sigma)
{
float exp = 0 - (std::pow((x-mu), 2) / (2 * sigma * sigma));
return (1/(sigma * std::sqrt(2*M_PI))) * (std::pow(M_E, exp));
}
float door(float mu, float x)
{
float sigma = 0.7... | true |
30cae9b47d6b848bde8211e0af4efcab653e3c3f | C++ | ciupmeister/cplusplus | /Pipe/main.cpp | UTF-8 | 2,652 | 2.515625 | 3 | [
"MIT"
] | permissive | #include <fstream>
#include <iostream>
#include <vector>
#include <bitset>
#include <string.h>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <deque>
using namespace std;
const char infile[] = "p... | true |
bdf2179eed26099484ac2b8936ecaf33c52c1d26 | C++ | tcrowne3/2036Assignment7 | /TheMatrix.h | UTF-8 | 1,407 | 2.703125 | 3 | [] | no_license | #include <vector>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include "string.h"
#include <stdexcept>
#include "stdlib.h"
#include "Complex.h"
using namespace std;
class Matrix
{
friend Matrix operator-(Matrix &);
friend Matrix o... | true |
c682ca07bf9a98146d5153fe8b4a0b17fedbf2c7 | C++ | Mark-Diedericks/Game-Engine | /GameEngineBase/src/Math/Vector4f.h | UTF-8 | 3,982 | 2.828125 | 3 | [] | no_license | #pragma once
#include <math.h>
#include "Common.h"
#include "Vector3f.h"
#include "Utils.h"
namespace gebase { namespace math {
struct Matrix4f;
class GE_API Vector4f {
public:
float x, y, z, w;
inline Vector4f() : x(0), y(0), z(0), w(0) {}
Vector4f(const float& ix, const float& iy, const float& iz, cons... | true |
cf6acbbdba71f2d41b9f6a4cae088074fad8add1 | C++ | eritry/algorithms | /structure/segment-tree.cpp | UTF-8 | 666 | 2.53125 | 3 | [] | no_license | int tree[4 * MAXN], leave[MAXN], n, k;
void upd(int i, int mod) {
int v = leave[i];
tree[v] = mod;
while (v) {
v = (v - 1) / 2;
tree[v] = tree[2 * v + 1] + tree[2 * v + 2];
}
}
int get(int v, int l, int r, int L, int R) {
if (L <= l && R >= r) return tree[v];
if (l... | true |
229317c75adae4849ee92dc0242c0f92c284ec74 | C++ | atakhalo/rich | /项目源码/大富翁/CardBag.cpp | GB18030 | 1,893 | 3.015625 | 3 | [] | no_license | //***************************************************************************************
// ֣ ̿ * Դļ
// ߣ ¬͢
// ڣ 2017-8-24
// ڣ 2017-8-24
//***************************************************************************************
#include "CardBag.h"
namespace Rich
{
CARD::CARD() : name(std::string("(None)"... | true |
8faeaeafebb76d49670c96d2bbfa4f42ac7330c7 | C++ | arif061126/My-C-plus-plus-Project | /area of triangle.cpp | UTF-8 | 615 | 3.484375 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int base, height;
cout<<"Enter the base of triangle: ";
cin>>base;
cout<<"Enter the height of triangle: ";
cin>>height;
//double area=1/2*base*height; //output=0
//cout<<"The area of triangle is: "<<are... | true |
685d3e7b4c503d1596f8822b9830fc045f2e00d1 | C++ | klainqin/LandXmlSDK | /Source/xs_privateinclude/TimingTmpl.h | UTF-8 | 1,653 | 2.515625 | 3 | [] | no_license | #if !defined(__TIMINGTMPL_H)
#define __TIMINGTMPL_H
#include "Timing.h"
#include "LXTypesTmpl.h"
namespace LX
{
// Class : Timing
template<class T>
class TimingTmpl : public ObjectTmpl<T>
{
public:
virtual void toXml (IStream& stream);
public:
// Constructors
TimingTmpl (DocumentImpl* pDoc... | true |
aecab24a1b877ed2f5485e22ce58b9ca721b9b0b | C++ | de-mar-n/robo | /src/custom.cpp | UTF-8 | 2,258 | 3.09375 | 3 | [] | no_license | #include "custom.h"
#ifdef RED_YELLOW_MODE
Mat create_mask_left(InputArray hsv)
{
Mat mask1, mask2;
// Creating masks to detect the upper and lower red color
// Red got 2 inRange because it's a major color while yellow is a minor
inRange(hsv, Scalar(0, 120, 70), Scalar(10, 255, ... | true |
a0ef7f2bb9862824651513592c83a8e201a24543 | C++ | ContraMolinos/CellSim | /voxel.cpp | UTF-8 | 655 | 2.703125 | 3 | [] | no_license | #include "voxel.h"
Voxel::Voxel(qreal _x, qreal _y, qreal _w, qreal _h):shape(new QGraphicsRectItem(0,0,_w,_h)),isOn(false)
{
shape->setPos(_x,_y);
}
Voxel::Voxel(const Voxel& _other):isOn(_other.isOn)
{
shape=new QGraphicsRectItem(_other.shape->rect());
shape->setPos(_other.shape->pos());
}
Voxel::~Voxe... | true |
f8867facd71525a6e369495261f4f834a8d1e609 | C++ | sysosil-sbny/BYNS-Cinema | /filenrand.cpp | UTF-8 | 3,597 | 2.765625 | 3 | [] | no_license | #include "SeatINFO.hpp"
#include "UserINFO.hpp"
#include <fcntl.h>
#include <iostream>
#include <list>
#include <vector>
#include <string.h>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#define MAX_LENGTH 8
#define BUFSIZE 1024
using namespace... | true |
64494343fad61b898d0e32d922f922f584122fed | C++ | ScaryPG/afina | /src/storage/StripedLRU.h | UTF-8 | 1,687 | 2.6875 | 3 | [] | no_license | #ifndef AFINA_STORAGE_STRIPED_LRU_H
#define AFINA_STORAGE_STRIPED_LRU_H
#include <map>
#include <mutex>
#include <string>
#include <vector>
#include "SimpleLRU.h"
namespace Afina {
namespace Backend {
class StripedLRU : public SimpleLRU {
private:
StripedLRU(size_t memory_limit, size_t stripe_count) : _stripe_c... | true |
6ff035afa90fa69d3a905339dd3bef15cad1cef7 | C++ | kaibraaten/swrip-1.5 | /src/commands/examine.cpp | UTF-8 | 9,844 | 2.796875 | 3 | [] | no_license | #include <cstring>
#include "mud.hpp"
#include "board.hpp"
#include "character.hpp"
#include "object.hpp"
#include "triggers.hpp"
void do_examine(std::shared_ptr<Character> ch, std::string arg)
{
char buf[MAX_STRING_LENGTH] = { '\0' };
std::shared_ptr<Object> obj;
std::shared_ptr<Board> board;
short da... | true |
1e0c0cac51cd714569fa85bbb3fd7c1c635314df | C++ | w-swift/DX11Demo | /DX11Demo/CubeShader.cpp | UTF-8 | 1,785 | 2.609375 | 3 | [] | no_license | #include "CubeShader.h"
D3D11_INPUT_ELEMENT_DESC cbShaderInputLayoutDesc[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
UINT numElements = ARRAYSIZE(cbShaderInputLayoutDesc);
CubeS... | true |
3f4101971320a4700e2a675a2453b1934221a057 | C++ | RaduMilici/cpp-tutorial-beginners | /src/practice/fight/Brawl.cpp | UTF-8 | 1,175 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include "Brawl.h"
using namespace std;
//PUBLIC***************************************************************
Brawl::Brawl(Fighter& a, Fighter& b){
fighters[0] = &a;
fighters[1] = &b;
}
//---------------------------------------------------------------------
void Brawl::start(){
cout << "Brawl ... | true |