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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
112f5ce50dbea9d3be663a524c162930241981f8 | C++ | flashxio/FlashX | /libsafs/unit-test/GClock_unit_test.cpp | UTF-8 | 7,548 | 3 | 3 | [
"Apache-2.0"
] | permissive | #include <sys/time.h>
#include "gclock.h"
void testEnhancedGClock()
{
const int BUF_SIZE = 5;
enhanced_gclock_buffer buffer(BUF_SIZE);
LF_gclock_buffer lf_buffer(BUF_SIZE);
for (int i = 0; i < BUF_SIZE; i++) {
frame *f = new frame(i * PAGE_SIZE, (char *) NULL);
frame *f1 = new frame(i * PAGE_SIZE, (char *) NU... | true |
b895ecfa2f31bf51ae154866a3feaecc496e0460 | C++ | 5cript/mc-modpack-updater | /main.cpp | UTF-8 | 2,597 | 2.875 | 3 | [
"MIT"
] | permissive | #include "mod_list.hpp"
#include <iostream>
#include <filesystem>
using namespace std::string_literals;
int main()
{
ModList list;
list.load("modlist.json");
std::cout << "Enter command:\n";
std::cout << "\tu = update\n";
std::cout << "\tl = list new\n";
std::cout << "\tq = qu... | true |
d64dbf45b97980fc998e98096b8c87e6edfd1ecc | C++ | LaLlorona/Algorithms | /BOJ/10001To15000/11722.cpp | UTF-8 | 803 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <fstream>
#include <string>
#include <algorithm>
#include <cstring>
using namespace std;
int n;
int LIS[1001] = {1,};
int seq[1001] = {0,};
int CalcLIS() {
LIS [n - 1] = 1;
for (int i = n - 2; i >= 0; i--) {
for (int j = i + 1; j ... | true |
5212ab09e58a2d216eaf34d6d03f14195f9e81fe | C++ | kennethh387/proyecto_kenneth_hern-ndez_1190618 | /lista.h | UTF-8 | 2,057 | 3.640625 | 4 | [] | no_license | #pragma
#include "Comparar.h"
template <typename T>
class lista
{
struct Node
{
T* item;
Node* siguiente;
Node(T* item) {
this->item = item;
this->siguiente = nullptr;
}
};
Node* cabeza;
Node* cola;
int size = 0;
public:
int getSize() {
return this->size;
}
bool vacio() {
return this->size... | true |
3334d1f9e8ef0ef5fad18731f5279c7adbca3aaf | C++ | lkcbharath/CP-Solutions | /Codeforces/118A.cpp | UTF-8 | 431 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
str = "";
char c;
scanf("%c", &c);
c = tolower(c);
while (c >= 97 && c <= 122)
{
if (c != 'a' && c != 'e' && c != 'i' && c != 'o' && c != 'u' && c != 'y')
{
str += '.';
... | true |
a51622bc969cb722b38d41177e2a7ac2639b5922 | C++ | s4chin/UVa-Solutions | /00341.cpp | UTF-8 | 1,085 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
#define INF 1e9
int fw[15][15], p[15][15], n, d, r, source, destination, neighbor, number(0);
void printPath(int i, int j) {
if(i!=j) printPath(i, p[i][j]);
printf(" %d", j);
}
int main() {
while(true) {
scanf("%d... | true |
6efb8ff48ca0384b0968b919e0ae3d52fd0bedfe | C++ | bryce-bowers/CS-130A | /user_network.cpp | UTF-8 | 3,223 | 3.109375 | 3 | [] | no_license | #include "user_network.h"
#include "wall.h"
#include "user.h"
#include "doubly_linked_list.h"
#include <iostream>
#include <string>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
User* UserNetwork::QueryUser(string uname) {
DoublyLinkedList<User>::iterator it;
for (it = users.begi... | true |
7c8f3cf2e8ade751caac5ec031f3c46c0816db46 | C++ | SeungkwanKang/baekjoon_answers_cpp | /src/2231.cpp | UTF-8 | 429 | 2.671875 | 3 | [] | no_license | /* Copyright https://www.acmicpc.net/problem/2798
* Generator
* KangSK
*/
#include <iostream>
#include <cmath>
#include "includes/basics.hpp"
int main(void)
{
std::cin.tie(NULL);
std::ios_base::sync_with_stdio(false);
std::cout.precision(10);
int N;
std::cin >> N;
for (int i = 0; i < N; i++)
{
if ((i +... | true |
19171c69aedc4530f32630aa41317efd8447c9c8 | C++ | ljmccarthy/amp | /src/types.cpp | UTF-8 | 3,331 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <cstring>
#include <cassert>
#include "lisp.h"
Type *type_table[NUM_TYPE_CODES];
#define init_type(code, name) \
type_table[code] = new Type(code, make_symbol(name))
void
init_types(void)
{
init_type(TC_CONST, "const");
init_type(TC_BOOL, "bool");
init_type(TC_TYPE, "type");
init_type(TC_FIXNUM, "fixnum... | true |
1b5babdd2bfda423bdcfd496eec29d233b0d376c | C++ | unix1986/universe | /book/bookcode/4/4.17/CLMutex.cpp | UTF-8 | 1,275 | 3.046875 | 3 | [
"BSD-2-Clause"
] | permissive | #include "CLMutex.h"
#include "CLLogger.h"
CLMutex::CLMutex()
{
m_pMutex = new pthread_mutex_t;
m_bNeededDestroy = true;
int r = pthread_mutex_init(m_pMutex, 0);
if(r != 0)
{
delete m_pMutex;
CLLogger::WriteLogMsg("In CLMutex::CLMutex(), pthread_mutex_init error", r);
throw "In CLMutex::... | true |
0a6f1399f063bc493a92c994764605154258d7ac | C++ | AlvaroMonteagudo/PathTracer | /include/scene/Material.h | UTF-8 | 1,693 | 2.859375 | 3 | [] | no_license | #pragma once
#include <RGB.h>
#include <memory>
#include <Ray.h>
using namespace std;
class Material {
public:
Material(const RGB &kd = BLACK, const RGB &ks = BLACK, const RGB &kr = BLACK, const RGB &kt = BLACK, float shininess = 0.0f);
float getShininess() const;
Material operator + (const Material... | true |
3b00ce12746c46aecae356beb153b395a9f78fb8 | C++ | JJuniJJuni/algorithm | /backjoon/n_m/15651/15651/n_m_3.cpp | UTF-8 | 380 | 2.765625 | 3 | [] | no_license | #include <iostream>
using namespace std;
bool check[7];
int answers[7];
void go(int idx, int n, int m) {
if (idx == m) {
for (int i = 0; i < m; i++) {
cout << answers[i] << " ";
}
cout << "\n";
return;
}
for (int i = 0; i < n; i++) {
if (!check[i]) {
answers[idx] = i + 1;
go(idx + 1, n, m);
}
... | true |
9ff409160a28942cd8baa980db25a5583b2d7457 | C++ | Serwlashev/ElementaryTasks | /Task1/ChessboardFactory.cpp | UTF-8 | 639 | 2.640625 | 3 | [] | no_license | #include "ChessboardFactory.h"
std::unique_ptr<ISXField::Field> ISXBoardFactory::ChessboardFactory::Create(const std::string& height, const std::string& width)
{
unsigned int converted_height = 0;
unsigned int converted_width = 0;
converted_height = ISXChessParser::ChessboardParser::ParseToUI(height);
converted_w... | true |
fa540b7f78af6d9d67a7a8495bbada094397dce7 | C++ | makarenya/opengl_learn | /src/shader_set.h | UTF-8 | 2,260 | 2.515625 | 3 | [] | no_license | #pragma once
#include "model.h"
#include "shaders/scene.h"
#include "shaders/particles.h"
#include "shaders/shadow.h"
#include "shaders/depth.h"
#include <glm/glm.hpp>
class IShaderSet {
public:
virtual ~IShaderSet() = default;
virtual void Particles(glm::mat4 model, glm::mat4 single, const TMesh &mesh) = 0;
... | true |
b30d4f880963e9c38efff308e22beadcdd60e354 | C++ | tktk2104/TktkDirectX12GameLib | /TktkDirectX12GameLib/TktkDX12GameLib/inc/TktkDX12Game/DXGameResource/OtherResouse/Sound/SoundManager.h | SHIFT_JIS | 1,555 | 2.859375 | 3 | [] | no_license | #ifndef SOUND_H_
#define SOUND_H_
/* IXAudio2, IXAudio2MasteringVoice, HANDLE */
#include <xaudio2.h>
#undef min
#undef max
/* tktkContainer::ResourceContainer */
#include <TktkContainer/ResourceContainer/ResourceContainer.h>
namespace tktk
{
class SoundData;
// uSoundDatavǗNX
class SoundManager
{
public:
e... | true |
7049ab90f32c295c008c5a7accccd23320173d5e | C++ | sykzhong/SocketTest | /SocketTest/Main.cpp | UTF-8 | 552 | 2.703125 | 3 | [] | no_license | #include "SocketServer.h"
#include <thread>
#include <chrono>
#include <mutex>
std::chrono::milliseconds interval(10); //10ms time interval for mutex
std::mutex mtx;
void getSocketData(SocketServer socketserver)
{
socketserver.listenClient();
}
void processSocketData(SocketServer socketserver)
{
std::this_thread:... | true |
6db70fcf98d60887bb7093a65b735fb1f0ab5362 | C++ | verri/vlite | /vlite/binary_expr_vector.hpp | UTF-8 | 3,394 | 2.9375 | 3 | [
"Zlib"
] | permissive | #ifndef VLITE_BINARY_EXPR_VECTOR_HPP_INCLUDED
#define VLITE_BINARY_EXPR_VECTOR_HPP_INCLUDED
#include <vlite/common_vector_base.hpp>
#include <vlite/expr_vector.hpp>
#include <iterator>
namespace vlite
{
template <typename LhsIt, typename RhsIt, typename Op>
class binary_expr_vector : public expr_vector<Op>,
... | true |
966f7cc8ece8d7d0065b4decfd67504bf185db15 | C++ | ggu/routemaking_macOS_GUI | /RoutemakingGUI/wrapper.cpp | UTF-8 | 2,353 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// wrapper.cpp
// RoutemakingGUI
//
// Created by Gabriel Uribe on 7/27/16.
// Copyright © 2016 Gabriel Uribe. All rights reserved.
//
#include <stdio.h>
#include <PathfinderController.h>
#include <pathfinding/LocalPathfinder.h>
#include <pathfinding/Astar.h>
Boat SimpleAISBoat(double lat, double lon, int tru... | true |
3b423f217f539e225e671d43583b53d5b7cb0d6e | C++ | merkys/jsonapi-client-cpp | /src/Resource.h | UTF-8 | 691 | 2.65625 | 3 | [
"MIT"
] | permissive | #include<string>
#include<iostream>
#include<cstring>
#pragma once
#include"ResourceIdentifier.h"
#include <jsoncpp/json/json.h> //adding json header for second constructor
class Resource: public ResourceIdentifier{
private:
std::string attribute_name_;
std::string value_;
Json::Value JSON;
public:
Resou... | true |
581d0efc7cc3d5e93d695cafb131735566c580e9 | C++ | JuliaHarkins/Maze | /MazeProject/MazeCreater.cpp | UTF-8 | 7,509 | 3.1875 | 3 | [] | no_license | #include "MazeCreator.h"
#include "MazeObj.h"
#include "DoorObj.h"
#include <fstream>
#include <vector>
#include <random>
#include<map>
/**
loads defalt static maze
*/
MazeObj* MazeCreator::staticMaze() {
//creating the maze
MazeObj* maze = new MazeObj;
//creating Rooms
RoomObj* a = new RoomObj("A");
RoomObj* ... | true |
3a6fb5970bf197b8490cc94d31d6f7df15e1ac98 | C++ | pjdurden/Competitive-programming-templates | /trees.cc | UTF-8 | 2,842 | 3.921875 | 4 | [] | no_license | //tree class
struct Node {
int key;
Node *left, *right;
Node (int x)
{
key = x;
left = right = NULL;
}
};
//insert function
void insert(Node* temp, int key)
{
queue<Node*> q;
q.push(temp);
while (!q.empty()) {
Node* temp = q.front();
q.pop(... | true |
16ae5a2c64a08288c85d6ae5a78617f6f5c52ac5 | C++ | eyedeng/Algorithm | /all/list.cpp | ISO-8859-7 | 432 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <list>
using namespace std;
int main()
{
int len;
int ele;
list<int> lis;
cin>> len;
while(len--)
{
cin>>ele;
lis.push_back(ele);
}
int delele;
cin>> delele;
lis.remove(delele);
cout<<lis.size()<<": ";
for(list<int>::iterator... | true |
df48148afd31d9ce73d3f9b3b96aa21f0a61d374 | C++ | ebirenbaum/yurtcraft | /project/src/noise.h | UTF-8 | 663 | 2.796875 | 3 | [
"MIT"
] | permissive | #ifndef NOISE_H
#define NOISE_H
#include "vector.h"
class Noise {
public:
Noise(int seed);
virtual ~Noise();
float perlin2(const Vector2 &pos, float period);
float perlin3(const Vector3 &pos, float period);
private:
int fastFloor(float n);
float linterpolate(float a, float b, float x);
... | true |
06eed9671e97b86c11a2a506f5eadad98ad4250f | C++ | mjunior-fitec/52821-lora | /lib/lib_enddevice/otica_ftdi.cpp | UTF-8 | 3,444 | 2.59375 | 3 | [] | no_license | #include <cdcftdi.h>
#include <usbhub.h>
#include "abnt.h"
#include "otica_ftdi.h"
//#include "pgmstrings.h"
/*-----------------------------------------*/
/* Variáveis globais do módulo */
/*-----------------------------------------*/
USBHost UsbH;
FTDIAsync FtdiAsync;
FTDI Ftdi(&UsbH, &FtdiAsync);
uint8... | true |
cbff6b23d275f91b7b4e5b5cb124db9c8f99eb6f | C++ | ghiffaryr/Praktikum_PTI_CPlusPlus | /TP4/Penjumlahan 2 buah array/PB03-19817097-171109-07.cpp | UTF-8 | 698 | 3.3125 | 3 | [] | no_license | // NIM/Nama : 19817097/Ghiffary Rifqialdi
// Nama File : 19817097-171109-07
// Tanggal : 09/11/2017
// Deskripsi : Program untuk menjumlahkan 2 buah array
#include<iostream>
using namespace std;
int main(){
//Kamus
int N,i;
int A[100];
int B[100];
int C[100];
//Algoritma
co... | true |
9b99c8f51651eb8bf669dc6261251255ea0e4b4d | C++ | ACupofAir/C | /Algorithm/bomb_search.cpp | UTF-8 | 1,731 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <stdio.h>
//It is fun
using namespace std;
int main(void) {
int row, col;
cout<<"Set the map's row number: \n";
cin>>row;
cout<<"Set the map's col number: \n";
cin>>col;
char **map = new char *[row];
for(int i = 0; i < row; i++) {
map[i] = new char[col];
}
cout<<"... | true |
29b5ca712ec3f84b70bf67a3750d95865803b6cc | C++ | cuberite/cuberite | /src/Items/ItemBanner.h | UTF-8 | 3,673 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive |
#pragma once
#include "ItemHandler.h"
#include "../World.h"
#include "../Blocks/BlockHandler.h"
#include "../BlockEntities/BannerEntity.h"
#include "../Blocks/ChunkInterface.h"
class cItemBannerHandler final:
public cItemHandler
{
using Super = cItemHandler;
public:
using Super::Super;
private:
virtual ... | true |
ae538f4e9eb3680c4f7146e69ace73574841d181 | C++ | OnurArdaB/Bayes-Classifier | /sample/main.cpp | UTF-8 | 3,943 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
#include "naive-bayes/model.hpp"
using namespace std;
vector<string> split(const string& str, const string& delim){
vector<string> tokens;
size_t prev = 0, pos = 0;
do
{
pos = str.find(delim, prev);
if (pos == string::npos) pos = str.length();
string t... | true |
9c3e509ecefb5379369144951afc8d810056def1 | C++ | T-Bone-Willson/SET09121-GamesEngineering-Labs | /practical_4/cmp_player_movement.cpp | UTF-8 | 900 | 2.75 | 3 | [
"MIT"
] | permissive | #include "cmp_player_movement.h"
#include <SFML/Graphics.hpp>
using namespace sf;
using namespace std;
PlayerMovementComponent::PlayerMovementComponent(Entity* p) : ActorMovementComponent(p) {
}
void PlayerMovementComponent::update(float dt) {
// COPY AND PASTED FROM "player.cpp"
// Movement
sf::Vector2f disp... | true |
f341d395f2f420278d13a72c43904c1e8ce46cdb | C++ | BrStall/uri-solutions-c- | /1080 - Maior e posição.cpp | UTF-8 | 294 | 2.9375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int X, pos = 0, maior = 0;
for (int i = 0; i < 100; i++)
{
cin >> X;
if (X > maior)
{
maior = X;
pos = i;
}
}
cout << maior << endl;
cout << pos+1<< endl;
}
| true |
c9e19a91f999cfd98ef47bb0db9ee30f66fc8463 | C++ | WuZixing/Geo3DML-CPP | /include/geo3dml/CuboidVolume.h | UTF-8 | 1,692 | 3.015625 | 3 | [
"MIT"
] | permissive | // UTF-8编码
#pragma once
#include "Volume.h"
namespace geo3dml {
/// @brief 大小不一的六面体(如长方体)单元构成的体。
class CuboidVolume : public Volume {
public:
CuboidVolume();
virtual ~CuboidVolume();
/// @name 读写顶点的方法。
///@{
/// @brief 添加一个顶点。
/// @param x 顶点的坐标:x。
... | true |
7d0fce7abd32682e9ad32fa904fed21a69e09d7c | C++ | linton-dawson/collections-cpp | /queue/queue.cpp | UTF-8 | 530 | 3.421875 | 3 | [] | no_license | #include "queue.h"
#include <iostream>
using namespace std;
Queue::Queue(const int sz)
{
size = sz;
vec.reserve(sz);
head = -1;
tail = -1;
}
void Queue::enqueue(const int num)
{
vec.push_back(num);
if(head == -1 && tail == -1) {
head++;
tail++;
}
else {
tail++;
}
}
void Queue::dequeue()
... | true |
e116f9ebb971dbac9c5e23946c6d3c08c665aa9c | C++ | vamsi12340/entify | /src/registry.cc | UTF-8 | 1,401 | 2.515625 | 3 | [] | no_license | #include "entify/registry.h"
#include "context.h"
#include "renderer/backend.h"
EntifyContext EntifyCreateContext() {
return new entify::Context(entify::renderer::MakeDefaultRenderer());
}
void EntifyDestroyContext(EntifyContext context) {
delete static_cast<entify::Context*>(context);
}
EntifyReference EntifyT... | true |
548c39ef338b8068c2ad4766d87af0a86d66fc91 | C++ | Deepakku28/Leetcode | /560. Subarray Sum Equals K.cpp | UTF-8 | 377 | 2.609375 | 3 | [] | no_license | class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
int n=nums.size();
for(int i=1;i<n;i++){
nums[i]+=nums[i-1];
}
int count=0;
unordered_map<int,int> mp;
mp[0]++;
for(int i=0;i<n;i++){
count+=mp[nums[i]-k];
... | true |
d33cb8ef783345e93a95a9551d4d73ee7de2a576 | C++ | chjesus/Estructura-de-Datos | /Parcial II/Parcial 2 - 2018-3/Problema 2/Principal.h | ISO-8859-10 | 8,490 | 2.90625 | 3 | [] | no_license | #ifndef PRINCIPAL_H
#define PRINCIPAL_H
#include <fstream>
#include <stdlib.h>
#include <conio.h>
#include "Genero.h"
#include "Canciones.h"
using namespace std;
class Principal{
fstream genero,canciones;
ListDinSimple<Genero> listaGen;
string cadena;
char *auxCadena;
public:
void Main();
void separarGene... | true |
525f3da93595a7c132f1dab14738452362779a39 | C++ | RTRTextures/project | /common/include/Renderer.h | UTF-8 | 5,612 | 2.953125 | 3 | [] | no_license | /// @file Renderer.h
/// @brief Defines the interface between OpenGL generic host process and its pluggable 'Renderer' clients
/// Host: Framework OpenGL host process which will load multiple renderers for rendering a scene
/// Renderer: Implementer of the scene container in its class
#ifdef _WIN32
#incl... | true |
504391134bb6968691c684123a9e455ecd998b18 | C++ | MichaelMGabriel/MasliMichael_CSC5_43952 | /Lab/TruthTable_1/main.cpp | UTF-8 | 2,886 | 3.421875 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Michael Masli
*
* Created on March 18, 2015, 10:02 AM
*
*/
#include <iostream>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
//Declare Variables
bool x,y;
//Heading
cout<<"X Y !X !Y X&&Y X||Y X^Y X^Y^Y X^Y^X "
<<"!(X&&... | true |
83d5eccab7929274a1e161bf02e72ce16568f4cc | C++ | Li2012/AdvCiv | /CvGameCoreDLL/WarAndPeaceCache.h | UTF-8 | 9,935 | 2.6875 | 3 | [] | no_license | #pragma once
#ifndef WAR_AND_PEACE_CACHE_H
#define WAR_AND_PEACE_CACHE_H
#include "CvEnums.h"
#include "CvDeal.h"
#include "CvInfos.h"
#include "MilitaryBranch.h."
#include <vector>
/* <advc.104>: Cached data used by the war-and-peace AI. Each civ has its own
cache. That said, each civ's cache also co... | true |
86655428d7936c5e1c2d0abd17c67511ed8b7c65 | C++ | IIvexII/CS | /PF-CSC313/Loops/c2.cpp | UTF-8 | 651 | 3.734375 | 4 | [] | no_license | /*
Date: 9-12-2020
Purpose: Print half pyramid using numbers
Author: Zafeer
*/
#include <iostream>
using namespace std;
int main(){
int total_rows;
cout << "Enter number of rows: ";
cin >> total_rows;
// This for loop will run untill the
// rows are less or equal to the total rows.
... | true |
06cf08ae0f889f28c748b2591287982700be2ba9 | C++ | AlexTangus/CHAT | /version_1/Chat/server/first_implement/main.cpp | UTF-8 | 5,792 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <memory>
#include <thread>
#include <atomic>
#include <mutex>
#include <map>
#include <boost/asio.hpp>
using std::cout;
using std::cin;
using std::endl;
using std::cerr;
std::map<std::string, std::shared_ptr<boost::asio::ip::tcp::socket>> name_sock;
std::mutex all_thread_guard;
class Ser... | true |
18f4683a95034159ff31513b2d34b22f33244d1c | C++ | tonycar12002/leetcode | /Cpp/26. Remove Duplicates from Sorted Array.cpp | UTF-8 | 383 | 2.875 | 3 | [] | no_license | /*
Author: Tony Hsiao
Date: 2019/04/30
Topic: 26. Remove Duplicates from Sorted Array
Speed: 24 ms
Note:
*/
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int record = 0 ;
for(int i=0;i<nums.size();i++){
if(i==0 || nums[i] != nums[i-1]){
nums[record++]... | true |
266cadcc9db9c8dbdba8b30097ce23d1e8aa1dbe | C++ | bliou/TheQuestOfTheBurningHeart | /TheQuestOfTheBurningHeart/TimedTileData.h | UTF-8 | 560 | 2.515625 | 3 | [] | no_license | #pragma once
#include "AbstractSolidBlockTileData.h"
class TimedTileData: public AbstractSolidBlockTileData
{
public:
TimedTileData(
float timer = 2.f,
bool reset = false,
float resetTimer = 5.f
);
~TimedTileData();
virtual void initializeEntity(
std::string dataId,
anax::Entity& entity,
GameScreen& g... | true |
b73440fc9b742c97e2254711ce781d3bc307d239 | C++ | KingsleyYau/LiveClient | /common/ImClient/TransportClient.cpp | UTF-8 | 9,346 | 2.546875 | 3 | [] | no_license | /*
* author: Samson.Fan
* date: 2017-05-18
* file: TransportClient.cpp
* desc: 传输数据客户端接口类(负责与服务器之间的基础通讯,如Tcp、WebSocket等)
*/
#include "TransportClient.h"
#include <common/KLog.h>
#include <common/CommonFunc.h>
const long long WEBSOCKET_CONNECT_TIMEOUT = 30*1000; // websoecket超时(毫秒)
TransportClient::Tran... | true |
0fe491ec22ec6a7559fb03ecd6cb3f5e302cc5d0 | C++ | ndsambare/dequeCplusplus | /deque_assignment/deque_assignment/deque_assignment.cpp | UTF-8 | 507 | 2.578125 | 3 | [] | no_license | // deque_assignment.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <deque>
#include "my_deque.h"
using namespace std;
int main()
{
//my_deque d = my_deque(init_size);
//for (int i = 0; i < n; i++) {
// d.push_back(i);
//
//}
//for (in... | true |
8ca6766f8be8e1f186f3389c9b34672b8d065fba | C++ | zarif98sjs/Competitive-Programming | /Spoj/SPOJ LOCKER.cpp | UTF-8 | 2,283 | 2.859375 | 3 | [] | no_license |
/**
Idea : Try to make n with numbers such that sum is n and the product is maximum
2 = 2
3 = 3
4 = 2+2 -> 2*2 = 4
5 = 2+3 -> 2*3 = 6
6 = 3+3 -> 3*3 = 9
7 = 3+4 = 3 + 2 + 2 -> 3*2*2 = 12
8 = 3+3+2 -> 3*3*2 = 18
9 = 3+3+3 -> 3*3*3 = 27
Slowly you will see that all the numbers can be made with 2 and 3 . Finding the f... | true |
569c356ab8280443f2319816594869bc11983bc7 | C++ | godls1650/ByteC | /구직자_오후/CPP/03.Friend/Point.h | UHC | 1,207 | 3.40625 | 3 | [] | no_license | #pragma once
#include <ostream>
#include <istream>
class Point{
friend std::ostream& operator<<(std::ostream& os ,const Point & target);
friend std::istream& operator>>(std::istream& in, Point& target);
private:
int X;
int Y;
public :
Point(int x = 0, int y = 0);
Point(const Point& ref);
void showPoint();
//
... | true |
1392f45f250919d6e0c2382a269d9918a3c8f232 | C++ | Heatclif/C- | /football.cpp | UTF-8 | 4,134 | 2.859375 | 3 | [] | no_license | /*
THIS PROGRAM IS DEVELOPED BY VIVEK BISWAS OF CLASS 11-A 2015-2016.
NO HAS THE RIGHT TO COPY THIS TO ANOTHER PROGRAM OR COMPUTER.
THIS IS A COPYRIGHT PROGRAM COPYING THIS IS A PUNISHABLE OFFENCE.
PRATCING SO MIGHT LEAD TO THE DOER LIFETIME IMPRISONMENT IN CELLULAR
JAIL IN ANDAMAN.
*/
#include<iostream>
#include... | true |
9a468ea674fd523ec5a4021f71d431ca40227194 | C++ | Autonomous-Wang/Leetcode | /randomnumber.cpp | UTF-8 | 264 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <random>
using namespace std;
int main()
{
default_random_engine generator;
uniform_int_distribution<int> distribution(1,6);
int dice = bind(distribution, generator);
int wisdom = dice()+dice()+dice();
cout << wisdom << endl;
}
| true |
02997d163f8c22afb51d109a2e21352a19befaf2 | C++ | Pafaul/SD | /LA.cpp | UTF-8 | 7,566 | 3.15625 | 3 | [] | no_license | #include "LA.h"
#include <cstring>
#include <math.h>
TVector::TVector() : n(0), data(nullptr) {}
TVector::TVector(int n) : n(0), data(nullptr)
{
resize(n);
}
TVector::TVector(const TVector& rval) : n(0), data(nullptr)
{
*this = rval;
}
TVector& TVector::operator = (const TVector& rval)
{
if (n != rval.n... | true |
492367c6b1c56261595c96ae50da126886ce4620 | C++ | AntonyMoes/tp-algo | /ДЗ3/task1/CArcGraph.h | UTF-8 | 587 | 2.6875 | 3 | [] | no_license | //
// Created by antonymo on 21.12.18.
//
#ifndef TASK1_CARCGRAPH_H_
#define TASK1_CARCGRAPH_H_
#include <cstddef>
#include "IGraph.h"
class CArcGraph : public IGraph{
public:
explicit CArcGraph(IGraph* graph);
explicit CArcGraph(size_t size);
void AddEdge(int from, int to) override;
int VerticesC... | true |
193028eb92bd1f1b43b8628f25c304ac1534a597 | C++ | karanpratap/CNS_LAB | /Labset_6/program.cpp | UTF-8 | 1,664 | 3.078125 | 3 | [] | no_license | //Author: karanpratap
//Program: 48-bit input generation for S-box
#include<bits/stdc++.h>
#include "../headers/conversions.h"
using namespace std;
//global initializations
// Expansion Table (E)
int expansionTable[8][6]={{32,1,2,3,4,5},{4,5,6,7,8,9},{8,9,10,11,12,13},{12,13,14,15,16,17},{16,17,18,19,20,21},{20,21,2... | true |
c14c6d4a89a5db92104e29f71f3c8844db770905 | C++ | vxl/vxl | /contrib/brl/bseg/bstm_multi/space_time_scene.h | UTF-8 | 8,288 | 2.53125 | 3 | [] | no_license | #ifndef bstm_multi_space_time_scene_h_
#define bstm_multi_space_time_scene_h_
//: \file space_time_scene.h
//
// \brief space_time_scene is a scene that represents a 3D
// volume of space over time. It contains a 4D grid of blocks that
// each model a region of that space. The scene data structure is
// templated over... | true |
e4a8bd6db26692121089850aae645560abbbe6f1 | C++ | sureshyhap/Schaums-Outlines-Programming-with-C-plus-plus | /Chapter 13/Problems/6/6.cpp | UTF-8 | 2,908 | 3.765625 | 4 | [] | no_license | #include <iostream>
template<typename T>
class Vector {
public:
Vector(int c = 100) : capacity(c), present_size(0) {data = new T[capacity];}
Vector(T* a) : present_size(sizeof(a)), capacity(present_size) {
data = new T[present_size];
for (int i = 0; i < present_size; ++i) {
data[i] = a[i];
}
}
... | true |
05ed8d4d5e10eab522e5a55139c92a56963cf819 | C++ | JoeGeC/GamesEngineConstruction | /HAPI_Start/Rectangle.h | UTF-8 | 469 | 3.4375 | 3 | [] | no_license | #pragma once
class Rectangle
{
public:
Rectangle();
~Rectangle();
int m_left, m_right, m_top, m_bottom;
Rectangle(int l, int r, int t, int b) : m_left(l), m_right(r), m_top(t), m_bottom(b) {};
Rectangle(int w, int h) : m_left(0), m_right(w), m_top(0), m_bottom(h) {};
int Width() const { return m_right - m_left... | true |
4b26ca5d8b908b869477fefa11e08a70a3e2f101 | C++ | godofthunder8756/CCOS-2.0 | /CCOS/Memory.cpp | UTF-8 | 1,386 | 3.1875 | 3 | [
"MIT"
] | permissive | #include "Memory.h"
void memset(void* start, uint_64 value, uint_64 num) {
if (num <= 8) {
uint_8* valPtr = (uint_8*)&value;
for (uint_8* ptr = (uint_8*)start; ptr < (uint_8*)((uint_64)start + num); ptr++) {
*ptr = *valPtr;
valPtr++;
}
return;
}
uint_64 proceedingBytes = num % 8;
uint_64 newnum = ... | true |
e66e4297908c77aa74c3c50aef5caa12c4e5ec00 | C++ | AlexShten/Phone | /OurPhone/PhonList.cpp | WINDOWS-1252 | 28,715 | 2.515625 | 3 | [] | no_license | #include "stdafx.h"
using namespace std;
PhonList::PhonList()
{
Head = nullptr;
Tail = nullptr;
count = 0;
onceEnter = 0;
myOperator = " ";
}
PhonList::~PhonList()
{
delete[] Head;
delete[] Tail;
}
void PhonList::ShowPB()
{
}
void PhonList::FacePaint()
{
cout << "\n\t\t\t ";
cout << "\n\t\t\t ";... | true |
9d8c7666ce75f28554df79bd01059ef8401eb908 | C++ | OrangeJuice7/SDL-OpenGL-Game-Framework | /src/Scene/Model/EntityManager.hpp | UTF-8 | 4,673 | 3.0625 | 3 | [
"MIT"
] | permissive | #ifndef ENTITY_MANAGER_HPP
#define ENTITY_MANAGER_HPP
#include <forward_list>
#include <functional>
#include "../../util/math.hpp"
class GameModelManager;
class UiManager;
template <class TEntity>
class EntityManager {
// Let all the different EntityManager<> classes talk to each other
// Needed for checkColl... | true |
f8b01f945c7a4d046346bc7283c85d41118d0ad9 | C++ | ljhg1124/Data_structure | /BFS/BFS.cpp | UTF-8 | 1,025 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define NUM 9
bool chk[NUM];
vector<int> node_Tree[NUM];
void bfs(int start) // 시작 인덱스값을 할당.
{
queue<int> q; // 탐색 순서를 담을 큐
q.push(start); // 시작 인덱스 값 push
chk[start] = true; // start 먼저 체크 하였으니 true
while(!q.empty()) ... | true |
ec3ce2980f4b521531f01d65b7558b1300925638 | C++ | zyex1108/DataStructures | /binary_tree/CharBinaryTree/CharBinaryTree/CharTree.cpp | UTF-8 | 545 | 2.96875 | 3 | [] | no_license | //
// CharTree.cpp
// CharBinaryTree
//
// Created by Ming Chow on 10/20/11.
// Copyright 2011 Tufts University. All rights reserved.
//
#include "CharTree.h"
#include <iostream>
using namespace std;
CharTree::CharTree()
{
root = NULL;
}
void CharTree::buildRoot(char someChar)
{
root = new TreeNode;
... | true |
f7115eba8a2acc75a771a074ba098023d1c766e1 | C++ | randomascii/blogstuff | /timer_interval/count_interrupts.cpp | UTF-8 | 2,720 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | /*
Copyright 2020 Cygnus Software. All Rights Reserved.
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 applicable law or... | true |
fe962f90faa3c96518230e9f8856309addf14954 | C++ | jamesptanner/arduino-arc-reactor | /spinner.h | UTF-8 | 940 | 2.859375 | 3 | [] | no_license |
#ifndef SPINNER_H
#define SPINNER_H
#include "arcreactor.h"
class Spinner : public Mode
{
private:
static const int loopTrails = 3;
static constexpr Colour loopColour = {20,20,40};
static const int loopLevels = PIXELCOUNT / loopTrails;
Colour looptable[loopLevels] ={};
int spinStep =0;
public:
Spinne... | true |
d07bfc1df8bba5bb7abf7474fbefcfd296c67b38 | C++ | karikera/ken | /KR3/msg/pump.h | UHC | 5,749 | 2.546875 | 3 | [] | no_license | #pragma once
#include <KR3/util/callable.h>
#include <KR3/util/keeper.h>
#include <KR3/mt/criticalsection.h>
#ifdef WIN32
#include <KR3/win/threadid.h>
#endif
#include "promise.h"
namespace kr
{
struct EventProcedure
{
EventHandle * event;
void * param;
void(*callback)(void*);
};
class EventPump:public In... | true |
c9b5863212d262f1e47b10ca962191285352c32f | C++ | kdaiki211/modern_cpp_challenge | /8/67.cpp | UTF-8 | 3,303 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
string InputPassword(void)
{
string password;
// TODO: disable echoback
cin >> password;
// TODO: enable echoback
return password;
}
class Checker {
public:
virtual bool isSatisfied(string password) = 0;
};
class... | true |
6ba332c310da2878260bac172d889542605bf2b7 | C++ | kellyualberta/Algorithms-Data-Structures | /Zenefits/travelMoney1.cpp | UTF-8 | 627 | 3.3125 | 3 | [] | no_license | #include "head.h"
class Solution{
int m;
int n;
public:
int travel(vector<vector<int>> matrix, int k){
m = matrix.size();
n = matrix[0].size();
int ret = INT_MAX;
bfs(0, 0, k, ret, matrix);
return ret;
}
void bfs(int i, int j, int left, int& ret, vector<vector<int>> &matrix){
left -= matrix[... | true |
ff251b5455855cd3932bd730697dcdafb00c495d | C++ | Miheel/Intro-Cpp | /Project/validInput.cpp | UTF-8 | 1,837 | 3.265625 | 3 | [] | no_license | //Namn: Mikael Leuf
//Datum: 2020-01-10
//Kurs: Introduktion till programering
//Lab: Project Contact
#include "validInput.h"
void isValidInput(std::string &contactMember, const REGFILTER ®Filter)
{
bool isValid = false;
std::regex regularFilter;
std::string errFormMsg = "The string must be on the specified for... | true |
1ac5efed8ced1c09ec61d8d521dfe6f469452a60 | C++ | gustn158/public | /[BOJ] SOLUTIONS/[BOJ] SOLUTIONS/[BOJ]3948.cpp | UHC | 1,791 | 3.53125 | 4 | [] | no_license | /*
̰ 簢 ̰ ־ ִ. ̸ Į ߶ ̰ 簢 ǵ ϰ Ѵ.
Į ̸ ڸ Ģ .
ڸ Ǵ ȴ. , 缱δ ڸ .
ڸ Į ٲ .
ڸ ߿ Į . , ϴ ڸ ϸ ݵ ѷ и ڸ.
߷ ̴ ̾ Ѵ.
Ģ ־ 簢 ̸ ߶ 簢 ǵ ϵ, ߷ ּҰ ǵ ϰ Ѵ.
, Ʒ Ͱ ̰ 5 6 ̰ ־ , ּ 簢 ڸ Ʒ .
#include <iostream>
#include <algorithm>
using namespace std;
int n, m;
int cache[10001][101];
c... | true |
fdc554ebfe4725bb0ca6e5f5bf4d4e76427af235 | C++ | luismoax/Competitive-Programming---luismo | /COJ_ACCEPTED/2548 - Gross Weight.cpp | ISO-8859-1 | 779 | 2.9375 | 3 | [] | no_license | /*
Author: Luis Manuel Daz Barn
Problem: 2548 - Gross Weight
Online Judge: COJ
Idea: Precalculate all P^K elements then greedy
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#define ll long long
using namespace std;
ll P, G;
ll used[501];
int calc()
{
used[0] = 1;
int idx = ... | true |
979d0087b314d30067b93adeeda1d6fc8eb763f2 | C++ | dreamTeamHack/SubiForever | /MathematicModel/Utils.hpp | UTF-8 | 389 | 3.21875 | 3 | [] | no_license | #ifndef UTILS_HPP
#define UTILS_HPP
#include <cmath>
class Angle
{
public:
float radians = 0.0;
float getDegrees() const;
Angle();
Angle(float radians);
Angle(const Angle& angle);
};
static constexpr float radians2degrees(float rad){
return rad * 180 / M_PI;
}
static constexpr float... | true |
c2dfff61323e1c5e3f4321a165c84dbfa32b1620 | C++ | crandino/Stack | /UnitTest1/unittest1.cpp | UTF-8 | 3,502 | 3.0625 | 3 | [] | no_license | #include "stdafx.h"
#include "CppUnitTest.h"
#include "../Stack.h"
#include "../Queue.h"
#include "../Trees.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace UnitTest1
{
TEST_CLASS(UnitTest1)
{
public:
// ----------------------------
// STACK
// -----------------------... | true |
4c4fefcf71256ddc27b0b281b9ceae3fb8636d97 | C++ | KenjuDari/crutches | /program/tsoy_d_a/rect2d/rect2d_test.cpp | WINDOWS-1251 | 746 | 3.296875 | 3 | [] | no_license | #include"rect2d.h"
#include<iostream>
#include<sstream>
using namespace std;
int main()
{
cout << "constructor without paramentrs: r1";
Rect2d r1;
cout << r1 << endl;
cout << "constructor with 4 paramentrs: r2";
Rect2d r2(-1, 0, -6, 4);
cout << r2 << endl;
cout << "constructor with 2 paramentrs... | true |
d2b46cd7e8a09da9ff19648301f390b6f2bf18bb | C++ | shurcooL/Hover | /HoverSource/common/stuff.cpp | UTF-8 | 2,795 | 2.5625 | 3 | [
"MIT"
] | permissive |
#include "common.h"
void CRectRegion::Set( INT32 sx, INT32 sz, INT32 ex, INT32 ez ){
startX = sx;
startZ = sz;
endX = ex;
endZ = ez;
}
void CRectRegion::Clip( INT32 sx, INT32 sz, INT32 ex, INT32 ez ){
if( startX < sx ){ startX = sx; }
if( startZ < sz ){ startZ = sz; }
if( endX > ex ){ endX = ex... | true |
59fa032750799a21cd3e9d33ac5290533a052804 | C++ | astraizer/algoFJ | /Soal/Day 2/S.cpp | UTF-8 | 301 | 2.875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
int main(){
int t;
scanf("%d",&t);
for(int tc=0;tc<t;tc++){
char s[1000];
scanf("%s",s);
for(int i=0;i<strlen(s)/2;i++){
char temp = s[i];
s[i]=s[strlen(s)-1-i];
s[strlen(s)-1-i] = temp;
}
printf("Case #%d : %s\n",tc+1,s);
}
return 0;
}
| true |
7b989b8317c7113b6441ca99005b5d2f549213c0 | C++ | RyanDJSee/CC3k | /wd.cc | UTF-8 | 538 | 2.515625 | 3 | [] | no_license | #include "potion.h"
#include "wd.h"
#include <memory>
using namespace std;
bool WD::wasUsed=false;
WD::WD(int chamber, int r, int c, int amt):
Potion(chamber, r, c, amt) {} //constructor, default amt is for cell on Floor
void WD::notify(shared_ptr<Subject>& whoNotified) {
// wN called this.notify(wN), thi... | true |
ae2065bb9ce6d5d632263f1033a48755bc6af07e | C++ | Haut-Stone/ACM | /INBOX/游戏币问题(简单dp).cpp | UTF-8 | 1,392 | 3.21875 | 3 | [] | no_license | /*问题概述: 在一个n*m的矩形方格里,每个网格里有一定数量的游戏币.我们可以控制机器人从左上角出发,到右下角
结束,并且会拾取沿途经过的格子里的游戏币,请计算机器人最富能得到多少游戏币
输入样例: 对应输出:
3 4 24
3 1 2 8
5 3 4 6
1 0 2 3
*/
#include <stdio.h>
int main(void)
{
int i, j;
int m, n;
int map[22][22] = {0};
int dp[2... | true |
3e0679943796ec232b2325a7eaa783cb4209e753 | C++ | henry-banks/Base | /Example/Factory.h | UTF-8 | 6,627 | 2.90625 | 3 | [] | no_license | #pragma once
#include "Entity.h"
class Factory
{
ObjectPool<Entity> entities;
// The factory will store an object pool for each component type
ObjectPool<Transform> transforms;
ObjectPool<Rigidbody> rigidbodies;
ObjectPool<Collider> colliders;
ObjectPool<Sprite> sprites;
ObjectPool<Lifetime> lifetimes;
... | true |
e386e907d3627bb56daa06042235edb5cf02f16d | C++ | lorenmanu/variado | /ugr_ig-master/P4/Robot.cc | UTF-8 | 4,545 | 2.78125 | 3 | [] | no_license | /*
* Jesús Ángel González Novez
* Práctica 4 IG
*
*/
#include "Robot.h"
Robot::Robot() {
posicion = 0;
baile = false;
}
Robot::Robot(const Robot& orig) {
}
void Robot::draw(int giro, int gla, int gra, int grl, int gll, int tipo) {
modo = tipo;
if (tipo == 0) {
glPolygonMode(GL_FRONT_AND_... | true |
a1d3f3d0c8a5d8f5afe9c8104cb7812928dfcbb5 | C++ | manuel-delverme/crop_row_detection | /crop_row_detection_cpp/src/ImagePreprocessor.cpp | UTF-8 | 3,580 | 2.90625 | 3 | [] | no_license | //
// Created by noflip on 21/11/16.
//
#include <string>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <CropRowDetector.h>
#include "ImagePreprocessor.h"
namespace crd_cpp {
ImagePreprocessor::ImagePreprocessor(cv::Size target_size) {
m_image_size = target_size;
}
cv::Mat ImagePrepr... | true |
24ce3f6f9e5227c13f7f03d512684178dd3af678 | C++ | Kaboms/CmdTetris | /Tetris/CMDGui.h | UTF-8 | 982 | 2.5625 | 3 | [] | no_license | #pragma once
//----------------------------------------------------------------------
#include <Windows.h>
#include <stdint.h>
//----------------------------------------------------------------------
namespace CMDGui
{
enum Color
{
Black = 0,
Blue = 1,
Green = 2,
Aqua = 3,
Red = 4,
Purple = 5,
Yellow = ... | true |
7fc9fb1790fdaa5f418ed61bfb2ee4599e84b038 | C++ | info-rick/proj-bacpfsec | /Bacpfsec_V2/TimelineHor.cc | UTF-8 | 1,194 | 3.109375 | 3 | [] | no_license | /**
* @file TimlineHorr.cc
* @Author Bacpfsec Rick
* @date 20150416
* @brief Implementation of TimelineHor Class
*
* TimelineHor is concrete implementation for Timeline Interface
*/
#include "TimelineHor.h"
void TimelineHor::timeline(std::ostream& os, std::vector<Task>& ts,
Date s, Date e, Date st,... | true |
b8e982d15fb19a02cfc90d6a7fc1bfbc37c62a43 | C++ | ljt141421/DataStructure | /sequenceList/sequence.cpp | GB18030 | 9,071 | 3.328125 | 3 | [] | no_license | #include<stdio.h>
#include<malloc.h>
#include<assert.h>
#define SEQLIST_INIT_SIZE 8//ʼռ
#define INC_SIZE 4//ռ
typedef int ElemType;
//ṹ
typedef struct SeqList
{
ElemType *base; //Ŀռ
int capacity; //
int size; //ĴС
}SeqList;
//Ϊ
void InitList(SeqList *list);
bool Inc(SeqList *list);
void push_back(SeqList *... | true |
d6260498c8da353135490ae1308cd9d6771d73d6 | C++ | BUPTxuxiangzi/xxz_leetcode | /leetcode_4_MedianofTwoSortedArray.cpp | UTF-8 | 3,853 | 4.21875 | 4 | [] | no_license | /*
Median of Two Sorted Arrays
Total Accepted: 43715 Total Submissions: 244807
There are two sorted arrays A and B of size m and n respectively.
Find the median of the two sorted arrays. The overall run time
complexity should be O(log (m+n)).
Tags: divide and conquer, array, binary search
*/
//这是一道非常经典的题。这题更通用的形式是,... | true |
328f4f6cc6db8a964d6ea8c75859b6e607e88cf6 | C++ | yquemener/ModelKeynes | /src/bot.h | UTF-8 | 1,563 | 3 | 3 | [] | no_license | #ifndef BOT_H
#define BOT_H
#include <string>
#include <list>
#include <map>
#include "types.h"
#include "market.h"
#include "good.h"
namespace Econ{
class IndustrialNode;
/// Bot simulates an economical agent. It "lives" in an IndustrialNode and has
/// access to the markets the industrial node is linked to. There... | true |
c6d239d4defa97d7cfb5de33bd68de591cdd2cf3 | C++ | jtlai0921/PG20045_example | /pg20045日文原始程式碼/chap15/stack.h | SHIFT_JIS | 1,154 | 3.515625 | 4 | [] | no_license | //----------------------------------------------------------------------------//
// X^bNNXev[g Stack "stack.h" //
//----------------------------------------------------------------------------//
//===== X^bNNXev[g =====//
template <class Type> class Stack {
private:
int size; // z̗vf
Type* ptr; ... | true |
e1870fd5c29882d2b96f7bf0a95dd17cb6e17960 | C++ | rubaiyat6370/Accepted-Solutions | /UVA/11624-Fire!.cpp | UTF-8 | 3,537 | 2.984375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#define S 1001
using namespace std;
struct point {
int x;
int y;
int dis;
};
char input[S][S];
int fireVisited[S][S];
int joeVisited[S][S];
int R, C;
int minimum;
point queue[1000002];
int first, last;
void initData() {
minimum = 999999999;
for (int i = 0;i ... | true |
d646ff45c356031e1c878ec53b0ecb13890f8b1a | C++ | estebanpw/repkiller | /src/SequenceOcupationList.cpp | UTF-8 | 2,959 | 3.125 | 3 | [] | no_license | #include "SequenceOcupationList.h"
SequenceOcupationList::SequenceOcupationList(double len_ratio, double pos_ratio, uint64_t seq_size)
: len_ratio(len_ratio), pos_ratio(pos_ratio), max_index(seq_size / DIVISOR),
ocupations(new forward_list<SequenceOcupationList::Ocupation>*[max_index + 1]) {
for (size_t i = 0; i... | true |
9d7be7909c2521a48d956477b588292829c9423e | C++ | joshua-lucier/Apriori | /FinalProject/main.cpp | UTF-8 | 909 | 2.96875 | 3 | [] | no_license | /* ***
* Changed: Joshua Lucier & Ryan Moss
* Last Update: December 5, 2014
* Class: CSI-281
* Filename: main.cpp
*
* Description:
* main logic of program
*
* Certification of Authenticity:
* I certify that changes to this assignment are entirely my own work.
****************************... | true |
4c3a34f53572420a444cd572f740f86b0ef60d15 | C++ | Rbtsv2/training | /Arme.h | UTF-8 | 280 | 2.65625 | 3 | [] | no_license | #pragma once
#include "Arme.h"
#include <string>
class Arme
{
public:
Arme(); // constructor par default
Arme(std::string nameArme, int degatsArme);
int getDegats() const;
void changer(std::string nom, int degats);
private:
std::string m_name;
int m_degats;
}; | true |
bd837eb4d49559687f2df09c433fd1ce04edd0e8 | C++ | patilatp/MS-Projects | /proj 6(ameyp)/headsUpDisplay.cpp | UTF-8 | 2,114 | 2.640625 | 3 | [] | no_license | #include "headsUpDisplay.h"
#include <iostream>
#include <string>
#include <iomanip>
#include "gamedata.h"
#include "aaline.h"
HeadsUpDisplay::HeadsUpDisplay() :
HUD_WIDTH(Gamedata::getInstance().getXmlInt("hud/HUD_WIDTH")),
HUD_HEIGHT(Gamedata::getInstance().getXmlInt("hud/HUD_HEIGHT")),
x(8),
y(8),
seconds... | true |
ac0b8aa2a2cda5624a97c38f4a986e0e4353558c | C++ | kogotto/experiments | /cpp/018_vector_initialization/main.cpp | UTF-8 | 349 | 3.359375 | 3 | [] | no_license | #include <vector>
#include <string>
#include <iostream>
using namespace std;
struct Foo {
vector<string> v;
int a;
};
void print(const Foo& f) {
cout << "print" << endl;
for (const auto s : f.v) {
cout << s << endl;
}
cout << "a = " << f.a << endl;
}
int main() {
Foo v{{"some", "... | true |
54733f7532998e8d29d5a4ec686e1fee5140223d | C++ | 0xekez/lox-cpp | /src/token.h | UTF-8 | 1,543 | 2.9375 | 3 | [] | no_license | // the parser generates tokens. a token has a type, data, a lexme, and a line.
// the type informs how the data should be interpreted later.
#ifndef token_h
#define token_h
#include <memory> // std::unique_ptr
#include <optional> // std::optional
#include <string>
#include <unordered_map>
#include "token_type.h"
#... | true |
945ac59d7d4a68752b66a0479a5a8f85d83376f8 | C++ | yuyaushiro/pfc_simulator | /src/avoidance.cpp | UTF-8 | 1,984 | 3.015625 | 3 | [] | no_license | #include "avoidance.h"
// コンストラクタ
//------------------------------------------------------------------------------
Avoidance::Avoidance()
{}
// コンストラクタ
//------------------------------------------------------------------------------
Avoidance::Avoidance(double weight, double maxWeight, double decreaseTime)
: weig... | true |
f4f1921dee51e99d554f8c5e94b1b3437e117f44 | C++ | vw2243564/WaltonVeronica_CIS5_44188 | /Homework/Assignment _4/Gladdis_8thEd_Chap5_Prob13_Greatest/main.cpp | UTF-8 | 1,117 | 3.875 | 4 | [] | no_license | /*
File: main.cpp
Author: Veronica Walton
Created on April 2, 2017, 5:30 PM
Purpose: Determine the greatest and least numbers
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Such as PI, Vc, -> Math/Science values
//as well as conversions from system o... | true |
76bc897133f7912faa69710cd65b616902b5afaf | C++ | LeeSeongDong/DataStructure | /그래프/무방향그래프/AdjListNode.h | UTF-8 | 334 | 2.65625 | 3 | [] | no_license | #ifndef __ADJLISTNODE_H__
#define __ADJLISTNODE_H__
#include "Header.h"
class AdjListNode
{
private :
friend class AdjListGraph;
friend class DirectedAdjListGraph;
int data;
AdjListNode* link;
AdjListNode()
{
link = NULL;
}
AdjListNode(int data)
{
this->data = data;
link = NULL;
}
~AdjListNode() {... | true |
5c7620ce87d89da918480a75f37effbb9a4bf95f | C++ | BoyuGuan/DATASTRUCTURE | /Chapter_05_String/sourcecode/DSqStringTest.cpp | GB18030 | 1,139 | 2.796875 | 3 | [] | no_license | #include <iostream.h>
#include"DSqString.h"
int main() {
DSqString S1, S2, S3, S4;
StrAssign_Sq(S1, "child");
StrAssign_Sq(S2, "children");
StrAssign_Sq(S3, "chinese chair technology ");
StrAssign_Sq(S4, "");
StrCopy_Sq(S4, S1);
cout << "S4ƺֵΪ";
StrTraveres_Sq(S4);
if (StrCompare_Sq(S1, S2)>0) cout << "S1>S2"... | true |
ac4702322e9e6a476320b1bf36351eb027460eab | C++ | liolliaustin/RAM_Mapper | /src/Solve.cpp | UTF-8 | 22,850 | 2.59375 | 3 | [] | no_license | #include "Solve.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include "math.h"
using namespace std;
//create vector for final file creation
void Solve::mapCircuit(vector<vector<int> > circuitDefs, vector<int> logicBlockCount){
vector<vector<int> > finalResult;
vector<int> RAM_map;
float logic_bloc... | true |
834d05abfab61fc2ba95b3f27cd931fdca0389d9 | C++ | IHA-Quadro/Drone | /Kode/Drone/Gyroscope_ITG3200Common.cpp | WINDOWS-1252 | 1,923 | 2.53125 | 3 | [] | no_license | #include "Gyroscope_ITG3200Common.h"
float gyroTempBias[3] = {0.0,0.0,0.0};
void initializeGyro() {
if ((readWhoI2C(ITG3200_ADDRESS) & ITG3200_IDENTITY_MASK) == ITG3200_IDENTITY)
vehicleState |= GYRO_DETECTED;
gyroScaleFactor = radians(1.0 / 14.375); // ITG3200 14.375 LSBs per /sec
updateRegisterI2C(ITG3200... | true |
e629d5fe7b44c7dca7e7ce1a77d3f50ddba9e6b2 | C++ | gurum77/gengine | /gengine-0.1/Engine/GEngine/Src/GAlignment/GHorizontalAlignmentElement.h | UHC | 1,843 | 3.046875 | 3 | [] | no_license | #pragma once
/**
@brief
- The element of horizontal alignment
- line, arc, clothoid, ovalness
- Element κ Ѵ.
- иǾ Ȱ ϴ
- ü Ư Element ϵ ϱ .
- Element ü Ȱ ֵ ϱ .
*/
class G_EXT_CLASS CGHorizontalAlignmentElement
{
public:
enum Type
{
eTypeUnknown,
eTypeLine,
eTypeArc,
eTypeClothoidA1,... | true |
32b382cef2b33f8865ccc5b00f001447ae089686 | C++ | jnaess/ENGO431Lab3 | /ENGO431_Lab3/ENGO431_Lab3/Functions.h | UTF-8 | 1,808 | 3.296875 | 3 | [] | no_license | #pragma once
#include "Eigen/Dense"
#include <string>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
using namespace Eigen;
using namespace std;
/*
Description:
Used to test that a MatrixXd has been made correctly
Input:
MatrixXd M: that will be printed
String title: the desirect matri... | true |
c6995f285d9ff4e1ad560118cf3c97c155b1b2f6 | C++ | Sadchant/Kollisionserkennung-DirectX | /Kollisionserkennung DirectX/FpsClass.h | UTF-8 | 899 | 2.609375 | 3 | [] | no_license | // The FpsClass is simply a counter with a timer associated with it.It counts how many frames occur in a one second period and constantly
// updates that count.
#pragma once
// ***Quelle***: http://www.rastertek.com/tutdx11.html
/////////////
// LINKING //
/////////////
#pragma comment(lib, "winmm.lib")
///////////... | true |
1e3af938805ee0c2181b129ea4dd42d0604ca2b8 | C++ | tfcpanda/cBaseExercises | /cBasicExercises04/test.cpp | UTF-8 | 205 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
int main( )
{
int x,y;
printf("Enter x:\n");
scanf("%d", &x);
if( x%10 == 0){
y = 3* x;
}
else {
y = x;
}
printf("f(%d)=%d\n",x,y);
return 0;
}
| true |