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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1296308e769346bfc2474a8192bedb6ad94d5c0a | C++ | Heartran/HOD | /Source/GUI/DraggableLabel.cpp | SHIFT_JIS | 2,373 | 2.65625 | 3 | [] | no_license | #include"DraggableLabel.h"
#include"Manager.h"
#include<GameLib/Graphics/Manager.h>
#include<GameLib/GameLib.h>
#include<GameLib/Framework.h>
#include<string.h>
#include<assert.h>
#include<GameLib/Input/Mouse.h>
#include<algorithm>
using GameLib::Math::Vector2;
namespace GUI {
DraggableLabel::DraggableLabel(
int x, i... | true |
d5474693a4340f3aaf8eedd24214817bdd32a92f | C++ | Paul-St-Young/cppDFT | /src/Interface/InputManager.h | UTF-8 | 419 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef _INPUTMANAGER_H
#define _INPUTMANAGER_H
#include <map>
#include <vector>
typedef std::map<std::string,std::string> Input;
class InputManager{
std::map<std::string,Input> _inputs;
std::string _remove_comments(std::string input);
void _strip_empties(std::vector<std::string>& vec);
public:
InputManager(std:... | true |
815b142b350400c4570f30acb3c8d95a50256ca0 | C++ | chenhao07023/algorithm017 | /Week_04/canJump.cpp | UTF-8 | 537 | 2.53125 | 3 | [] | no_license | #include <string>
#include <stdio.h>
#include <vector>
#include <assert.h>
#include <unordered_set>
#include <queue>
using namespace std;
class Solution {
public:
bool canJump(vector<int>& nums) {
int farest = 0;
int size = nums.size();
for (int i = 0; i < size; i++)
{
... | true |
b6918dbd65d8f52a2fb48ada07ba148acc2f093d | C++ | robatbobat/labs | /laba1_double_linked_list/dlist.cpp | UTF-8 | 602 | 2.65625 | 3 | [] | no_license | using namespace std;
#include "dlist.h"
int main()
{
cList list;
list.push(10);
list.push(20);
list.push(30);
list.push(40);
list.push(50);
list.push(99);
list.list_elements_forward();
list.insert_before(1,10);
list.insert_before(5,20);
list.insert_before(90,99);
list.list_elements_forward();
list.ins... | true |
5b5141be132d2236862f0db51791232d06917579 | C++ | yjbong/problem-solving | /boj/11722/11722.cpp | UTF-8 | 437 | 2.96875 | 3 | [] | no_license | #include <cstdio>
int n; // 수열의 길이
int a[1000];
int d[1000]; // d[i]=a[i]를 마지막으로 하는 최장 감소 수열의 길이
int main(void){
scanf("%d",&n);
for(int i=0; i<n; i++) scanf("%d",&a[i]);
for(int i=0; i<n; i++) d[i]=1;
for(int i=0; i<n; i++)
for(int j=0; j<i; j++)
if(a[i]<a[j] && d[i]<d[j]+1) d[i]=d[j]+1;
int ans=0;
for(in... | true |
91a89439de18d17682757787689c6d655b3e61ae | C++ | jovetickop/Xiao2Jie_Book_Coding-Interviews_Code | /面试题38 : 数字在排序数组中出现的次数.cpp | UTF-8 | 1,581 | 3.8125 | 4 | [] | no_license | //如果直接遍历数组,则时间复杂度是O(n);
//如果用二分法分别找出第一次出现的位置和最后一次的位置,再相减,时间复杂度就是O(log(n));
#include<iostream>
using namespace std;
int GetFirstK(int Array[], int length, int K, int start, int end)
{
if(Array == NULL || length <= 0 || start<0 || end<0 || start>end)
return -1;
int mid = (start+end)/2;
int midData = Array[mid];
if(... | true |
5b0e6347c81a2a72548280c64d445d4865acc0f0 | C++ | Vijay-Giri/Compiler-Design-ICOD632C-Assignment-1 | /3.cpp | UTF-8 | 3,123 | 2.671875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void e_prime();
void e();
void t_prime();
void t();
void f();
void advance();
char ip_sym[15],ip_ptr=0,op[50],tmp[50];
int n=0;
void advance()
{
ip_ptr++;
}
void f()
{
int i,n=0,l;
for(i=0;i<=strlen(op);i++)
if(op[i]!='e')
tmp[n++]=op[i];... | true |
834299e27fb56256eb93f25c8529db814f8fcaa6 | C++ | L-dana/limited | /BinarySearch_recursion.cpp | UHC | 893 | 3.421875 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int* s;
int location(int low, int high,int node) {
int mid;
if (low > high)return 0;
else {
mid = (low+high) / 2;
if (node == s[mid])return mid;
else if (node < s[mid])return location(low, mid-1, node); //left
else... | true |
08e6fb009b67022dc2cf9d9774bc0372b7bac400 | C++ | lengxi/Strategy | /src/Queue.h | UTF-8 | 486 | 2.578125 | 3 | [] | no_license | // Queue.h: interface for the Queue class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(QUEUE)
#define QUEUE
#ifndef UNIT
#include "Unit.h"
#endif
#include "time.h"
class Queue
{
public:
void SetUnit(char buildtype);
string GetUnit();
//char GetUnit(int type);
void Set... | true |
83d08c2bf733ece2571dae72060d3741798902ac | C++ | jasonblog/note | /c++/data/cpp-concurrency-in-action/src/ch6/queuelist.cpp | UTF-8 | 1,958 | 3.859375 | 4 | [] | no_license | #include <iostream>
#include <queue>
#include <memory>
#include <thread>
#include <mutex>
template <typename T>
class queue
{
private:
struct node {
std::shared_ptr<T> data;
std::unique_ptr<node> next;
};
std::mutex head_mutex;
std::unique_ptr<node> head;
std::mutex tail_mutex;
... | true |
5bd064d266d6a4b14f52e1e71ce79775a72ef8c0 | C++ | s6tsschu/VRLAB | /Source/VR/Parser.cpp | UTF-8 | 4,896 | 2.703125 | 3 | [] | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "VR.h"
#include "Parser.h"
#include <algorithm>
Parser::Parser()
{
}
std::vector<std::pair<float, std::map<std::string, FTransObject>>> Parser::parseXml(std::string url)
{
std::vector<std::pair<float, std::map<std::string, FTra... | true |
07ca33743dbb584b8d4f006fa41e24239fbbddc9 | C++ | eschild2/test | /lib/StringList.cpp | UTF-8 | 2,200 | 3.75 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
namespace ece309{
// class for a list node
class ListNode{
private:
char* str;
ListNode *next;
public:
ListNode(char* a){
str = a;
next = 0;
}
ListNode* getNext() {
return next;
}
void setNext(ListNode *n){
next = n;
}
... | true |
b3e65f12b1de291a9c637678010d3ae611d46279 | C++ | jetpotion/HEAPCPP | /Heap/Heap.hpp | UTF-8 | 2,338 | 3.4375 | 3 | [] | no_license | #ifndef HEAP_HPP
#define HEAP_HPP
#include <vector>
#include <array>
template<typename T>
class Heap
{
private:
std::vector<T>data;
bool ismax = true;
//These should be include functions that dont modify any of the data
constexpr int Parent(int i) const;
constexpr int Left(int i) const;
constexpr int... | true |
9f72d79ac291daef045a981618389bdcb9d9c3c9 | C++ | kentlc/camera_module | /include/pipes/tx_pipe.hpp | UTF-8 | 387 | 2.609375 | 3 | [] | no_license | /**
* @file tx_pipe.hpp
* @brief Transmitter pipe class definition.
*/
#ifndef DEF_TX_PIPE_HPP
#define DEF_TX_PIPE_HPP
#include <fstream>
#include <string>
class TXPipe {
public:
TXPipe(const std::string &pipefile);
~TXPipe();
void send(const char *data, int dataSize);
private:... | true |
a45c728cce0f49f01434d28606df0e38c3580390 | C++ | xodud001/coding-test-study | /sally/dynamic_programming_1/1106_호텔.cpp | UTF-8 | 1,023 | 2.90625 | 3 | [] | no_license | /*
# DP
# Problem: 1106
# Memory: 2028KB
# Time: 0ms
*/
#include <iostream>
#include <cmath>
using namespace std;
#define INF 2147483646
int C; // goal
int N; // city num
int cost[201] = {0,};
int customer[201] = {0,};
int result = INF;
int dp[1001] = {0,}; // ind:customer val:min_cost
int main(void){
cin.tie(... | true |
cbecf1179fcecd9cfbb673c4db191dee243e2450 | C++ | hsondd/learn | /LearnCPP/5.Overload/35.NhapXuat.cc | UTF-8 | 1,454 | 3.46875 | 3 | [] | no_license | #include <iostream>
using namespace std;
//Cach 1: Member-func
class PhanSo
{
private:
int Tu, Mau;
public:
//getter
int LayTu()
{
return Tu;
}
int LayMau()
{
return Mau;
}
//setter
void SetTu(int a)
{
Tu = a;
}
void SetMau(int b)
{
... | true |
bae77c8da3d19b9fabac45a3703ea17fd319cd22 | C++ | roboteur/proof-of-code-concepts-arduino | /deepsleep_timer_wakeup/deepsleep_timer_wakeup.ino | UTF-8 | 918 | 2.953125 | 3 | [
"MIT"
] | permissive | /* Deep Sleep and Wake-up Using Timer */
#define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP 10 /* Time ESP32 will go to sleep (in seconds) */
RTC_DATA_ATTR int bootCount = 0;
void functionWorkOnAnything() {
Serial.println("Place all processes and ar... | true |
1e7c48a6e2a4f622121dc1e6ee4ab496adba2f8b | C++ | olcf/CSGF_2017 | /Kokkos/VectorAddition/VecAdd.cpp | UTF-8 | 1,170 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <Kokkos_Core.hpp>
#include <Kokkos_Parallel.hpp>
#include <Kokkos_View.hpp>
#include "mpi.h"
#include <assert.h>
#include <limits>
int main(int argc, char **argv) {
// Initialize MPI before Kokkos
MPI_Init(&argc, &argv);
// Initialize Kokkos
Kokkos::initialize(argc, argv);
con... | true |
52f8db6caa8f59a738ffcd7da89f2e7fe669ae1d | C++ | zzuummaa/yandex_interview_training | /contest/interesting_travaling/main.cpp | UTF-8 | 1,483 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
#include <queue>
struct Coordinate {
long x;
long y;
long dist(Coordinate& other) const {
return labs(this->x - other.x) + labs(this->y - other.y);
}
};
int main() {
int city_count;
std::cin >> city_count;
std::vector<Coordinate> city_coordinates(city_co... | true |
35aed7fee0ecb448906daf24906efd714503b31c | C++ | BlueButterflyTeam/SeminaireMath | /SeminaireMath/controls.cpp | WINDOWS-1252 | 5,342 | 2.9375 | 3 | [] | no_license | // Include GLFW
#include <GLFW/glfw3.h>
extern GLFWwindow* window; // The "extern" keyword here is to access the variable "window" declared in tutorialXXX.cpp. This is a hack to keep the tutorials simple. Please avoid this.
// Include GLM
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx... | true |
17bb91073dfd430d593517673b126807cc12f325 | C++ | bluemix/Online-Judge | /CodeForce/347A Difference Row.cpp | UTF-8 | 2,235 | 3.34375 | 3 | [] | no_license | /* 4566942 Sep 26, 2013 4:01:53 PM Shark 347A - Difference Row GNU C++ Accepted 30 ms 0 KB */
#include<stdio.h>
#include<stdlib.h>
#define SWAP(x,y) { int temp=x; x=y; y=temp; }
int main(){
int n;
int M[10000];
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&M[i]);
for(int i=0;i<n;i++)
for(int j=i+1;j<... | true |
7eac7f529ce96ce9c3eeb08c9f5b1b0bf0afd095 | C++ | Nikhilsharmaiiita/LeetcodeCracker | /maximum-69-number/maximum-69-number.cpp | UTF-8 | 242 | 2.765625 | 3 | [] | no_license | class Solution {
public:
int maximum69Number (int num) {
string s=to_string(num);
for(int i=0;i<s.size();i++)
{
if(s[i]=='6'){s[i]='9';break;}
}
int x=stoi(s);
return x;
}
}; | true |
0d346794a6ccbfe34fe0c20c9e258699b43c5c20 | C++ | nathanj96/Cinnabar-Engine | /Commands/CAudio Commands/ChannelBase/CChannelSetPitchCommand.h | UTF-8 | 660 | 2.6875 | 3 | [] | no_license | #ifndef C_CHANNEL_SET_PITCH_COMMAND
#define C_CHANNEL_SET_PITCH_COMMAND
class CSoundChannelBase;
#include "CAudioCommandBase.h"
class CChannelSetPitchCommand : public CAudioCommandBase
{
private:
CSoundChannelBase* chnl;
float pitch;
public:
CChannelSetPitchCommand() = delete;
CChannelSetPitchCommand(const CChan... | true |
5d1b309929587fb07b5c4549aa6a16949911e316 | C++ | Poukiaaaaaaaaaaaaaaa/hnsm | /hnsm/src/engine/Audio.cpp | ISO-8859-1 | 9,112 | 2.84375 | 3 | [] | no_license | #include "Audio.h"
/*
* 'streamCallback': fonction appele automatiquement une certaine frquence
* (dfinie lors de l'initialisation du flux audio)
*
* Paramtres:
* - 'input': pointeur utilis pour l'enregistrement audio, dsigne un emplacement
* mmoire dans lequel sont stockes les donnes enregistres (membre inutil... | true |
a9b652907da474adcc7a29bf80f271577a381c8c | C++ | marciodrosa/sc-game-2 | /Source/Models/GameState.cpp | UTF-8 | 1,685 | 3.015625 | 3 | [] | no_license | #include "GameState.h"
#include <set>
using namespace sc;
using namespace std;
GameState::GameState()
{
SelectedCharacterIndex = 0;
CurrentMovieIndex = 0;
IsInModuleInTransition = false;
IsInModuleOutTransition = false;
RingoAlreadyAppeared = false;
}
Movie* GameState::FindMovieById(MovieId id)
{
for (Movie& m... | true |
54c668a79bfb7cd707d4832fc270df16065a8427 | C++ | MitkoZ/PingPong | /main.cpp | UTF-8 | 3,420 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <GL\gl.h>
#include <GL\glu.h>
#include <C:\My Files\GLUT\glutdlls36\glut.h>
#include "Player.h"
#include "Ball.h"
#include "Constants.hpp"
Player* bottomPlayer = new Player(300);
Player* topPlayer = new Player(300);
Ball* ball;
using namespace std;
void specialHandler(int key, int x, int... | true |
72ba509e137090bc9b41cd30a17fe8cbf7357bfc | C++ | jdelezenne/Sonata | /Sources/Engine/Graphics/VertexFormats/VertexPositionNormalColor.cpp | UTF-8 | 911 | 2.78125 | 3 | [
"MIT"
] | permissive | /*=============================================================================
VertexPositionNormalColor.cpp
Project: Sonata Engine
Author: Julien Delezenne
=============================================================================*/
#include "VertexPositionNormalColor.h"
namespace SonataEngine
{
const VertexEle... | true |
1b7b390aa5530aa4e0a06eaa213a9ec0e7ed7f7f | C++ | vpantanella/SnakeGame | /src/Node.cpp | UTF-8 | 329 | 3.265625 | 3 | [] | no_license | #include "Node.h"
Node::Node(int data) :data(data),next(0){}
void Node::setData(int data)
{
this->data = data;
}
int Node::getData() const
{
return data;
}
void Node::setNext(Node *node)
{
next = node;
}
Node* Node::getNext() const
{
return next;
}
Node::~Node()
{
delete next;
nex... | true |
38b52de947ecad35b9a1eef2e96b58cbf1567b6b | C++ | Yan-Song/burdakovd | /c++/sdl/sdlapplication/SDLApplication.h | UTF-8 | 5,254 | 2.796875 | 3 | [] | no_license | #ifndef SDLAPPLICATION_H
#define SDLAPPLICATION_H
#include <cmath>
#include <ctime>
#include <iostream>
#include <list>
#include <sstream>
#include <string>
#include <SDL.h>
#include "Color.h"
#include "IGameLoop.h"
#include "Shared.h"
#include "Timer.h"
#include "Utils.h"
#include "Vector.h"
s... | true |
b91762d246322eea0b9316526eac7ec4c9ebc2bf | C++ | keithlowc/health-companion | /Arduino_code/main.cpp | UTF-8 | 323 | 2.546875 | 3 | [] | no_license | #include "pulse_sensor.h";
#include "temp_sensor.h";
Pulse pulsing(0); // Analog input
TemperatureSensor tempSensor; // Digital pin #2
void setup()
{
Serial.begin(9600);
pulsing.PulseSetUp();
tempSensor.InitializeTemperatureSensing();
}
void loop()
{
pulsing.PulseSensing();
tempSensor.CaptureTemperature()... | true |
e21f29989c3d09fa98e75bb0d4d99cb9791c25a5 | C++ | nealwu/UVa | /volume009/996 - Find the Sequence.cpp | UTF-8 | 2,674 | 2.75 | 3 | [] | no_license | #include <stdio.h>
#include <set>
#include <vector>
#include <iostream>
#include <sstream>
#include <algorithm>
using namespace std;
string num2str(int x) {
string s;
stringstream sin(s);
sin << x;
return sin.str();
}
int dfs(vector<int> A, int M, string &solution) {
// printf("[");
// for (int i ... | true |
1b70d28b1130b9e1289aedbb123fa6491f1cafee | C++ | ekirshey/WorldBuilder | /include/ChunkGeometry.h | UTF-8 | 1,201 | 2.703125 | 3 | [] | no_license | #pragma once
#include <vector>
#include <GL/glew.h>
#include "Ray.h"
#include "ChunkModel.h"
#include "ShapePrimitives.h"
namespace chunk {
class Geometry {
public:
Geometry(glm::vec3 localcoords, glm::vec3 translation, GLfloat width);
~Geometry();
bool intersectsWithRay(const Ray& ray, float& intersect_point... | true |
c1688e637f92ecec2064f7d07175840f7ab34df1 | C++ | nikopa96/C-Advanced | /Prax02/src/number.cpp | UTF-8 | 741 | 2.71875 | 3 | [] | no_license | #include "number.hpp"
int Number::add(int a, int b) { return 0; }
int Number::difference(int a, int b) { return 0; }
int Number::product(int a, int b) { return 0; }
int Number::quotient(int a, int b) { return 0; }
int Number::remainder(int a, int b) { return 0; }
int Number::gcd(int a, int b) { return 0; }
int Number:... | true |
c11c0644a14a7243399613ef603e5e037aa6c5d4 | C++ | AdamMoffitt/portfolio | /C++ projects/Maze Solver/mazesolver.h | UTF-8 | 1,098 | 2.75 | 3 | [] | no_license | #ifndef MAZESOLVER_H
#define MAZESOLVER_H
#include "visitedtracker.h"
#include "maze.h"
#include <QMessageBox>
#include <queue>
#include <stack>
#include <vector>
#include <exception>
/*
* I didn't want the students to have to deal
* with function pointers, so I'm making the
* MazeSolver an object with various so... | true |
94657f8cdead804a672a7273b113c00046cd499e | C++ | LemuriaX/luogu | /方块分割.cpp | UTF-8 | 682 | 2.71875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int sum = 0;
int fz[7][7] = {0};
int xx1[4] = {1,-1,0,0};
int yy1[4] = {0,0,-1,1};
int vis[7][7] = {0};
void dfs(int x,int y){
//cout << x<<" "<<y<<endl;
if(x == 0||y == 0||x == 6||y == 6){
sum++;
/*for(int i = 0;i<7;i++){
for(int j = 0;j<7;j++){
cout << vis[i]... | true |
d38cc2e66c7eda67d6729e3112e6fd751cd8f6c7 | C++ | sanghoon23/Algorithm | /QBaekJoon_210129_일요일아침의데이트/ConsoleApplication1_Test/ConsoleApplication1_Test.cpp | UTF-8 | 5,322 | 2.765625 | 3 | [] | no_license | #include "pch.h"
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <string.h>
using namespace std;
/*@210129
여기서 중요한 것은 값을 과정에서 구하지 말고
미리 구할 수 있는 값들은 미리 구해서 사용하자. ex) FindAround
첫번째 코드와 밑의 삽질 코드는 이 차이밖에 없었는데,
우선순위 큐 안에서 주변의 'g' 를 구하는 과정에서 내가 파악하지 못한 다른 상황이 발생하는 것으로 추측됨.
이런 과정은 미묘하고 찾기... | true |
899204db3eaec29ece6d9ba68857270666a07837 | C++ | MelisaLuciano/SistemasDistribuidos | /Proyecto3/cliente.cpp | UTF-8 | 841 | 2.5625 | 3 | [] | no_license | #include "Solicitud.h"
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
using namespace std;
int nbytes;
char buffer[BUFSIZ];
int main(int argc, char *argv[]){
if(argc!=6){
cout<<"Agregue: direccion_ip puerto archivo_original nuevo_nombre ... | true |
a2e57bd2878759e0d2ebe59831e175ca07236c29 | C++ | opensupport-ceo/beaglebone-ai-tutorial | /GPIO.cpp | UTF-8 | 2,210 | 2.921875 | 3 | [] | no_license | #include "GPIO.h"
#include <stdio.h>
#include <unistd.h>
#include <string>
#include <iostream>
#include <fstream>
#include <fcntl.h>
#include <sys/ioctl.h>
GPIO::GPIO(int init_num) {
path = default_path + "gpio" + to_string(init_num) ;
num = init_num ;
num_str = to_string(num) ;
gpio_export() ;
}
GPIO... | true |
eb902b548d54ef4e0f6d4dbbe91a1c40ff453f62 | C++ | RedOni3007/Itsukushima | /Itsukushima/Game/Camera.cpp | UTF-8 | 2,619 | 2.5625 | 3 | [] | no_license | #include <Game/Camera.h>
Camera::Camera(void)
{
m_vUP = Vector3(0.0f,1.0f,0.0f);
m_fFOV = 60.0f;
m_fRatio = 16.0f/9.0f;
m_fNearClip = 0.1f;
m_fFarClip = 1000.0f;
m_mProjectionMatrix = glm::perspective( m_fFOV, m_fRatio, m_fNearClip, m_fFarClip);
}
Camera::~Camera(void)
{
}
void Camera::RefreshViewMatrix()
{
... | true |
89d59e53132cda88110418382afdd0c3d42e1205 | C++ | moh008/CS100-lab4-1- | /Composite.h | UTF-8 | 1,590 | 3.21875 | 3 | [] | no_license | #ifndef COMPOSITE_H
#define COMPOSITE_H
#include <iostream>
/*Antonio Martinez and Minwhan Oh*/
using namespace std;
class Base{
public:
/* Constructors */
Base() {};
/* Pure Virtual Functions */
virtual double evaluate() = 0;
};
class Op : public Base{
protected:
double var;
public:
Op(double v): var(v) {};
... | true |
ca8b39e6663c03ebc12b57514323ca569e2473b8 | C++ | Crisspl/GPU-particle-system | /particles/maths/VecBase.h | UTF-8 | 7,752 | 3.140625 | 3 | [
"MIT"
] | permissive | #ifndef FHL_MATHS_VEC_BASE_H
#define FHL_MATHS_VEC_BASE_H
#include <type_traits>
#include <cmath>
#include <ostream>
#include "BoolVec.h"
#include "Compare.h"
namespace fhl { namespace detail
{
namespace impl
{
template<typename _T>
constexpr _T repeatValue(_T _value, std::size_t) { return _value; }
}
temp... | true |
b91f62fa7f508026fcc17bae081d7220820c474d | C++ | James-Sneyd-Gomm/DirectXProject | /DX11 Framework 2018/DX11 Framework 2018/Camera.cpp | UTF-8 | 2,465 | 2.75 | 3 | [] | no_license | #include <iostream>
#include "Camera.h"
using namespace std;
Camera::Camera(XMFLOAT4 eye, XMFLOAT4 up, XMFLOAT4 at, bool free)
{
eyeVal = eye;
upVal = up;
atVal = at;
freeCam = free;
r = 0.0;
if (!freeCam)
{
XMVECTOR Eye = XMVectorSet(eyeVal.x, eyeVal.y, eyeVal.z, eyeVal.w);
XMVECTOR At ... | true |
34df9d96f7a84bdf7d721a42ea2a707a9da2f38f | C++ | ashwinsuresh83/Data-structures-and-algorithms | /matrix/median of row sorted matrix.cpp | UTF-8 | 641 | 2.59375 | 3 | [] | no_license | int median(int matrix[][100], int r, int c){
// code here
int min=INT_MAX,max=INT_MIN;
for(int i=0;i<r;i++){
if(matrix[i][0]<min)
min=matrix[i][0];
if(matrix[i][c-1]>max)
max=matrix[i][c-1];
}
int desired=(r*c+1)/2;
... | true |
1de258b20b8def06c599acd4d0e16dbe252e5b82 | C++ | Dermofet/OOP | /lab2/MyErrors.h | WINDOWS-1251 | 534 | 3.15625 | 3 | [] | no_license | #pragma once
#include <iostream>
using namespace std;
class Error : public exception { //
public:
Error() = default; //
explicit Error(const char* msg) : str(msg) {}; //
string what() { return str; }; //
~Error() override = default; //
private:
string str; //
}; | true |
cbf43ae8935a15bc7ac64b90b192770e33597b7f | C++ | caolandix/DarkSynthesis | /jumpdrive/CustomOperator.cpp | UTF-8 | 833 | 3.0625 | 3 | [] | no_license | #include "CustomOperator.h"
CustomOperator::CustomOperator(const string symbol, const bool leftAssociative, const int precedence) {
m_leftAssociative = leftAssociative;
m_symbol = symbol;
m_precedence = precedence;
m_operandCount = 2;
}
CustomOperator::CustomOperator(const string symbol, const bool leftAssociative... | true |
b1aaf548a94f077ba1ca0c312f036cf797d73782 | C++ | torbjornmolin/Stagetimer | /Timer.h | UTF-8 | 617 | 2.625 | 3 | [] | no_license | #pragma once
#include <SDL2/SDL.h>
#include <functional>
#include <SDL2/SDL_timer.h>
#include "TimeDisplay.h"
class Timer
{
public:
Timer();
~Timer();
void Start();
void SetTime(int duration);
void Pause();
void SetTimeDisplay(TimeDisplay *td);
bool IsPaused();
private:
static Uint... | true |
9f031be01a5bfec4c9956448593e57bdeb6da1c5 | C++ | edujguevara100/P3Lab-6_EduardoGuevara | /Vagon.cpp | UTF-8 | 253 | 2.875 | 3 | [] | no_license | #include "Vagon.h"
Vagon::Vagon(char ident, int posx, int posy): Item(ident){
x = posx;
y = posy;
}
void Vagon::setX(int posx){
x = posx;
}
void Vagon::setY(int posy){
y = posy;
}
int Vagon::getX(){
return x;
}
int Vagon::getY(){
return y;
}
| true |
f75f95d833b59b4a1817246ab38d35022bf3620f | C++ | eaglesky/leetcode | /C++/OneEditDistance.cc | UTF-8 | 809 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
bool isOneEditDistance(string s, string t)
{
int ns = s.size();
int nt = t.size();
if (abs(ns - nt) > 1)
return false;
if (ns > nt) {
swap(s, t);
swap(ns, nt);
}
int i = 0;
for (; (i < ns) && (s[i] == t[i]); ... | true |
8b9e60ae79e8d45d2f0f63830f3eac15590ca9a0 | C++ | IAmFunkyFrog/EigenValuesFinder | /libs/RationalNum/RationalNum.cpp | UTF-8 | 9,024 | 3.1875 | 3 | [] | no_license | #include "RationalNum.h"
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <limits.h>
using namespace std;
int absInt(long long int x) {
if (x >= 0) {
return x;
} else {
return -x;
}
}
void getFactors(long long int num, vector<long long int> &factorSet) {
... | true |
9ec52edc3be050d3d0b5b2bded867ca493ee6529 | C++ | junkoda/junkoda.github.io | /codes/mockgallib/src/_src/nbar.cpp | UTF-8 | 3,774 | 2.53125 | 3 | [] | no_license | //
// Computes n(z) for given HOD parameter
//
#include <iostream>
#include <string>
#include <cmath>
#include <boost/program_options.hpp>
#include <gsl/gsl_integration.h>
#include "msg.h"
#include "const.h" // -> delta_c
#include "cosmology.h"
#include "growth.h"
#include "power.h"
#include "sigma.h"
#include ... | true |
14cafac82fc238c098ee170d3b188e9d00ab57d2 | C++ | ghazi-naceur/arduino-sketchs | /src/main/c/sensors/hc-sr04-ultrasonic-sensor/hc-sr04-ultrasonic-sensor.ino | UTF-8 | 817 | 2.96875 | 3 | [] | no_license |
const byte TRIGGER_PIN = 2; // Broche TRIGGER
const byte ECHO_PIN = 3; // Broche ECHO
const unsigned long MEASURE_TIMEOUT = 25000UL; // 25ms = ~8m à 340m/s
const float SOUND_SPEED = 340.0 / 1000;
void setup() {
Serial.begin(115200);
pinMode(TRIGGER_PIN, OUTPUT);
digitalWrite(TRIGGER_PIN, LOW);
pinMode(E... | true |
ea244fa1be83d266006853ffe07ac4774366e6d6 | C++ | TemporalKing/Distributed-Minimum-Spanning-Tree | /Prims.cpp | UTF-8 | 1,518 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <limits.h>
#include "Prims.h"
using namespace std;
extern int number_of_nodes;
int Prims::getEdgeBetween(int i, int j) {
return graph[i*number_of_nodes + j];
}
int Prims::minIndexNotInSet(const vector <int> key) {
int min = INT_MAX, min_index;
for (int i ... | true |
6b3af30889ce6907a62c6085e9a9931a0fe91e27 | C++ | icsfy/some_little_stuff | /c++/ch12/cow.h | UTF-8 | 1,691 | 3.6875 | 4 | [] | no_license | #ifndef COW_H
#define COW_H
class Cow {
char name[20];
char * hobby;
double weight;
public:
Cow();
Cow(const char * nm, const char * ho, double wt);
Cow(const Cow & c);
~Cow();
Cow & operator=(const Cow & c);
void ShowCow() const; //display all cow data
};
#endif
#ifndef COW_C
#define COW_C
#includ... | true |
db0fbcd5076598160e40c41ef1471ae46af96954 | C++ | pengchant/C-C- | /2.数据结构/2.3线性表-栈结构/main.cpp | UTF-8 | 1,846 | 3.78125 | 4 | [] | no_license | #include <iostream>
#include <cstring>
#include <cstdlib>
#define MAXLEN 50
using namespace std;
// 定义栈的数据结构
typedef struct{
char name[10];
int age;
}DATA;
typedef struct stack{
DATA data[MAXLEN+1];
int top;
}StackType;
// 初始化栈
StackType* STInit(){
StackType* p;
if(p = (StackType*)malloc(siz... | true |
68bb8e36e0f141c7c676249a871f5bb393faf834 | C++ | KrzysiekJa/Warehouse-System | /Warehouse-System/Seller.cpp | UTF-8 | 2,371 | 2.96875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include "Employee.h"
#include "Seller.h"
#include "OrderCreationInterface.h"
#include "OrdersControlSystem.h"
#include "Messenger.h"
#include "Receipt.h"
#include "Client.h"
Seller::Seller(int n_id) : Employee(n_id) {}
void Seller::sendReceipt(std::string receipt_id) {
sql_... | true |
62e088c2df5575d3b2af050d392fc801c99ff3db | C++ | BarIfrah/Hulda-FinalProject | /src/MovingObject.cpp | UTF-8 | 2,876 | 2.78125 | 3 | [] | no_license | #include "MovingObject.h"
#include "Resources.h"
#include <iostream>
//==================== Constructors & destructors section ====================
MovingObject::MovingObject(b2World& world, const sf::Vector2f& location,
const sf::Vector2f& size, int objectType,int ID)
: GameObject(DYNAMIC, world, location, siz... | true |
69640ab702f5f57a3dd4c34bad767b35eeb87e88 | C++ | xienezheng/cPractice | /dataStruct/数据结构练习初级/栈,队列/数据结构--队列栈应用3.12进制转换/main.cpp | UTF-8 | 925 | 3.328125 | 3 | [] | no_license | #include <iostream>
using namespace std;
template<class T>
class queue1
{
private:
T *p;
int top;
int next;
int size;
public:
queue1()
{
p=new T[20];
size=0;
next=top=0;
}
void push(const T&temp)
{
p[next]=temp;
size=size+1;
next=next+... | true |
e8a82dbf9d89235f0edeb805a441edd7ba7b49ed | C++ | lzj112/Data-Structure | /BinaryTree/AVL.cpp | UTF-8 | 7,798 | 3.890625 | 4 | [] | no_license | #include <queue>
#include <stack>
#include <vector>
#include <iostream>
using namespace std;
struct AVLNode
{
AVLNode()
: val(0), left(nullptr), right(nullptr)
{}
AVLNode(int v)
: val(v), left(nullptr), right(nullptr)
{}
int val; //data
// int height; //当前结点高度
AVLNode... | true |
91f813a241fcb79f2f063943df156cc2af93bffc | C++ | kodo-pp/ModBox | /Project/include/modules/module_manager.hpp | UTF-8 | 829 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef MODULES_MODULE_MANAGER_HPP
#define MODULES_MODULE_MANAGER_HPP
#include <string>
#include <map>
#include <modules/module.hpp>
// TEMP: maybe we should change it to something more complex
using ModuleMessage = std::wstring;
/**
* Manages modules
*
* There should be only one instance of it
*/
class ModuleM... | true |
d6511c4ad08be2675fed228e5f676a6ca39b9fc9 | C++ | J-Vernay/Ariane-simulator-NX-move | /src/widgets/glscenewidget.hpp | UTF-8 | 1,296 | 2.953125 | 3 | [] | no_license | #ifndef GLSCENEWIDGET_HPP
#define GLSCENEWIDGET_HPP
#include <QOpenGLWidget>
#include "../gameobjects/maze.h"
#include "../gameobjects/cell.h"
#include "../gameobjects/player.hpp"
#include "../gameobjects/abstractitem.hpp"
/**
* @brief Classe d'affichage de la scene 3D OpenGL
*/
class GLSceneWidget : public QOpenGL... | true |
cd7350016eca786af9ac2a734700e9b3b0ccfaa9 | C++ | dhruvsasuke/reachy_ibvs | /src/reachy_vel_moveit/src/Jacobians_base_wrist_hand.cpp | UTF-8 | 12,658 | 2.53125 | 3 | [] | no_license | void getJacobianBaseShoulder(std::vector<double> q,Eigen::Matrix<double,6,6> &J)
{
J.setZero();
double shoulder_pitch=q[0];
double shoulder_roll=q[1];
double arm_yaw=q[2];
double elbow_pitch=q[3];
double forearm_yaw=q[4];
double wrist_pitch=q[5];
J(0,0)=0;
J(1,0)=0;
J(2,0)=0;
J(3,0)=0;
J(4,0)=1.00000000000000;
J(... | true |
81bfe83f148e391b034ff2a50b5ceefc6bd6d453 | C++ | TianhuaTao/computer-graphics-assignment | /rt-compact/src/util/imageio.cpp | UTF-8 | 3,263 | 2.859375 | 3 | [] | no_license | //
// Created by Sam on 2020/6/15.
//
#include "imageio.h"
#include "color.h"
static inline int isWhitespace(char c) {
return c == ' ' || c == '\n' || c == '\t';
}
// Reads a "word" from the fp and puts it into buffer and adds a null
// terminator. i.e. it keeps reading until whitespace is reached. Returns
// th... | true |
4685d452730d7f7748c0e75662829fd2d86f486d | C++ | thatianajessica/EstruturaDeDadosLab | /Lista1/Q04/main.cpp | UTF-8 | 438 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int num;
cout<<"Digite o numero:"<<endl;
cin>>num;
for (int i=0;;i++) {
int valor = i*(i+1)*(i+2);
if(valor == num){
cout<<"Numero eh triangular"<<endl;
cout<<i<<"*" <<i+1<<"*"<<i+2<<endl;
break... | true |
78539d47455e1dffb6895b872807ac1009830122 | C++ | zhuhui1990/poj | /3279/main.cpp | UTF-8 | 1,302 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxm = 20;
const int maxn = 20;
const int dx[5] = {-1,0,0,0,1};
const int dy[5] = {0,-1,0,1,0};
int m,n;
int tile[maxm][maxn];
int opt[maxm][maxn];
int flip[maxm][maxn];
int get(int x,int y){
int c = tile[x][y];
for(int d=0;d... | true |
b3f89c5ab5bc21e5da9c8f81719aabbb45923b53 | C++ | AnsgarGM/Estructuras-de-datos | /ArbolSimulado.cpp | UTF-8 | 3,206 | 3.203125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
class nodo{
public:
int dato;
int id, id_padre;
nodo *sig;
nodo(int x, int y, int z){
dato=x;
id=y;
id_padre=z;
sig=NULL;
}
};
class ArbolSimulado{
public:
nodo *inicio, *aux, *aux2;
... | true |
dc82d4a08a9d92790352e1d65d1b3d4615ab4be4 | C++ | IceBirdCiel/Traitement-d-image | /Traitement d'Image/Image.h | UTF-8 | 695 | 2.875 | 3 | [] | no_license | #ifndef _IMAGE_HPP_
#define _IMAGE_HPP_
#include <cstdint>
#include <cstdio>
#include "stb_image.h"
#include "stb_image_write.h"
enum ImageType {
PNG, JPG, BMP, TGA
};
struct Color {
int r, g, b;
};
class Image {
private:
size_t size = 0;
int width, height, channels;
public:
uint8_t* data = NULL;
Image(cons... | true |
76e892a75a184d3306371de55f01b4a79649ce59 | C++ | loyinglin/Codeforces | /741/A/Codeforces/main.cpp | UTF-8 | 2,159 | 2.953125 | 3 | [] | no_license | //
// main.cpp
// Codeforces
//
// Created by loying on 16/7/27.
// Copyright © 2016年 loying. All rights reserved.
/************************** 题解 **********************
题目链接:http://codeforces.com/contest/741/problem/A
题目大意:
输入n个数字a[i],设定一个操作x=a[x];
找到一个最小的k,要求:
执行k次,x=a[x]之后,x的最终值是y;
如果对y也执行k次,y=a[y],y的最终值是x... | true |
53165d386a9c912eae3c99720a2719fe67e8f8e8 | C++ | ksaveljev/UVa-online-judge | /10004.cpp | UTF-8 | 1,786 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
#include <queue>
using namespace std;
struct Vertex
{
public:
int id;
int color;
vector<Vertex*> adj;
Vertex (int id) : id(id) { color = -1; }
};
typedef map<int, Vertex*> vmap;
typedef pair<int, Vertex*> vpair;
class Graph
{
public:
Graph() {}
~Gr... | true |
a254137fba29a23212fc18b52a9e3bed3d60085c | C++ | huolab-datastructures/Data_structures_knight | /knight.h | UTF-8 | 436 | 2.828125 | 3 | [] | no_license | //Created by Alex Schrepfer
//CS151, University of Hawaii-Hilo
//April 5th, 2001
#include <iostream>
using namespace std;
const int max_board = 18;
class Knights {
public:
Knights(int size);
int size() const;
bool valid(int x, int y) const;
void insert(int x, int y, int move);
void remove(int x, int ... | true |
ce1d1525900f708a2a02e7987abc6d4f7b84212f | C++ | yuecheng11/ThreadPool | /examCsdn/Thread.cpp | UTF-8 | 3,321 | 2.765625 | 3 | [] | no_license | #include "Thread.h"
using namespace std;
void CTask::SetData(void * data)
{
m_ptrData = data;
}
vector<CTask*> CThreadPool::m_vecTaskList; //\u4efb\u52a1\u5217\u8868
bool CThreadPool::shutdown = false;
pthread_mutex_t CThreadPool::m_pthreadMutex = PTHREAD_MUTEX_INITIALIZER;
p... | true |
c75429fc6cee45dadab177da3ce3a152d0ef14b8 | C++ | EmreTech/File_Manager | /include/file_mangement.hpp | UTF-8 | 1,802 | 3.46875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
#include <filesystem>
#include <fstream>
#include <iomanip>
using namespace std::chrono;
using namespace std::filesystem;
namespace FileOperations {
struct FileCreate {
FileCreate(){}
// Creates a file with some sample content using ofstream
static void c... | true |
f64fc00dc4f6c597c77095ee5854092a57896e03 | C++ | blake-sheridan/py-postgresql | /include/postgresql/parameters.hpp | UTF-8 | 5,767 | 2.515625 | 3 | [] | no_license | #ifndef POSTGRESQL_PARAMETERS_HPP_
#define POSTGRESQL_PARAMETERS_HPP_
#include "Python.h"
#include "libpq-fe.h"
#include "postgresql/network.hpp"
#include "postgresql/type.hpp"
namespace postgresql {
namespace parameters {
static const size_t MAX_BYTES_PER = 8;
class Parameters
{
public:
Oid *types_i;
... | true |
66985dc483eed3d968f5739827a7c426da778d91 | C++ | nickyc975/VScript | /src/objects/VSCellObject.cpp | UTF-8 | 2,575 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "objects/VSCellObject.hpp"
#include <cassert>
#include "error.hpp"
#include "objects/VSBoolObject.hpp"
#include "objects/VSFunctionObject.hpp"
#include "objects/VSIntObject.hpp"
#include "objects/VSNoneObject.hpp"
#include "objects/VSStringObject.hpp"
NEW_IDENTIFIER(__hash__);
NEW_IDENTIFIER(__eq__);
NEW_ID... | true |
47cb61700c078b392391af66223e9309ecf05340 | C++ | bopopescu/projects-2 | /cs140/lab5/notes1.cpp | UTF-8 | 2,087 | 3.296875 | 3 | [] | no_license | //DONT MODIFY HIS CODE
//Rename something so the code will work
//Bit-matrices - Linear Algebra Class
//Adding them is XOR or add them and mod 2
//TRIPLE FOR LOOP
// for each row do it for each collumn
// this times this, this times this, etc.
//Do error checking to make sure they are the same size
//a*b is not b*a
// ... | true |
e8a668c5c438ed1109737a87c876c91f91a55a87 | C++ | isysoi3/Programming | /c++/1 сем/лаба/б/15_1/15_1/15_1.cpp | WINDOWS-1251 | 562 | 3.078125 | 3 | [] | no_license | // 15_1.cpp: .
//
#include <iostream>
using namespace std;
int main()
{
setlocale ( LC_ALL, "RUS" );
int a[10];
int n, c, k;
k = 0;
cout << " " << endl;
cin >> n;
while (n != 0)
{
c = n % 10;
a[c] = 1;
n = n / 10;
}
for ( int i = 0 ; i <= 9 ; i++ )
{
if ( a[i] == 1 )
k++;
... | true |
61be70579d509d97c546fe7efe00b1c6c208333b | C++ | cakkae/tasks-in-cpp | /tekst1.cpp | UTF-8 | 1,190 | 3.09375 | 3 | [] | no_license | // tekst1.C - Definicije metoda i funkcija uz klasu tekstova.
#include "tekst1.h"
void Tekst::kopiraj (const char* n) { // Kopiranje teksta.
if (n && strlen(n)) {
niz = new char [strlen(n)+1]; strcpy (niz, n);
} else niz = 0;
}
Tekst operator+ (const Tekst& t1, const Tekst& t2) { // ... | true |
cdea29d21021b79881b58b03de4f2520e308eb81 | C++ | VIPUL1306/cp_practice | /src/codeforces/Selling Souvenirs.cpp | UTF-8 | 689 | 2.96875 | 3 | [] | no_license | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll knapsack(vector<pair<ll,ll>> arr,int m){
int n = arr.size();
vector<ll> present(m+1,0);
vector<ll> prev(m+1,0);
for(int i = 1;i<n+1;i++){
present.resize(m+1,0);
for(int j = 1;j<m+1;j++){
if(j - arr[i-1].first >= 0){
present[j... | true |
fa8dd2185d86719d49ebc4960663a309c44b5928 | C++ | cvejoski/CUDALab | /CUDABase/Algorithms/KernelClassification.cpp | UTF-8 | 8,953 | 2.625 | 3 | [] | no_license | /*
* KernelClassification.cpp
*
* Created on: Jul 8, 2014
* Author: cve
*/
#include "KernelClassification.h"
template <typename M>
KernelClassification<M>::KernelClassification() {
this->n_iter = 0;
this->n_dim = 0;
this->n_classes = 0;
this->l_rate = 0.0;
this->r_rate = 0.0;
this->kernel = NULL;
}
... | true |
75bdadaa580a234030ba3bd4065c8687bc8a312c | C++ | liuxuanhai/C-code | /Qt4精彩实例分析/C++ GUI Programming with QT4/01 HelloWorld.cpp | GB18030 | 554 | 2.609375 | 3 | [] | no_license | // : 2014-08-26 13:00:08
#include <QApplication> // QtͼλӦó Դ, , , ¼...
// QtķͼλӦó, Ҫ<QCoreApplication>
#include <QPushButton>
int main(int argc, char ** argv) // ͼʾ, ¼Ĺ
{
QApplication app(argc, argv);
QPushButton b("Hello World!"); // ûָťĸ, ԼΪ
b.show();
QObject::connect(&b, SIGNAL(clicked()), &app, SLOT(quit()... | true |
5819ef837a66b6aee1601c989761f611318d2caa | C++ | lakshmanaram/penguinV | /PenguinV/unit_tests/cuda/unit_test_helper_cuda.h | UTF-8 | 1,512 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include <algorithm>
#include <cstdlib>
#include <vector>
#include "../../Library/image_exception.h"
#include "../../Library/cuda/image_buffer_cuda.cuh"
// A bunch of functions to help writing unit tests
namespace Unit_Test
{
namespace Cuda
{
// Generate images
Bitmap_Image_Cuda::ImageCuda uniformI... | true |
9a090573cad880a58784965f272eccc975d2063c | C++ | qiuyuoye/StockMonitor | /Stocks/analyse/TrendAnalyse.h | UTF-8 | 2,293 | 2.734375 | 3 | [] | no_license | #pragma once
#include "Analyse.h"
#include "stock/Stock.h"
#include <vector>
#include <set>
#include <map>
enum Trend
{
E_TRD_NONE,
E_TRD_UP,
E_TRD_FLUCTUATION_UP,
E_TRD_DOWN,
E_TRD_FLUCTUATION_DOWN,
};
class __declspec(dllexport) PeriodItem
{
public:
static double getSlopDiff(const PeriodItem& item1, const P... | true |
52b14144b64515704a6c0e3316b0db35811603ea | C++ | hanzhuoran/UchicagoHPC | /PS1/serial/main.cpp | UTF-8 | 2,514 | 3 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <string>
#include <fstream>
#include <math.h>
#include <vector>
#include <iomanip>
using namespace std;
int prev (int i, int N);
int next (int i, int N);
int main (int argc, char *argv[])
{
if(argc != 7)
{
cout<<"Wrong Number of Inputs."<<endl;
}
else
{
int ... | true |
f74ea70d4543bd6148bd3f1782f9fc2bcb8a2b43 | C++ | cjlcarvalho/patterns | /Implementations/Behavioral/Iterator/iterator-composite/iterator.h | UTF-8 | 298 | 2.734375 | 3 | [] | no_license | #ifndef ITERATOR_H
#define ITERATOR_H
class Component;
class Iterator
{
public:
Iterator(Component *component);
void first();
void next();
bool hasNext() const;
Component *current() const;
private:
Component *m_component;
unsigned int m_top;
};
#endif // ITERATOR_H
| true |
fbd8ac1f651cca811569ebe8f533b6243b431170 | C++ | Lppy/Calculation | /Model/Function/eigenvalue.h | UTF-8 | 350 | 2.515625 | 3 | [] | no_license | #pragma once
#include "matrix.h"
class Eigenvalue
{
private:
static const int MAX_N = 30;
public:
Eigenvalue();
~Eigenvalue();
void swap(double &a, double &b);
void MatrixToArray(Matrix a, double * A);
void MatrixHessenberg(double * A, int n, double * result);
bool MatrixEigenValue(Matrix a, int n, int Loop... | true |
8d96eb90b696b9f15eb8e133d8e182b4f488ebb9 | C++ | sstanitski/CISC360Project | /SeqSorts.cpp | UTF-8 | 2,254 | 3.953125 | 4 | [] | no_license | //Author Eric
//CPP Code for various sorts
//Website linked above
// A function to implement bubble sort
//http://www.geeksforgeeks.org/bubble-sort/
void bubbleSort(int arr[], int n)
{
int i, j;
for (i = 0; i < n-1; i++)
// Last i elements are already in place
for (j = 0; j < n-i-1; j++... | true |
83a7c01980daed7720c52ee4dccb2b8f657463e6 | C++ | jgreitemann/aoc18 | /day7/parallel_make.cpp | UTF-8 | 2,650 | 2.859375 | 3 | [] | no_license | #include <algorithm>
#include <fstream>
#include <iostream>
#include <iterator>
#include <map>
#include <regex>
#include <set>
#include <string>
constexpr inline static int base_duration = 60;
constexpr inline static size_t n_workers = 4;
int main() {
auto str = [] () -> std::string {
std::ifst... | true |
3598dc3bcd8222520ac13bed98e186f8b329d025 | C++ | bughunter9/DataStructuresandAlgorithms | /Practice/Queue/base.cpp | UTF-8 | 1,048 | 3.9375 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define n 20
// Queue: FIFO - First In First Out
// push is similar to enqueue
// pop is similar to dequeue
// top is similar to peek
class Queue{
int *arr;
int front;
int back;
public:
Queue()
{
arr = new int[n];
front = -1;
back = -1;
}
void push(int x)
... | true |
4a40e645f44d8d85ae720d30eaa5a54318a0281d | C++ | xx8086/liuhan_pipeline | /liuhan_pipeline/lhpipeline/lhrasterization/lhlinesegment.cpp | GB18030 | 1,858 | 3.046875 | 3 | [] | no_license | #include "lhlinesegment.h"
#include<algorithm>
LhLineSegment::LhLineSegment()
{
}
LhLineSegment::~LhLineSegment()
{
}
bool LhLineSegment::on_segment(Point Pi, Point Pj, Point Q)
{
if ((Q.x - Pi.x) * (Pj.y - Pi.y) == (Pj.x - Pi.x) * (Q.y - Pi.y) //
... | true |
19a987bd22247a71cdd6a3fe92c081956a1ad06e | C++ | WinningLiu/SCU | /COEN/coen175/Lab 3/phase3/parser.cpp | UTF-8 | 17,257 | 3.21875 | 3 | [] | no_license | /*
* File: parser.cpp
*
* Description: This file contains the public and private function and
* variable definitions for the recursive-descent parser for
* Simple C.
*/
# include <cstdlib>
# include <iostream>
# include "tokens.h"
# include "lexer.h"
# include "Type.h"
# include "checker.h"
# include <vector>
... | true |
b33c3953e61a8b6bff4f2898248c4ae3c24aba45 | C++ | tyanmahou/Re-Abyss | /Re-Abyss/app/components/Actor/Player/ChargeCtrl.hpp | UTF-8 | 672 | 2.703125 | 3 | [] | no_license | #pragma once
#include <abyss/modules/GameObject/IComponent.hpp>
namespace abyss::Actor::Player
{
/// <summary>
/// player attack charge
/// </summary>
class ChargeCtrl : public IComponent
{
double m_charge;
public:
ChargeCtrl();
/// <summary>
/// charge update
... | true |
45c346f4e245feca1c7587a7cfd766182496a682 | C++ | WeyrSDev/SFML-Blueprints | /Chapter-2/include/ResourceManager.hpp | UTF-8 | 2,445 | 3.1875 | 3 | [] | no_license | //
// Created by scastner on 11/7/2015.
//
#ifndef SFML_BLUEPRINTS_RESOURCEMANAGER_HPP
#define SFML_BLUEPRINTS_RESOURCEMANAGER_HPP
#include <SFML/Audio.hpp>
#include <unordered_map>
#include <memory>
template<typename RESOURCE, typename IDENTIFIER = int>
class ResourceManager
{
public:
/**
* This c++11 feat... | true |
14129ddd2c4bf44138e151af31867039ad1b6873 | C++ | zmudson/World-Simulation | /Projekt1/Human.cpp | UTF-8 | 3,216 | 2.828125 | 3 | [] | no_license | #include "Human.h"
#include "Grass.h"
#include "Guarana.h"
#include "Dandelion.h"
#include <iostream>
#define STRENGTH 5
#define INITIATIVE 4
#define SYMBOL 'C'
#define NAME "czlowiek"
#define SKILL_STRENGTH 10
#define SKILL_DURATION_TIME 5
#define SKILL_RENEWING_TIME 5
#define YELLOW_COLOR_CODE 14
Human::Human(World... | true |
866e7a722b90161b2ae916528ed66a3b415e4736 | C++ | Uedaki/Jotun | /Collada/Collada.cpp | UTF-8 | 3,737 | 2.8125 | 3 | [] | no_license | #include "stdafx.h"
#include "Collada.h"
#include <map>
#include <functional>
#include "GeometryInstance.h"
#include "LightInstance.h"
#include "Camera.h"
void collada::Collada::loadFile(const std::string &file)
{
xmlParser::Parser parser(file);
root = parser.getRoot();
mapNodeById(*root);
}
void collada::Collada... | true |
598b0bfcb4671aa2ea327e139bd5d6b360c23706 | C++ | i74n/COSMOSTARS | /COSMOSTARS/Map.cpp | UTF-8 | 228 | 2.515625 | 3 | [] | no_license | #include "Map.h"
Map::Map(){
makeTexture("images/cosmos.png", 1);
displace = 0;
}
Status Map::update(float time){
displace += time*1000;
if (displace >= 960)
displace = 0;
setPosition(-displace, 0);
return stay;
}
| true |
ad2287e19170ebb8748bb838d3731837f64c507a | C++ | HeliosInteractive/ofxHeliosLibs | /src/mediaBanks/VideoBank.cpp | UTF-8 | 3,806 | 2.84375 | 3 | [] | no_license | #include "VideoBank.h"
void VideoBank::setup ( float _x , float _y , float videoDelay , bool _bLoop )
{
x = _x ;
y = _y ;
bLoop = _bLoop ;
videoDelayTimer.setup( videoDelay ) ;
ofAddListener( videoDelayTimer.TIMER_COMPLETE , this , &VideoBank::videoDelayTimerComplete ) ;
}
void VideoBank::videoDelayTimerC... | true |
0d0f0bead5b961448a17d3d1d317233cf0657e7a | C++ | zhangergaici/cnpl | /VM/VM.cpp | UTF-8 | 31,903 | 2.71875 | 3 | [] | no_license | #include "VM.h"
#include <locale>
#include <codecvt>
#include <cassert>
#include <cstring>
namespace VM
{
Engine::Engine() :
mConstants(),
mInstructionCount(0),
mInstructions(nullptr),
mIP(nullptr),
mCallParameters(),
mCallStack(),
mCALCStack(),
mDATAStack(nullptr),
mGlobalVariableTable(),
mGC()
... | true |
fe5caa103c263af2659708a432152db45748bb1f | C++ | SahilMadan/ProgrammingWindows | /02_WideCharacterFormatting/Main.cpp | UTF-8 | 1,590 | 3.03125 | 3 | [] | no_license | #include <Windows.h>
#include <stdio.h>
#include <tchar.h>
// Use cdecl instead of stdcall.
int CDECL MessageBoxPrintf(const TCHAR* szCaption, const TCHAR* szFormat, ...) {
// TCHAR points to WCHAR if unicode is defined; else CHAR.
TCHAR szBuffer[1024];
va_list pArgList;
// The va_start macro (defined in STD... | true |
d83a648134056d1a926692d1553591a4906878a1 | C++ | university-studies/ipk-isa-networking | /isa-project/mtu_ipv6.h | UTF-8 | 1,142 | 2.796875 | 3 | [] | no_license | /**
* File: mtu_ipv6.h
* Author: Pavol Loffay, xloffa00@stud.fit.vutbr.cz
* Date: 25.9.2012
* Description: modul spracujuci checksum protolu TCP, UDP
*/
#ifndef MTU_IPV6_H
#define MTU_IPV6_H
#include <string>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <netdb.h>
/*
* @brief Trieda spracujuca ... | true |
8cff8faa1889eb614844d6df96a6885c567b6d55 | C++ | NazarovDevelopment/OOP | /OOP2014/quadtree/tree.cpp | UTF-8 | 795 | 2.859375 | 3 | [] | no_license | #include "quadtree.h"
void CoolQuadTree::separate()
{
CoolPoint center(border.lower_right.x / 2 - border.upper_left.x / 2, border.lower_right.y / 2 - border.upper_left.y / 2);
CoolRectangle q1(border.upper_left, center);
CoolRectangle q2(CoolPoint(border.upper_left.x, center.y), CoolPoint(center.x,border.lower_rig... | true |
11c8c6c0c3873f3c3c060bdeb99982b5ac3fffe8 | C++ | 2302053453/MyStudy | /C++Study/C++Study/STL/Chapter4_Linked List/Chapter4_02.cpp | UHC | 1,395 | 3.734375 | 4 | [] | no_license | //#include<iostream>
//#include<list>
//using namespace std;
///*
// 2016-03-03
// STL LIST insert
//*/
//
//void main()
//{
// list<int> list1;
// list1.push_back(20);
// list1.push_back(30);
//
// cout << " Ʈ 1" << endl;
// // ù° ġ Ѵ.
// list<int>::iterator iterInserrtPos = list1.begin();
// list1.insert(iterInserr... | true |