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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a0933d637db701e7457716bf10fac9763c44c55d | C++ | luizfeldmann/Ecliptic | /MeeusSeasons.cpp | UTF-8 | 3,752 | 2.796875 | 3 | [] | no_license | #include "MeeusSeasons.h"
#include <iostream>
#include <cmath>
static double calcJDE0(int year, MeeusEvent event)
{
if ((year < 1000) || (year > 3000))
std::cerr << "Attempt calculating events for year " << year << " which is outside the implemented bounds 1000 < Y < 3000!" << std::endl;
double Y = ((... | true |
aa36a3bc71795bbb64c2e2e1c2713e4e6ccee7ed | C++ | diaaserag/URI-ONLINE-JUDGE- | /1557 - Square Matrix III.cpp | UTF-8 | 1,316 | 2.765625 | 3 | [] | no_license | // main.cpp
// answer 1557 - Square Matrix III uri online judge
// solved by diaa serag
// Try hard before using other programmers' codes
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
int n,l=0,s=0,c=0;
while(cin>>n)
{
if(n==0)
{
break;
}
else
{
int a[10... | true |
6604142a3863531cb45e897a8c8b6cb9af5cb92d | C++ | anvesh649/programming-revamp | /InterviewBit/Arrays/Max Sum Contiguous Subarray.cpp | UTF-8 | 597 | 2.84375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int Solution::maxSubArray( const vector<int> &A) {
// Do not write main() function.
// Do not read input, instead use the arguments to the function.
// Do not print the output, instead return values as specified
// Still have a doubt. Checkout www.interview... | true |
cce12f6dfd51aae8d18a93fb69978bc078e5e589 | C++ | chaowang15/MeshSimplification | /mesh_simp/mesh_simp/include/qslim/metric/MxStack.h | UTF-8 | 1,450 | 2.75 | 3 | [] | no_license | #ifndef MXSTACK_INCLUDED // -*- C++ -*-
#define MXSTACK_INCLUDED
#if !defined(__GNUC__)
# pragma once
#endif
/************************************************************************
This provides a very simple typed-access stack class. It's really
just a convenience wrapper for the underlying MxDynBlock class.... | true |
103018484c3ec428ce566c8e8e3a0e38c82cb789 | C++ | jwk390/code | /lec08/test/geometry.cpp | UTF-8 | 590 | 2.546875 | 3 | [] | no_license | #include "geometry.h"
#include "eecs230.h"
using namespace lec08;
TEST(Posn, X)
{
Posn p;
p.x = 4;
EXPECT_EQ(4, p.x);
}
TEST(Posn, Initialize)
{
Posn p{3, 4};
EXPECT_EQ(3, p.x);
EXPECT_EQ(4, p.y);
}
TEST(Posn, Distance)
{
EXPECT_EQ(13, distance(Posn{3, 9}, Posn{8, 21}));
}
TEST(Circle, ... | true |
683a45e3b5d6dd3d5448e6011d3eb3795e4c8864 | C++ | ccoolliinn/test | /Array/Maximal_Rectangle.cpp | GB18030 | 2,112 | 3.390625 | 3 | [] | no_license | #include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
class Solution
{
public:
//άҵ1ľ
int maxRectangle(vector<vector<char>> &nums)
{
if (nums.empty() || nums[0].empty())
return 0;
int m = nums.size();//
int n = nums[0].size();//
////֮ͬǰֱͼһתΪֱͼ
vector<vector<int>> he... | true |
bdd46086b02e0f3864e62cee471526996aa97690 | C++ | fh666z/IncomeStats | /SQLStorage.cpp | UTF-8 | 6,134 | 2.765625 | 3 | [] | no_license | #include <QSqlDatabase>
#include <QSqlDriver>
#include <QSqlError>
#include <QSqlQuery>
#include <QDebug>
#include "SQLStorage.hpp"
#include "Definitions.hpp"
//==================================================================================================
// Constructors/Descrutctor
//===============... | true |
075e990d8f43b456bbd52e17e6b34691316d2d75 | C++ | MarwanG/Graal | /oldies/c++/DeltaVarIntEncoder.cpp | UTF-8 | 1,232 | 3.109375 | 3 | [] | no_license | #include "DeltaVarIntEncoder.h"
DeltaVarIntEncoder::DeltaVarIntEncoder(){
prev = 0;
}
void DeltaVarIntEncoder::encodeVarint(uint64_t value, uint8_t* output, uint8_t* outputSizePtr) {
uint8_t outputSize = 0;
while (value > 127) {
output[outputSize] = ((uint8_t)(value & 127)) | 128;
value >>= 7;
... | true |
e88c13bdd440e3dfcd64c67fae081d162759d177 | C++ | blake-boswell/algorithms_review | /red_black_tree/redBlackTree.h | UTF-8 | 934 | 3.015625 | 3 | [] | no_license | #define BLACK true
#define RED false
#include <iostream>
struct Node {
int data;
bool color;
Node* left;
Node* right;
Node* parent;
Node() {
data = -1;
color = RED;
left = NULL;
right = NULL;
parent = NULL;
}
};
class RedBlackTree {
private:
... | true |
e4510f08c4ddd9867c06d9e8cc31895ae13460b9 | C++ | mockingbirdnest/Principia | /base/not_null.hpp | UTF-8 | 15,064 | 3.109375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <algorithm>
#include <memory>
#include <type_traits>
#include <utility>
#include "base/not_constructible.hpp"
#include "base/traits.hpp"
#include "glog/logging.h"
// This file defines a pointer wrapper |not_null| that statically ensures
// non-nullness where possible, and performs runtime check... | true |
1bedc34e3ad05e896742d00743853a51e70f4789 | C++ | jiaaaaaaaqi/ACM_Code | /HDU/1698/14010530_AC_873ms_7960kB.cpp | UTF-8 | 2,113 | 2.671875 | 3 | [] | no_license | #include<map>
#include<queue>
#include<string>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#define inf 0x3f3f3f3f
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;
const int maxn = 400005;
int n, m;
ll node[maxn];
ll a... | true |
54cc1ead3fbbfc743fd760503239d3ab1151e0e2 | C++ | jenzou/Fluid-Simulator | /simulator/code/OptimizationLib/SoftUnilateralConstraint.cpp | UTF-8 | 1,043 | 3.28125 | 3 | [] | no_license | #include "SoftUnilateralConstraint.h"
SoftUnilateralConstraint::SoftUnilateralConstraint(double stiffness, double epsilon) {
this->epsilon = epsilon;
a1 = stiffness;
b1 = -0.5 * a1 * epsilon;
c1 = -1.0 / 3 * (-b1 - a1 * epsilon) * epsilon - 1.0 / 2 * a1 * epsilon * epsilon - b1 * epsilon;
a2 = (-b1 - a1 * epsilo... | true |
757812dbecde7e32fd96319e1646371e26844416 | C++ | anandaditya444/Competitive-Coding | /Codeforces/Codeforces_448A.cpp | UTF-8 | 463 | 2.59375 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
int main() {
int cups = 0, medals = 0, temp;
for(int i = 0; i < 3; i ++) {
scanf("%d",&temp);
cups += temp;
}
for(int i = 0; i < 3; i ++) {
scanf("%d",&temp);
medals += temp;
}
int n;
scanf("%d",&n);
int count = 0;
count += cups/5;
count += medals/10... | true |
238eb0dbdb463c440ccf23cdf4e86e247929e87b | C++ | mamengchen/-Data_Structure | /vector/my_vector.cpp | GB18030 | 4,644 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <algorithm>
#include <string>
#include <assert.h>
using namespace std;
namespace mmc
{
template<class T>
class My_vector
{
public:
//vectorĵһԭָ
typedef T* Iterator;
typedef const T* const_Iterator;
Iterator my_begin() { return _start; }
Iterator my_end() { return _finish; }
... | true |
8d324d8cf9c11f31e0a7bb878b67b85935762ae4 | C++ | liyinan1001/hangman-AI-CPP | /function.cpp | UTF-8 | 5,947 | 2.65625 | 3 | [] | no_license |
#include "function.hpp"
using namespace std;
void buildDicts(vector<string>& dicts, vector<long long>& counts, vector<double>& freq) {
string filePath = "./count_1w.txt";
ifstream fin(filePath);
long long sum = 0;
while(!fin.eof()) {
string word;
long long count;
fin >> word >> ... | true |
bc0edb5265a1b0d837d7900c0c52435c22425d36 | C++ | Whu-wxy/AmbientLightLab | /hysteresisloginterval.cpp | UTF-8 | 2,193 | 2.609375 | 3 | [] | no_license | #include "hysteresisloginterval.h"
HysteresisLogInterval::HysteresisLogInterval(int numTh)
{
m_numTh = numTh;
m_lastStable = -1;
m_methodName = "HysteresisLogInterval";
}
HysteresisLogInterval::HysteresisLogInterval(LightChart* pChart, int numTh)
{
m_pOutChart = pChart;
m_numTh = numTh;
m_las... | true |
6e0b1ac40e6e806e2ae0c90a54614212789c955c | C++ | valery-kirichenko/spbu | /Bushev/C++/3_if_else_for_while_etc/exception.cpp | UTF-8 | 287 | 3.15625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int i, j;
cin >> i >> j;
try{
if(j == 0) throw "Error, you can't devide by 0";
}catch(char c[]){
cout << c << endl;
system("pause");
return 0;
}
cout << "Devision: " << i / j << endl;
system("pause");
return 0;
}
| true |
1db8c6227291a94a7c53e77e4f89d5e49d40b5ef | C++ | Abdul-Haddi/1st-2019005 | /2019005 LAB 11 T2.cpp | UTF-8 | 335 | 3.453125 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include<math.h>
int pow(int x, int y)
{
if (y > 1)
{
return x * pow(x, y - 1);
}
else
{
return x;
}
}
int main()
{
int base, exp;
cout << "Enter base: \n";
cin >> base;
cout << "Enter exponent: \n";
cin >> exp;
cout <<base<< "^"<<exp<<" = "<<pow(base,exp);... | true |
0783f5d271d82b690b8cb154ce02321c64451f1d | C++ | sebastienPatte/Archives | /Info121/TP4/ex4.cpp | UTF-8 | 606 | 3.65625 | 4 | [] | no_license | #include <iostream>
using namespace std;
/** calcule la suite de syracuse en partant d'un terme de départ '&n'
* @param '&n' un entier
**/
void syracuse(int &n){
if(n<=0)cout<<"erreur, le terme de départ est inférieur à zéro"<<endl;
if(n%2==0){
n = n/2;
}else{
n = (n*3)+1;
}
}
/** Calcule le nombre de ter... | true |
c76ed7630100dab22f4771f42bb9f2af06a897b9 | C++ | WillardGithub/Beauty | /Android_SourceCode/BeautyAlgorithm.cpp | GB18030 | 47,975 | 2.625 | 3 | [] | no_license |
#include "BeautyAlgorithm.h"
using namespace cv;
#define PI 3.1415926
#define DETECT_BUFFER_SIZE 0x20000
#define max_uchar(a, b) (((a) > (b)) ? (a) : (b))
#define min_uchar(a, b) (((a) < (b)) ? (a) : (b))
#define MIN2(a, b) ((a) < (b) ? (a) : (b))
#define MAX2(a, b) ((a) > (b) ? (a) : (b))
#define CLIP3(x, a, b) ... | true |
5549ff255ecdf7bb9053ad40d8b6278e8ed8158b | C++ | hatlonely/leetcode-2018 | /c++/164_maximum_gap.cpp | UTF-8 | 663 | 3.34375 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <iostream>
#include <vector>
class Solution {
public:
int maximumGap(std::vector<int>& nums) {
if (nums.size() < 2) {
return 0;
}
std::sort(nums.begin(), nums.end());
int max = 0;
for (int i = 0; i < nums.size() - 1; i++) {
... | true |
8567b132feab807b403dcedcf280a89a335e19e6 | C++ | Klein-CK/C-Web | /QT_XViewer/src/XVideoEdit/XFilter.h | GB18030 | 1,060 | 2.640625 | 3 | [] | no_license | #pragma once
#include <opencv2/core.hpp>
#include <vector>
enum XTaskType {
XTASK_NONE,
XTASK_GAIN, // Աȶȵ
XTASK_ROTATE90, // ͼת
XTASK_ROTATE180,
XTASK_ROTATE270,
XTASK_FLIPX, // ͼ
XTASK_FLIPY,
XTASK_FLIPXY,
XTASK_RESIZE, // ıߴ
XTASK_PYDOWN, // ˹
XTASK_PYUP, // ˹
XTASK_CLIP, // ͼü
XT... | true |
808be4c1b208398917a0d09bef91254a11ad7b46 | C++ | leslier94/RodriguezLeslie_CSC17A_42824 | /homework/Assignment 3/problem_7/main.cpp | UTF-8 | 966 | 2.984375 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Leslie Rodriguez
*
* Created on April 4, 2016, 11:13 AM
*/
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <cctype>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
const int SIZE = 100;
char fileName1[SIZE];
char fileName2[SIZE];
... | true |
c36b18fb76c5585054fca6117e47282203be0e16 | C++ | Youssab-William/Competitive-Programming | /USACO/USACO 19feb-gold-cowland.cpp | UTF-8 | 3,614 | 2.625 | 3 | [] | no_license | /*
problem : http://usaco.org/index.php?page=viewproblem2&cpid=921
sol: standard HLD
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll OO= 0;
struct SGTR
{
int sz;
vector<ll>segment;
void calcsz(int n)
{
segment.clear();
sz=1;
while(sz<n)sz*=2;
... | true |
3d2abf9939bc16e42a56bc34e50fc2df1b39635d | C++ | g-4-gagan/Algorithm | /topologicalordering.cpp | UTF-8 | 2,890 | 3.296875 | 3 | [] | no_license | #include<iostream>
#include<queue>
using namespace std;
class node
{
node* prev;
int val;
node* next;
public:
node(node* ptr=0,int a=0,node* ptr1=0)
{
prev=ptr;
val=a;
next=ptr1;
return;
}
friend class DLL;
friend class graph;
};
class DLL
{
node* head;
node* tai... | true |
f7840d359f5370a8b9a005129633a513a5ad86f6 | C++ | axel36/some_stuff | /sphere_cpp_task/main.cpp | UTF-8 | 5,206 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <set>
#include <vector>
#include <algorithm>
class LinesController{
public:
void AddLine(const std::string& line){
std::vector<std::string> new_line;
auto start = 0U;
auto end = line.find(delim_);
while (end != std::string::npos)
{
... | true |
fa3911f86412ddbc68405dd5b2c9ade003e301d6 | C++ | iYefeng/DesignPatterns | /src/Prototype/Product.cc | UTF-8 | 881 | 2.78125 | 3 | [] | no_license | /************************************************************
* Use of this source code is governed by a BSD-style license
* that can be found in the License file.
*
* Author : yefeng
* Email : yefeng38083120@126.com
* Create time : 2016-10-04 17:04
* Last modified : 2016-10-04 17:04
* Filenam... | true |
04358891c3ebd2c60fb159646d75325f6f987066 | C++ | LorenzGonda/Car-Parking-System | /Car-Park-System/Main.cpp | UTF-8 | 2,111 | 3.0625 | 3 | [] | no_license | #include "Carpark.h"
#include "CarparkSlot.h"
#include "Staff.h"
#include "Driver.h"
#include <iostream>
#include <typeinfo>
using namespace std;
int main(int argc, char** argv) {
Carpark** carparkList = new Carpark*[3];
// Car Parks:
string name = "Happy Parking", location = "Happy Valley";
int numSlots[3] = { 6,... | true |
f9385b1ab2880da02683ef6efd71c0da80c11f35 | C++ | zhujiang73/pytorch_mingw | /torch/csrc/jit/codegen/cuda/index_compute.h | UTF-8 | 3,858 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | #pragma once
#include <torch/csrc/jit/codegen/cuda/iter_visitor.h>
#include <vector>
/*
* Index compute takes in a list of indices typically generated from the
* surrounding for loop nest. The number of indicies are intended to match the
* number of dimensions of the incomming TensorView which may have less or mo... | true |
c6a64ebcbe844e9692bb9a8c42ae59724ced1f0d | C++ | SimplyKnownAsG/argreffunc | /tests/PositionalTests.cpp | UTF-8 | 1,978 | 3.40625 | 3 | [
"Apache-2.0"
] | permissive | #include "arf/argreffunc.hpp"
#include "catch.hpp"
#include <iostream>
using namespace arf;
class SomeClass {
public:
double member_dubs;
};
TEST_CASE("positional", "[positional]") {
Parser parser("prog");
int int_val;
float float_val = 0.0f;
SomeClass sc;
std::function<void(double)> func ... | true |
062cf1163b2d8509761691b5514ffd93296e88da | C++ | VA-007/CP-Code | /79-Byterace-C.cpp | UTF-8 | 676 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#define int long long
using namespace std;
main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n, q;
cin >> n >> ... | true |
9d98daec6f71c0367a007a54fab052845d6b701b | C++ | iddeepak/Student_Management_System | /Database_Manager.h | UTF-8 | 521 | 2.59375 | 3 | [] | no_license | #include "sqlite3.h"
#include "Student.h"
using namespace std;
class DatabaseManager
{
private:
sqlite3 *DB;
public:
void setupDatabase();
void createTable();
void closeDatabase();
void saveStudentData(Student x);
void saveResultData(Result x, int rollno);
void ... | true |
40e3b0b6a8a586fd611ec714bf43012a7ee784d1 | C++ | EthanGriffee/SoftwareDev | /assignment4/part1/submitted_test_2.cpp | UTF-8 | 1,965 | 3.125 | 3 | [] | no_license | #include <gtest/gtest.h>
#include "dataframe.h"
#define GT_TRUE(a) ASSERT_EQ((a),true)
#define GT_FALSE(a) ASSERT_EQ((a),false)
#define GT_EQUALS(a, b) ASSERT_EQ(a, b)
#define ASSERT_EXIT_ZERO(a) \
ASSERT_EXIT(a(), ::testing::ExitedWithCode(0), ".*")
/*******************************************************... | true |
904869a0ff14a53dc10af9e5eb3cfad6f1aa23a4 | C++ | p-gonzo/cpp_practice | /chp12/listing_12_1.cpp | UTF-8 | 1,198 | 4.15625 | 4 | [] | no_license | #include <iostream>
#include <sstream>
#include <string>
class Date
{
private:
int day, month, year;
std::string dateString;
public:
Date(int m, int d, int y)
: month(m), day(d), year(y) { };
Date& operator++ () // preifx
{
++ day;
return *this;
}
Date operato... | true |
70c5caa8f8adfac095b4a8471288f9179994d0ad | C++ | mkut/cf | /01-99/03/3C/c++.cpp | UTF-8 | 1,226 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <map>
using namespace std;
class solver
{
map<string, string> ans;
public:
solver()
{
_solve(".........", true);
}
string solve(string str)
{
if(ans.count(str) != 0) return ans[str];
return "illegal";
}
private:
void _solve(string str, bool first)
{
if(ans.coun... | true |
c9a46c8cfd4d7f5a4e7851013059473031d98c15 | C++ | Tomcc/dojo | /src/Renderable.cpp | UTF-8 | 3,089 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "Renderable.h"
#include "Game.h"
#include "Viewport.h"
#include "Mesh.h"
#include "GameState.h"
#include "Object.h"
#include "Platform.h"
#include "Renderer.h"
using namespace Dojo;
Renderable::Renderable(Object& parent, RenderLayer::ID layer) :
Component(parent),
layer(layer) {
color = Color::White;
}
... | true |
4b5b0ff30f87b18370dfa8f7ac6095fa7da889a8 | C++ | yanbcxf/cpp | /MyToolKit/GB28181Client/AbstractCommand.h | GB18030 | 542 | 2.78125 | 3 | [] | no_license | #pragma once
class UsageEnvironment;
class AbstractCommand
{
public:
AbstractCommand(bool bSnyc);
virtual ~AbstractCommand(void);
int Call(UsageEnvironment & environ);
void CommandExecute(UsageEnvironment* pThis);
virtual int Execute(UsageEnvironment* pThis) = 0;
bool IsSnyc(){ return m_bSnyc; }
virtual... | true |
cc205e0e7c1d17c8986693f1bf0f80d35954419a | C++ | wojciech-goledzinowski/Zadania-z-programowania-STL-III-sem | /cpp/z31.cpp | UTF-8 | 527 | 3.3125 | 3 | [] | no_license | //BB31. W kontenerze <list> umieścić 10 liczb (od 0 do 9). Wyświetl elementy. Przy pomocy iteratora ustawionego na 3 element wstaw liczbę 1313 do kontenera. Wyświetl ponownie elementy kontenera.
#include <iostream>
#include <list>
using namespace std;
int main()
{
list<int> k1;
list<int>::iterator i1;
... | true |
d49aa2538b5e2b6de55f0b26d5cff54735e139fc | C++ | ckupetz/SeamCarving | /main.cpp | UTF-8 | 1,562 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include "Seam.cpp"
int main(int argc, char * argv[]) {
//Make sure we have the right number of arguments
if (argc != 4) { std::cout << "Please use the following format: '[filename] [VERTICAL_SEAMS] [HORIZTONAL_SEAMS]'\n"; return 0; }
... | true |
9538ba79de137cf2366449cb4d8fed8177ca8725 | C++ | mryoshio/hackerrank | /cpp/quicksort.cpp | UTF-8 | 938 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
void d(vector<int> ar, int l, int r) {
for (int i = l; i <= r; i++)
cout << ar[i] << " ";
cout << endl;
}
void quickSort(vector<int> &ar, int l, int r) {
vector<int> tmp(ar.size());
int i, l_idx = l, r_idx = r;
int piv = ar[l];
... | true |
4482af06efabd5b8044db52629f37d18650f25dc | C++ | shivangigoel1302/leetcode_solutions | /minimum_add_to_make_parenthesis_valid.cpp | UTF-8 | 558 | 2.6875 | 3 | [] | no_license | class Solution {
public:
int minAddToMakeValid(string S) {
int count = 0;
stack<char>parenthesis;
for(auto c: S){
if(c == '('){
parenthesis.push(c);
}
else{
if(parenthesis.empty()){
count++;
... | true |
aa3b4232601e8434d72e4cba260b00d3f70b9ed4 | C++ | CTDL-18CTT5A/FinalProject | /Source/CompressFileText/jpeg_encoder.h | UTF-8 | 2,965 | 2.90625 | 3 | [] | no_license | #ifndef __JPEG_ENCODER_HEADER__
#define __JPEG_ENCODER_HEADER__
class JpegEncoder
{
private:
int m_width; // Chiều rộng
int m_height; // Chiều cao
unsigned char* m_rgbBuffer; // Mảng chứa toàn bộ điểm ảnh m_width*m_height*3
unsigned char m_YTable[64]; // Chứa độ sáng khi chuyển đổi không gian màu
unsig... | true |
60bd2eaf23f5f8ffec5d530149321a61d9c9814e | C++ | Spetsnaz-Dev/CPP | /Misc/efficient_janitor.cpp | UTF-8 | 1,116 | 3.453125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void insertionSort(vector<float> arr, int n)
{
int i, j;
float key;
for (i = 1; i < n; i++)
{
key = arr[i];
j = i - 1;
/* Move elements of arr[0..i-1], that are
rer than key, to one position ahead
o... | true |
ab56911ed742f0dfb1d107591cbd4c104f11cfa4 | C++ | muhammadadji17/quiz1 | /menentukanJenisBilangan.cpp | UTF-8 | 365 | 3.140625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int Z;
cout<<"silahkan masukan bilangan: ";cin>>Z;
cout<<""<<endl;
if (Z < 0)
{
cout<<"yang anda input adalah bilangan negatif"<<endl;
}
else if (Z>0)
{
cout<<"yang anda input adalah bilangan positif"<<endl;
}
else if (Z==0)
cout<<"yang anda inpu... | true |
9347b311ebdd49c1e5c0f3915711ae623d33d4d1 | C++ | YC-YC/JNI | /TestBin/jni/pattern/component/Component.h | UTF-8 | 1,485 | 2.9375 | 3 | [] | no_license | /*
* Component.h
*
* Created on: 2018-5-7
* Author: Administrator
*/
#ifndef COMPONENT_H_
#define COMPONENT_H_
#include "Log.h"
#include "comdef.h"
#include <vector>
using namespace std;
class Component {
public:
virtual ~Component() {
}
virtual void action() = 0;
virtual void add(Component* pCom) {
L... | true |
acce644e0e0b8d8b40e2cddfe9087431c0832c90 | C++ | luthfihm/Tubes-2-Jarkom | /server.cpp | UTF-8 | 1,762 | 2.875 | 3 | [] | no_license | #include "server.h"
Server::Server()
{
// buka socket TCP (SOCK_STREAM) dengan alamat IPv4 dan protocol IP
if((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) < 0){
close(sock);
printf("Cannot open socket\n");
exit(1);
}
// ganti opsi socket agar dapat di-reuse addressnya
int yes = 1;
if (setsockopt(... | true |
b03cf3b57f1522d47df0d526f6a40d578ccc3ba1 | C++ | elensalustiano/chrome-t-rex | /chrome_t_rex.ino | UTF-8 | 5,267 | 2.890625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #include <LiquidCrystal.h>
// Defines the pins that will be used for the display
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//bitmap array for the dino character
byte dino [8]
{ B00000,
B00111,
B00101,
B10111,
B11100,
B11111,
B01101,
B01100,
};
//character for the tree
byte tree [8]
{
... | true |
2d5a64b93e6b6dafe6a5dc04298fdae800b89bec | C++ | UbiquityRobotics/fiducials | /fiducial_slam/include/fiducial_slam/helpers.h | UTF-8 | 217 | 3.09375 | 3 | [
"BSD-3-Clause"
] | permissive | #include <cmath>
#include <memory>
// Degrees to radians
constexpr double deg2rad(double deg) { return deg * M_PI / 180.0; }
// Radians to degrees
constexpr double rad2deg(double rad) { return rad * 180.0 / M_PI; }
| true |
506f5cee87bc63761aefd32e02209db869ca1c99 | C++ | RipeTomatoe/Capstone | /Capstone/Destroyer.h | UTF-8 | 1,123 | 3.453125 | 3 | [] | no_license | #ifndef __DESTROYER_H_
#define __DESTROYER_H_
template<class T>
class Destroyer
{
public:
/********************************************************************************************
Summary: Default Constructor
Parameters: [in] dest - The pointer of the singleton to be destroyed.
********************************... | true |
aeb66667ad5d1588c6258e9eca463c0b4436d88c | C++ | ygalkin/coding-challenges | /src/leetcode/roman-to-integer.h | UTF-8 | 619 | 3.34375 | 3 | [] | no_license | // https://leetcode.com/problems/roman-to-integer/
class Solution {
private:
const unordered_map<char, int> _lookup_tbl = {
{'I', 1}, {'V', 5}, {'X', 10}, {'L', 50},
{'C', 100}, {'D', 500}, {'M', 1000}
};
public:
int romanToInt(string& s) {
auto n{ 0 }; // result
int i{ 0 }... | true |
9e8b1e56c422f6bde31ceb2fd3de6e0c3ba96b50 | C++ | ZeCroque/study-uppa | /L2/S2/POO/TP6/main.cpp | UTF-8 | 876 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "adherents.h"
#include "oeuvre.h"
using namespace std;
int main()
{
Adherent moi("Croquefer", "Gaëtan", "140996", 21, "Louis Lacaze", "Pau", "64000", 16);
Adherents ad;
ad.addAdherent(moi);
ad.afficheAdherent(0);
Exemplaire exp1(1);
Exemplaire exp2(2);
Exemplaire exp3(3);
... | true |
928815b885175fe847d49cb55257e1b20b7e2067 | C++ | junbrot/algorithm | /programmers/p42748.cpp | UTF-8 | 845 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> array, vector<vector<int>> commands) {
vector<int> answer;
for(int i=0; i<commands.size();i++)
{
vector<int> temp;
for(int j=commands[i][0]-1; j<commands[i][1]; j++)
... | true |
3c7142c3528f50ada11583c6d4441ca8351f92a5 | C++ | kohlerricardo/simulator | /main_memory/memory_controller.hpp | UTF-8 | 1,492 | 2.59375 | 3 | [] | no_license | #ifndef MEMORY_CONTROLLER_H
#define MEMORY_CONTROLLER_H
class memory_controller_t{
private:
uint64_t requests_made; //Data Requests made
uint64_t operations_executed; // number of operations executed
uint64_t requests_emc; //Data Requests made to DRAM
uint64_t requests_llc; //Data ... | true |
38a50b33e7ac91459a46309e3b9857ea6272b16d | C++ | nathaniel-mohr/undergrad_coursework | /CS162/labs/lab7/shape.h | UTF-8 | 316 | 2.96875 | 3 | [] | no_license | #ifndef SHAPE_H
#define SHAPE_H
#include <string>
#include <iostream>
using namespace std;
class Shape{
protected:
string name;
string color;
public:
string get_name() const;
string get_color() const;
void set_name(string);
void set_color(string);
virtual float calculate_area() = 0;
};
#endif
| true |
3d30c590dc9ff6329ff2cdf7733cc46cd801863b | C++ | MartinTownley/ampify-placement-p1 | /source/resultChecker.h | UTF-8 | 2,109 | 3.546875 | 4 | [] | no_license | //
// resultChecker.h
// Calculator
//
// Created by sierra on 18/02/2021.
//
#pragma once
#ifndef resultChecker_h
#define resultChecker_h
#include "calculator.h"
/* The following function constitutes one solution
to the std::abs error (see README for details)
*/
double ABS (double input)
{
return input <... | true |
43faf61ca605608efade7be72179673cb1f82bfd | C++ | nvs-abhilash/OSNtrust | /CST/partition.cpp | UTF-8 | 3,264 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string.h>
#include "graph.h"
#include "tree.h"
#include <bits/stdc++.h>
#include <vector>
const char FILE_NAME[] = "CST_out.bin";
int *partHash;
int *part;
// Compares two intervals according to staring times.
bool compare(Node i1, Node i2)
{
return ((i1.edgeWeigh... | true |
0861600ec12e87919cb6daac210df793cdcd4590 | C++ | eXpliCo/SimCraft | /Source/GraphicsEngine/Text.cpp | UTF-8 | 318 | 2.65625 | 3 | [] | no_license | #include "Text.h"
Text::Text(string text, D3DXVECTOR2 position, float size)
{
this->text = text;
this->position = position;
this->size = size;
this->font.texture = NULL;
for(int i = 0; i < 256; i++)
this->font.charTexCoords[i] = 0;
}
Text::~Text()
{
if(this->font.texture)
this->font.texture->Release();
}
| true |
896c0c85f19d2aae0bdea9a0db5823729a60382c | C++ | daveying/learn-algorithm | /linked-list.h | UTF-8 | 4,498 | 3.875 | 4 | [] | no_license | #ifndef DDLINKED_LIST_H
#define DDLINKED_LIST_H
#include <functional>
template<class T>
class LinkedListNode {
public:
T data;
LinkedListNode<T>* next;
LinkedListNode() : next(nullptr) {}
LinkedListNode(T data, LinkedListNode<T>* next = nullptr) : data(data), next(next) {}
~LinkedListNode();
};
... | true |
13cb075e23b8d1c07a693e72c36b2d313d249e43 | C++ | Sumanzaheer/ComplexNumber | /header.h | UTF-8 | 2,074 | 3.75 | 4 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
class ComplexNum
{
private:
double real;
double imaginary;
public:
ComplexNum()
{
this->real=0.0;
this->imaginary=0.0;
}
ComplexNum(double r, double i)
{
this->real=r;
this->imaginary=i;
}
Comple... | true |
d1afa77c618a8d45829c9fd374b4909ba59d5669 | C++ | sridharreddy7/Algos | /ekt.cpp | UTF-8 | 1,079 | 2.828125 | 3 | [] | no_license | #include <utility>
#include <stdio.h>
#include <iostream>
#include <map>
#include <algorithm>
using namespace std;
int main(){
string str1, str2;
long long int wgt;
map<string, long long int> map1;
map<string, long long int>map2;
map<string, string>map3;
map<long long int, string>map4;
long long int n,m;
c... | true |
b44505ab4de4551b1485384267dcbf8ca7d36694 | C++ | ehsanpanahy/SocketUDP | /serverinterface.h | UTF-8 | 1,543 | 2.90625 | 3 | [] | no_license | #ifndef SERVERINTERFACE_H
#define SERVERINTERFACE_H
#include <string>
/**
* @brief An interface for Server infrastructure.
* @details This interface decouples the implementation of server infrastrucure
* from the underlying library(Unix, boost, win32,...). That way the user of the
* Server class does not need t... | true |
05bb2386302663e4fba1df3f65ca3010b1be6224 | C++ | ThreeInches/Total_review | /总复习/异常处理/异常处理/1异常的概念.cpp | GB18030 | 707 | 3.34375 | 3 | [] | no_license | #include <iostream>
using namespace std;
//C++쳣ķʽһԼʱͿ׳쳣úֱӻӵĵ
//throwֵʱ׳һ쳣ͨthrowؼɵ
//catchͨcatchؼ쳣жcatchв
//trytryеĴʶض쳣һcatch
int main()
{
try
{
//ıʶ
}catch (ExceptionName e1)
{
//catch
}catch (ExceptionName e2)
{
//catch
}catch (ExceptionName eN)
{
//catch
}
system("pause");
return 0;
}
| true |
707f68dafc0b2e5772c51cfffec2091575fac059 | C++ | CosmicHunter/Various-Codes-in-C | /C-Codes/no of path.cpp | UTF-8 | 419 | 2.984375 | 3 | [] | no_license | #include<stdio.h>
int m;
void fun(int x,int y);
int ans=0;
int main(){
int i,j;
int n;
printf("Enter the no of rows");
scanf("%d",&n);
printf("enter the no of columns");
scanf("%d",&m);
fun(n,1);
printf("%d",ans);
}
void fun(int x,int y){
y>=1&&y<=m;
if(x==1&&y==m){
ans++;
... | true |
104b933136d03855b71899d4a7c00849910d32a9 | C++ | xelomit/advancedCpp | /assignment5/L5.1FileLockerRPN/fraction.h | UTF-8 | 2,099 | 2.984375 | 3 | [] | no_license | //
// Created by timo on 26.11.18.
//
#ifndef L5_1FILELOCKERRPN_FRACTION_H
#define L5_1FILELOCKERRPN_FRACTION_H
#include <iostream>
int gcf(int a, int b) {
return b == 0 ? a : gcf(b, a % b);
}
int lcm(int a, int b) {
return (a*b) / gcf(a, b);
}
class fraction {
int c;
int d;
public:
fraction(i... | true |
b54d0ac616d8a63edfbaf0d8232ba334c6eb91dd | C++ | srishti26/ray | /include/spotlight.h | UTF-8 | 1,539 | 2.828125 | 3 | [] | no_license | #ifndef RAY_SPOTLIGHT_H
#define RAY_SPOTLIGHT_H
#include "light.h"
#include "random.h"
class Spotlight : public Light {
public: /* Methods: */
Spotlight (const SceneSphere& sceneSphere, Colour intensity, const Point& p, const Vector& d, floating a)
: Light {sceneSphere, intensity, true, true}
, m... | true |
267a0b323720acb285277762c0cc258ecc5adaa7 | C++ | Kawser-nerd/CLCDSA | /Source Codes/AtCoder/arc051/C/715890.cpp | UTF-8 | 1,980 | 2.609375 | 3 | [] | no_license | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>
#... | true |
fd9ca3d1db1f09547d163798ef952621aaf9faa1 | C++ | Chicaogo/WinCode | /刷题/一本通提高篇/第一部分/第一章 贪心算法/1.1活动安排.cpp | UTF-8 | 941 | 2.71875 | 3 | [] | no_license | //https://www.luogu.org/problemnew/show/U48369
#include<bits/stdc++.h>
using namespace std;
inline int read()
{
int x = 0,t = 1; char ch = getchar();
while(ch < '0' || ch > '9'){if(ch == '-') t = -1; ch = getchar();}
while(ch >= '0' && ch <= '9'){x = x*10 + ch - '0'; ch = getchar();}
return x*t;
}
st... | true |
073b96f2339a3a30238127e295cf538ea5fb1491 | C++ | hannachoi24/Data_Structure | /termProject/project2(directionO).cpp | UTF-8 | 15,138 | 3.21875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <map>
#include <iterator>
#include <vector>
#include <algorithm>
#include <cmath>
#include <time.h>
#define NUMBER 500
#define MAX_VTXS 5000
using namespace std;
class AdjMatGraph
{
protected:
int vertices[MAX... | true |
3db604dc68a004c052f7312333676c7b468ac874 | C++ | SerxLee/acm | /hlg/26-H.cpp | UTF-8 | 664 | 2.671875 | 3 | [] | no_license | #include <cstdio>
int main()
{
int n;
int i, j ,k;
scanf("%d", &n);
int a[105][105];
int max = 0, sum = 0;
for (i = 1; i <= n; ++i)
for (j = 1; j <= n; ++j)
scanf("%d", &a[i][j]);
for (i = 1; i <= n; i++){
for (k = 1; k < i; k++)
sum -= a[k][i];
for (j = i + 1; j <= n; ++j){
sum += a[i][j];... | true |
6212b3fdd4f2e0e2326125a2d4afbf6ffa682aa6 | C++ | noahaim/Ex3_b | /Main.cpp | UTF-8 | 1,359 | 2.96875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
// #include <sstream>
// #include <stdexcept>
using namespace std;
#include "NumberWithUnits.hpp"
using namespace ariel;
int main() {
ofstream Myunits_file;
Myunits_file.open("Myunits_file.txt");
Myunits_file<<"1 km = 1000 m"<<endl;
Myunits_file<<"1 m = 100 cm"<<endl;
... | true |
d61b7303536425e166ad0afdf9f68f4b81486066 | C++ | fonxsirax/Analysis-and-Project-of-Algorithms | /EditDistance/main.cpp | UTF-8 | 967 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
#include <iostream>
using namespace std;
char a[2000];
char b[2000];
int n = 0;
int editDistance()
{
int table[strlen(a) + 1][strlen(b) + 1];
int minimun;
int aux1 = 0;
int aux2 = 0;
int aux3 = 0;
unsigned int i = 0;
for... | true |
511d12e774c0b9192abb25f3ce92644ce3f1eac6 | C++ | LoyieKing/anNESlie | /anNESlie/Emulator/CPU/Instruction.cpp | UTF-8 | 5,616 | 2.5625 | 3 | [] | no_license | #pragma once
#include "CPU.h"
void CPU::JSR()
{
PushWord(Register.PC + 1);
Register.PC = NextWord();
}
void CPU::RTI()
{
NextByte();
Register.setP(Pop());
Register.PC = PopWord();
}
void CPU::RTS()
{
NextByte();
Register.PC = PopWord() + 1;
}
void CPU::INY()
{
Register.setY(Register.getY() + 1);
}
void CPU::... | true |
afd32fccb76e4feb43bc4126d714a19e32ffb2f2 | C++ | agudeloandres/C_Struct_Files | /C_Tutorships/OOP_C/CAP6/P90.CPP | UTF-8 | 152 | 2.90625 | 3 | [] | no_license | #include "iostream.h"
int x,y;
int &F(int &y) {
y = 3;
return x;
}
main() {
int &F(int &);
F(y) = 100;
cout << x << endl;
cout << y << endl;
}
| true |
1b1383def6855d61837e61b9881ddcbdde26e211 | C++ | ivanhu42/p | /codeforces/cpp/534a.cpp | UTF-8 | 685 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <iomanip>
using namespace std;
typedef long double db;
typedef long long ll;
int main()
{
int n, i = 1;
cin >> n;
if (n == 1)
cout << "1\n1" << endl;
e... | true |
61e90a64ab096d7f3139c57f191865dde4f146a9 | C++ | aalok-sathe/cs301-prog2 | /MachLangParser.cpp | UTF-8 | 13,759 | 3.34375 | 3 | [] | no_license | // aalok sathe
#include "MachLangParser.h"
/*
* Public class methods go here
*/
MachLangParser::MachLangParser(string inputfile)
// Default constructor for the MachLangParser class.
// Initializes using a string filename of an input file,
// and processes each line in that input file to decode
// the binary and ass... | true |
f2cd43443e35010aa13a2231c4fabaaa9efe4868 | C++ | awebkit/cppbuilding | /cpp-building/myown/meson.cpp | UTF-8 | 1,138 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long LL;
LL Mul(LL a, LL b, LL m)
{
LL ans = 0;
while(b)
{
if(b & 1)
ans = (ans + a) % m;
a = (a*2)%m;
b /= 2;
}
retu... | true |
e277ea8873cbaab4457ea0f6633cbe77fafe9aac | C++ | kusosk/cvim-ide | /cxx/test/zigzagString.cc | UTF-8 | 2,641 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <climits>
#include <string>
#include <exception>
#include <stdexcept>
using namespace std;
string convert(string s, int nRows) {
if (s.size()<2 || nRows < 2) return s;
int len=s.size(), pos;
int stp = (nRows<<1)-2;
char c;
string res;
int cnt=0;
for (in... | true |
9d409a3e9663bdb21949693a02e97c8c5f92fd05 | C++ | cli851/noi | /P58L4.3.cpp | WINDOWS-1252 | 260 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int sum_ji=0,sum_ou=0;
for(int i=1;i<=100;i++)
{
if(i%2==0)//ż
{
sum_ou +=i;//sum_ou=sum_ou+i;
}
else
{
sum_ji +=i;
}
}
cout<<sum_ji<<" "<<sum_ou;
return 0;
}
| true |
b42b3704f98908fbdbc62b1a2b17463836e55528 | C++ | kjellhar/QLibUsb | /usbimpl.cpp | UTF-8 | 570 | 2.59375 | 3 | [] | no_license | #include "usbimpl.h"
/// Used by shared_ptr to delete a libusb context
class ContextDeleter
{
public:
void operator()(libusb_context* ctx) { libusb_exit(ctx); };
};
QLibUsb::UsbImpl::UsbImpl()
{
// Create the libusb context
libusb_context* pContext = 0;
int Result = libusb_init(&pContext);
if (Re... | true |
c5178999d5107a06c8b4daad6fa319399b08b933 | C++ | jiaxinchenxx/TreeAlgorithm | /HuffmanTree/HuffmanTree.cpp | UTF-8 | 3,439 | 3.765625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class HuffmanTreeNode {
public:
char element;
float weight;
HuffmanTreeNode * parent;
HuffmanTreeNode * leftChild;
HuffmanTreeNode * rightChild;
HuffmanTreeNode() {
leftChild = NULL;
rightChild = NULL;
}
HuffmanTreeNode(char ... | true |
dcd2975affdc2b2d656bafd5471394383b56909f | C++ | Mdlglobal-atlassian-net/orbit | /OrbitBase/MainThreadExecutorTest.cpp | UTF-8 | 1,489 | 2.75 | 3 | [
"LicenseRef-scancode-free-unknown",
"BSD-2-Clause"
] | permissive | // Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include <memory>
#include <utility>
#include "OrbitBase/MainThreadExecutor.h"
TEST(MainThr... | true |
e2d284ebb603604c4bb75c29385346c6e364ae01 | C++ | mohsinenur/URIOnlineJudge | /S Sequence.cpp | UTF-8 | 316 | 3.09375 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
using namespace std;
main()
{
//s= 1/1 + 1/2 + 1/3 + ....+ 1/100
double S = 0;
double tS = 0;
int i;
cout << fixed;
for (i=1; i<=100; i++)
{
S = (double)1/i;
tS += S;
}
cout << setprecision(2) << tS << endl;
return 0;
}
| true |
f7d02e3b5546417afe21b68b948d7cc4fe7b41ff | C++ | youtube/cobalt | /base/allocator/partition_allocator/spin_lock.h | UTF-8 | 1,550 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_SPIN_LOCK_H
#define BASE_ALLOCATOR_PARTITION_ALLOCATOR_SPIN_LOCK_H
#include <atomic>
#include <memory>
#in... | true |
731f00850fb5be16eea641624f5213edf1f643a6 | C++ | victorhbc/Estruturas-de-dados- | /Projeto 1/insertSort.cpp | UTF-8 | 1,002 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define len 20000
#include "header.h"
using namespace std;
void select(int v[]);
int main(int argc, char const *argv[])
{
int x;
int v0[len], v1[len], v2[len];
cout << "Ordenado: " << endl;
sorted(v0);
select(v0);
cout << "Des... | true |
4de10919cfc363710bbfc0c9bdfcc9825d370881 | C++ | FJNU-spicey/software-test | /VirtualQueryEx.cpp | GB18030 | 2,344 | 2.859375 | 3 | [] | no_license | #include<windows.h>
#include<iostream>
#include<shlwapi.h>
#include<iomanip>
#pragma comment(lib,"shlwapi.lib")
inline bool TestSet(DWORD dwTarget, DWORD dwMask)
{
return((dwTarget & dwMask)==dwMask);
}
#define SHOWMASK(dwTarget,type)\
if(TestSet(dwTarget,PAGE_##type))\
{std::cout<<","<<#type;}
... | true |
68be087039806f18a7c40775e779bbb4f5b04b81 | C++ | Veirisa/MathLogic | /Homework1/main.cpp | UTF-8 | 1,274 | 2.8125 | 3 | [] | no_license | #include "expression.h"
vector<expression*> hypotheses;
vector<expression*> derivations;
void add_hypotheses(const string& s) {
size_t i = 0;
string new_hypo = "";
while (s[i] != '|' || s[i + 1] != '-') {
if (s[i] == '\0' || s[i] == ' ' || s[i] == '\t') {
++i;
continue;
... | true |
77ec196d929d2c7ee17e28dfe256a2f4eee383f0 | C++ | YongHoonJJo/BOJ | /2493.cpp | UTF-8 | 466 | 2.734375 | 3 | [] | no_license | #include <cstdio>
#include <stack>
using namespace std;
stack<int> S;
int ans[500001];
int main()
{
int n, k;
int tower[500001];
scanf("%d", &n);
for(int i=1; i<=n; i++)
scanf("%d", tower+i);
for(int i=1; i<=n; i++) {
while(!S.empty()) {
int prev = S.top();
if(tower[prev] > tower[i]) {
ans[i] = ... | true |
537d3a95df722b5be25092d45e999b60ccba7206 | C++ | ucsb-cs16-s19-nichols/code-from-class | /05-09/centroid.cpp | UTF-8 | 695 | 4.03125 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct Point {
double x;
double y;
};
// Point *arr ≡ Point arr[]
Point* centroid(const Point *arr, int size) {
Point *ret = new Point;
(*ret).x = 0;
ret->y = 0;
// average all the points
for (int i = 0; i < size; i++) {
ret->x += arr[i].x... | true |
32c0bffff1cca0e22e3ea7a9e2427d87836820a7 | C++ | KristiyanGergov/DataStructuresAndAlgorithms | /Week 07 - Tree Algorithms/BinarySearchTree/TreeExcercice/BinarySearchTree.cpp | UTF-8 | 1,143 | 3.625 | 4 | [] | no_license | #include "BinarySearchTree.h"
BinarySearchTree::BinarySearchTree()
{
this->head = NULL;
}
BinarySearchTree::~BinarySearchTree()
{
delete head;
}
void BinarySearchTree::insert(int data)
{
if (head == NULL)
{
head = new Node(data);
return;
}
Node * curr = head;
Node * temp = new Node(data);
while (curr !... | true |
4b69d42485dfa72f0871859188907ee43b39a254 | C++ | ramzani97/Alpro-II---semester-2 | /array.TUGAS.cpp | UTF-8 | 579 | 3.203125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int i,x;
cout << endl ;
cout << "-_-_-_-_Aplikasi ini menggunakan ARRAY-_-_-_-_" <<endl ;
cout << "Tentukan banyaknya data!: " ;
cin >> x ;
cout << "=============" << endl;
string nama[x]; // ARRAY //
for (i=0;i<x;i++) { // Pengulangan //
cout <<... | true |
b0831a115c1fdc8b767467834282043a1346aab2 | C++ | rodrigobmg/201503_direct3d_demo | /engine/header/util/Texture2DFromBytes.h | UTF-8 | 5,031 | 2.59375 | 3 | [] | no_license | /*
Texture2DFromBytes.h
--------------------
Created for: COMP3501A Assignment 6
Fall 2014, Carleton University
Authors:
Bernard Llanos
Created November 7, 2014
Primary basis: None
Description
-A Texture class encapsulating texture creation from in-memory data
-Note that textures are created CPU read-only,
... | true |
303d2b87c61fb975dadcec876fa5e792dd17fce4 | C++ | dmaulikr/sushi | /sushicpp/sushiapplication/sushiapplication/application.hpp | UTF-8 | 3,026 | 2.703125 | 3 | [
"MIT"
] | permissive | // application.hpp
// sushiapplication - sushicpp
//
// Created: 01:19 08/15/2017
// Author: Michael Ong
#pragma once
#include <functional>
#include <vector>
#include <string>
#include <sushicore/Rectangle.h>
#include <sushicore/CoreObject.h>
#include <sushicore/PointerOwnership.h>
namespace sushi::window {
c... | true |
b11d0a86468ddb8b8428e9606b79f22966a317c6 | C++ | chandreshsharma/Cpp11 | /22_lambdas_2.cpp | UTF-8 | 3,037 | 4.0625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <limits>
#include <algorithm>
#include <list>
#include <functional>
/******
A program to use lambdas with STL containers and User defined Classes.
It also shows how to use the std::function() to point to a lambda function.
******/
class Height {
public:
... | true |
2434497ef08991132553697d5d444587239ea5f3 | C++ | TheLogicalNights/CPP-Programing-Assignments | /Assignment_3/Program_3/Helper.cpp | UTF-8 | 1,722 | 3.25 | 3 | [] | no_license | #include "Header.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Function Name : Number
// Parameters : None
// Return Value : None
// Description : It is default constructor used to initialize the object
// Author : Swapni... | true |
6b4a14112651535d369d44ac3cee5eaa989872e3 | C++ | star-217/DXTK-Effekseer | /DirectX12 Game Solution/DirectXTK9/Inc/Model.h | UTF-8 | 5,450 | 2.578125 | 3 | [] | no_license | #pragma once
#include <d3dx9.h>
#include <wrl/client.h>
#include <memory>
#include <vector>
#include <DirectXMath.h>
#include <DirectXCollision.h>
namespace DX9 {
class Model {
public:
Model() = default;
Model(
IDirect3DDevice9* device,
ID3DXMesh* mesh,
const DWORD meshes
);
virtual ~M... | true |
1119df7d8455d4319fde65134083e35689dd286c | C++ | terngkub/gomoku_cmake | /gomoku/history/history.cpp | UTF-8 | 319 | 2.59375 | 3 | [] | no_license | #include <gomoku/history/history.hpp>
History::History()
: _actions{}
, current_action{}
{}
void History::push_action()
{
_actions.push(current_action);
current_action = Action{};
}
Action History::pop_action()
{
Action last_action = _actions.top();
_actions.pop();
return last_action;
}
| true |
b20bce80591ebbab72bb482a9ae6583e752d4e67 | C++ | nilrum/Property | /Serialization.h | UTF-8 | 2,632 | 2.640625 | 3 | [] | no_license | //
// Created by user on 26.08.2019.
//
#ifndef TESTAPP_SERIALIZATION_H
#define TESTAPP_SERIALIZATION_H
#include "PropertyClass.h"
class TSerializationInterf
{
public:
virtual TString SaveTo(TPropertyClass *value) const = 0;
virtual TResult LoadFrom(const TString& text, TPropertyClass *value) const = 0;
... | true |
74c883dc14601acd091f099f474a837727e2dfd9 | C++ | blackzhy/PAT-Basic-Level | /1031.cpp | UTF-8 | 1,017 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
int number = 0;
int weight[17] = { 7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
int z = 0;
char m[11] = { '1','0','X','9','8','7','6','5','4','3','2' };
bool flag = true;
bool character = false;
string IDtemp;
cin >> number;
for ... | true |
3ea9d40d5af983e983c2c6293fd33aed82c93e8d | C++ | kartikeytripathi/hackerrank-Algorithms | /WarmUp/diagonalDifference.cpp | UTF-8 | 856 | 3.0625 | 3 | [] | no_license | //Hackerrank Algorithm Warmup Challenge #7
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int a[100][100], n, diagonal1 = 0, diagonal2 = 0, difference = 0;
cin >> n;
for(int i = 0 ; i < n ; i++)
{
for(int j ... | true |
80c798a6d3f6d5cf8aa609dda04d33b0c6521dd2 | C++ | JonahtCheyette/SteampunkGame | /Sprite.cpp | UTF-8 | 2,172 | 3.203125 | 3 | [] | no_license | #include "stdafx.h"
void Sprite::load(std::string path, SDL_Renderer* renderer, int scaleBy) {
//Load image at specified path
SDL_Surface* loadedSurface = IMG_Load(path.c_str());
if(loadedSurface == NULL){
std::cout << "Img didn't load at " + path << std::endl;
}
w = loadedSurface -> w;
... | true |