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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9af081729fd0d7b1dc0a0070b2071bfcb0db7a49 | C++ | SadSock/acm-template | /poj/poj1018.cpp | UTF-8 | 1,412 | 2.53125 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <map>
#include <vector>
#include <climits>
#include <iomanip>
int t,n;
int c[150];
int price[150][150],band[150][150];
int idx[10000];
int main(int argc ,char* argv[])
{
//freopen("in.txt","r",stdin);
std::cin>>t;
while(t--)
... | true |
141b9350b82022155e17687731d0b00e846c328d | C++ | VictorinaVicka/CPP_Module | /CPP_Module06/ex00/main.cpp | UTF-8 | 1,590 | 2.84375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | true |
9354b78393d909dfe8295e163013d4869a849175 | C++ | Mogball/jeffniu.com | /src/strutil.cpp | UTF-8 | 365 | 3.0625 | 3 | [] | no_license | #include "strutil.hpp"
#include <algorithm>
#include <utility>
using namespace std;
bool ends_with(const string &val, const string &end) {
if (end.size() > val.size()) {
return false;
}
return equal(end.rbegin(), end.rend(), val.rbegin());
}
void force_move(string &dst, string &src) {
dst.~st... | true |
b9f5c6d18901479f0660fee760ef2b4f2c0d141d | C++ | eduherminio/Academic_ArtificialIntelligence | /9_Sudoku_CSP/src/sudoku.cpp | UTF-8 | 2,275 | 3.171875 | 3 | [
"MIT"
] | permissive | #include "../header/sudoku.h"
#include <iostream>
#include <stdexcept>
#include <algorithm>
namespace sudoku
{
void Sudoku::inicializa_dominio()
{
dominio = std::vector<std::vector<unsigned>>(num_variables, std::vector<unsigned>(dim, 0));
for (unsigned i = 0; i != num_variables; ++i)
{
for (unsigned j = 0; ... | true |
998e34c300fd0cbc45af1b62125dda1a979c26d6 | C++ | Dblaze47/Problems-Solved---Category-Beginner | /UVA12403.cpp | UTF-8 | 377 | 2.890625 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int main(){
int T, balance = 0, x;
scanf("%d", &T);
while(T--){
string str;
cin>>str;
if(str == "donate"){
cin>>x;
balance += x;
}
else if (str == "report"){
c... | true |
f6f1872dd9dcff2358b929d37ee0f587942a3d8b | C++ | ganmacs/playground | /books/pc_data_structure/7/partition.cpp | UTF-8 | 1,270 | 3.28125 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define M 100000
int v[M];
int partition(int p, int r)
{
int x = v[r], i = p - 1, j = 0;
for (j = p; j < r; j++) {
if (v[j] <= x) {
i++;
swap(v[i], v[j]);
}
}
swap(v[i + 1], v[r]);
return i + 1;
}
void pp(int r)
{
for (int i = 0; i <= r; i++... | true |
0b4099e93341b0782c04e373ccda6bf4bc96372b | C++ | tectronics/loki-engine | /Loki/include/core/viewsystem/IViewSystem.h | UTF-8 | 1,976 | 3.1875 | 3 | [] | no_license | #pragma once
#ifndef IVIEWSYSTEM_H
#define IVIEWSYSTEM_H
namespace loki
{
class IView;
class IViewSystem
{
public:
IViewSystem();
virtual ~IViewSystem() = 0;
//////////////////////////////////////////////////////////////////////////
// Finds a view by name. Returns NULL if it doesn't exist.
... | true |
2aea58c65885cd94b996332b72762c538be65ca6 | C++ | thinkmariale/Smoke-Simulation | /smoke_simulation/smoke_simulation/smokeParticle.h | UTF-8 | 1,132 | 2.8125 | 3 | [] | no_license | #ifndef SMOKE_PARTICLE_H
#define SMOKE_PARTICLE_H
#include "glCanvas.h"
class Ray;
class Hit;
class Material;
class SmokeParticle {
public:
// CONSTRUCTORS
SmokeParticle () { position = Vec3f(0,0,0); temperature = 0; density = 0; radius = .2; setMaterial(); }
SmokeParticle (Vec3f pos, double temp, double dens) ... | true |
e212414e7261cc354892bd2f5ecdea10d6b7ca57 | C++ | jovanSlavujevic96/CamH264CvMatStreaming_Cpp | /opencv_camera.cpp | UTF-8 | 636 | 2.578125 | 3 | [] | no_license | #include <opencv2/opencv.hpp>
#define LINK 0
#define WINDOW_NAME "OpenCV_CAM"
int main()
{
cv::VideoCapture capture(LINK);
if (!capture.isOpened())
{
std::cerr << "Opening of capture with id = " << LINK << " has been failed\n.";
std::cerr << "Exit app.\n";
return -1;
}
cv::Mat... | true |
660244529ee17ed59b8746bc7266e1301e26b951 | C++ | cocokechun/Programming | /College/USACO/friday.cpp | UTF-8 | 1,321 | 2.828125 | 3 | [] | no_license | /*
ID: kmao1
PROG: friday
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#define MAX 7
int res[MAX];
bool is_leap(int y) {
if (y % 4 == 0) {
if (y % 100 == 0) {
return y % 400 == 0;
} else {
return true;
... | true |
b5902d9271baeffa1a46cf1f31d0a5f9f9dc8e9f | C++ | aznnobless85/ToyProject | /test/TestHashMap.cpp | UTF-8 | 2,325 | 3.359375 | 3 | [] | no_license | // TestHashMap.cpp
//
// ICS 45C Winter 2014
// Project #3: Maps and Legends
//
// Write unit tests for your HashMap class here. I've provided one test already,
// though I've commented it out, because it won't compile until you've implemented
// three things: the HashMap constructor, the HashMap destructor, and HashM... | true |
f0a424a58a985fa30fa9de7b5a8d8732f5fbe6b5 | C++ | flopczak/win-based-dummy-os-cpp | /shell/Interfejs.h | UTF-8 | 8,281 | 2.6875 | 3 | [] | no_license | #pragma once
#ifndef Shell_H
#define Shell_H
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <ctime>
#include <cstdio>
#include <windows.h>
#include <cstdlib>
#include <time.h>
using namespace std;
class Interfejs {
private:
Memory *memory;
Process_List *P... | true |
b0f141e202f320453ab1ff097b734d6330d0dee2 | C++ | azma1984/aggregatesdk | /src/com/tibbo/aggregate/common/datatable/validator/RegexValidator.cpp | UTF-8 | 2,005 | 2.921875 | 3 | [] | no_license | #include "datatable/validator/RegexValidator.h"
#include "datatable/FieldFormat.h"
#include <regex>
#include <boost/functional/hash.hpp>
#include "datatable/ValidationException.h"
const std::string RegexValidator::SEPARATOR = "^^";
const std::string RegexValidator::SEPARATOR_REGEX = "\\^\\^";
RegexValidator::RegexVal... | true |
755a2c32fc04a748a92d3612938071ecfa8fe6c5 | C++ | AvihaiDidi/avidudu2017 | /src/server/CloseGameCommand.cpp | UTF-8 | 926 | 3.078125 | 3 | [] | no_license | #include "headersS/CloseGameCommand.h"
/*
* Constructor - Makes a new command for closing a game.
*/
CloseGameCommand::CloseGameCommand(GameManager *info): info(info) ,target(0){
handler = new SocketHandler();
}
/*
* Destructor - delete the handeler.
*/
CloseGameCommand::~CloseGameCommand() {
delete handler;
}
/*... | true |
d475bfd3cbe51d6e8cdcc5de20a7cb43edfdbdc0 | C++ | xavierm02/PROG1-projet-3 | /src/Vector.hpp | UTF-8 | 844 | 3 | 3 | [] | no_license | #include <iostream>
#ifndef VECTOR_H
#define VECTOR_H
class Vector {
protected:
double x;
double y;
double z;
public:
Vector();
Vector(double x, double y, double z);
double get_x() const;
double get_y() const;
double get_z() const;
bool operator==(const Vector& other) const... | true |
3a603b7b04ed919a400d637acece6939c1e135cc | C++ | nguyenluminhhang/Siv3D-Reference | /Programming Guide/Headers/Siv3D/AnimatedGIFWriter.hpp | UTF-8 | 2,704 | 2.65625 | 3 | [
"MIT"
] | permissive | //-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (C) 2008-2016 Ryo Suzuki
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# pragma once
# include <memory>
# include "Fwd.hpp"
namespace s3d
{
/// <summary>
/// G... | true |
bebfe6f5d576c5c4df4b827a91db0df3b1837e17 | C++ | alepharchives/dxr | /tests/json-test/HelloWorld/BitField.h | UTF-8 | 1,339 | 3.3125 | 3 | [
"MIT"
] | permissive | #include <stdint.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
/** Representation of a BitField, well really, just some annoying part of it */
class BitField {
private:
/** Definition of underlying type for the bitfield*/
typedef unsigned int _word;
/** Number of bits per word */
static const siz... | true |
8518340ea7dd425f41614062dd714a18e4491b3e | C++ | jonwa/Nukes-of-the-Patriots-v2 | /Nukes of the patriots/TimerHandler.cpp | UTF-8 | 1,588 | 3.140625 | 3 | [] | no_license | #include "TimerHandler.h"
#include "Timer.h"
TimerHandler::TimerHandler() :
mVecTimers(){}
TimerHandler::~TimerHandler(){ clear(); }
void TimerHandler::addTimer(Timer* timer)
{
mVecTimers.push_back(timer);
}
void TimerHandler::clear()
{
mVecTimers.clear();
}
void TimerHandler::removeTimer(Timer* timer)
{
for(s... | true |
b94a252da250e0594da61a27f16bbc01ee1c467b | C++ | metaphysis/Code | /UVa Online Judge/volume102/10203 Snow Clearing/program.cpp | UTF-8 | 1,210 | 2.640625 | 3 | [] | no_license | // Snow Clearing
// UVa ID: 10203
// Verdict: Accepted
// Submission Date: 2017-08-21
// UVa Run Time: 0.000s
//
// 版权所有(C)2017,邱秋。metaphysis # yeah dot net
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[])
{
cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
string line;
... | true |
3806694d90eccaa00d8d0173cf617fbe18df5908 | C++ | leonheuler/ProjectEuler | /71/main.cpp | UTF-8 | 924 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <ctime>
using namespace std;
int properFractions(int d)
{
double dist_min = 1.0;
int res = 0;
for (int den = 2; den <= d; den++)
{
for (int nom = den / 2; nom > 0; nom--)
{
if (double(nom)/den < 1/3.0)
break;
... | true |
2b9c58d4c8e38ada8561503c8d4c62abb8afaee3 | C++ | SunNEET/LeetCode | /E22_E27/684. Redundant Connection.cpp | UTF-8 | 1,091 | 3.296875 | 3 | [] | no_license | class Solution {
// 複習一下disjoint set, 或叫union find
// 都是以前ACM時用的寫法, 合併時是讓p[u]->p[v]
//
// 這題只要發現邊連接的兩端屬於同個set就是會變cycle了
public:
vector<int> findRedundantConnection(vector<vector<int>>& edges) {
vector<int> ans;
for(int i=1;i<=edges.size();i++) parent[i]=i;
for(auto e:edges) ... | true |
a3319316e4d4f275a37b34521df407db1f2c9a33 | C++ | ramonjunquera/GlobalEnvironment | /Android/04 appsIOT/03 RGB/Platformio/ledRGB/src/main.cpp | UTF-8 | 2,876 | 3.28125 | 3 | [] | no_license | /*
Tema: Servidor socket tcp con led RGB
Autor: Ramón Junquera
Fecha: 20210513
Se crea un servidor socket para la recepción de colores que se
aplicarán a un led RGB.
Un color estará definido por 3 bytes con la información de cada uno
de los canales de color.
El valor 255 se considera el comando para re... | true |
1e1c2dfe3bd824795c217640e383954e41a0b136 | C++ | manjurrashed/coding-solution | /c_plus_plus/LeetCode/BinaryTrees/559_LC_Maximum_depth_of_n-ary_tree.cpp | UTF-8 | 763 | 3.34375 | 3 | [] | no_license | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
void helper(Node* root, int... | true |
b13f53bec0c8e71cefac28fc65aa250aaf502efc | C++ | amit96321/projecteuler | /P14LongestCollatzSequence.cpp | UTF-8 | 966 | 3.359375 | 3 | [] | no_license | /*Problem: Which starting number, under one million, produces the longest chain in Collatx series?
Author: Amit Kumar(kumaramit96321@gmail.com)
If n is even, then n → n/2 ⇒ Collatz(n) = Collatz(n/2) + 1. Therefore Collatz(2k) > Collatz(k) for all k,
and we do not need to compute the chain for any k ≤ LIMIT /2. In this ... | true |
55cef13c75dcac82ac761b9eec90f936530d3231 | C++ | NaMoAr/CS170_Project1_Puzzle | /CS170_Puzzle/Node.h | UTF-8 | 830 | 3.484375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
using namespace std;
/* This class allows the creation of the Node object which will continously
update each time the state is being executed */
struct Node
{
vector<vector<int>> problem;
//at most a blank tile can move in four directions, so with a given node, ... | true |
adde3630387f7d04b267fe54bb3ce12822247d4d | C++ | superdyzio/PWR-Stuff | /AIR-ARR/SCR - Systemy Operacyjne/szeregowanie/lab9.cpp | WINDOWS-1250 | 5,314 | 3.046875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <fstream>
#include <cstdlib>
#include <cstdio>
using namespace std;
//co to jest ile na procku - ile ju si wkonywa
// procesor jest tablic 10 elementow zada
// czy czas to kwant czasu
class Zadanie
{
public:
int przybycie, trwanie,... | true |
3a322e912e87d226c84dea3bfee0be5ae9bfaba2 | C++ | tectronics/infinite-bounty | /InfiniteBounty_Game/InfiniteBounty_Project/Source/BombPack.h | UTF-8 | 590 | 2.640625 | 3 | [] | no_license | #ifndef BOMBPACK_H_
#define BOMBPACK_H_
#include "IPlayerWeapon.h"
#include "Bomb.h"
#include <vector>
using namespace std;
class CBombPack : public IPlayerWeapon
{
public:
CBombPack(void);
virtual ~CBombPack(void);
virtual void Init( WeaponTypes Type );
virtual void Release( void );
virtual... | true |
8e9192b323cb8d88da395cedd7a88ab625c120f8 | C++ | LanghuaYang/origin | /singleton/main.cpp | UTF-8 | 186 | 2.515625 | 3 | [] | no_license | #include "Singleton.h"
int main()
{
//get_instance() is a static function, so we could use it
//without creating a instance.
SINGLETON::get_insatance()->dosomething();
return 0;
}
| true |
34e34dffcb02e4bfcc4a5fb4344b69780ffa5e41 | C++ | p10dibb/linuxDungon_Crawl | /DC/Items/Armor/Armor.h | UTF-8 | 1,278 | 2.78125 | 3 | [] | no_license | #pragma once
#include "../Item/Item.h"
class Armor :public Item {
friend class Item;
private:
//Armor's Level
int Level;
//the total resistance percentage
int TotalResistance;
//the armor type of this piece
ArmorType_enum Type;
//class (light, normal, or heavy)
ArmorClass_enum Class;
//items... | true |
3a5ac10786871ed6cfa7fe3be2536a8fb5c8cc18 | C++ | tuduweb/LeetCode | /programming/3.无重复字符的最长子串.cpp | UTF-8 | 6,882 | 3.390625 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=3 lang=cpp
*
* [3] 无重复字符的最长子串
*/
class Solution {
public:
int lengthOfLongestSubstring(string s) {
//map<char,int> charMap;
#if 0
int len = 0;
for(string::iterator it = s.begin();it != s.end();++it)
{
string::iterator itb = it;
... | true |
7e0e3319bf415e7c8be9ae8cfdab86e80ceb828d | C++ | Tcochr/CppBasicsReview | /ifstream.cpp | UTF-8 | 975 | 3.375 | 3 | [] | no_license | //
// Created by Cochr on 4/16/2020.
//
#include<iostream>
#include <string>
#include <fstream>
using namespace std;
int main(){
string filename = "..\\letters.txt";
ifstream input;
input.open(filename);
cout << input.is_open() << endl;
string data, longWord;
//start longestCount at -1 since c... | true |
5440104fe7f932ca47718221935acb1a0cecdd39 | C++ | ans-hub/gdm_framework | /framework/data/abstract_image.cc | UTF-8 | 1,790 | 2.84375 | 3 | [
"MIT"
] | permissive | // *************************************************************
// File: abstract_image.cc
// Author: Novoselov Anton @ 2018
// URL: https://github.com/ans-hub/gdm_framework
// *************************************************************
#include <cassert>
#include "abstract_image.h"
// --public
gdm::Abst... | true |
1e0c18dd48e6a8141fda220a2db9f5b41202b8e3 | C++ | WangsirCode/C-test-code | /sqlite3.cpp | UTF-8 | 3,086 | 3.125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>
#include<iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
using namespace std;
static std::function<void(void *data, int argc, char **argv, char **azColName)> func;
static int callback(void *data, int argc, char **argv, char **azColName){... | true |
7becdb0056decb4be4a6d54625ad023291ae1f14 | C++ | zerefwayne/data-structure-and-algorithms | /data_structures/graphs/algorithms/Topological.cpp | UTF-8 | 2,446 | 3.640625 | 4 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
class Graph
{
public:
vector<vector<int>> adj;
int V;
Graph(int _V)
{
V = _V;
adj.resize(V);
}
void addEdge(int src, int dest, bool isUnidirectional)
{
if (src >= 0 && src < V && dest >= 0 && dest < V && dest != src)... | true |
d5ff72fbaa061f2c466ff9fa9480d29d6229254a | C++ | Jungjaewon/ProblemSolving | /17140_2d_array_operation/17140_2d_array_operation/17140_2d_array_operation.cpp | UTF-8 | 4,003 | 2.953125 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <unordered_map>
using namespace std;
/*
1시간 넘게 걸렸음
R operation이면 col이 줄어들고
C operation이면 row가 줄어들고 하는 것을 놓침
그리고 연산전 새로운 결과를 업데이트하기 전에 이전것을 0으로 초기화하는 것을 깜빡함.
cmp_fun 만들때 오... | true |
5f7caa19ef0b4a27325c5c776ef098a755e7875c | C++ | poseidn/KungFoo-legacy | /src/DescentEngine/src/Input/MultiplexedInput.h | UTF-8 | 1,252 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #pragma once
#include <boost/noncopyable.hpp>
#include "../Cpp11.h"
#include "InputSystemBase.h"
#include "InputContainer.h"
#include "NullInput.h"
// this class will allow two input system to operate on the
// same InputContainer instead of one,
// can be used to have dummy input from the application fed back
// t... | true |
fcdbab6e89c75ae733836546e7ae60d1cdf9c424 | C++ | RapdElzo/Flask | /source/util.cpp | UTF-8 | 3,394 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "shared.h"
#include <jansson.h>
std::vector<char *> split(char * string, char * delim)
{
std::vector<char *> array;
char * token = strtok(string, delim);
while (token != NULL)
{
array.push_back(token);
token = strtok(NULL, delim);
}
return array;
}
void downloadFile(char * url, char * fil... | true |
0bec01aec1c713c4a5b1ba78ebc9d60a9b8c242e | C++ | ku-alps/cse17_keunbum | /Baekjoon/solved/10866/cpp/sol.cpp | UTF-8 | 1,242 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <deque>
using namespace std;
deque<int> a;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
while (n--) {
string cmd;
cin >> cmd;
char c = cmd[0];
switch (c) {
case 'p':
int v;
if (cmd[1] == 'u') {
cin >> ... | true |
60fde854d235fe1a95fd1303ab9342fa058e6ce3 | C++ | JJJackZhen/leetcode-workspace | /14.longest-common-prefix.cpp | UTF-8 | 734 | 2.96875 | 3 | [] | no_license | /*
* @lc app=leetcode id=14 lang=cpp
*
* [14] Longest Common Prefix
*/
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
string longestCommonPrefix(vector<string>& strings) {
if (strings.empty()) {
return string();
}
string tmp = strings[0];
... | true |
6944acb8755adaa49047879c21a5d5aaad3191dd | C++ | ThiagoTassinari/Mini_Curso_Ceuma_Arduino | /Aula_04/N_025/N_025.ino | UTF-8 | 3,769 | 3.015625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | /* Projeto Nº 25 -> Simulação de servo motor + LEDs
*
* Author: Thiago Santos Tassinari
* Data: 06/10/2020
* Descrição do Projeto:
<!---------------------Simulação de transferidor com servo motor + LEDs----------------------------->
// Os LEDs acesos indicam o seguinte:
// Verde, motor ab... | true |
4e8cfa137ab1c19eb7038eb262813c9480978f05 | C++ | Catnip0709/CodeStudy | /剑指offer/构建乘积数组.cpp | UTF-8 | 1,452 | 3.265625 | 3 | [] | no_license | /*
Author: Catnip
Date: 2020/02/17
From: 剑指offer
Link: https://www.nowcoder.com/practice/94a4d381a68b47b7a8bed86f2975db46?tpId=13&tqId=11204&rp=3&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking
*/
/* Q
给定一个数组A[0,1,...,n-1]
请构建一个数组B[0,1,...,n-1]
其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1]。
不能使... | true |
69a7a29d300019f0487c6c39a6d8b55fff08c93f | C++ | mmtobi/dp | /Visitor.h | UTF-8 | 834 | 2.75 | 3 | [] | no_license | #ifndef Visitor_h
#define Visitor_h
#include "Node.h"
class Visitor {
public:
virtual void visit(const Leaf_Node& leaf_node) = 0;
virtual void visit(const Add_Node& add_node) = 0;
virtual void visit(const Subtract_Node& subtract_node) = 0;
virtual void visit(const Multiply_Node& multiply_node) = 0;
... | true |
47e3f86fe1b69e557aba39a638fc1340ca1abe8b | C++ | Emadon13/RPGQuest | /Depressia/gui/frame/itemframe.cpp | UTF-8 | 6,812 | 2.609375 | 3 | [] | no_license | #include "itemframe.h"
#include "gui/clickable/clickablelabel.h"
////////////////////////////////////////////////////////
/// ///
/// ItemFrame ///
/// ///
//////////////////////////... | true |
9d4abdedd3497663414bfd266b3cba3754686137 | C++ | kotrenn/c8 | /c8/interpret/binaryexp.cpp | UTF-8 | 1,700 | 3.15625 | 3 | [] | no_license | #include "binaryexp.h"
BinaryExp::BinaryExp(const string &op, Exp *lhs, Exp *rhs)
:m_op(op),
m_lhs(lhs),
m_rhs(rhs)
{
}
BinaryExp::~BinaryExp()
{
delete m_lhs;
delete m_rhs;
}
Data BinaryExp::eval(VarTable *vars,
FuncTable *funcs,
bool *retstat)
{
... | true |
21f5bc0bf493ade870cbc15c6fef3aaff21dd7e5 | C++ | cathook/PTTArticleRecommender | /src/article_analysis/utils/funcs-test.cc | UTF-8 | 882 | 3.21875 | 3 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <string>
#include <gtest/gtest.h>
#include "utils/funcs.h"
using std::string;
namespace {
TEST(FormatStr, IsCorrect) {
int a = 7;
std::string s("def");
EXPECT_EQ(utils::FormatStr("%d %d %s %s %s",
a, 8, "abc", s, std::string("ghi")),
"7 8 abc def ghi");
}
... | true |
3c5f35e3ad2882feb94e7ff5e19276eddfbc2fe5 | C++ | pfiorentino/Modelisation3D | /sphere.h | UTF-8 | 331 | 2.71875 | 3 | [] | no_license | #ifndef SPHERE_H
#define SPHERE_H
#include "point3d.h"
#include "implicitobject.h"
#include <math.h>
class Sphere : public ImplicitObject
{
public:
Sphere(const Point3D ¢er, const int radius);
virtual float getDistance(const Point3D& pt) const;
private:
Point3D _center;
float _radius;
};
#endif /... | true |
f4a661a3f3fb6f230b3cc64bbe210d1b95005fb1 | C++ | 3BodyProblem/QYAuthModule | /QYAuthModule/Infrastructure/Hash.cpp | GB18030 | 7,078 | 2.5625 | 3 | [] | no_license | #include "Hash.h"
CollisionHash::CollisionHash()
: m_nUsedNumOfCollisionBucket( 0 )
{
Clear();
}
void CollisionHash::Clear()
{
m_nUsedNumOfCollisionBucket = 0;
std::for_each( m_BucketOfHash, m_BucketOfHash+MAX_BUCKET_SIZE, std::mem_fun_ref(&T_ListNode::Clear) );
std::for_each( m_CollisionBucket, ... | true |
06ff16755f977998ab6e555f3751d58aaaa718e6 | C++ | DanikNik/univer | /file.cpp | UTF-8 | 1,371 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
bool isin(int num, int * arr, int len){
for(int i; i < len; i++){
if(num == arr[i]){
return 1;
}
}
return 0;
}
int * append(int num, int * arr, int len){
int * temp1 = new int [len+1];
for (int i = 0; i < len; ... | true |
9b4c2750446dd52e26c27ed2d93a56d0e5b169c7 | C++ | SoaringhawkCheng/thedesignandanalysisofalgorithm | /thedesignandanalysisofalgorithms/p90.cpp | UTF-8 | 2,515 | 3.21875 | 3 | [] | no_license | //
// p90.cpp
// thedesignandanalysisofalgorithms
//
// Created by 追寻梦之碎片 on 2017/5/18.
// Copyright © 2017年 追寻梦之碎片. All rights reserved.
//
#include <iostream>
#include <iterator>
#include <vector>
#include <map>
using namespace std;
struct UndirectedGraphNode{
map<UndirectedGraphNode *,int> neighbors;
};
c... | true |
9494036928cd9659cf3f7a104ecfad448957b53d | C++ | s-nandi/contest-problems | /dynamic-programming/general/twisty_movement.cpp | UTF-8 | 1,402 | 3.0625 | 3 | [] | no_license | //dynamic programming, longest increasing subsequence with reversal
//http://codeforces.com/contest/934/problem/C
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin>>n;
vector <int> a(n);
fo... | true |
2e4160ee20d72945f37afe779e3f9c5267bbe35e | C++ | zibas/futz | /src/futz/models/Model.cpp | UTF-8 | 4,453 | 2.765625 | 3 | [
"MIT"
] | permissive | #include <cstring>
#include <sstream>
#include <iostream>
#include <string>
#include "Model.h"
#include "../Futz.h"
Model::Model(string name) {
filename = name;
size_t found;
found = filename.find_last_of("/\\");
path = filename.substr(0,found+1);
}
void Model::Statistics(){
stringstream ss;
ss << "Model loaded... | true |
32a8deb726ff1527e95b47a016712c5a01052d28 | C++ | s0mnaths/amfoss-tasks | /task-15/euler003.cpp | UTF-8 | 794 | 2.890625 | 3 | [] | no_license | #include <cmath>
#include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
long largest[t]={0};
for(int a0 = 0; a0 < t; a0++)
{
long n;
cin >> n;
while (n % 2 == 0)
{
largest[a0]=2;
n = n/... | true |
7947b95a250dd956dcf8f0794101befeb9c9cfe6 | C++ | AleGrins/CPP_assignemt3 | /unit_tests.cpp | UTF-8 | 1,485 | 3.40625 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "Member.cpp"
int main() {
Member a;
cout << "Members following a: " << a.numFollowers() << " Members a is following: " << a.numFollowing() << endl; // 0 0
cout << "Member count: " << Member::count() << endl; // 1
Member b;
cout << "Member count: " << Member::... | true |
f9269c7fa924c935504cad06e08bb3b590f587e2 | C++ | richardsplit/C_plus_plus_-_VSCode | /02_19_2021_push/Moving.cpp | UTF-8 | 1,177 | 2.765625 | 3 | [] | no_license | #include<iostream>
//#include <cmath>
//#include<ostream>
//#include<vector>
//#include<<sum<string>
//#include <climits>
//#include <algorithm>
#include<string>
//#include <memory>
//#include <sstream>
using namespace std;
//using std::cout;
//using std::endl;
//smart pointer is a wrapper around a pointer //dont have ... | true |
da9f82ed2f415f06d29b123db0b26ba8f4bc0153 | C++ | adrianpoplesanu/personal-work | /cpp/repl/big-numbers2/parser.cpp | UTF-8 | 737 | 2.84375 | 3 | [] | no_license | #include "parser.h"
Parser::Parser() {
}
Parser::~Parser() {
}
void Parser::load(std::string source) {
lexer.load(source);
nextToken();
nextToken();
}
void Parser::nextToken() {
currentToken = peekToken;
peekToken = lexer.nextToken();
}
void Parser::buildProgramStatements(AstProgram program) ... | true |
75d987bfd286bb8fe107cbdd9df141fcc0769dd5 | C++ | AndrewShkrob/Courses | /Coursera/Art of Development in Modern C++ Specialization/Red Belt/Week2/training/booking.cpp | UTF-8 | 2,037 | 3.265625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Event {
string hotel_name;
int64_t time;
size_t client_id;
size_t room_count;
};
struct Hotel {
size_t booked_rooms = 0;
map<size_t, size_t> clients;
void addEvent(const Event &event) {
booked_rooms += event.room_count;
... | true |
6d961d3f28548ede674b35f92ade807fd10720bb | C++ | guille31794/AAED | /Practica 4/polinom/e_s_polinom.h | UTF-8 | 811 | 2.859375 | 3 | [] | no_license | //Cabeceras de es_polinom.cpp
#include "polinom.h"
using namespace std;
//Grado maximo de un polinomio
const unsigned gradoMax = 3;
//Función que inicializa los polinomios
void introducirPolinomio(polinomio &p1, polinomio &p2);
//Funcion que añade los coeficientes a los polinomios
void introducirCoeficientes(po... | true |
52d11b2c1c493294598e530ed04776dad206905f | C++ | Edekheh/JarvisOS | /JarvisOS.ino | UTF-8 | 608 | 2.921875 | 3 | [] | no_license | #include "menu.h"
#include <Arduino.h>
void (*menu)(int,String);//menu variable
String str="";//serial input variable
void setup() {
// put your setup code here, to run once:
menu=mainMenu;//initialize menu pointer on main menu
Serial.begin(115200);//initialize serial communication with 115200 bps
setUpOledD... | true |
0ff1f607ea8772a7e598790ba8ad928a86b43177 | C++ | vishmohan/inline_assembly_examples | /factorial/factorial.cpp | UTF-8 | 674 | 3.265625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int fact(int n);
int main()
{
int num;
cout << "Enter num: " << endl;
cin >> num ;
cout << fact(num) << endl;
return 0;
}
int fact(int n)
{
int result;
//rcx has the input number
asm volatile("movq %0, %%rcx\n" ::"m"(n));
//rax = 1
asm volatile("movq $1, %rax\... | true |
da88b4de26de8bc4faaad9192ce9bcc77553d6b8 | C++ | Barne1/AIGunner | /Source/AIGunner/FGHealthComponent.cpp | UTF-8 | 680 | 2.53125 | 3 | [] | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "FGHealthComponent.h"
// Sets default values for this component's properties
UFGHealthComponent::UFGHealthComponent()
{
}
// Called when the game starts
void UFGHealthComponent::BeginPlay()
{
Super::BeginPlay();
CurrentHealt... | true |
40859af143ac58d8d36b26786033f2744e10f96a | C++ | terz99/course-algorithms-data-structures | /hw10/fullhw/p1.cpp | UTF-8 | 1,644 | 3.40625 | 3 | [] | no_license | /**
* Problem 1
* @author: Dushan Terzikj 30001357
* @since: 29.04.2018
*/
#include <bits/stdc++.h>
using namespace std;
int *dp;
/**
* The algorithm for getting the longest increasing
* subsequence.
* @param arr the full sequence
* @param n the size of the full sequence (arr)
*/
int solve(int arr[], int n){
... | true |
8370ecc96b6805aa97a6783eb0ac38b2b7073851 | C++ | Quartzeee/cppThreadPool | /threadPool.cpp | UTF-8 | 2,898 | 3.203125 | 3 | [
"MIT"
] | permissive |
#include "threadPool.h"
/**
* Default constructor - this ctor will initialize the pool to contain the number of hardware threads on the machine.
*/
ThreadPool::ThreadPool() : bAlive(true)
{
this->initThreads(thread::hardware_concurrency());
};
/**
* Constructor for caller to specify the number of t... | true |
5d090716fd525e0401a9b31ab179c635659b40ca | C++ | MacManus88/Microcontroller-Sources | /ultrasonic_candle.ino | UTF-8 | 853 | 2.640625 | 3 | [] | no_license | //Mehr Infos auf: http://www.pascals-koenigreich.de/2013/04/led-kerze-mit-unterschiedlichen.html
#include <NewPing.h>
#define TRIGGER_PIN 12
#define ECHO_PIN 11
#define MAX_DISTANCE 15
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
int ledPin = 9;
int last_value = pow(MAX_DISTANCE, 2)-50;
void setup()
{
... | true |
3a68d49415188e2c43c7525d9ac8c3f56fd48b81 | C++ | m0178/legoino | /arduino/Arduino v105.app/Contents/Resources/Java/libraries/ChibiOS_AVR/examples/chMutex/chMutex.ino | UTF-8 | 1,732 | 2.796875 | 3 | [] | no_license | // Example of mutex to prevent print calls from being scrambled
#include <ChibiOS_AVR.h>
// declare and initialize a mutex for limiting access to threads
MUTEX_DECL(demoMutex);
// data structures and stack for thread 2
static WORKING_AREA(waTh2, 100);
// data structures and stack for thread 3
static WORKING_... | true |
c1731e4f00dabeec41168f2e21e81bc50d5d1bd6 | C++ | ptryfon/loxim-stats | /Protogen/loxim_protocol/cpp/protocol/packages_data/Uint32Package.h | UTF-8 | 730 | 2.578125 | 3 | [] | no_license | #ifndef UINT32PACKAGE_H_
#define UINT32PACKAGE_H_
#include <stdint.h>
#include "../ptools/Package.h"
#include "../ptools/CharArray.h"
#include "../enums/enums.h"
namespace protocol{
#define ID_Uint32Package 5
class Uint32Package : public Package
{
private:
uint32_t value;
public:
Uint32Package();
~Uint32Pac... | true |
b026caf8fc41f4ec2b20707f31318ee19cb7ab27 | C++ | amaliujia/velox | /velox/common/serialization/Registry.h | UTF-8 | 3,720 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | true |
16d518b613a23aa3fadb4814ea6fee04a664404e | C++ | JCP92/Cplusplus-Programs | /tic tac toe.cpp | UTF-8 | 1,639 | 3.171875 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
#include<string>
#include<ctime>
#include<math.h>
#include<array>
using namespace std;
const short int ROW = 3;
const short int COLUMN = 3;
//const short int X = 1;
//const short int O = -1;
const char Player1 = 'X';
const char Player2 = 'O';
short int turn = 0;
cha... | true |
13f3301dc212ee93754d01e776d04ef04bb21833 | C++ | vigansub/StructureAwareShapeTemplates | /Src/Light.h | UTF-8 | 2,311 | 2.59375 | 3 | [] | no_license | #ifndef LIGHT_H
#define LIGHT_H
#include "Headers.h"
#include "Geometry.h"
#ifndef WIN32
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef unsigned int UNINT32;
#endif
class CameraManager;
class VertexBufferObject;
class Shader;
class FrameBufferObject;
class Scene;
class Light
{
public:
struct Path... | true |
2d9bad268e3a8fb5f0cc8f1937de22c83b68519e | C++ | MiChuan/Leetcode | /LCCI/lcci1704 1~n中缺失的数字(等差求和)/res.cpp | UTF-8 | 229 | 2.765625 | 3 | [] | no_license | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n = nums.size();
int count = n * (1 + n) / 2;
for(int num : nums){
count -= num;
}
return count;
}
}; | true |
6a9150b2968ee858d542987b0a8533d5c006c972 | C++ | RPI-Game-Architecture-Spring-2020/final-projecct-LionLin27 | /src/ga1-core/physics/ga_intersection.h | UTF-8 | 3,051 | 2.8125 | 3 | [
"MIT"
] | permissive | #pragma once
/*
** RPI Game Architecture Engine
**
** Portions adapted from:
** Viper Engine - Copyright (C) 2016 Velan Studios - All Rights Reserved
**
** This file is distributed under the MIT License. See LICENSE.txt.
*/
#include "math/ga_mat4f.h"
#include "math/ga_vec3f.h"
#include <vector>
struct ga_shape;
str... | true |
40f5924cad6da347756e5050c5cd93b7e392fac1 | C++ | DmitryYurov/qt-mvvm | /tests/viewmodel/TestPropertiesRowStrategy.cpp | UTF-8 | 4,308 | 2.78125 | 3 | [] | no_license | #include "google_test.h"
#include "propertiesrowstrategy.h"
#include "sessionitem.h"
#include "sessionmodel.h"
#include "vectoritem.h"
#include "viewdataitem.h"
#include "test_utils.h"
using namespace ModelView;
class TestPropertiesRowStrategy : public ::testing::Test
{
public:
~TestPropertiesRowStrategy();
};
T... | true |
4e2d1add58cad2da2d3d92a4b710bd415a4dff8d | C++ | Vladimir-ai/Generic-B-Tree | /B-Tree/MyBTree.h | UTF-8 | 3,411 | 3.078125 | 3 | [] | no_license | #pragma once
#include <vector>
#include <string>
#include <stdexcept>
#include <functional>
#include <ostream>
#include <algorithm>
template<typename T>
class MyBTree
{
private:
template <typename T = T>
struct BTreeNode
{
BTreeNode<T>* _parent;
std::vector<T> _keys;
std::vector<BTreeNode<T>*> _children;
... | true |
5e0fd6d853204e76e68706feabd6fb734b656eb9 | C++ | ayushsengupta1991/algorithmic-programming-practice | /CodeChef/May_14/anudtc.cpp | UTF-8 | 516 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
long t;
scanf("%ld",&t);
while(t--)
{
long long int n;
scanf("%lld",&n);
// 1
if(n>360)
printf("n ");
else if(360%n!=0)
printf("n ");
else printf("y ");
//2
if(n>360)
printf("n ");
else printf("y ");
//3
if(n>=360)
... | true |
a84ec416c527da827a79d0e32c8347c0b28c6467 | C++ | ashwinaj/Programs | /ClosestPowerOf2.cc | UTF-8 | 684 | 3.140625 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int number = 64;
int closestNumber = 0;
int dummy = 1;
while(number > 0)
{
if(dummy >= number)
{
// Check if closentNumber is closer to the number than dummy
if((dummy-number)<(num... | true |
9db4eb98303622b1e5fa61a71bcadce2d289168c | C++ | yikliu/ArithmeticExpressionParser | /ArithmeticExpressionParser/postfix/Calculator.cpp | UTF-8 | 1,525 | 2.921875 | 3 | [] | no_license | #ifndef CALCULATOR_CPP_
#define CALCULATOR_CPP_
#include "Calculator.h"
/// Default constructor
template<typename T>
Calculator<T>::Calculator(void)
:p_postfix_array_(0),
p_iter_(0),
p_parser_(0),
p_evaluator_(0),
p_factory_(0)
{
p_postfix_array_ = new Array<Expr_Command<T> *>();
p_iter_ = new Array_Iterator<E... | true |
5279b159b85ffcc4832685ec73bfa404619eb3d6 | C++ | jingwang9302/Cpp | /Practice Setter and Getter/src/Practice Setter and Getter.cpp | UTF-8 | 547 | 2.984375 | 3 | [] | no_license | //============================================================================
// Name : Practice.cpp
// Author : Zoe
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#inclu... | true |
b34f3d5dda8664e69afcad2dd01d8645ff01a313 | C++ | b6t/focus | /components/Clock.cpp | UTF-8 | 2,452 | 3.5 | 4 | [] | no_license | #include <string>
#include <ncurses.h>
#include "Clock.h"
using std::string;
// Constructor Clock
// A constructor that instantiates a clock object then passes the input on
// to the inherited component class
Clock::Clock(
string title, int height, int width, int verticalPos, int horizontalPos,
bool outline... | true |
52b02b64aa7699ed3191e78a1720c267cf85afc6 | C++ | IvanAli/ACMICPC2017Training | /LATAM11/m/m.cpp | UTF-8 | 987 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int m;
int n;
int mask;
int dp[(1<<15)];
void trans(int bitmask)
{
for(int i = m; i >= 1; --i)
if(bitmask&(1<<i))
cout<<'1';
else
cout<<'0';
cout<<endl;
}
int dfs(int bitmask)
{
int &ans = dp[bitmask];
if(ans != -1)
return ans;
if(bitmask&(1<<m))
... | true |
7546a2b6a7792830a287a5c05260936cde01dcbd | C++ | mrDIMAS/32k-shooter | /particlesystem.h | UTF-8 | 804 | 2.59375 | 3 | [] | no_license | #pragma once
#include "scenenode.h"
class Particle {
public:
Math::Vector3 mPosition;
Math::Vector3 mSpeed;
int mLifeTime;
Math::Color mColor;
float mSize;
Particle();
};
class ParticleSystem : public SceneNode {
public:
Particle * mParticles;
int mParticleCount;
int mAliveParticles;
Math::Vector3 mEmitDi... | true |
35438a23f1faf60a41f7867a3ce00a2280d517de | C++ | joshsarath/Fall-13-CSC-281-Project-8 | /project 8/project 8/Automobile.cpp | UTF-8 | 1,282 | 3.09375 | 3 | [] | no_license | //
// Automobile.cpp
// project 8
//
// Created by Josh Sarath on 11/4/13.
// Copyright (c) 2013 Josh Sarath. All rights reserved.
//
#include "Automobile.h"
using namespace std;
Automobile::Automobile(string m, string b, string c, int cy, long mile, long dist, long cost, long price)
{/*
constructor for class a... | true |
aa41fe967eadcaa65f2e971a70d8d87ffdf2150d | C++ | StraToN/stratego | /ListPiece.h | UTF-8 | 546 | 2.84375 | 3 | [] | no_license | # ifndef H_LISTPIECE
# define H_LISTPIECE
# include "Piece.h"
# include <list>
class ListPiece{
private:
// attributs
list<Piece*>* pieces;
public:
// constructeurs et destructeur
ListPiece();
ListPiece(int size);
~ListPiece();
// methodes
... | true |
85430fc9384067b58613e14a15c2ad032aa2e574 | C++ | harimohanraj89/SoniScan | /ControlBlock.cpp | UTF-8 | 16,585 | 2.96875 | 3 | [] | no_license | //
// ControlBlock.cpp
// SoniScan_2_0
//
// Created by Hariharan Mohanraj on 11/30/12.
// Copyright (c) 2012 Hariharan Mohanraj. All rights reserved.
//
#include "ControlBlock.h"
#include "Constants.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <math.h>
// ==============... | true |
e6ec856351f5da51bda37e018b1a201c58be4d86 | C++ | VSarabudla/spaceships-and-aliens | /src/core/character.cc | UTF-8 | 1,369 | 3.0625 | 3 | [] | no_license | #include "core/character.h"
shooter::Character::Character(const glm::vec2& position, float radius,
float movement_speed, int health_points)
: position_(position),
radius_(radius),
movement_speed_(movement_speed),
health_points_(health_points) {
}
void shooter::Chara... | true |
faf075495a36fcaac68a77452995978059d0d1ff | C++ | benel2606/ChainOfStoresManagement | /Senior_Salesman.cpp | UTF-8 | 1,775 | 3.078125 | 3 | [] | no_license | /*
Assignment: 4
Campus: Ashdod
Author: Benel Aharon
ID: 307908111
*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include "Workers.h"
#include "Senior_Salesman.h"
using namespace std;
void Senior_Salesman::print() const
{
cout << "<Senior_Salesman>" << endl;
cout << "Name: " << name << end... | true |
bbe7d8465c22d959ded4e1c4240856232e3641be | C++ | chanfool21/Competitive-Coding | /summer_love/Practice Codes/Check/stack_lol.cpp | UTF-8 | 969 | 3.59375 | 4 | [] | no_license | #include<iostream>
using namespace std;
int top = 0;
#define MAX 10
void push(int i, int a[])
{
if(top == MAX - 1)
{
cout<<"Stack Overflow";
}
a[top++] = i;
}
int pop(int a[])
{
if(top == -1)
{
cout<<"Stack is empty";
}
int b = a[top--];
return b;
}
int peek(int a[])
{
if(top == -1)
{
cout<<"Stack is empty";
}
int ... | true |
bd0a290a0b382a45283fd8b18c363d19810d9c41 | C++ | liuyihao18/QtBigHomework | /role.cpp | UTF-8 | 1,819 | 2.765625 | 3 | [] | no_license | #include "role.h"
Role::Role(QObject *parent) : BaseObject(parent), _HP(3)
{}
Role::Role(int x,
int y,
int width,
int height,
const QString& imgPath,
int speed,
int HP,
... | true |
4c64636bb674f317d63d720feffd8d3d1dc692c5 | C++ | shrekwu/OpenS3D | /src/core/s3d/test/utilities/tests_stats.cpp | UTF-8 | 768 | 3.28125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "gtest/gtest.h"
#include "s3d/utilities/stats.h"
#include <numeric>
TEST(percentile, first_last_elements) {
std::vector<float> v;
v.resize(100);
std::iota(std::begin(v), std::end(v), 0.0f);
EXPECT_EQ(s3d::percentile(v, 0.00), 0.0f);
EXPECT_EQ(s3d::percentile(v, 1.00), 99.0f);
}
TEST(percentile, m... | true |
3a3e5e22dfc4a4cd428cf28890a6df404c7363e4 | C++ | YoungJooYoo/For_Coding_Test | /LeetCode/find-the-difference/find-the-difference.cpp | UTF-8 | 325 | 2.890625 | 3 | [] | no_license | class Solution {
public:
char findTheDifference(string s, string t) {
sort(s.begin(),s.end());
sort(t.begin(),t.end());
for(size_t i = 0; i < t.length(); i++) {
if(s[i] != t[i]) {
return t[i];
}
}
return 'success';
... | true |
b9b7f4c3388fd4db9277309c277930f16021779d | C++ | pratiksaha/practice | /algorithms/encodingFibonacciZeckendorf.cpp | UTF-8 | 1,106 | 3.390625 | 3 | [] | no_license | //fibonacci encoding using Zeckendorf's theorem
#include <bits/stdc++.h>
using namespace std;
#define N 30
int fib[N];
int zeckendorf(int n) {
fib[0] = 1;
fib[1] = 2;
int i;
for (i=2; fib[i-1]<=n; i++)
fib[i] = fib[i-1] + fib[i-2];
return (i-2);
}
void reprFibonacci(int n) {
while (n>0... | true |
5f1dec39a5dfbe078ca8aa615cf0c6aef72742e8 | C++ | abdulilah1424/SocialMediaSimulate | /Client/src/connectionHandler.cpp | UTF-8 | 8,945 | 2.703125 | 3 | [] | no_license | #include <connectionHandler.h>
#include <algorithm>
#include <string>
using boost::asio::ip::tcp;
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using std::string;
ConnectionHandler::ConnectionHandler(string host, short port): host_(host), port_(port), io_service_(), socket_(io_servi... | true |
d0efdc1adc6d8d91be5e2139d71737da91c64c28 | C++ | LamperEin/leetcode_exe | /algo_solver/LRUcache.cpp | UTF-8 | 1,491 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <unordered_map>
#include <list>
using namespace std;
class LRUCache {
private:
int _cap;
list<pair<int, int>> _cache;
unordered_map<int, list<pair<int, int>>::iterator> _map;
public:
LRUCache(int capacity) {
_cap = capacity;
}
int get(... | true |
f2c41aededb0d04ec0419c21933e8b1a6551eb29 | C++ | Yumin-Kim/BaiscProgrammingKnowledge | /Unmanaged-C_CPP/ch01/ch08.cpp | UHC | 2,265 | 3.5 | 4 | [] | no_license | #include <stdio.h>
/*
Ϳ
ǽ Ӽ >> Ŀ >> ּ Ǯ ǽϱ!!
300 16 ǥϰԵǸ
0x00 00 01 2C
ǥǴ
2C 01 00 00
̿ Byte Order̸ Littile Endian ̴!!
Little Endian ü intel!!
cpu intel Ǿ Little Endian !!
Ǿ!!
ּҸ &ڸ ȰϿ ּҸ Ȯ ִ!!
& compile Time ̴!!
ѹ compile ķδ Ű澲 ʴ ̴!!
( ߴٴ ǹ̴)
!!
Ȱ!!
ؿ Ѱ ԵǸ npn... | true |
be3a27e43f3d4a70f82a28df0f17a0959c0dec4e | C++ | tmd9760/cpp-bitcoin-block-parser | /main.cpp | UTF-8 | 2,702 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "picosha2.h"
#include "Helpers.hpp"
#include "Input.hpp"
#include "Output.hpp"
#include "Transaction.hpp"
#include "BlockHeader.hpp"
#include "Block.hpp"
int main(int argc, char ** argv) {
if (argc < 2) {
std::cout << "Command: " << argv[0] << " FILENAME" <<... | true |
de4c5ad904e715873cbb5614dc400e6da6672d05 | C++ | confidentFeng/QtAppProject | /Rocker/widget.cpp | UTF-8 | 4,728 | 2.75 | 3 | [] | no_license | #include "widget.h"
Widget::Widget(QDialog *parent)
: QDialog(parent)
{
Init(); //初始化函数
}
Widget::~Widget()
{
}
//初始化函数
void Widget::Init()
{
//设置窗口无边框且窗口显示在最顶层
//this->setWindowFlags(Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint);
//设置大圆圆心位置
SmallCir_xy.setX(300);
Small... | true |
2c8cbedc3d2633fcf1edc1a877a9b49e25b3bc92 | C++ | koshka-kartoshka/SPRINGS | /Spring.hpp | UTF-8 | 683 | 2.765625 | 3 | [] | no_license | #include <SFML/Graphics.hpp>
#include <iostream>
class Spring
{
public:
Vector2f length0Start;
Vector2f length0End;
Vector2f lengthStart;
Vector2f lengthEnd;
sf::Color color;
float stiffness;
void drawSpring(Spring spring, sf::RenderWindow*... | true |
0af29464d7607c9d79b3580dbdc1a3bb394497c0 | C++ | EunSeong-Seo/coding_test | /codeup_c++/1084.cpp | UTF-8 | 239 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int r,g,b;
int count=0;
scanf("%d %d %d",&r,&g,&b);
for(int i=0;i<r;i++)
for (int j=0;j<g;j++)
for (int k=0;k<b;k++)
{
printf("%d %d %d\n",i,j,k);
count++;
}
printf("%d",count);
}
| true |
6a345b540a575e2c7df8928eee2bd034f41d16f6 | C++ | xmlb88/algorithm | /leetcode/BFS/743.networkDelayTime.cpp | UTF-8 | 541 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
// TODO:
// https://leetcode-cn.com/problems/network-delay-time/solution/dirkdtra-by-happysnaker-vjii/
int networkDelayTime(vector<vector<int>>& times, int n, int k) {
vector<vector<pair<int, int>>> edge(n + 1);
for (auto& time : times... | true |
a7e6c8b6174513a5c3d2c97f66b204447ad5b1bc | C++ | imaycen/Riemann | /main.cpp | UTF-8 | 3,920 | 3.40625 | 3 | [] | no_license | // Author : Ivan de Jesus May-Cen
// Email : imaycen@hotmail.com, imay@itsprogreso.edu.mx
// Language : C++
// Environment : Linux
// Compiler : g++
// Revisions :
// Initial : 16.02.2017
// Last :
// Este programa compila en la consola de linux mediante la orde
/... | true |
731de04fa092e9d4473379809682e13449e76b11 | C++ | Charliechen1/EECS_coding_practice | /charliechen/in_post_tree/in_post_tree.cpp | UTF-8 | 1,590 | 3.359375 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder) {
return buildTreeHelper(inorder, postorder, ... | true |
e5613e8a9d29e67db84299857c6f1c57aed6db2b | C++ | AnushkaDwivedi17/Data_Structures | /stack.cpp | UTF-8 | 749 | 3.890625 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int data){
this->data = data;
this->next = NULL;
}
};
class Stack{
public:
Node* top;
Stack(){
top = NULL;
}
void peek(){
if(top!=NULL)
cout<<top->data;
els... | true |