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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9f50d68c9d3a02590b2c05d3b11bf258bd6d6e0f | C++ | mourogurt/oage | /src/system/core/Threads/thread_guard.hpp | UTF-8 | 911 | 3.0625 | 3 | [
"MIT"
] | permissive | #ifndef THREAD_GUARD_HPP
#define THREAD_GUARD_HPP
#include <event.hpp>
#include <thread>
/*class thread_guard
{
std::thread t;
std::unique_ptr<EventBase> ev {nullptr};
public:
explicit thread_guard(std::thread&& t_, EventBase&& ev_) noexcept : t(std::move(t_)), ev(&ev_) {}
explicit thread_guard(std::t... | true |
2e3da131ec40c3dd433cf60c9f0db436bacba7ff | C++ | ParkerSD/nlos_rpi | /rpi_files/Documents/wifip2p/driver/p2p_driver/connect.h | UTF-8 | 3,586 | 3 | 3 | [] | no_license | #ifndef CONNECT_HEADER
#define CONNECT_HEADER
#include <string>
/******************** FUNCTION DECLARATIONS ********************/
/**
* Enters the connected state of the program.
* Spawns two threads:
* - Thread 1: Will monitor the connection status of our P2P connection using function: connected_loop()
* - Thre... | true |
8d9087e5401a006c7405f340d29c258a10e63129 | C++ | ForPertP/The-Bomberman-Game | /The-Bomberman-Game.cpp | UTF-8 | 1,461 | 3.171875 | 3 | [] | no_license | void detonate(vector<string>& grid, const vector<string>& previous_grid)
{
size_t r{ grid.size() };
size_t c{ grid[0].size() };
for (int i = 0; i < r; ++i)
{
for (int j = 0; j < c; ++j)
{
if (previous_grid[i][j] == 'O')
{
grid[i][j] = '.';
... | true |
ca7dd66982bc9937d70b06dad7bef2969a4aabf5 | C++ | rxtsolar/finger-game | /server/gs_epoll.h | UTF-8 | 1,428 | 2.75 | 3 | [] | no_license | #ifndef _GS_EPOLL_H_
#define _GS_EPOLL_H_
#include "gs_socket.h"
#include <cstring>
#include <fcntl.h>
#include <sys/epoll.h>
namespace gs {
struct Data {
int fd;
unsigned int len;
char buf[2048];
Data() { }
Data(const char* s, const int l)
{
memcpy(buf, s, l);
}
};
class EpollManager {
public:
EpollMan... | true |
3a5c0d20d0ec0bb0632aad2763d0cf610128e490 | C++ | chidaa/Smart-Project | /Smart/jeu.h | UTF-8 | 596 | 2.515625 | 3 | [] | no_license | #ifndef JEU_H
#define JEU_H
#include <QString>
#include <QSqlQuery>
#include <QSqlQueryModel>
class Jeu
{
public:
Jeu();
Jeu(int,QString,int,int);
int get_jeu_id(){return jeu_id;}
QString get_type_jeu(){return type_jeu;}
int get_nombre_tick(){return nbr_tick;}
int get_nombre_enf(){return nbr_en... | true |
a888c180a16bafcf987b4674710edd831fc72adf | C++ | micyril/AIWars | /WebHandler/WebHandler/WebSocketPacket.h | UTF-8 | 757 | 2.671875 | 3 | [] | no_license | #pragma once
#include <Windows.h>
#include <string>
using namespace std;
enum WebSocketMessageType {
TextData = 1,
BinaryData = 2,
AnyData = TextData | BinaryData,
Ping = 4,
Pong = 8,
Close = 16,
UnknownType = 0
};
class WebSocketPacket {
private:
BYTE flags_opcode;
BYTE mask_len;
WORD exlen;
unsigne... | true |
e244fd19e1a872287ef7a03be79eb6243e32cf5f | C++ | JeissonNaveros16/NaverosJeisson_Ejercicio30 | /EDPelip.cpp | UTF-8 | 1,917 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cmath>
#include "stdio.h"
void init(double *psi, int n_x);
void print(double *psi, int n_x);
void copy(double *recibe, double *entrega, int n_x);
double evolve(double *psi_new, double *psi_old, double delta_x, int n_x, double m, double p);
void save(double **almacen, do... | true |
04ba9e59a1cfda4c38ebed8b5304c73abb91fb6a | C++ | KRHero03/CompetitiveCoding | /Codeforces/1379A.cpp | UTF-8 | 2,509 | 2.53125 | 3 | [] | no_license | /*
author: KRHero
IDE: VSCode
*/
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define MOD 1000000007
#define f(i, a, b) for (int i = a; i < b; i++)
#define fe(i, a, b) for (int i = a; i <= b; i++)
#define fd(i, a, b) for (int i = b; i > a; i--)
#define fde(i, a, b) for (int ... | true |
57cd33ccdb4c24b846aafe938ad1ea6ecc0bbd78 | C++ | Nodmgatall/R | /Rcpp/pir_heidmann-presentation/test/src/RcppExports.cpp | UTF-8 | 1,016 | 2.640625 | 3 | [] | no_license | // This file was generated by Rcpp::compileAttributes
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#include <Rcpp.h>
#include <vector>
using namespace Rcpp;
void rcpp_hello_world();
int return_given_value(int value);
std::vector<int> add_lists(std::vector<int> vec1, std::vector<int> vec2);
// rcpp_hello... | true |
041f1ccfe6fc58372547dc33eaca18b9ce1fb99c | C++ | AlirezaShamsoshoara/gfpop | /src/Edge.h | UTF-8 | 502 | 2.65625 | 3 | [] | no_license | #ifndef EDGE_H
#define EDGE_H
#include<string>
#include "Rcpp.h"
class Edge
{
public:
Edge();
Edge(double b, int s1 = 0, int s2 = 0, Rcpp::String cstt = "std", double param = 0);
double getBeta() const;
int getState1() const;
int getState2() const;
std::string getConstraint() const;
dou... | true |
dc88e842ed8d547567be804609b6219b5b3fcb93 | C++ | mevoroth/eternal-engine-core | /src/Core/Level.cpp | UTF-8 | 1,210 | 2.671875 | 3 | [] | no_license | #include "Core/Level.hpp"
#include "Core/GameObject.hpp"
namespace Eternal
{
namespace Core
{
Level::Level()
: WorldObject()
{
_GameObjects.reserve(GameObjectsInitialPool);
}
void Level::SetWorld(_In_ World* InWorld)
{
WorldObject::SetWorld(InWorld);
for (uint32_t GameObjectIndex = 0; GameObje... | true |
4961523b8abfbed5270af7589f26323ee81f630e | C++ | willstudy/LeetCode | /strstr.cpp | UTF-8 | 1,648 | 3.78125 | 4 | [] | no_license | /*
Implement strStr().
Returns the index of the first occurrence of needle in haystack,
or -1 if needle is not part of haystack.
*/
class Solution {
public:
int strStr(string haystack, string needle) {
int size1 = haystack.size();
int size2 = needle.size();
int i, j;
int index = 0;... | true |
50c4ca5b8cbd077bc3c94b656e21fbf90110da23 | C++ | wangxinalex/LeetCode-1 | /Palindrome Number.cpp | UTF-8 | 510 | 3.21875 | 3 | [] | no_license | class Solution
{
public:
bool isPalindrome(int x)
{
if (x < 0)
{
return false;
}
int digit[12] = {0};
int count = 0;
while (x != 0)
{
digit[count++] = x % 10;
x /= 10;
}
for (int i = 0... | true |
e89c8cf4d7168dde36636f8ea0c90909c1a3dec7 | C++ | abidon/pbxbuild | /pbxbuild/base_object.hpp | UTF-8 | 442 | 2.625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <memory>
#include <string>
namespace pbx
{
class Project;
class BaseObject
{
std::weak_ptr<pbx::Project> _project;
std::string _uid;
public:
BaseObject(const std::shared_ptr<pbx::Project>& project, const std::string& uid);
virtual ~BaseObject() = 0;
std::weak_ptr<pbx::Proje... | true |
2643bebb054cf5d4a3d1eb412d53b185ce19edc5 | C++ | smallsunsun1/Cpp-tools | /libs/simple_thread_pool.cpp | UTF-8 | 1,381 | 2.765625 | 3 | [] | no_license | //
// Created by 孙嘉禾 on 2020/1/22.
//
#include "simple_thread_pool.h"
thread_local WorkStealingThreadPool::Data* WorkStealingThreadPool::local_queue_;
thread_local unsigned WorkStealingThreadPool::index_;
bool WorkStealingThreadPool::PopTaskFromLocalQueue(WorkStealingThreadPool::Task &task) {
if (!local_queue_)
... | true |
ea1d205ac6106b25b045894f6a3cdc88597394f1 | C++ | OC-MCS/p2finalproject-02-josephkarch1 | /game/textureManager.h | UTF-8 | 5,162 | 3.046875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
using namespace std;
#include <SFML/Graphics.hpp>
using namespace sf;
class textureManager
{
private:
Texture shipTexture; // holds the texture for the ship / russell westbrook
Texture starsTexture; // holds the texture for the stars background / OKC thunde... | true |
ded095a5b0c916060d4fe9c871d3ba43c2ab2754 | C++ | Kamil7260/Age_of_War | /src/GameClass/CannonSpawner.hpp | UTF-8 | 900 | 2.78125 | 3 | [] | no_license | #pragma once
#include "../Base/Actor.hpp"
#include <functional>
class CannonSpawner : public base::Actor {
public:
CannonSpawner();
CannonSpawner(const CannonSpawner& source) = default;
CannonSpawner(CannonSpawner&& source) = default;
CannonSpawner& operator=(const CannonSpawner& source) = default;
CannonSpawner&... | true |
332fe04f86ce892dc6a4ad16c4af06f74afd5632 | C++ | Naivedya02/learning101 | /C++HRQ16.cpp | UTF-8 | 3,299 | 3.28125 | 3 | [] | no_license |
#include<bits/stdc++.h>
using namespace std;
class Box{
private:
int length,breadth,height;
public:
void setlength(int l){
length = l;
}
void setbreadth(int b){
breadth = b;
}
void setheight(int h){
height = h;
}
... | true |
e7867fb435a0d2a10286bc9c42eefb9d815347f4 | C++ | LuisBarcenas14/Programacion-Competitiva | /Otros/minimax.cpp | UTF-8 | 3,385 | 3.078125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
const int MAX = 10;
bool gano(char c, char tablero[MAX][MAX],int n){
bool horizontal;
for(int i=0; i<n; i++){
horizontal=true;
for(int j=0; horizontal && j<n; j++){
if(tablero[i][j] != c)
horizontal=fal... | true |
de4800ed0942ef62a87efc77cf62fa74781503cc | C++ | kennethhu418/LeetCode_Practice | /Maximal_Rectangle/Maximal_Rectangle.cpp | GB18030 | 4,247 | 3.25 | 3 | [] | no_license | // Maximal_Rectangle.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <vector>
#include <stack>
#include <assert.h>
using namespace std;
class Solution {
public:
int maximalRectangle(vector<vector<char> > &matrix) {
vector<vector<int>> verticalLineLengthOfPoints;
int rows = matrix.size();
... | true |
4a9d728f84fbb4979c133c68286ec0a0f7318d46 | C++ | marcphilippebeaujean-abertay/archaic-arena | /sfml_server.h | UTF-8 | 950 | 2.828125 | 3 | [] | no_license | #pragma once
#include "connection_manager.h"
class sfml_server : public connection_manager
{
public:
sfml_server(sf::IpAddress hostAddr, unsigned short serverport, sf::Time blockingTimeval, int nrOfPlayers);
~sfml_server();
// override functions
void update(float& deltaTime) override;
void handleGameStart() over... | true |
71cb540bae7b846605ddde5db0a6936498b6133c | C++ | dsfb/topicosProgramacao | /aula12/src/CadastroPessoas.cpp | UTF-8 | 9,686 | 3.1875 | 3 | [] | no_license | /**
PCS2478 - Tópicos de Programação
CadastroPessoas.cpp
@author 8586861 - Luiz Eduardo Sol (luizedusol@gmail.com)
@author 7576829 - Augusto Ruy Machado (augustormachado@gmail.com)
@version 1.0 2017-10-11
*/
#include "CadastroPessoas.h"
#include <iostream>
using namespace std;
// C... | true |
1e18b5aaab0c47c3bf2e059230e2d785a545350b | C++ | oLESHIYka/PdfConsoleParser_QT | /PdfConsoleParser_QT/source/Text/Style/TextStyle.h | WINDOWS-1251 | 6,861 | 3.015625 | 3 | [] | no_license | #pragma once
/*====================================================*\
TextType.h - TextType
\*====================================================*/
#include "../../MaybeType/MaybeType.h"
#include <unordered_map>
#include <functional>
#define ENUMERABLE_STYLE_FIELD_DECLARATION(enumType, fieldName, ...) ... | true |
38b9da5d9329bed4b485c0d09c05ef1a6afb9a23 | C++ | dorkosaurus/engine | /gvector.h | UTF-8 | 777 | 2.65625 | 3 | [] | no_license | #include <math.h>
#include <sstream>
#include <string>
using namespace std;
#ifndef GVector_H
#define GVector_H
class GVector{
private:
double x,y,z;
double length;
public:
double GetX();
double GetY();
double GetZ();
... | true |
7dd54b47980c9b1b2240a03f0da70b2b57999c9b | C++ | adamurish/roborebels | /RoboRebels2014/src/org/stlpriory/robotics/I2CFromChiefDelphi.ino | UTF-8 | 4,340 | 3.140625 | 3 | [] | no_license | #include <Wire.h>
byte dataToSend = 0;
unsigned long counter = 0;
byte data2[6] = {11, 12, 13, 14, 15, 16};
void setup()
{
Wire.begin(2); // Start I2C interface (address 2)
Wire.onReceive(i2cReceive); // Receive ISR routine
Wire.onRequest(... | true |
c1c048e7dc908618a7707dba11212d0538bded93 | C++ | jg-maon/test | /ListQuickSort/source/Random.inl | UTF-8 | 391 | 2.875 | 3 | [] | no_license |
namespace ns_Random
{
template<typename ValueType> inline ValueType Random::GetRandom(const ValueType& min, const ValueType& max)
{
::std::uniform_real_distribution<ValueType> range(min, max);
return range(m_engine);
}
template<> inline int Random::GetRandom<int>(const int& min, const int& max)
{
std::uni... | true |
82b027ad47dbed40dddbbe114bbbc8f2d748f7be | C++ | niuxu18/logTracker-old | /second/download/CMake/CMake-old-new/CMake-old-new-joern/Kitware_CMake_old_new_old_function_891.cpp | UTF-8 | 4,444 | 2.734375 | 3 | [] | no_license | const void *
__archive_read_filter_ahead(struct archive_read_filter *filter,
size_t min, ssize_t *avail)
{
ssize_t bytes_read;
size_t tocopy;
if (filter->fatal) {
if (avail)
*avail = ARCHIVE_FATAL;
return (NULL);
}
/*
* Keep pulling more data until we can satisfy the request.
*/
for (;;) {
/*
... | true |
9717a1c17ccad1f44a22307eb9b209bc9d58f767 | C++ | pjanotti/signalfx-dotnet-tracing | /shared/src/native-src/string.cpp | UTF-8 | 2,549 | 2.859375 | 3 | [
"MIT",
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "string.h"
#ifdef _WIN32
#include <Windows.h>
#define tmp_buffer_size 512
#else
#include "miniutf.hpp"
#endif
namespace shared {
std::string ToString(const std::string& str) { return str; }
std::string ToString(const char* str) { return std::string(str); }
std::string ToString(const uint64_t i) {... | true |
b9ed21f046da9ce6c08ded0471256568402382dd | C++ | Wouterdek/raytracer | /raytracer/src/lib/material/environment/ImageMapEnvironment.cpp | UTF-8 | 779 | 2.75 | 3 | [] | no_license | #include "ImageMapEnvironment.h"
#include <utility>
ImageMapEnvironment::ImageMapEnvironment(std::shared_ptr<Texture<float>> environmentMap)
: texture(std::move(environmentMap))
{}
ImageMapEnvironment* ImageMapEnvironment::cloneImpl() const
{
return new ImageMapEnvironment(this->texture);
}
RGB ImageMap... | true |
d694026537225fdecf90a091779b8465f9584437 | C++ | MarcusTurnerBSU/LinkedIn-Learning | /CodeLab II/C++ Standard Template Library/The Standard Template Library/sequence-containers.cpp | WINDOWS-1252 | 2,667 | 3.609375 | 4 | [] | no_license | /*
Containers
objects that handle a collection of other objects (elements) implementing a well defined data structure
example: vectors, stacks, queues, maps, pairs
three types of containers - sequence, associative, unordered associative
sequence - storage of data elements - vectors, list, deques, stacks, queues
//f... | true |
4f2c8ac6b6d3b7a6ef41a07bfafa8f8a8223d0b5 | C++ | adam-lafontaine/BoostBeast | /Server/source_main.cpp | UTF-8 | 958 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <exception>
#include "server.hpp"
namespace svr = server_async;
// C++17 for constexpr lambdas
auto constexpr send_text =
[](auto const& req) {
svr::send_text(req, "Here is some text");
std::cout << "send_text\n";
};
auto constexpr send_json =
[](auto const& req) {
svr::send_js... | true |
2c000e543aa4b38ec7937dac0589ab7b3d7f5f56 | C++ | dav991/octotouch | /src/MainActivity.cxx | UTF-8 | 2,844 | 2.578125 | 3 | [] | no_license | #include "MainActivity.h"
MainActivity::MainActivity( Glib::RefPtr< Gtk::Application > app ): window(nullptr)
{
this->app = app;
app->hold();
statusActivity = new StatusActivity(this);
webcamActivity = new WebcamActivity(this);
filesActivity = new FilesActivity(this);
moveActivity = new MoveAct... | true |
02618b9ad1d96848d60913e36339a71b0445f0a4 | C++ | gilbutITbook/080261 | /C204_PPD42NS_미세먼지_센서/01 아두이노 라이브러리/libraries/Steamedu123_Sensor-master/src/C204_Steam_Air_PPD42NS_Dust.cpp | UTF-8 | 2,447 | 2.890625 | 3 | [] | no_license | /*
PPD42NS library
STEMEDU123 license
written by SteamLabs
homepage: http://www.steamedu123.com
naver cafe : https://cafe.naver.com/arduinosensor/book5108749/49
email : steamedu123@gmail.com
*/
#include "C204_Steam_Air_PPD42NS_Dust.h"
#define COUNT_NUM 10
/**
* @함수명 : SteamPPD42NS
* @설명 : 생성... | true |
17a245e8110102f7fbe990a7fcad6b68890a1e93 | C++ | MetalBall887/Competitive-Programming | /CodeForces/CF850-D1-B.cpp | UTF-8 | 1,756 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//Let d be our new gcd, x = kd. For each numbers [(k-1)d+1;kd] they either add enough times to become x or get deleted. For this segment it's easy to determine a
//border where it gets more optimal to delete a number rather than increase it to x. For e... | true |
6722717e0657d8c14075ea1461c989829bc73f00 | C++ | ahmedibrahim404/CompetitiveProgramming | /CF Contests/Div2_569/A/main.cpp | UTF-8 | 379 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include<math.h>
using namespace std;
typedef long long ll;
int n;
int main(){
scanf("%d", &n);
if(n == 1) return printf("1"), 0;
int a=1;
long long total=0;
for(int i=0;i<n;i++){
total += a;
a+=2;
}
a-=2;
total *= 2;
tota... | true |
1095427d83a8f2e666faf1c6301bba317fdd8eef | C++ | kevinlin47/Projects | /Data-Structures/Stack/main.cpp | UTF-8 | 1,269 | 3.890625 | 4 | [] | no_license | #include"stack.h"
#include<time.h>
#include<random>
int main()
{
std::cout<<"Testing all stack methods"<<std::endl;
std::cout<<"\nAdding 20 random numbers into the stack"<<std::endl;
stack testStack;
srand(time(NULL));
for (int i=0;i<20;++i)
{
int randomEntry=rand()%99... | true |
91c04ecfa964d67c9d1010a09eede04e03101bdb | C++ | sheharyarak/CS124 | /Lab4/main.hpp | UTF-8 | 443 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class Term
{
public:
Term *nxt = nullptr;
int coeff;
int exp;
Term(int exp, int coeff);
};
class Polynomial
{
public:
Term *h = nullptr;
Term *t = nullptr;
void addTerm(int coeff, int exp);
void addToStart(Term *newterm);
void addToEnd(Term *newterm... | true |
56e77dd3c3819d32419b7366a6f1e34027480660 | C++ | demelue/easy-medium-code-challenges | /C_C++/BST/main.cpp | UTF-8 | 2,867 | 3.28125 | 3 | [] | no_license | #include "bst.h"
vector<int> output;
vector<std::vector<int> > results;
void pre_order_traversal(BstNode* root)
{
if (root == NULL) return;
output.push_back(root->data);
pre_order_traversal(root->left);
pre_order_traversal(root->right);
}
void post_order_traversal(BstNode* root)
{
if (!root) return;
pos... | true |
db323c6831021f3fc23df7736cb529fe9c40afef | C++ | TheIncredibleVee/Classes-and-object | /Answer 5 Objects and classes.cpp | UTF-8 | 1,696 | 3.625 | 4 | [] | no_license | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
/*Class*/
class Cloth{
char code[30];
char type[50];
int size;
char material[50];
float price;
void Calc_price();
public:
Cloth();
void getData();
void showData();
};
/*Main Function*/
int main(int argc, char... | true |
061aa0a25799cc57f7f31378ed7f6821505a9e22 | C++ | jcasanella/game_programming | /Learning/source/private/Shader.cpp | UTF-8 | 2,737 | 3.03125 | 3 | [] | no_license | #include "Shader.h"
#include <iostream>
#include <fstream>
#include <cassert>
namespace GameEngine {
const GLuint INVALID_PROGRAM_ID = 0;
Shader::Shader() : m_programId(INVALID_PROGRAM_ID)
{
}
Shader::~Shader()
{
Terminate();
}
void Shader::Terminate()
{
if (m_programId != INVALID_PROGRAM_ID)
{
... | true |
5224885eb838046a908c6c9f58123221e3db5e7d | C++ | Kushagratandon12/Coding-Competition-Problems- | /30Days.cpp | UTF-8 | 2,346 | 3.875 | 4 | [] | no_license | #include<iostream>
#include<conio.h>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include<vector>
using namespace std;
void duplicate_array()
{
//only one repeating element is present
//Sort the array and find the element adajcent to it
//First approach in mind is using set and passing the eleme... | true |
4d3388b90ebd830e92eea5e1be5fdeaaa84441a2 | C++ | m80126colin/Judge | /before2020/UVa_ACM/003 - Volume III/UVa 369(1.5, Combination, Math).cpp | UTF-8 | 555 | 3.125 | 3 | [] | no_license | /**
* @judge UVa
* @id 369
* @tag 1.5, Combination, Math
*/
#include <stdio.h>
#include <iostream>
using namespace std;
int n, m;
long long c(int a, int b)
{
long long ans, i, j, mn, mx;
ans = 1;
mn = min(a - b, b);
mx = max(a - b, b);
for (i = a, j = 1; i > mx; i--)
{
ans *= i;
if (j ... | true |
47255b1b914d64ac1159f8c892f84487b68d52e7 | C++ | google/perfetto | /include/perfetto/protozero/static_buffer.h | UTF-8 | 3,449 | 2.515625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright (C) 2019 The Android Open Source Project
*
* 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 app... | true |
0f5464b82a96fd27078fd75fdcecdede99dec20b | C++ | HopeChanger/homework4 | /PB15000176_PB15000202/hw4.cpp | UTF-8 | 7,656 | 2.671875 | 3 | [] | no_license | #include<FindContours.h>
#define OK 1
#define FAIL 0
#define MAX_LABLE 100000
int *table;
int length;
int Connect_Update(int a, int b) {
int con_a = table[a];
int con_b = table[b];
if (con_a > con_b) {
int temp = con_a;
con_a = con_b;
con_b = temp;
}
for (int i = con_b; i <= length; i++)
{
if (table[i... | true |
594d281f2decb60191c2b6983cb1694fe8891ada | C++ | Mustafamemon/SEM_THREE | /DATA STRUCTURE/Ass/K173795 -E MustafaManga/K173795 A2_P2.cpp | UTF-8 | 2,620 | 2.953125 | 3 | [] | no_license | #include<iostream>
#include<string.h>
#include<fstream>
#include<cmath>
#include<stack>
using namespace std;
int i_ans(char ch[])
{
stack <int>s ;
int con=0,ans=0;
for(int i=0;i<strlen(ch);i++)
{
if(ch[i]>='0' && ch[i]<='9')
{
con=(con*10)+(ch[i]-48);
}
else if(ch[i]==' ')
{
if(con!=-1)
s.push(c... | true |
ad4119cba9b71d2e43b623e2e5bc830387abea5d | C++ | yuzin9712/Alogrithm | /대학생 심화반/BOJ_11404.cpp | UTF-8 | 1,374 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#define INF 1000000001
using namespace std;
int **graph;
int n, m;
void init() {
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
if(i == j) {
graph[i][j] = 0;
} else {
graph[i][j] = INF;
}
... | true |
c440a6a16fabae21f75c7db29608009adafd25cf | C++ | xd23fe39/arduino-basics | /PlatformIO/RelaisDemoV1/src/main.cpp | UTF-8 | 2,026 | 3.109375 | 3 | [] | no_license | #include <Arduino.h>
#define PIN_RELAIS_A 8
// Funktion für Signal-LED-Steuerung
void blink(uint8_t pin, byte repeat, int ms = 200);
/*
Relais 5V/230V Raspberry Pi Modul Channel Relay Arduino
- 5V Relais Modul 1-Kanal
- 5 Volt 1-Kanal-Relais-Schnittstellenkarte
- zur Steuerung von Verbrauchern bis 230 Volt
... | true |
4b9486453c17a7993cc4e3a480fac3e9c6b6d7e3 | C++ | Iamnvincible/myleetcode | /LinkedList/Solution_83.hpp | UTF-8 | 636 | 3.78125 | 4 | [] | no_license | #ifndef SOLUTION_83
#define SOLUTION_83
/* Given a sorted linked list,
delete all duplicates such that each element appear only once.
在排好序的链表中删除重复元素
记得要释放内存
*/
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(nullptr) {}
};
class Solution {
public:
ListNode* deleteDuplicates(ListNode*... | true |
b116c6cf9c18b804296e5765abccad6530cf00e9 | C++ | DmitriyKitov/cppcourse | /lw1/cpp1.4/square_equation.cpp | UTF-8 | 638 | 3.5625 | 4 | [] | no_license | #include <cstdio>
#include <cmath>
int main()
{
// 1. prompt user to enter coefficients
std::puts("please enter a, b and c for `ax^2 + bx + c = 0`:");
// 2. read coefficients for equation `ax^2 + bx + c = 0`
float a = 0;
float b = 0;
float c = 0;
std::scanf("%f %f %f", &a, &b,... | true |
1fe46b4054fa443a98026e8823f4a4834a009de2 | C++ | DongChengrong/ACM-Program | /UVA/1300-1399/1388.cpp | UTF-8 | 808 | 2.84375 | 3 | [] | no_license | /*
很遗憾没学会刘汝佳的做法,不过我们可以把它们均分最后用二分确定一下大小就好了
*/
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define N 2200
double a[N], b[N];
int main() {
int n,m;
while (scanf("%d%d",&n, &m) == 2) {
double a_cnt = 10000.0 / n;
double b_cnt = 10000.0 / (n +... | true |
8994d6bbe78d07c1429965bc207cf494a0c8669a | C++ | windystrife/UnrealEngine_NVIDIAGameWorks | /Engine/Source/ThirdParty/Perforce/p4api-2015.2/include/p4/filesys.h | UTF-8 | 12,845 | 2.5625 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | /*
* Copyright 1995, 1996 Perforce Software. All rights reserved.
*
* This file is part of Perforce - the FAST SCM System.
*/
/*
* FileSys.h - OS specific file manipulation
*
* Public classes:
*
* FileSys - a file handle, with all the trimmings
*
* Static Public methods:
*
* FileSys::Create() - create a ... | true |
0912b470c23cc98f76ccf0a3222f9ff115ef2c58 | C++ | IgorYunusov/Mega-collection-cpp-1 | /数据结构STL版/第4章/PBiTree.h | GB18030 | 1,616 | 2.984375 | 3 | [] | no_license | //PBiTree.h ָṹĶࣨPBiTreeࣩ
#ifndef _PBITREE_H_
#define _PBITREE_H_
#define BiTNode PBiTNode
#include "BiTree.h"
template<typename T>class PBiTree: public BiTree<T>
{
static void VisitParent(BiTNode<T> &c)
{
if (c.lchild != NULL)
c.lchild->parent = &c;
if (c.rchild != NULL)... | true |
3785b0113afb745e4018e7cf32e9a216362bd34d | C++ | Sjhunt93/Nes-Emulator | /NES Emulator/Source/Audio/Filter.hpp | UTF-8 | 1,658 | 2.671875 | 3 | [] | no_license | //
// Filter.hpp
// NES Emulator - App
//
// Created by Samuel Hunt on 21/02/2019.
//
#ifndef Filter_hpp
#define Filter_hpp
#include "Audio.h"
class FirstOrderFilter {
public:
float B0;
float B1;
float A1;
float prevX;
float prevY;
float step(float x)
{
float y = B0*x + B1... | true |
e1415f2a1450dcc339a40d7fcf23c1c350dcd59c | C++ | satellitnorden/Catalyst-Engine | /Engine/Include/Math/General/SpringDampingSystem.h | UTF-8 | 2,029 | 3.234375 | 3 | [] | no_license | #pragma once
//Core.
#include <Core/Essential/CatalystEssential.h>
class SpringDampingSystem final
{
public:
/*
* Returns the current.
*/
FORCE_INLINE NO_DISCARD float32 GetCurrent() const NOEXCEPT
{
return _Current;
}
/*
* Returns the velocity.
*/
FORCE_INLINE NO_DISCARD float32 GetVelocity() const NO... | true |
e931a63b879a6e84ba81272e640b04558f6bbe4e | C++ | inge91/AISnake | /screen.cpp | UTF-8 | 210 | 2.515625 | 3 | [] | no_license | #include "screen.h"
bool Screen::handle_input(SDL_Event e, Screen* s)
{
if (e.type == SDL_QUIT)
{
return false;
}
}
void Screen::execute_tick(SDL_Renderer* renderer){
std::cout << "Here" << std::endl;
} | true |
c62b42d2275c2a96758a0d594e6e23d3f9e8e502 | C++ | rmalusa72/cs310-quickhull | /qhull.cpp | UTF-8 | 916 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cmath>
#include <CGAL/Cartesian_d.h>
#include <CGAL/constructions_d.h>
typedef CGAL::Cartesian_d<double> K;
typedef CGAL::Point_d<K> Point;
typedef CGAL::Vector_d<K> Vector;
typedef CGAL::Segment_d<K> Segment;
typedef CGAL::Hyperplane_d<K> Hyperplane;
typedef K::Squared... | true |
ed9d164a6a695627507e550cdab820d8dbf6cda6 | C++ | CFWLoader/Basic-Algorithm | /Matrix-Chain-Order/main.cpp | UTF-8 | 488 | 2.859375 | 3 | [] | no_license | //
// Created by cfwloader on 9/3/15.
//
#include <iostream>
#include "MatrixChain.h"
using namespace std;
int main(int argc, char* argv[])
{
vector<int> dimension = {3, 6, 9, 12};
MatrixChain matrixChain(dimension);
for (int i = 0; i < matrixChain.getCostMatrix().size(); ++i) {
for (int j = ... | true |
4e57009b1e570797363b497276c6a92101ca5fa5 | C++ | shashidhargr111/C-Plus-Plus | /l9.cpp | UTF-8 | 549 | 3.25 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
class STRING
{
char *p;
int len;
public:STRING()
{
}
STRING(char *a)
{
len=strlen(a);
p=new char[len+1];
strcpy(p,a);
}
friend int operator ==(STRING,STRING);
};
int operator ==(STRING x,STRING y)
{
if(strcmp(x.p,y.p)==0)
return 1;
else
return 0;
}
int main... | true |
b87271a27db762aab1d5f17340b5ac5b3dd976c0 | C++ | 2ooom/annoyjni | /src/main/cpp/annoyint.h | UTF-8 | 2,421 | 2.53125 | 3 | [] | no_license | #include "annoylib.h"
#include "kissrandom.h"
extern "C" {
long createAngular(int f) {
return (long)new AnnoyIndex<int32_t, float, Angular, Kiss64Random>(f);
}
long createDotProduct(int f) {
return (long)new AnnoyIndex<int32_t, float, DotProduct, Kiss64Random>(f);
}
long createEuclidean(int f) {
return (long)n... | true |
57d5223128637e6bfb5fafbbce167ea13d6124a9 | C++ | capull0/SkyReader | /checksum.cpp | UTF-8 | 8,768 | 3.484375 | 3 | [] | no_license | #include "checksum.h"
/*
data checksums
The checksums are a mess. There are four "types" of checksums:
Type 0: this is a CRC16 checksum of the first 0x1E unsigned chars of sector 0. The checksum itself is stored in block 0x01, offset 0x0E.
Type 1: this is a CRC16 checksum of the data area header. As there are tw... | true |
cbc5cdde29f92f033f311c56995cb8e5f5947dbf | C++ | territo-sci/flare | /src/ShaderProgram.cpp | UTF-8 | 6,372 | 2.75 | 3 | [] | no_license | /*
* Author: Victor Sand (victor.sand@gmail.com)
*
*/
// TODO abstraction of shader binder, maybe a templated ShaderBinder class?
// or string values service
// possibly make a common UniformType class to handle matrices, ints, floats
#include <GL/glew.h>
#ifndef _WIN32
#include <GL/glfw.h>
#else
#include <GL/... | true |
f1e28dc401e017c2ae9b3d336db15f9637e219d5 | C++ | narayanr7/HeavenlySword | /code/geometry/Sector2D.h | UTF-8 | 4,103 | 3.0625 | 3 | [] | no_license | /***************************************************************************************************
*
* DESCRIPTION Simple class to encapsulate a sector of a circle in two dimensions.
*
* NOTES
*
***************************************************************************************************/
#ifndef SECTOR2D_H_
... | true |
8cbcba0362b01ebe8590860a4e025042cce3d435 | C++ | csyezheng/Cpp-Primer | /ch09/9.27.cpp | UTF-8 | 464 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <forward_list>
using std::cout;
using std::endl;
using std::forward_list;
int main()
{
forward_list<int> iFwList = { 1, 2, 3, 5, 23, 24 };
auto prev = iFwList.before_begin();
auto curr = iFwList.begin();
while (curr != iFwList.end())
{
if (*curr & 1)
{
curr = iFwList.erase_aft... | true |
7e2999dcf3f7bdee6592c8556bc84dfbd81d1905 | C++ | alex-min/babelroxor | /babel-2014-minett_a/trunk/lib/network.h | UTF-8 | 773 | 2.546875 | 3 | [] | no_license | #ifndef NETWORK_H
#define NETWORK_H
#include <map>
#include "iportablesocket.h"
#include "circularbuffer.h"
#include "islotinterface.h"
#include "crc.h"
#include "singleton.h"
class Network
{
public:
Network(unsigned int readCirbufSize = 4096, unsigned int writeCirbufSize = 4096);
Network(PortableSocket *sock... | true |
901f99f47bc2a143e5cce9eb564fec20f24e6697 | C++ | kenken64/VoiceControlledK-nexCar | /RaspberryPiArduinoControl/raspiMotorControl/raspiMotorControl.ino | UTF-8 | 1,899 | 3.296875 | 3 | [] | no_license | // Arduino Control for Raspberry Pi Voice Controlled Car
// Author: Austin Wilson
#include "MotorDriver.h"
MotorDriver motor;
char ser;
int greenPin = 3;
int redPin = 5;
int bluePin = 6;
#define COMMON_ANODE
void setup(){
pinMode(greenPin, OUTPUT);
pinMode(redPin, OUTPUT);
pinMode(bluePin, OUTPUT);
mot... | true |
11810b581b7f0dbbc3509d3e48b4ecf0ad618678 | C++ | dvir/homework | /spl/exercises/hw1/sentence.cpp | UTF-8 | 637 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> split(char sentence[], int len) {
vector<string> words;
string word = "";
for (size_t i = 0; i < len; i++) {
if (sentence[i] == ' ') {
words.push_back(word);
word = "";
} else {
word = word + sentence[i];
}
... | true |
45f01129e7fe1022076d1f6746feec1d75a30a37 | C++ | niuxu18/logTracker-old | /second/download/git/gumtree/git_repos_function_2456_git-2.6.5.cpp | UTF-8 | 769 | 2.609375 | 3 | [] | no_license | static struct trailer_item *process_command_line_args(struct string_list *trailers)
{
struct trailer_item *arg_tok_first = NULL;
struct trailer_item *arg_tok_last = NULL;
struct string_list_item *tr;
struct trailer_item *item;
/* Add a trailer item for each configured trailer with a command */
for (item = first_... | true |
7ee9620c7699532f1abeb652e265fbcec12445e8 | C++ | Acytoo/leetcode | /c++/844backspaceString.cc | UTF-8 | 1,006 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <climits>
#include <stack>
#include <algorithm>
#include <cmath>
#include <set>
#include <unordered_map>
#include <list>
#include <unordered_set>
#include <map>
#include <set>
#include <functional>
using namespace std;
static int x = []... | true |
5b358f09dbfa4ab9beeb34de2ebd288496b3681d | C++ | dastyk/SE | /SluaghEngine/Test/WindowTest.cpp | UTF-8 | 2,675 | 2.5625 | 3 | [] | no_license | #include "WindowTest.h"
#include <window/IWindow.h>
#include <Graphics/IRenderer.h>
//#include "Utilz/Console.h"
#include <Profiler.h>
#ifdef _DEBUG
#pragma comment(lib, "WindowD.lib")
#pragma comment(lib, "GraphicsD.lib")
#else
#pragma comment(lib, "Window.lib")
#pragma comment(lib, "Graphics.lib")
#endif
//using n... | true |
5b903a49fa1ba5e77a261cbf077bdf089adce34f | C++ | tedsta/Tetraverse | /include/PlayerDatabase.h | UTF-8 | 795 | 3.03125 | 3 | [] | no_license | #ifndef PLAYERDATABASE_H
#define PLAYERDATABASE_H
#include <string>
#include <vector>
class Engine;
class Entity;
struct Player
{
std::string mName;
std::string mPassword;
int mNetID; // -1 if the player isn't logged in
Entity* mEntity;
};
class PlayerDatabase
{
public:
PlayerDatabase(En... | true |
8a80ca012cc2367a85c283e6b7019fa128c60498 | C++ | iamweiweishi/LeetCode-Problems | /127.cpp | UTF-8 | 1,380 | 2.671875 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
if(!wordList.size()) return 0;
queue<string> q;
queue<int> t;
unordered_map<string,bool> visited;
q.push(beginWord);
t.push(1);
visited[beginWord]=true;
... | true |
a592b629a9cd2cfdba2eadd0a3b6105b7c73a9d3 | C++ | gayu-thri/Coding | /C/Program15_Books.cpp | UTF-8 | 1,764 | 3.59375 | 4 | [] | no_license | #include<stdio.h>
#include<string.h>
struct date
{
int mon, yr;
};
const date curr={5,2018};
struct book
{
int accno, price;
char title[18];
date pub;
void input()
{
printf("\n Enter the account number : ");
scanf("%d", &accno);
printf("\n Enter the price : ");
scanf("%d", &price);
... | true |
439a82d0a137bb426c75e17344c6a81f442269ca | C++ | luqian2017/Algorithm | /LintCode/395_Coins-in-a-Line-II/395_Coins-in-a-Line-II-V3.cpp | UTF-8 | 757 | 3.421875 | 3 | [] | no_license | class Solution {
public:
/**
* @param values: a vector of integers
* @return: a boolean which equals to true if the first player will win
*/
bool firstWillWin(vector<int> &values) {
int len = values.size();
if (len < 3) return true;
int sum1 = values[len - 1];
... | true |
dbb8bf7053e0a2a1e655f71794f66ed19dce12c8 | C++ | Mouradouchane/HackerRank_ProblemSolving | /HackerRank/SerivceLane.cpp | UTF-8 | 1,149 | 3.296875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
// problem : https://www.hackerrank.com/challenges/service-lane/problem
// solution O(n*k) ====================================================
// just normal function for getting min value instead of std::min
int getMin(std::vector<int> &w , int start , int end){ // O... | true |
8c9c211e95ff48e506aca26151965ad2d0bb564e | C++ | thomasmaters/A2B-Applicatie | /Route.cpp | UTF-8 | 1,352 | 3 | 3 | [] | no_license | #include <string>
#include <vector>
#include <list>
#include <iostream>
#include <assert.h>
#include "Route.hpp"
void Route::inputRoute(Location A, Location B)
{
startPoint = A;
endPoint = B;
}
void Route::calculateRoute()
{
for(auto connectie : RoadNetwork::connectionpieces){
if(connectie->getStartPoint() == s... | true |
b1ec029525430de874a861a789436ba60976befd | C++ | samychen/AndroidOpengl | /photoeditor/jni/beauty/gpuprocess/src/texture_2d.cpp | UTF-8 | 2,251 | 2.578125 | 3 | [] | no_license | #include "texture_2d.h"
#include <android/bitmap.h>
static int toolsavefile(unsigned char* pData, int size, char* name)
{
FILE *pf =fopen(name, "wb");
if(pf != 0){
fwrite(pData, size, 1, pf);
fclose(pf);
return 1;
}
return 0;
}
static int toolloadfile(unsigned char* pData, ... | true |
3ac6f2fe70aa5864c0bc2d580ec6d53f57abb65e | C++ | Akzwar/ArenstorfModel | /Matrix.cpp | UTF-8 | 7,927 | 3.21875 | 3 | [] | no_license | #include <Matrix.h>
#include <stdarg.h>
#include <QDebug>
TMatrix::TMatrix(int Width, int Height, double *n)//Параметр n- указатель
{ //на одномерный динамический массив
data= new double*[Width]; //Из него созается двумерный массив,
for(int i=0... | true |
729c001fb383c4812ee9bac453a1ee32baed3b0b | C++ | delor34n/maximization_function-genetic_algorithm | /ga_script.cpp | UTF-8 | 3,719 | 3.09375 | 3 | [] | no_license | /*
* File: ga_script.cpp
* Author: macbook
*
* Created on 4 de julio de 2016, 23:49
*/
#include <iostream>
#include <cstdlib>
#include <bitset>
#include <time.h>
//Tamaño de la poblacion
#define P_LENGTH 5
//Largo del array de cromosomas
#define C_LENGTH 5
//Número máximo de soluciones a encontrar
#define C_M... | true |
c0b08c6b89ac94659adba2c87627d1259a579aa1 | C++ | maxkhain/AutonomouseVehicle | /Data_structure/CurrentStatus.h | UTF-8 | 562 | 2.828125 | 3 | [] | no_license | #pragma once
#ifndef _CURRENTSTATUS_H /* Guard against multiple inclusion */
#define _CURRENTSTATUS_H
/**Status
@param <speed>
@param <angle>
*/
class Status {
private:
double angle;
double speed;
public:
Status(double speed, double angle)
{
this->speed = speed;
this->ang... | true |
ca687d7d1dbda8738a37b31378795d1125f44019 | C++ | kenza-bouzid/PLD-COMP-H4242 | /compiler/code/AST/Expression/ExpressionNeg.cpp | UTF-8 | 599 | 2.71875 | 3 | [
"MIT"
] | permissive | #include "ExpressionNeg.h"
ExpressionNeg::ExpressionNeg(Expression *expr)
{
this->expr = expr;
}
string ExpressionNeg::getIR(BasicBlock **bb)
{
#ifdef DEBUG
cout << "getIR ExpressionNeg starting" << endl;
cout << "Current BasicBlock is : " << *bb << " | addressed at: " << bb << endl;
#end... | true |
ed4ad5eac4417078a8945e2faea6b740090ab97c | C++ | jasonblog/note | /c++/code/mybooksources/Chapter01/codes/test_shared_ptr_use_count.cpp | GB18030 | 974 | 3.390625 | 3 | [] | no_license | // test_shared_ptr.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <memory>
class A
{
public:
A()
{
std::cout << "A constructor" << std::endl;
}
~A()
{
std::cout << "A destructor" << std::endl;
... | true |
c9a8099c8380b094c962a1fe27bdab85f90eb410 | C++ | noahklein00/cs5201_hw5 | /kalman.h | UTF-8 | 3,993 | 3.359375 | 3 | [] | no_license | /*! \file
*
* Definitions for the kalman filter derived class. \n
* Programmer: Noah Klein \n
* Class: CS5201 \n
* Assignment: Homework 5 \n
*/
#ifndef KALMAN_H
#define KALMAN_H
#include "filter.h"
#include "nTrix.h"
//! kalman class.
/*!
* This class is a derived filter class that acts as a kalman filter to ... | true |
e3309f06c5f4fe6894805edd13abc5e31ccfd1b2 | C++ | tekfyl/DataStructures | /BST/main.cc | UTF-8 | 4,756 | 3.53125 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct node{
int data;
node* left;
node* right;
};
node* insert(node *root, int value);
void find_bst(node *bst, int e);
void levelOrder(node *root);
int height(node *root);
void inOrder(node *root);
void postOrder(node *root);
void visit(node *root);
void pr... | true |
e7ae972178f85a6f8a26763cb0d354a4e5e23918 | C++ | shulincome/Data_Structres-with-c- | /ch02/CH02_01.cpp | GB18030 | 626 | 3.34375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int Score[5]={ 87,66,90,65,70 };
//Score[5], 5ɼ
int count, Total_Score=0;
for (count=0; count < 5; count++) // ִ for ѭȡѧɼ
{
cout<<""<<count+1<<"λѧķ:"<<Score[count]<<endl;
Total_Score+=Score[count]; //жȡܷ
... | true |
73c92ade77a451e2f2ad74cbce8543cb35ef3b11 | C++ | xMonny/Data-Structures-And-Algorithms | /Homeworks/File_Systems/main.cpp | UTF-8 | 2,925 | 3.84375 | 4 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
using namespace std;
struct Directory
{
Directory* parent;
string word;
map<string, Directory*> table;
Directory()
{
this->word = "/";
this->parent = nullptr;
}
};
class Path
{
Directory* root = new Directory();
Dir... | true |
1827225a20bc4a4feb4988115ba1b262eb0b74ea | C++ | dlgkrwns213/algorithm | /수학10 (baekjoon11050 - 이항 계수1) .cpp | UTF-8 | 305 | 3.453125 | 3 | [] | no_license | //기본적인 조합값 구하는 문제
#include <iostream>
using namespace std;
int fac(int big, int small);
int main()
{
int n, k;
cin >> n >> k;
cout << fac(n, n-k+1)/fac(k, 1);
return 0;
}
int fac(int big, int small)
{
int sum = 1;
for(int i=small;i<=big;i++)
sum *= i;
return sum;
}
| true |
b26f836209d9a8a04c569cf5a5d5e35c184ff106 | C++ | overaction/algorithm_problem_solution | /8.16 두니발 박사의 탈옥/8.16 두니발 박사의 탈옥/main.cpp | UHC | 2,022 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cmath>
using namespace std;
int C,N,D,P,T,Q;
int village[51][51], counts[51];
// cache[ ȣ][¥]
double cache[51][101];
/* Ž
double allSearch(vector < int > &path) {
// ¥ ߴٸ
if(path.size() == D+1) {
... | true |
addb790f394e12c2e25a8c96118fcb9ea7120684 | C++ | peterxie/482p2 | /old_tests/test_unlock_unowned_mutex.cpp | UTF-8 | 623 | 3.1875 | 3 | [] | no_license | #include "thread.h"
#include <iostream>
#include <exception>
using namespace std;
// This tests behavior of a thread unlocking a mutex
// owned by no thread
// Expected output:
// terminate called after throwing an instance of 'std::runtime_error'
// what(): Thread cannot unlock mutex it does not own.
// Aborted
... | true |
42e9635627d670f0b4c6a2a1748ad5e5f5a55510 | C++ | weimingtom/tanuki-mo-issyo | /プログラム/Ngllib/src/OpenGL/RendererGL.cpp | SHIFT_JIS | 15,077 | 2.578125 | 3 | [] | no_license | /*******************************************************************************/
/**
* @file RendererGL.cpp.
*
* @brief OpenGL _[NX\[Xt@C.
*
* @date 2008/07/20.
*
* @version 1.00.
*
* @author Kentarou Nishimura.
*/
/******************************************************************************... | true |
608934035dac1e4487d755b79233b23bf944bc9d | C++ | Easoncer/swordoffer | /sword_c++/UnionFindSet.cpp | UTF-8 | 2,155 | 3.40625 | 3 | [] | no_license | //
// Created by 李先生 on 2018/9/3.
//
#include <iostream>
#include <vector>
#include <map>
using namespace std;
map<char, int> rootdict; //key: root value: 结点值的数目
map<char, char> parent; //定义某个结点的父结点
void Make_Set(vector<vector<char>> relation)
{
for (int i = 0; i< relation.size(); i++)
{
rootdict[re... | true |
6572090a454599c38457c38fe5091683dd61b41a | C++ | rlannon/SIN-Language | /link/Linker.cpp | UTF-8 | 13,227 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "Linker.h"
void Linker::get_metadata() {
// iterate through the .sinc files to get the file metadata and ensure they are compatible
// if they aren't, throw an exception
// first, we need to get the wordsize and version of the 0th file; this will be our reference
uint8_t wordsize_compare = this->objec... | true |
ddb9e3b9a6f8e2ffd6ff902da3a7b0db156f036e | C++ | ngthvan1612/OJCore | /TestModule/HK1/Users/19110342/BAI1.CPP | UTF-8 | 440 | 3.140625 | 3 | [] | no_license | #include<iostream>
using namespace std;
void kt(int x, int y, int &a, int &b)
{
if(x==1&&y==3)
{
a+=3;
}
else if(x==3&&y==1)
b+=3;
if(x==3&&y==2)
{
a+=3;
}
else if(x==2&&y==3)
b+=3;
if(x==2&&y==1)
{
a+=3;
}
else if(x==1&&y==2)
b+=3;
if(x==y)
{
a++;
b++;
}
}
void main()
{
int a=0,b=0,c... | true |
01b1b483bfde83cb276a52ef4a5c1baae824434c | C++ | clubeccuffs/obi2018 | /uri2783.cc | UTF-8 | 639 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <vector>
using namespace std;
vector<bool> carimbada;
vector<int> figurinhas;
int main() {
int N, C, M;
cin >> N >> C >> M;
carimbada.assign(N, false);
figurinhas.assign(N, 0);
for(int i = 0; i < C; ++i) {
int x;
cin >> x;
cari... | true |
4b061b88f8ebd09775292ff5c54ef0fd6bd6d0da | C++ | MarcoLotto/ScaenaFramework | /Graphics/src/BasicForceMeshDeformationTFShader.cpp | UTF-8 | 3,332 | 2.515625 | 3 | [
"MIT"
] | permissive | /**********************************
* SCAENA FRAMEWORK
* Author: Marco Andrés Lotto
* License: MIT - 2016
**********************************/
#include "BasicForceMeshDeformationTFShader.h"
#include "GraphicDevice.h"
#include "WindowConnector.h"
//***PARAMETROS GENERALES************************************************... | true |
a0a95b56a284699830759f60fbdb0ceeb519d4f7 | C++ | vroussea/piscine_cpp | /D04/ex01/Character.cpp | UTF-8 | 2,910 | 2.921875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Character.cpp :+: :+: :+: ... | true |
0c740ed6eb133e77bb31befb696aae3b2107568e | C++ | clchen3667/algorithm-exercise | /heap/mergeToMaxHeap/heap_maker.cpp | UTF-8 | 538 | 3.3125 | 3 | [] | no_license | #include "heap_maker.h"
using namespace std;
void buildMaxHeap(vector<int>& arr, int num) {
for (int i = num/2 -1;i >= 0;i--)
maxHeapify(arr, num, i);
}
void maxHeapify(vector<int>& arr, int n, int idx) {
if (idx >= n)
return;
int l_child = 2 * idx + 1;
int r_child = 2 * idx + 2;
int max;
if (l_child < n &... | true |
ec94a5b0fcf5dffb51a693ca126d6eb6f3db61d4 | C++ | noeld/cpp | /cpp11/cpp11.cpp | UTF-8 | 1,534 | 2.8125 | 3 | [
"Unlicense"
] | permissive | //clang++ cpp11.cpp -std=c++11 -o cpp11
#include <iostream>
#include <thread>
#include <unistd.h>
#include <mutex>
#include <array>
#include <atomic>
#include <cstdint>
using namespace std;
long long func() {
cout << std::this_thread::get_id() << endl;
sleep(1);
return 7ll;
}
template<typename t> struct counterty... | true |
e41c573759496a0530d703a826a3bfea69cbbdaa | C++ | zhaodongzhi/leetcodeSolution | /Best_Time_to_Buy_and_Sell_Stock_IV.cpp | UTF-8 | 707 | 3.0625 | 3 | [] | no_license | class Solution {
public:
int maxProfit(int k, vector<int>& prices) {
if(k >= prices.size()/2)
{
int result = 0;
for(int i=1; i<prices.size(); ++i)
{
result += max(prices[i]-prices[i-1], 0);
}
return result;
}
... | true |
39d32db6ff235bd627ac6cecdf0909ad5b6e2b4f | C++ | xry224/newcode | /code/浮点数加法.cpp | GB18030 | 1,890 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
#define SIZE 3000
class BigFloat
{
public:
int Integer[SIZE] = { 0 };
int Decimal[SIZE] = { 0 };
BigFloat(string str)
{
int index = str.find(".");
for (int i = index - 1; i >= 0; i--)
{
int off = index - 1 - i;
Integer[SIZE - off ... | true |
0945d91ed0416eed0ef0625eaa97a911a90e9f0b | C++ | gtz12345/gao_tianze | /第四章/salary/main.cpp | UTF-8 | 254 | 3.015625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
float a;
float b=200;
float c;
while(a!=-1)
{
cout<<"Enter sales in dollars(-1 to end):";
cin>>a;
c=b+a*0.09;
}
cout<<"Salary is :$"<<c<<endl;
}
| true |