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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
57bbf7fd9ee442b947d69b7e1005ab46b52a8195 | C++ | 00mjk/Cross-Platform-Game-Engine | /Engine/src/AI/Astar.cpp | UTF-8 | 3,753 | 2.734375 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | #include "stdafx.h"
#include "Astar.h"
namespace Astar
{
static Generator* instance = 0;
GridCoord Heuristic::GetDelta(GridCoord source, GridCoord goal)
{
return GridCoord(abs(source.x - goal.x), abs(source.y - goal.y));
}
uint32_t Heuristic::Manhattan(GridCoord source, GridCoord goal)
{
auto delta = std:... | true |
5959f9e817e63bdd884e56c16163adef9002a033 | C++ | ryoo0424/algorithm | /Baekjoon/boj lecture/1. algorithm_IO/algorithm_IO.cpp | UHC | 1,339 | 3.359375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int a, b;
// Ʈ ̽ ־
while (cin >> a >> b) {}
// ---------------------------------- Է¹ޱ
fgets(s, 100, stdin); // ٲޱ Է¹ޱ ؾ
scanf("%[^\n]\n", s);
// ǥ: \n ü Է \n Է
// ٹٲ Է¹ ʱ յڿ ִ
// Է¹
// ϴ ϰ ں Է¹ް
// #11719 ٰ ϴ 츦 ϱ getline̳ ... | true |
86513b6925444b3b1a452c442543cbb2cad58f8f | C++ | cianmcintyre811/CodilityChallenges-CPP | /7.4_Fish.cpp | UTF-8 | 1,644 | 3.1875 | 3 | [] | no_license | /*
This one was a bit of a pain in the butt but I still did it solo. Made an early mistake of not realising that there
might be multiple fish going downstream, so I couldn't just discard them. Stack2 was previously a vector before I
realised it was unneccesary to have it be one, because the fish swimming up can be dis... | true |
de4013310e7348054dd12a94b2aaa82e9fe04e49 | C++ | erhanonal/ITU-Assignments | /BLG252E-Object Oriented Programming/Assignment1/main.cpp | UTF-8 | 9,070 | 3.703125 | 4 | [] | no_license | /*@erhanonal
Erhan Önal
Date: 25.03.2019
#include <iostream>
#include <fstream>
#include <vector>
#include <stdlib.h>
#include "Polynomial.h"
#include "Vector.h"
using namespace std;
/*Constructor for Vector Class
int s: Size of the vector
int* vals: Pointer to the array of vector values
*/
Vector::Vector(int s,int*... | true |
e780f2bb0901946099f03a51735d4acd7d6129ee | C++ | bitmingw/LintcodeSolution | /121WordLadder2/main.cpp | UTF-8 | 2,123 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <unordered_set>
#include <string>
#include <queue>
using namespace std;
class Solution {
public:
/**
* @param start, a string
* @param end, a string
* @param dict, a set of string
* @return a list of lists of string
*/
vector<vector<string>> findLadder... | true |
dedf4c3e13eec8113d6cc636f5539ebc4932ba46 | C++ | yudeeeth/Pdfquestions | /week2/c4.cpp | UTF-8 | 636 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void print(vector<vector<int>> &sol, int i, int j){
while(i>=0 && j<sol[0].size()){
cout<<sol[i][j]<<" ";
i--;
j++;
}
}
int main() {
//code
int n;
cin>>n;
for(int it=0;it<n;it++){
int k;
cin>>k;
vector... | true |
0d13e3a82416fe77b91e57c0dfa12c4f63d3d48b | C++ | metaphysis/Code | /Books/PCC2/10/10.2.1.2.cpp | UTF-8 | 1,591 | 2.84375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int MAXV = 1010;
int stk[MAXV], top, connected[MAXV][MAXV];
int cntOfVertices, cntOfEdges;
void printStack()
{
cout << "STACK:";
for (int i = 0; i < top; i++) cout << ' ' << stk[i] + 1;
cout << '\n';
}
void dfs(int x)
{
stk[top++] = x;
for (in... | true |
a0541500ad7aa6b70af84bbc211340858fe5e752 | C++ | xingfeT/c-practice | /day-001-100/day-066/problem-1/main.cpp | UTF-8 | 3,045 | 3.71875 | 4 | [] | no_license | /*
*
* Here is a version of a problem called "the random walk." It can be extended to two or
* three dimensions, and used to simulate molecular motion, to determine the effectiveness
* of reactor shielding, or to calculate a variety of other probabilities.
*
* Assume that your very tired and sleepy dog leaves his... | true |
14c276d3c255f151c2c900dd42409cb31cb4e33e | C++ | weaverjm3/JW_info_450_spring_2019 | /week2/practice2.cpp | UTF-8 | 428 | 3.5625 | 4 | [] | no_license |
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
int i = 0;
int num;
while (i)
{
cout << "Please enter a number to find out if it is prime! (Enter 0 to quit): ";
cin >> num;
if ((num == 2) || (num % 2 != 0))
{
cout << "This is a prime number" << endl;
}
else if (num == 0)
... | true |
e627ecfd5fdac97fbfb148c4cbbd6746aae56cdd | C++ | jeafonso/cpp_projects | /CppND-System-Monitor/src/linux_parser.cpp | UTF-8 | 8,882 | 2.765625 | 3 | [
"MIT"
] | permissive | #include <dirent.h>
#include <unistd.h>
#include <sstream>
#include <string>
#include <vector>
#include "linux_parser.h"
using std::stof;
using std::string;
using std::to_string;
using std::vector;
// DONE: An example of how to read data from the filesystem
string LinuxParser::OperatingSystem() {
string line;
st... | true |
436e7b8582a4a4bed3a05cf083bfa007bb3411eb | C++ | EngravedMemories/guo_jiacheng | /郭佳承 3-6 第二章作业/2.19/main.cpp | UTF-8 | 445 | 3.765625 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a=0, b=0, c=0, sum=0, ave=0, pro=0;
cout <<"Input three different integers: ";
cin >>a>>b>>c;
sum=a+b+c;
ave=sum/3;
pro=a*b*c;
cout <<"Sum is "<<sum<<endl;
cout <<"Average is "<<ave<<endl;
cout <<"Product i... | true |
21eaeebf23a0a62dcf4e15db4112f53b827a6a6c | C++ | LeeWooSang/Capstone_Design_TeamProject | /Server/2019-1GameServerProgramming/FrameWork/FrameWork/Sprite.cpp | UHC | 3,492 | 2.8125 | 3 | [] | no_license | #include "Sprite.h"
Sprite::Sprite()
{
Index = 0; // ʱȭ ڿ?
}
Sprite::~Sprite()
{
for (int i = 0; i < MAX_BMP; ++i)
{
if (BmpData[i].Bitmap != NULL)
DeleteObject(BmpData[i].Bitmap);
}
}
void Sprite::Entry(int Num, const char* path, int x, int y)
{
BITMAP TmpBit; // ̹ ̿ ʺ Ƽ Ѱֱ
BmpData[Num].Bitmap =... | true |
d970098855052043e1d5cc90ad0aceb5822b47e6 | C++ | Alice105973/PriorityQueues | /modules/PriorityQueues/src/ThinHeap.cpp | WINDOWS-1251 | 9,702 | 3.171875 | 3 | [] | no_license | #include <vector>
#include <cmath>
#include <cstddef>
#include <climits>
#include <iostream>
#include "../include/ThinHeap.h"
vector<int> Thin_Dijkstra(const vector < vector<pair<int, int>>>& graph) {
ThinHeap q;
vector<ThinElem> data(graph.size());
ThinElem a(0, 0);
data[0] = a;
q.insert(&data[0... | true |
728988e93f9280b949b9fae29935462517f4f641 | C++ | ditsing/plain-interpreter-guide | /8-interpreter/interpreter.h | UTF-8 | 2,056 | 2.921875 | 3 | [] | no_license | #ifndef INTERPRETER_H
#define INTERPRETER_H
#include <string>
#include <map>
#include <vector>
#include <stdexcept>
#include <memory>
#include "arith_expr.h"
#include "variable.h"
class Statement;
class Program;
class Program {
std::map<std::string, Variable> variable_map;
std::vector<std::unique_ptr<const Statem... | true |
094139f88eae52b012337741fe5cf0448965cfb5 | C++ | atioi/Iterative-methods | /Jacobi.cpp | UTF-8 | 1,882 | 3.046875 | 3 | [] | no_license | #include "other.h"
#include "estimator.h"
#include "residuum.h"
#include <iostream>
void Jacobi(double *A, int size, double *b, double *x_initial) {
double M[size * size];
double C[size];
/* Wzór operacyjny:
*
* x_next = - 1 / D * ( L + U ) * x_before + 1 / D * b
* M = - 1 / D * (L+U)
... | true |
cab542d8b3593075b9eacc87d679919ad3a570ff | C++ | wenzhuow/CS165 | /CS165/project1/shell_sort.cpp | UTF-8 | 518 | 2.78125 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "project1.h"
void shell_sort(vector<int>& a, const vector<int>& gaps)
{
int n = a.size();
for (int index=0;index<gaps.size();index++)
{
int gap = gaps[index];
for (int i = gap; i < n; i ++)
{
int tem... | true |
9ec03f9dbeb2176068c4665c7d0c966841ec69d5 | C++ | ldhshao/mylearnings | /qtlearnings/tabletest1/fruitmodel.cpp | UTF-8 | 1,747 | 2.96875 | 3 | [] | no_license | #include "fruitmodel.h"
#include <QtDebug>
///fruit
Fruit::Fruit(const QString &name, const float &price)
: m_name(name), m_price(price)
{
}
QString Fruit::name() const
{
return m_name;
}
float Fruit::price() const
{
return m_price;
}
void Fruit::setPrice(const float &price)
{
m_price... | true |
cafb618c70d18ab11e03aba8190184954c9037d1 | C++ | AmitBu/scrolleg-bluetooth-control | /ScrolLeg-HID.ino | UTF-8 | 3,235 | 2.859375 | 3 | [] | no_license | /**
* ScrolLeg - Arduino controlled bluetooth device, that lets you scroll with your legs
*
* Device contains 2 buttons and WT12 bluetooth chip
* Each buttons sends a different command to the blueooth chip,
* One for scroll up, one for down.
*
*
*/
#include <avr/pgmspace.h>
/**
* Up/Down button pin number... | true |
796b5f03c21278dd667d4511e61ba31da070e297 | C++ | aliasad059/lonely_cells | /lonely_cells/cells_operations.cpp | UTF-8 | 6,275 | 2.875 | 3 | [] | no_license | #include <stdio.h>
#include <graphics.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include "structs.h"
#include"linklists_operations.h"
void move_fun(struct cells * player,int cell_num,struct map_attribute *bin_map,int n){
system("cls");
struct cells_el * player_c... | true |
c5fc4bb9c1f9db5e02fd3c2350911ab7066b1e24 | C++ | golapraj/uva | /uva generating fast.cpp | UTF-8 | 553 | 2.609375 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
bool fun(char a,char b)
{
if(tolower(a)==tolower(b))
return a<b;
return tolower(a)<tolower(b);
}
int main()
{
freopen("in.txt","r",stdin);
int l,t;
char s[10000];
scanf("%d",&t);
getchar();... | true |
5c6f8cc7bed584ce0d65b409d0675dc52df7fe4f | C++ | firoorg/firo | /src/sigma/sigmaplus_proof.h | UTF-8 | 1,969 | 2.53125 | 3 | [
"MIT"
] | permissive | #ifndef FIRO_SIGMA_SIGMAPLUS_PROOF_H
#define FIRO_SIGMA_SIGMAPLUS_PROOF_H
#include "params.h"
#include "r1_proof.h"
namespace sigma {
template<class Exponent, class GroupElement>
class SigmaPlusProof {
public:
int n;
int m;
GroupElement B_;
R1Proof<Exponent, GroupElement> r1Proof_;
std::vector<Gr... | true |
77dcf8e5bf6a35f0bd7a71575f19c800e5a1c9c2 | C++ | EndysGit/GraphicProject | /source/headers/Vertex.h | UTF-8 | 2,042 | 2.796875 | 3 | [] | no_license | //
// Created by Gleb Vorfolomeew on 27/08/2017.
//
#ifndef TEXTUREOGL_VERTEX_H
#define TEXTUREOGL_VERTEX_H
#include <map>
#include <vector>
#include "source/headers/ServiceGLEnum.h"
#include <exception>
class ConversionFail : public std::exception
{
public:
ConversionFail();
ConversionFail(const char* excep... | true |
aca30308acae0eda3d7347cf7e8e546161026af4 | C++ | rebeccamurphy/Hackathon-2013 | /C++/winsocktutorial.cpp | UTF-8 | 11,653 | 3.03125 | 3 | [] | no_license | /*
Information Gleaned from the Windows Tutorial on Socket Programming (Winsock)
* The difference b/t blocking and non-blocking circuits
- blocking: old way
- "oh, you didn't successfully perform the operation you wanted? No API for you!"
- non-blocking: new way
- "you didn't finish it, but my ... | true |
aca4596fe043c10715abe1f7676b0cc256db270f | C++ | fabba/BH2013-with-coach | /Src/Modules/Sensing/FallDownStateDetector.h | UTF-8 | 2,383 | 2.796875 | 3 | [
"BSD-2-Clause"
] | permissive | /**
* @file FallDownStateDetector.h
*
* This file declares a module that provides information about the current state of the robot's body.
*
* @author <a href="mailto:maring@informatik.uni-bremen.de">Martin Ring</a>
*/
#pragma once
#include "Representations/Infrastructure/SensorData.h"
#include "Representations/Infra... | true |
e292acacff5d32fd265a30fb26592fe4350a6b21 | C++ | jessicaione101/online-judge-solutions | /UVa/357.cpp | UTF-8 | 690 | 3.203125 | 3 | [] | no_license | // https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=293
#include <iostream>
#include <vector>
const int kMax = 30001;
int main() {
std::vector<int> coins{1, 5, 10, 25, 50};
std::vector<int64_t> count(kMax);
count[0] = 1;
for (size_t i = 0; i < coins.size(); ++i)
for (in... | true |
71034459fca8d24aabba9671e0d39ef17189620e | C++ | menegais1/VectorFigures | /src/ColorPicker/ColorSlider.h | UTF-8 | 1,170 | 2.765625 | 3 | [] | no_license | //Color picker secondary window, used to select colors variance between black and the color selected at
//the color picker main window
#ifndef COLORSLIDER_H
#define COLORSLIDER_H
#include "../Base/CanvasObject.h"
#include "../Vectors/Float3.h"
#include <vector>
#include <functional>
class ColorSlider : public Canvas... | true |
b5dcd8b64c4b602e304d03698b5ffb412b754597 | C++ | n-jing/njinglib | /inc/hash_key.h | UTF-8 | 1,163 | 3.328125 | 3 | [] | no_license | #ifndef HASH_KEY_JJ_H
#define HASH_KEY_JJ_H
#include <unordered_map>
template <class T>
inline void hash_combine(std::size_t &seed, const T &v) {
std::hash<T> hasher;
seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
template<typename T, size_t d>
std::size_t HashFunc(const T &key)
{
size_t val... | true |
5640b58faafc40c942845e7ed23932d9a09a9cfd | C++ | vs256/GraphType-BreadthFirst-DepthFirst | /main.cpp | UTF-8 | 3,942 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "graphType.h"
using namespace std;
int main()
{
string vertices[] = { "Seattle", "San Francisco", "Los Angeles", "Denver", "Kansas", "Chicago", "Boston", "New York", "Atlanta", "Miami", "Dallas", "Houston"};
int amountOfCities = sizeof(vertices) / sizeof(vertices[0]);
graphType graph(a... | true |
80d70be55c37f760c98791ff9dc2655e90d6ded4 | C++ | uwcms/FinalStateAnalysis | /DataAlgos/interface/SmartTrigger.h | UTF-8 | 3,942 | 2.78125 | 3 | [] | no_license | #ifndef SMARTTRIGGER_ZE9BQMEK
#define SMARTTRIGGER_ZE9BQMEK
/*
* Choose the trigger to use from a list in a smart way.
*
* Author: Evan K. Friis, UW Madison
*
* The SmartTrigger is passed a comma separated list of TriggerGroups.
*
* example: "A|B, B_v*, C_v*"
*
* If [ez] is true, use the friendly '*' syn... | true |
24d85c51a8713871f4ebe39a241638e595bfd880 | C++ | alexvsezanyato/lab4 | /Line.cpp | UTF-8 | 669 | 3.046875 | 3 | [] | no_license | class Line: Shape {
public:
using Vec2 = sf::Vector2;
using Vec2f = sf::Vector2f;
using Positon = std::pair<Vec2f, Vec2f>;
private:
Position position;
public:
void setPos(Position);
Position getPos();
float getLength();
};
void Line::setPos(Position position) {
this->position = positi... | true |
d1f3f7a7466d9bd4390d8c1614402045777ce873 | C++ | vijaylaxmi26/competative | /Word_Break_Problem.cpp | UTF-8 | 1,130 | 3.453125 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
bool match(string s)
{
string dictionary[]={ "i","like", "sam" , "sung", "samsung" , "mobile" , "ice", "cream" ,
"icecream" , "man" , "go", "mango"};
int l=sizeof(dictionary)/sizeof(dictionary[0]);
for(int i=0;i<l;i++){
//cout... | true |
a9669e03180b97fd8a5d32380d671437d526b5ac | C++ | kelleyrw/pac | /packages/AnalysisTools/include/at/ConvertHypIndexToVectors.h | UTF-8 | 415 | 2.546875 | 3 | [] | no_license | #ifndef CONVERTHYPINDEXTOVECTORS_H
#define CONVERTHYPINDEXTOVECTORS_H
#include <vector>
namespace at
{
// function to convert a hyp index into a vector of mu/el indices
// NOTE: clears any contents on the reference vector arguments
void ConvertHypIndexToVectors(const int hyp_index, std::vector<int>& mu_in... | true |
238b4f1a9c6dcf88c4fc5d3848d58496de079087 | C++ | surabivishnupriya/AirlineReservation-Kal | /AirlineReservation/flight.cpp | UTF-8 | 3,243 | 2.921875 | 3 | [] | no_license | #include "stdafx.h"
#include "flight.h"
#include "Plane.h"
#include<iostream>
#include<iomanip>
using namespace std;
namespace AirlineReservation {
Flight::Flight( const std::string date, const std::string departureTime, const std::string arrivalTime, const std::string origin,
const std::string destination, const s... | true |
40dc89be21a2b850e1c6e2eca6ecfb761ad82865 | C++ | Abhishek765/DSA_Final | /Graphs/AlienDictionary.cpp | UTF-8 | 2,113 | 3.46875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void av()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
void dfs(vector<int> g[],int start,vector<bool>& vis,stack<int>& s, int V){
vis[start] = true;
// neighbours2
for(auto node: g[start]){
... | true |
aaecb5716ad09ecaede9002ec8dd328c108cdd3b | C++ | kaolin/detritus | /src/highscores.cpp | UTF-8 | 3,754 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #include <sqlite3.h>
#include "highscores.h"
#include <iostream>
using namespace std;
static std::ostream *myerror;
sqlite3* getDB(const char *filename) {
#ifdef DEBUG_MYERROR
(*myerror) << "OPENED DB:" << filename << endl;
#endif
sqlite3 *db;
int rc=0;
rc = sqlite3_open(filename,&db);
if (rc) {
... | true |
dc840cb8b72734100b10e8a2e93d0756a346f2c6 | C++ | sudiptobd/UVA-Solving | /10004.cpp | UTF-8 | 1,212 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <queue>
using namespace std;
int main()
{
int n=0;
while(scanf("%d",&n)&&n)
{
int e;
scanf("%d",&e);
vector<int>v[n];
int a,b;
for(int i=0; i<e; i++)
{
scanf("%d ... | true |
b338580f58cbea974d7cbc852f8186020144ea40 | C++ | zhiyaojia/Game | /parkour/parkour/MazeScreen.cpp | UTF-8 | 1,443 | 2.546875 | 3 | [] | no_license | #include "MazeScreen.h"
#include "Game.h"
#include "GameModeScreen.h"
#include "Renderer.h"
#include "OptionButton.h"
#include <iostream>
#include <vector>
#include <string>
#include <SDL/SDL.h>
using namespace std;
MazeScreen::MazeScreen(Game* game):UIScreen(game)
{
mNextButtonPos = Vector2(-130, 120);
mBackground... | true |
d16210d6feb2da32513ec13dbd3e4d8674226594 | C++ | valentinjacot/backupETHZ | /HPCI/exercises/ex07/solution_code/network/Network.h | UTF-8 | 7,954 | 2.9375 | 3 | [
"MIT"
] | permissive | /*
* Network.h
*
* Created by Guido Novati on 30.10.18.
* Copyright 2018 ETH Zurich. All rights reserved.
*
*/
#pragma once
#include "Layers.h"
struct Network
{
std::mt19937 gen;
// Vector of layers, each defines a forward and bckward operation:
std::vector<Layer*> layers;
// Vector of parameters of... | true |
f5328a8bb9024939b18ca1d61756f58bbe1f680f | C++ | xiabofei/leetcode | /2018/462_MinimumMovestoEqualArrayElementsII.cpp | UTF-8 | 518 | 3.03125 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <string>
#include <unordered_set>
#include <stack>
#include <queue>
#include <map>
#include <set>
using namespace std;
// 选1个元素+1 或 选1个元素-1
// 最小移动次数
// 解法: 排序 两头往中间靠拢
class Solution {
public:
int minMoves2(vector<int>& nums){
sort(nums.begin(), nums.end());
... | true |
809b17cb1016cdec4163598cce2f57a3626a22fa | C++ | SYCstudio/OI | /Practice/2019.3.31/BZOJ5324.cpp | UTF-8 | 662 | 2.8125 | 3 | [
"MIT"
] | permissive | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
const int maxN=5010;
int n,H[maxN],F[maxN][maxN];
double Slope(int a,int b);
int main()
{
scanf("%d",&n);
for (int i=1; i<=n; i++) scanf("%d",&H[i]);
int Ans=0;
for (int r=1; r<=n; r++) {
Ans^=(F[r]... | true |
71a545f3217b06fb295cd948b06744a8e816d8a6 | C++ | GNUDimarik/OsDev-3 | /user/bin/terminal/src/CommandLineInput.cpp | UTF-8 | 5,342 | 2.875 | 3 | [] | no_license | /**
* @file: CommandLineInput.cpp
*
* @date: Oct 24, 2017
* @author: Mateusz Midor
*/
#include "syscalls.h"
#include "Cout.h"
#include "StringUtils.h"
#include "CommandLineInput.h"
using namespace cstd;
using namespace cstd::ustd;
using namespace middlespace;
namespace terminal {
const char CommandLineInp... | true |
dae9bb41ab4ad6963a15dbd05bee3ade4757b521 | C++ | teddy8997/LeetCode | /Medium/139. Word Break/wordBreak.cpp | UTF-8 | 881 | 3.203125 | 3 | [] | no_license | /*
參考: https://zxi.mytechroad.com/blog/leetcode/leetcode-139-word-break/
time complexity: O(n^2)
space complexity: O(n^2)
*/
class Solution {
public:
bool wordBreak(string s, vector<string>& wordDict) {
unordered_set<string> sd(wordDict.begin(), wordDict.end());
return wordB(s, sd);
... | true |
4795d21561af011032f1fe3a2f4335e07d76e3eb | C++ | julianaabs/Zuma | /mapeamento.inl | UTF-8 | 3,039 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include "mapeamento.h"
#include "mainList.h"
//Construtor da classe
template <class object>
Map<object>::Map(Node<object> *auxInserido, Lista<object> *auxGame){
maisPosition = -1;
menosPosition = -1;
counterCombo = 0;
numberOfBalls = 0;
game = auxGame;
points = 0;
auxAfter = NULL;
auxBefor... | true |
a46650580e4d41afdc733df826d7ba0c7a13deff | C++ | StoneIron02/202101-CSE1101-004 | /5주차/실습/12211554강석철2_1.cpp | UTF-8 | 431 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
void printCmath(double x) {
cout << "ceil(x) : " << ceil(x) << endl;
cout << "exp(x) : " << exp(x) << endl;
cout << "log(x) : " << log(x) << endl;
cout << "sqrt(x) : " << sqrt(x) << endl;
cout << "fabs(x) : " << fabs(x) << endl;
cout << "pow(x,2) : " << ... | true |
3ee20d8ca559ca1d92ec7136907dd7a51b4dae7a | C++ | Brebl/Sdl2-wrapper | /src/brb_texture.cpp | UTF-8 | 5,708 | 2.5625 | 3 | [] | no_license | #include "pch.h"
namespace brb::sdl
{
Texture::Texture(const WindowRenderer& wr, const Font& f) :
texture_(nullptr),
texture_width_(0),
texture_height_(0),
renderer_(wr.get_renderer()),
font_(f.get_font()),
basecolor_(brb::sdl::col::basics::black)
{
basecolor_.a = 0xff;
SDL_SetRenderDraw... | true |
1b5b6c9608af8fc9ebfa45928e101e1e2bc04076 | C++ | frog97/freelec_modern_c-_programming | /Project_Code/Project5 - Ch9/Owner.h | UHC | 872 | 2.9375 | 3 | [] | no_license | #ifndef _OWNER_H_
#define _OWNER_H_
#include <iostream>
#include "Contact.h"
class Owner {
private:
char name[20]; // ̸
char phoneNumber[13]; // ȭȣ
char email[30]; // ̸
char address[50]; // ּ
char twitterAccount[20]; // Ʈ
public:
// Է
void ... | true |
3f9925f59d39a95e3bae37896e2579631335d38c | C++ | ShanzhongXinzhijie/DemolisherWeapon | /DemolisherWeapon/Render/GaussianBlurRender.h | SHIFT_JIS | 2,110 | 2.6875 | 3 | [] | no_license | #pragma once
namespace DemolisherWeapon {
class GaussianBlurRender{
public:
GaussianBlurRender() = default;
~GaussianBlurRender() {
Release();
}
/// <summary>
///
/// </summary>
/// <param name="souce">ڂVF[_[\[Xr[</param>
/// <param name="dispersion">ڂ̋</param>
/// <param name="sampleScale">T... | true |
53f8600013bd66d89592a4f02578f1b9138ce2be | C++ | Saurabh-12/learn_cpp | /oprator_loading/IOoverloading.cpp | UTF-8 | 1,028 | 3.828125 | 4 | [] | no_license | #include<iostream>
class Points
{
private:
double m_x, m_y, m_z;
public:
Points(double x = 0.0, double y = 0.0, double z = 0.0)
{
m_x = x;
m_y = y;
m_z = z;
}
friend std::ostream & operator<<(std::ostream &out, const Points &p);
friend std::istream & operator>>... | true |
0ef23435ac1b5bdc39970af997686392f3b7ec9a | C++ | saguila/EDA | /GISA2-01.cpp | UTF-8 | 553 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
#include "Stack.h"
void escribeDigitos(int numero) {
Stack <int> pila;
int calculo = 0;
do{ // Llenamos la pila
pila.push(numero % 10);
numero = numero / 10;
}while(numero > 0);
while(pila.size() > 0){
cout << pila.top();
if(pila.size() > 1) cout << " + ";
calc... | true |
6e4f58fb6499ac43430bcb1d5b71b971927a67be | C++ | kontai/CPlus | /L14重載運算和轉換/重載算術運算符.cpp | BIG5 | 1,887 | 3.75 | 4 | [] | no_license | /****************************************
[5/23/2017 21:18]
NMYB.cpp
****************************************/
#include<iostream>
#include<string>
using namespace std;
class Sales_item3
{
public:
Sales_item3(const string &book,const int units,const double amount):
isbn(book),unit_sold(units),revenue(amount){ }
/... | true |
8d492f9c9ff8c830dd7f7efdcb1fa2c0dca9d6ba | C++ | suptaphilip/C-Plus-Plus-Object-Oriented | /2. Class and Objects/1.Structre.cpp | UTF-8 | 1,187 | 4.125 | 4 | [
"MIT"
] | permissive | /*
write a proram to demonstrate structure in c++
*/
#include <iostream>
using namespace std;
struct Box
{
int length,width;
int Area()
{
return length*width;
}
};
int main(int argc, char const *argv[])
{
Box red;
red.length = 10;
red.width = 8;
cout << "Area is: " << red.Area() << endl;
return 0;
... | true |
de2ad90abfb1958a7127b85d7cc95592babe08a2 | C++ | arina237/3DS | /СТЗ/Лаб1/my_robot.h | WINDOWS-1251 | 1,639 | 2.703125 | 3 | [] | no_license | #pragma once
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
class MyRobot
{
public:
MyRobot() = default;
MyRobot(float width, float height,
float wheelWidth, float wheelDiameter,
float m_widtgT... | true |
640944dabd5f52342fef3b450e67569c033b735b | C++ | alur/LSBlur | /blurarea.cpp | UTF-8 | 3,217 | 2.625 | 3 | [] | no_license | #include "blurarea.h"
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//
// BlurArea - Constructor for BlurArea class.
//
// bmpWallpaper should be a pointer to a CBitmapEx class which contains a
// reconstruction of the wallpaper.
//
BlurArea::BlurArea(UINT X, UINT Y, UINT Wi... | true |
8e39cc45159c6499fbaf914dd62c454300765c33 | C++ | kanicha/C.C-CS-2021_09_01-Test | /C.C++CS-2021_09_01-Test.cpp | UTF-8 | 2,958 | 3.625 | 4 | [] | no_license | // Sakamaki Daiki
#include <iostream>
int main()
{
char str[10];
do
{
int num1 = 0;
int num2 = 0;
int ans = 0;
printf("値を2つ入力してください \n");
scanf_s("%d", &num1);
scanf_s("%d", &num2);
printf("終了するには end を入力してください。\n");
scanf_s("%s", &str);
if (num1 % 2 == 0)
{
ans = num1 - num2;
printf(... | true |
ff89a6a27ab5d56588cdd63a6c7ceff733e22a99 | C++ | jflozanor/iso8583core | /unittest/testPadder.cpp | UTF-8 | 1,771 | 3.203125 | 3 | [] | no_license | #include "LeftPadder.h"
#include "RightPadder.h"
#include "NullPadder.h"
#include "gtest/gtest.h"
class testPadder : public ::testing::Test {
protected:
testPadder() {};
virtual ~testPadder() {};
virtual void SetUp(){};
virtual void TearDown(){};
};
TEST_F(testPadder, pad) {
std::string zero_test = "abc";... | true |
44078c64d5bbc7bfb17f0d92048cb7f4c99b0c7d | C++ | EdgarM-/Proyecto-Objetos | /lib/SFicha.h | UTF-8 | 3,292 | 2.65625 | 3 | [
"MIT"
] | permissive | /* Copyright (c) 2013 Santiago Quintero Pabón, Edgar Manuel Amézquita, Juan Camilo Arévalo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limita... | true |
4ffcad95c37f6e8351f80c01e4f2e95543005909 | C++ | roboFiddle/7405M_TowerTakeover_Code | /src/robot/RobotAux.cpp | UTF-8 | 1,109 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// Created by alexweiss on 8/12/19.
//
#include "Robot.hpp"
namespace meecan {
void Robot::setupMainLoop() {
mainLooper = new loops::Looper(0, "main");
mainLooper->flag_as_main();
loops::Loop *test = new loops::Loop();
test->onStart = [](){instance->lastState = -1;};
test->onDisable = [](){}... | true |
2285c2d9039eefe714ff7b83bc065f9f7b377be8 | C++ | bang815/iFrogLab_F-60_UART | /Sample10-Android-Arduino-UART-LED/read/read.ino | UTF-8 | 820 | 2.71875 | 3 | [] | no_license | // 柯博文老師 www.powenko.com
#include <SoftwareSerial.h>
int ledPin = 10;
SoftwareSerial mySerial(10, 11); // RX, TX
String readString;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
Serial.println("serial on/off test 0021"); // so I can keep track
mySerial.begin(9600);
mySerial.println("Hello, ... | true |
64acb11837a7ccab81380890ce5f581e6b3bf059 | C++ | finnhittson/csds-397-hw3 | /research_assistant.h | UTF-8 | 1,196 | 3.1875 | 3 | [] | no_license | #ifndef RESEARCHASSISTANT_H_INCLUDE
#define RESEARCHASSISTANT_H_INCLUDE
#include "student.h"
#include "staff.h"
class ResearchAssistant : public Staff, public Student // definition of class ResearchAssistant with parent class of Student and Staff
{
public:
// default constructor ResearchAssistant(area... | true |
62d66c794964dbd2fe272041ff822533b1a7b5f1 | C++ | mililanirobotics/robot2013 | /2012Tracking/2013Tracking.cpp | UTF-8 | 7,743 | 2.578125 | 3 | [] | no_license | #include "WPILib.h"
#include "math.h"
/**
* This code is able to control a two motor system and get encoder values.
* Note that the drive system takes input from the left and right analog
* sticks of the Logitech controllers. If you want to use the normal
* joysticks, then change
*/
class RobotDemo : public Sim... | true |
524c2024858b8c19159f1b13e7ce8b60cb476510 | C++ | carvluc/URI_Online_Judge | /Há Muito, Muito Tempo Atrás - 1962.cpp | UTF-8 | 483 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<math.h>
using namespace std;
int main(){
long long int N, T, resposta;
cin>>N;
if(N>=1 && N<=100000){
while(N--){
cin>>T;
if(T>=0 && T<=pow(2,31)){
resposta = T - 2015;
if(resposta == 0 || resposta<0){
resposta = abs(re... | true |
6d895954e1e0a16d6ac2a787bd67690e21d719c3 | C++ | Goom11/interview_practice | /deleteDups/deleteDups.cpp | UTF-8 | 630 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <map>
using std::cout;
using std::endl;
using std::list;
using std::map;
void deleteDups(list<int>& n) {
map<int, bool> table;
list<int>::iterator n_it = n.begin();
while (n_it != n.end()) {
if (table[*n_it]) {
n.erase(n_it);
n_it--;
} else {
... | true |
c98be83e0e7c69e977925c6691ce974108700bd3 | C++ | Low-profile/ShenruoyangNa | /ll-compiler/expr.cpp | UTF-8 | 8,072 | 2.59375 | 3 | [] | no_license |
#include "parser.h"
using namespace std;
vector<unique_ptr<ExprAST>> Parser::Exprs(vector<token_t>::size_type idx, vector<token_t>::size_type &ret_idx, AST_node *node)
{
// auto n_expr = new AST_node("expr");
auto n_pexprs = new AST_node("_exprs");
auto tmp_idx = idx;
vector<unique_ptr<... | true |
83ba9f2de94b6e34f7f69aff4de8f99d04faffc4 | C++ | jaredmales/ExAOLab | /Bohlman/code/old_files/read_mixed_exp/read_mixed_exp.cpp | UTF-8 | 7,369 | 3.40625 | 3 | [] | no_license | /*! \file read_mixed_exp.cpp
\brief A documented file that takes 100 different pictures for 10 exposure times, for a total of 1000 images taken. Can subtract median photo from each.
Initializes the pylon resources, takes each photo and subtracts the median photo from each.
*/
#include "write_basler_fits.h"
// Subtra... | true |
7590422bccaab399dd7a400dacb19e006cecf81b | C++ | Benjamin-Crysup/protengine | /includes_pro/protengine_index_fasfa.h | UTF-8 | 2,787 | 2.59375 | 3 | [] | no_license | #ifndef PROTENGINE_INDEX_FASFA_H
#define PROTENGINE_INDEX_FASFA_H 1
#include <vector>
#include "whodun_compress.h"
#include "protengine_index_failgz.h"
/**The number of characters to take before splitting up into blocks.*/
#define FASFA_BLOCK_SIZE 1000
/**
* This will build a fasfa file from multiple source files.... | true |
61c902da06c7739c887428ff1c4b967b7d08c3bc | C++ | ssh352/CppWorkStream | /BookSamples/CppPL_BS/CppFromBS1/main.cpp | UTF-8 | 3,162 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <limits>
#include <memory>
#include <cstddef>
using namespace std;
int test_si()
{
string from, to;
cin >> from >> to; // get source and target file names
ifstream is {from}; // input stream for file "from"
istre... | true |
f812fb83043c25703f3550238fa970e90e963eac | C++ | Hesh0/Sabre3D | /Source/Sabre3D/Sabre3D.cpp | UTF-8 | 7,004 | 2.6875 | 3 | [] | no_license | #include "Sabre3Dstd.h"
#include "../Shader Handling/Shader.h"
#include "../Window/Window.h"
#include "../Graphics/OpenGLRenderer.h"
#include "../Graphics/3D/Mesh.h"
#include "../Graphics/Texture.h"
#include "../Math/S3DVectors/Vector.h"
#include "../Math/Mat4.h"
template <unsigned int N> struct Fib
{
en... | true |
f37a966f2717f8e4fe298fea1cd65627ca5cd16f | C++ | pareenj/Coding | /Trees/Practice/Find Height of Binary Tree.cpp | UTF-8 | 350 | 3.328125 | 3 | [] | no_license | // Binary Tree - Implemenation in C++
// Find height of Binary Tree
#include <iostream>
using namespace std;
// Definition of Node for Binary Tree
struct Node
{
int data;
Node* left;
Node* right;
};
int FindHeight(Node* root)
{
if(root == NULL) return -1;
return (max(FindHeight(root->left), FindH... | true |
277bb5b23306c740292f070cbc23fbd52082f3e9 | C++ | BenoitStackler/Projet_irrlicht | /src/projectile.hpp | UTF-8 | 688 | 2.5625 | 3 | [] | no_license | /* projectile.hpp */
#ifndef PROJECTILE_HPP
#define PROJECTILE_HPP
#include <irrlicht.h>
class Character;
class Projectile
{
public:
Projectile(Character *caster, float speed, float damage);
Projectile(Character *caster);
Projectile();
void impact();
void move();
void position(irr::core::vect... | true |
f87079c57cf3c8de1ccc50d153f2c2898204c1cc | C++ | ThierDev/Camera_Gimbal_Project | /Kalman_filter/Kalman_Lib.cpp | ISO-8859-2 | 1,855 | 3.078125 | 3 | [] | no_license | #include "Kalman_Lib.h"
Kalman::Kalman() {
Q_angle = 0.001f; // Erreur en position.
Q_error_s = 0.003f;// Erreur en vitesse.
R_measure = 0.03f;// Variance(v)
angle_after_kalman = 0.0f;// remet zro l'angle
speed_after_kalman = 0.0f; // remet zro l'erreur
// Ceci est la matrice de covariance d'erreur// t=0... | true |
57d325ca80c201c0351b0f53221708808ec9f002 | C++ | bintrue/design-patterns-play | /zdekany/Chain of Responsibility/example.cpp | UTF-8 | 2,493 | 4.3125 | 4 | [] | no_license | #include <iostream>
using namespace std;
// Abstract class called Handler
// It is abstract because it has a pure virtual function.
// This prevents instances of Handler being created directly.
class Handler {
protected:
Handler *next;
public:
// Constructor
Handler() { next = NULL; }
... | true |
fa63de54c78a51f33b0a59dd8617dd1f21d0c7f5 | C++ | 15831944/barry_dev | /src/DataField/FieldUtil.cpp | UTF-8 | 4,464 | 2.546875 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2005
// Packet Engineering, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification is not permitted unless authorized in writing by a duly
// appointed officer of ... | true |
72d4c3591cd20b4f8ae02e5b8f6b89331e86d28d | C++ | itsDhruv01/HiringProblem_1 | /Hiring.cpp | UTF-8 | 1,388 | 3.171875 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
//#include<random>
#include<ctime>
using namespace std;
void getWeight(int *wt, int n)
{
for(int i=0; i<n; i++)
cin>>*wt++;
cout<<endl;
}
void getPermutation(int *p, int n)
{
for(int i=0; i<n; i++)
{
int j = 0;
*(p+i) = rand()% n + 1;
... | true |
1c2e96a9954e863517534ef6f3ea0a1db987b97a | C++ | qdaggett/FryydGames | /SpriteLib2/FHazard.cpp | UTF-8 | 1,108 | 2.8125 | 3 | [] | no_license | #include "FHazard.h"
#include <iostream>
FHazard::FHazard(float newX, float newY, int newS, int h, Sprite newM, float w, float g)
:Monster(newX, newY, newS, h, newM)
{
theWidth = w;
gLvl = g;
}
void FHazard::move(int backLimit, int frontLimit, int &thecounter)
{
//try to incorporate physics here
float temp = getY... | true |
e9a78e870d9de26808eec8ec148bb3a85637873c | C++ | x0mka/Stud | /Queue.cpp | WINDOWS-1251 | 832 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include "Queue.h"
Queue::Queue()
{
length = 0;
};
Queue::~Queue()
{
};
void Queue::ExtractMax()
{
for (int counter = 0; counter < length - 1; counter++)
{
value[counter] = value[counter + 1];
key[counter] = key[counter + 1];
length--;
}
};
void Queue::Insert()
{
int k;
string str;
... | true |
aa942b468b189206777f1375a0218194c4647968 | C++ | egortrue/NeVK | /src/engine/scene/objects/camera.cpp | UTF-8 | 2,977 | 2.921875 | 3 | [] | no_license | #include "camera.h"
void Camera::update(float deltaTime) {
updatePosition(deltaTime);
updateDirections();
updateView();
}
void Camera::updateView() {
viewMatrix = glm::lookAt(
transform.position, // Позция камеры
transform.position + direction.front, // Позиция цели
direc... | true |
df10fe6f02056068e9f615c1ec852a00c70b4035 | C++ | mukeshjais/FAANG-Leetcode-questions | /house_robber.cpp | UTF-8 | 452 | 2.703125 | 3 | [] | no_license | class Solution {
public:
int rob(vector<int>& nums) {
int n = nums.size();
for(int i=2;i<n;i++){
int max=0;
for(int j=0;j<i-1;j++){
if(nums[j]>max)
max=nums[j];
}
nums[i]+=max;
}
int max_sum=0;
... | true |
5f74106728ad9911a4e4ea2ce37e4c3c8e1f1359 | C++ | RoseySoft/bobcat | /bobcat/tty/echo.cc | UTF-8 | 332 | 2.828125 | 3 | [] | no_license | #include "tty.ih"
bool Tty::echo(EchoType type)
{
struct termios tty = d_tty;
switch (type)
{
case ON:
tty.c_lflag |= ECHO;
break;
case OFF:
tty.c_lflag &= ~ECHO;
break;
default:
break;
}
return tcsetattr(d_fd, TCSANOW, &t... | true |
02ab14966fc0356819f2d7f1abba966a1b42972b | C++ | minorfish/ACM | /UVA/11054.cpp | UTF-8 | 386 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
const int N = 100005;
long long wines[N];
int main () {
int n;
while (scanf ("%d", &n), n) {
for (int i = 0; i < n; i++) {
scanf ("%lld", &wines[i]);
}
long long count = labs(wines[0]);
for (int i = 1; i < n; i++) {
wines[i] += wines[i - 1];
count +=... | true |
1f74870ae6d87100261c4a79e81260caac770f13 | C++ | nikonikolov/c_compiler | /src/DataStructures/WhileLoop.cpp | UTF-8 | 2,110 | 2.703125 | 3 | [] | no_license | #include "WhileLoop.h"
WhileLoop::WhileLoop(BaseExpression* condition_in, Statement* single_statement_in, const StatementT& stat_type_in) :
Statement(stat_type_in), condition(condition_in), loop_body(NULL), single_statement(single_statement_in) {}
WhileLoop::WhileLoop(BaseExpression* condition_in, CompoundStatement*... | true |
3ac860f3512b4af66e86974d55e5c67e2aae254a | C++ | yaokeepmoving/ELL | /libraries/predictors/neural/tcc/Activation.tcc | UTF-8 | 2,665 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | ////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Project: Embedded Learning Library (ELL)
// File: Activation.tcc (neural)
// Authors: Chris Lovett
//
////////////////////////////////////////////////////////////////////////////////////////////////////
... | true |
afdb8e3894b69cd07597591e518d3f39e7caff5f | C++ | hazelguo/Computer-Network-Practicum | /MachineLearning/generate_similarity_matrix.cc | UTF-8 | 3,735 | 2.671875 | 3 | [] | no_license | #include "StudentInfo.h"
#include "BPNeuralNet.h"
using namespace std;
BPNeuralNet BP_neural_net;
StudentInfo *GetInputForOneStudent() {
int _school;
double _GPA;
double _IELTS;
int _TOEFL;
double _GRE_overall;
double _GRE_verbal;
double _GRE_writing;
int _research_intern;
int _co... | true |
e8824bb001eb65e336f8a2f9c7e69b9fae4a213a | C++ | oraeng/px4_offboard_jw | /src/single_iris_hold_pos.cpp | UTF-8 | 7,584 | 2.515625 | 3 | [] | no_license | /**
* @file offb_node.cpp
* @brief Offboard control example node, written with MAVROS version 0.19.x, PX4 Pro Flight
* Stack and tested in Gazebo SITL
*/
#include <ros/ros.h>
#include <geometry_msgs/PoseStamped.h>
#include <geometry_msgs/TwistStamped.h>
#include <mavros_msgs/CommandBool.h>
#include <mavros_msgs/Se... | true |
b3e7ac52f8ea6e0e7047d45153b1780c8ace1b4b | C++ | deep-dream/virtual_gw | /src/ctrl_break_handler.h | UTF-8 | 987 | 3.0625 | 3 | [] | no_license | #pragma once
#include <windows.h>
#include <iostream>
class Ctrl_break_handler{
static BOOL CtrlHandler( DWORD fdwCtrlType )
{
switch( fdwCtrlType )
{
case CTRL_C_EVENT:
case CTRL_CLOSE_EVENT:
case CTRL_BREAK_EVENT:
case CTRL_LOGOFF_EVENT:
case CTRL_SHUTDOWN_EVENT:
printf(... | true |
ed8cf7084badf103f584742c9365ad224737a6b3 | C++ | vcheesbrough/phishpi.actionhero | /phishpi.arduino/src/MessageDispatcher.h | UTF-8 | 990 | 2.71875 | 3 | [] | no_license | #ifndef _MessageDispatcher_
#define _MessageDispatcher_
#include "InboundMessageHandler.h"
#include <initializer_list>
#include <vector>
#include <map>
namespace phishpi
{
class MessageDispatcher {
public:
MessageDispatcher(std::initializer_list<phishpi::InboundMessageHandler*> handlers) : handler... | true |
19aecaa824763ca5c556b07d11a79fb233a957d2 | C++ | kurdybacha/concurrency | /src/task_system_queue_per_thread_with_stealing.h | UTF-8 | 1,431 | 3.109375 | 3 | [] | no_license | #pragma once
#include <atomic>
#include <task_queue.h>
#include <thread>
#include <vector>
namespace queue_per_thread_with_stealing {
class task_system {
public:
task_system() {
for (unsigned int i = 0; i != _threads_count; ++i)
_threads.emplace_back([&, i] { run(i); });
}
~task_syste... | true |
5be9277f643ed7885ea67a6cca92f6fc964bbefd | C++ | EDCBlockchain/blockchain | /libraries/wallet/api_documentation_standin.cpp | UTF-8 | 2,284 | 2.546875 | 3 | [
"MIT"
] | permissive | // see LICENSE.txt
#include <iomanip>
#include <boost/algorithm/string/join.hpp>
#include <graphene/wallet/wallet.hpp>
#include <graphene/wallet/api_documentation.hpp>
namespace graphene { namespace wallet {
namespace detail {
namespace
{
template <typename... Args>
struct types_to_st... | true |
388784f89e9238f7ff9cf5316174c725cdd8aef1 | C++ | abhishek2208/Code | /Alternating Split of LinkedLIst.cpp | UTF-8 | 1,672 | 3.28125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node* next;
};
struct node* append(struct node* head,int val)
{
struct node* new_node=(struct node*)malloc(sizeof(struct node));
new_node->data=val;
struct node* temp=head;
while(temp->next!=NULL)
{
... | true |
48dd243b728e67237159ea0376b486ed6d303732 | C++ | VladyslavLopata/SFML_Engine | /collisions.cpp | UTF-8 | 1,340 | 3.09375 | 3 | [] | no_license | #include "collisions.h"
void Collisions::resetCollisions(int *levelMap,int &lWidth, int &lHeight, int &tWidth, int &tHeight)
{
//reset the map with provided values
collisionMap.clear();
collisionMap.resize(lWidth * lHeight);
for(int i = 0; i < lWidth * lHeight; i++)
{
collisionMap[i] = le... | true |
3b10e858d7296067cabc61194843c89085c67ea0 | C++ | zzo30802/ffmpeg-windows | /webcam_audio_to_rtmp/src/DataManager.cpp | UTF-8 | 1,332 | 2.859375 | 3 | [] | no_license | #include "DataManager.h"
#include <iostream>
extern "C" {
#include <libavformat/avformat.h>
#include <libavutil/time.h>
}
// bool ErrorMesssage(const int &error_num) {
// char buf[1024]{0};
// // put error code to buf
// av_strerror(error_num, buf, sizeof(buf));
// std::cout << buf << std::endl;
// return f... | true |
f4e9d9e35d356f8aba722ac7f2c9bcafd6f50b28 | C++ | VSFe/Algorithm | /CPP/etc/Gold I/17398.cpp | UTF-8 | 2,356 | 2.953125 | 3 | [] | no_license | /*
Problem: 통신망 분할 (17398)
Tier: Gold 1
Detail: BOJ의 인기스타, 방송인 권욱제는 통신 회사에 취업했다. 현재 이 통신 회사는 너무나 큰 통신망을 한 지사에서 관리하느라 큰 비용을 지불하고 있었다.
그래서 회사는 최근 IT의 트렌드 중 하나인 '탈중앙화'에 편승하여, 통신망을 분할하도록 결정했다. 그래서 욱제한테 통신망을 분할 할때 발생하는 비용을 분석하도록 지시했다.
현재 회사 망에는 1번부터 N번까지 총 N개의 통신 탑이 존재하며, 통신탑 간의 연결이 M개 존재한다.
이때 회사에서는 총 Q번 통신탑 간의 연결을 제거함으로써 ... | true |
ef01efa8553929386e8627e6da3fe17b02066fb6 | C++ | iXerol/Longest-Increasing-Sequence | /C++ Version/LIS/main.cpp | UTF-8 | 399 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// main.cpp
// LIS
//
// Created by Xerol Wong on 4/28/18.
// Copyright © 2018 Xerol Wong. All rights reserved.
//
#include <iostream>
#include "QuadrupleList.h"
using namespace std;
int main(int argc, const char * argv[]) {
int t[10] = {3, 9, 6, 2, 8, 5, 7, 10};
QuadrupleList q(t, 7);
q.printLongestIncreas... | true |
1b174ad41e08237f2a451baaa2c7c07644342e01 | C++ | hy38/OOP_Project | /ConsultingRequest.cpp | UTF-8 | 1,142 | 2.984375 | 3 | [] | no_license | #include "ConsultingRequest.h"
#include <iostream>
#include <string>
using namespace std;
ConsultingRequest::ConsultingRequest(vector<Professor> _Members)
{
professorList = _Members;
}
int ConsultingRequest::ifRequest()
{
string _IdNumber;
cout << "상담하고싶은 교수님의 ID를 입력해주세요: ";
cin >> _IdNumber;
int... | true |
4af422ebd2c32255ea4a4e23577909efe5aaf6aa | C++ | gakeane/C_Projects | /Sockets/network_utils.cpp | UTF-8 | 6,136 | 3.265625 | 3 | [] | no_license |
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
using namespace std;
/*
DECLARATIONS
*/
int open_client_connection(const char* hostname, const char* port);
int open_server_connection(cons... | true |
2678c961a863bc43957d297694526b0c4e881652 | C++ | rathyon/CGJ | /projects/lab0/qtrn.cpp | UTF-8 | 3,744 | 3.015625 | 3 | [] | no_license | #include "qtrn.h"
qtrn::qtrn()
{
}
qtrn::qtrn(float theta, vec3& axis)
{
float axis_length = axis.norm();
vec3 norm_axis = vec3(axis.x / axis_length, axis.y / axis_length, axis.z / axis_length);
float a = theta * (float)DEGREES_TO_RADIANS;
t = cos(a / 2.0f);
float s = sin(a / 2.0f);
x = norm_axis.x * s;
y ... | true |
63cd5eb85f37fa34fa2ada454d92e23478b0d523 | C++ | ChicoState/eggbeater | /cli/tests/SerialComm_test_port.cpp | UTF-8 | 3,025 | 2.703125 | 3 | [] | no_license | #include "gtest/gtest.h"
#include <memory>
#include <eggbeater/Serial.h>
#include <eggbeater/Discovery.h>
#include <iostream>
using namespace EggBeater;
class NoOpFixture : public ::testing::Test
{
public:
NoOpFixture()
{
// No-op
}
virtual ~NoOpFixture()
{
// No-op
}
virtual void SetUp(... | true |
75500cc19a8cdae23425e7cb021a70a88643060b | C++ | jimbui/Project-4_Graphs | /main.cpp | UTF-8 | 2,789 | 3.3125 | 3 | [] | no_license | #include "HashTable.h"
#include "Graph.h"
#include "DirGraph.h"
#include "Menu_Program.h"
int main()
{
cout << "4 tcejorP maeT" << endl << endl; // Insert new edge is the only algorithm for insertion required. Hash table can cause collisions.
Menu_Program() ;
// Get name --> vertex
// Method --> R... | true |
90af4ed3e16ee43806388907605b001db8e11e24 | C++ | luxe/unilang | /source/code/scratch/old_repos/code-scraps/project/cpp/move_around_curses.cpp | UTF-8 | 8,946 | 3.640625 | 4 | [
"MIT"
] | permissive | #include <curses.h>
#include <menu.h>
#include <cstdlib>
#include <string>
#include <cstring>
using namespace std;
/* This program was written by David Eck and modified by Scotty Orr
*
* This program demonstrates "curses" mode. It must be run on command line.
* When it is run, the console window is converted in... | true |
a7268b881accb2377b49d042a72e93800b769e99 | C++ | Lawrence37/algorithms | /sorting/shell_sort/shell_sort.hpp | UTF-8 | 1,925 | 3.8125 | 4 | [
"MIT"
] | permissive | #include <vector>
#include "../insertion_sort/insertion_sort.hpp"
#include "../../libraries/skip_iterator.hpp"
namespace {
/**
* Computes Sedgewick's gap numbers.
*
* @param limit The maximum gap needed. Must be at least 1.
* @return The gap numbers from smallest to largest.
*/
std::vector<long> sedgewickGaps(... | true |
4e9ea9a5dbd09f574bc8b9761815ce1782831e6f | C++ | lineCode/zaf | /src/zaf/parsing/parsers/internal/utility.h | UTF-8 | 816 | 2.546875 | 3 | [] | no_license | #pragma once
#include <string>
#include <zaf/parsing/parser.h>
#include <zaf/parsing/xaml_node.h>
#include <zaf/reflection/creation.h>
namespace zaf {
namespace internal {
bool ParseAttributeToDoubleFloats(
const std::wstring& attribute,
float& float0,
float& float1);
bool ParseAttributeToQuaterFloats... | true |