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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f8e638bdc792de813de3f0cf4ae207ab9daab439 | C++ | MuhammadNurYanhaona/ITandPCubeS | /compilers/multicore-backend/src/codegen/thread_state_mgmt.cc | UTF-8 | 24,172 | 2.53125 | 3 | [] | no_license | #include "thread_state_mgmt.h"
#include "space_mapping.h"
#include "../semantics/task_space.h"
#include "../utils/list.h"
#include "../syntax/ast_task.h"
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
// This function is simple. It just copy the dimension information fr... | true |
51d857dde66ca784867694ce1e46ff0eee0f6ca8 | C++ | WhiZTiM/coliru | /Archive2/e1/506948ab3c6066/main.cpp | UTF-8 | 269 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <vector>
template<typename Container>
void foo(Container && v)
{
v[100] = 1;
std::cout << __PRETTY_FUNCTION__ << std::endl;
}
int main()
{
foo(std::vector<int>(1000));
std::vector<int> buffer(100);
foo(buffer);
} | true |
660a98b4b623f7c9f4117928054691ad49397ebb | C++ | jonasmr/screenbsp | /src/math.h | UTF-8 | 13,429 | 2.703125 | 3 | [
"Unlicense"
] | permissive | #pragma once
#define PI 3.14159265358979323846f
#define TWOPI 6.2831853071795864769f
#define TORAD (PI/180.f)
#include <string.h>
#include "immintrin.h"
struct v2;
struct v3;
struct v4;
struct v2
{
float x;
float y;
void operator +=(const v2& r);
void operator -=(const v2& r);
void operator ... | true |
30da04f145f8f05ff129718313ff2ea30723fdd6 | C++ | yzysonic/DirectX-first-game | /DirectX 初ゲーム/Core/Color.h | UTF-8 | 734 | 2.640625 | 3 | [] | no_license | #pragma once
class Color
{
public:
unsigned char b;
unsigned char g;
unsigned char r;
unsigned char a;
//unsigned long data;
Color(void);
Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
//unsigned char getR(void);
//unsigned char getG(void);
//unsigned char getB(void);
//unsigne... | true |
36a0b09ca356de00ddbefb68d5e17ab0e0a0b0fb | C++ | JOLO1011/ESP32-PWM-FAN-CONTROL | /PWM_FANControl_Webserver.ino | UTF-8 | 25,442 | 2.671875 | 3 | [] | no_license |
#include <OneWire.h>
#include <DallasTemperature.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
////////////////////////////////////////////////////////
// Webserver
////////////////////////////////////////////////////////
WiFiServer server(80); //Port 80
... | true |
700db65cb045498d857545e2fe44b9567c6b21c0 | C++ | xuanjin001/Leetcode | /C++/139.word-break.cpp | UTF-8 | 1,057 | 3.015625 | 3 | [] | no_license | /*
* @lc app=leetcode id=139 lang=cpp
*
* [139] Word Break
*/
class Solution {
public:
bool wordBreak(string s, vector<string>& wordDict) {
std::vector<int>::iterator it;
if(wordDict.size()==0) return false;
vector<bool> dp(s.size()+1, false);
dp[0]=true;
... | true |
2dbff50fe428eaa4d5489d48e20563805407fc76 | C++ | drago-96/competitive-programming | /lezione19/bipartite.cpp | UTF-8 | 1,877 | 3.53125 | 4 | [] | no_license | // https://practice.geeksforgeeks.org/problems/bipartite-graph/1
/*
We use the algorithm seen in class: run a BFS colouring greedily the vertices. If at some points we fail to do so, we have an odd cycle and the graph isn't bipartite; otherwise it is.
Running time is O(V+E).
*/
// C++ program to find out whether a ... | true |
a2823900bf2ac23fae9c90e75173213c3022a448 | C++ | FlyingFishPeng/jianzhioffer | /minDepth.cpp | GB18030 | 409 | 3.609375 | 4 | [] | no_license | /*
ĿСȡ
*/
/*
˼·ݹ顣
*/
int minDepth(TreeNode* root)
{
if (root == NULL)
return 0;
if (root->left == NULL&&root->right == NULL)
return 1;
int left = minDepth(root->left);
int right = minDepth(root->right);
if (root->left == NULL)
return right + 1;
if (root->right == NULL)
return left + 1;
return l... | true |
ec3daf8643f854d10f3b5fd39fe45bcae3bb2d63 | C++ | Bhoomikapanwar/Prac | /Array_prodpair.cpp | UTF-8 | 538 | 2.53125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int t,n,p;
cin>>t;
while(t){
int flag=0;
cin>>n>>p;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int j=0;j<n;j++){
for(int k=j+1;k<n;k++){
if((a[j]*a[k])==p)
{
... | true |
47049df97fe65c169a734fa3bbf889c5b7a92906 | C++ | Evalir/Algorithms | /Problems/codeforces/144-A/144-A-31608832.cpp | UTF-8 | 881 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> soldiers;
for(int i = 0; i < n; i++) {
int x;
cin >> x;
soldiers.push_back(x);
}
int hsoldier = 0, lsoldier = 100;
int hpos = 0, lpos = 0;
int seconds;
for (int i = 0; i < n; i++) {
if (soldiers[i] ... | true |
a4b5d83142570e7a924ffcd3373efb00afa7921f | C++ | akeskimo/salary-administration-gui | /SalaryAdministrationGui/src/model/MonthlyPaidEmployee.h | UTF-8 | 1,016 | 3.15625 | 3 | [] | no_license | //============================================================================
// Name : MonthlyPaidEmployee.h
// Author : Aapo Keskimolo
// Description : Definition file for monthly paid employee class. Inherits from
// Employee base-class.
//==================================================... | true |
571a5c1940dbaf965131a76eae63a1966e4b840f | C++ | RishabhDevbanshi/C-Codes | /Bactracking/Knights-Tour.cpp | UTF-8 | 1,026 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define n 8
bool valid(int nx, int ny,int mat[n][n])
{
return (nx>=0 and nx<n and ny>=0 and ny<n and mat[nx][ny]==-1);
}
bool go(int mat[n][n],int x,int y,int dx[n],int dy[n],int mv)
{
if(mv==n*n)
{
return 1;
}
for(i... | true |
e079f20ffc7a3f95d173b72e6aa071101bd7037f | C++ | CAHenry/AudioProgramming | /Coursework Three/Source/DelayLine.cpp | UTF-8 | 1,179 | 2.921875 | 3 | [] | no_license | /*
==============================================================================
DelayLine.cpp
Created: 9 Jan 2018 10:41:34pm
Author: Craig
==============================================================================
*/
#include "DelayLine.h"
Delay::Delay (int numSamplesToAllocate)
: delayLi... | true |
0e4f45726b95d94e2be9dcbb0dff935e7516f709 | C++ | caasI25Vilen/bst_in_bst | /bst_in_bst/bst_in_bst.h | UTF-8 | 2,983 | 3.40625 | 3 | [] | no_license | #pragma once
#include<cmath>
///////////////////////////////////// ** BST ** /////////////////////////////////////
template<typename T>
class BST
{
public:
BST();
BST(const BST& src);
~BST();
const T& findMin() const;
const T& findMax() const;
bool contain(const T& item) const;
bool isEmpty() const;
void m... | true |
cca0689da1517650cffe97864ebeca2e193f0830 | C++ | DragonJoker/Castor3D | /include/Core/CastorUtils/Graphics/UnsupportedFormatException.hpp | UTF-8 | 1,267 | 2.59375 | 3 | [
"MIT"
] | permissive | /*
See LICENSE file in root folder
*/
#ifndef ___CU_UnsupportedFormatException_H___
#define ___CU_UnsupportedFormatException_H___
#include "CastorUtils/Graphics/GraphicsModule.hpp"
#include "CastorUtils/Exception/Exception.hpp"
namespace castor
{
class UnsupportedFormatException
: public castor::Exception
{
pub... | true |
d9337e1c6d28e1500375b951248c724374b71bf2 | C++ | Nebrija-Programacion/Programacion-II | /examenes/1819/extraordinaria/solucion/ejercicio1/caballo.cpp | UTF-8 | 327 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include "caballo.h"
Caballo::Caballo(string nombre, string sexo, int edad):
nombre{nombre},
sexo{sexo},
edad{edad}
{
}
void Caballo::printInfo() const
{
cout << "Mi nombre es: " << nombre << endl;
cout << "Mi edad es: " << edad << endl;
cout << "Mi sexo es: " << sexo << e... | true |
3c2b1689024c73a0780144a8f8b0eb1cb10ba90f | C++ | fanmanqian/learnCplusplus | /20190104/const.cc | UTF-8 | 870 | 3.28125 | 3 | [] | no_license | #include<iostream>
using std::cout;
using std::endl;
//C++/Java/C 编译型(静态)语言
//动态语言 没有太好的调试工具 解释执行 没有编译的过程
//宏定义发生的时机是预处理,只会简单的进行字符串替换,没有类型检查;在运行时出现了bug
//不利于错误的发现
#define Max 1024
//#define multi(x,y) x*y //仅仅是进行字符串的替换 1+2*3+4 = 11 出错
//避免这种错误的发生就是加上小括号
#define multi(x,y) (x)*(y)
//C++更多的一种定义常量的方式
//
//发生的时机是编译时,有类型检查... | true |
07ec0e42bc99c0477048afca5abd5f128cb334e8 | C++ | snikolova27/UP-2.0 | /Week03_If statements/task05.cpp | UTF-8 | 1,272 | 3.890625 | 4 | [] | no_license | #include <iostream>
int main()
{
int num1, num2, num3;
std::cin >> num1 >> num2 >> num3;
int max = 0, min = 0;
if (num1 == num2 && num2 == num3)
{
std::cout << "All numbers are equal \n";
return 0;
}
else if (num1 > num2 && num1 > num3)
{
max = num1;
m... | true |
b9b1cefb5dfb276f7c6895f140f7e8ac7b2448dd | C++ | hi-takeda/test | /pointer/src/call_by_value.cpp | UTF-8 | 338 | 3.1875 | 3 | [] | no_license | #include <iostream>
void twice (int a)
{
std::cout << a << " : in twice(int a)" << std::endl;
a *= 2;
std::cout << a << " : in twice(int a)" << std::endl;
}
int main(int argc, char *argv[])
{
int v = 16;
std::cout << v << " : in main()" << std::endl;
twice(v);
std::cout << v << " : in main()" << std::en... | true |
8e7d5b6824fe05dda614ce5ab76e12ef2d71919f | C++ | Qkrka/OS1_project | /h/WList.h | UTF-8 | 407 | 2.875 | 3 | [] | no_license | #ifndef WLIST_H_
#define WLIST_H_
#include "PCB.h"
struct Node{
PCB* pcb;
Time time;
Node* next;
Node(PCB* p, Time t){
pcb=p;
time=t;
next=NULL;
}
};
class WaitList {
private:
Node* first;
public:
WaitList(){
first=NULL;
}
~WaitList();
void add(PCB* p, Time t);
PCB* pop();
PCB* rem... | true |
c525673e76568ce3c60a05dcef00b7127b93c3ae | C++ | LonglongSang/Life_of_XDU | /PTA/Basic_Level/1013.cpp | UTF-8 | 656 | 3 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <math.h>
using namespace std;
bool is_o(int n);
int main(){
int count=0;
int low,high;
cin>>low>>high;
vector<int> oo;
int o_count=0;
for(int i=1;i<=10000000000;i++){
if(is_o(i)){
oo.push_back(i);
o_count++;... | true |
9b7d2f678bbaacd210dafa8110aab2b015fac95d | C++ | Aleshkev/algoritmika | /archive/2/po_prostu_xor.cpp | UTF-8 | 673 | 2.875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #include <iostream>
using namespace std;
typedef unsigned I;
int main()
{
cout.sync_with_stdio(false);
I n, k;
cin >> n >> k;
I *t = new I[n];
for(I i = 0; i < n; ++i) {
cin >> t[i];
}
I *prefixes = new I[n];
prefixes[0] = t[0];
for(I i = 1; i < n; ++i) {
prefix... | true |
984bfe61971e04451b6ce4bacdde646c69a2ce2f | C++ | freds0/HighPrecisionAdaptiveMesh | /OpenGL/openGL.cpp | UTF-8 | 6,530 | 2.71875 | 3 | [] | no_license | #include "openGL.h"
static bool
CONFIG_LOCAL_SHOW_TRIANGLE = true,
CONFIG_LOCAL_SHOW_CIRCLE = true,
CONFIG_LOCAL_SHOW_VORONOI_DIAGRAM = true,
CONFIG_LOCAL_SHOW_VERTEX_LABEL = true;
void openGL::drawLine( mpfr::real<MPFR_BITS_PRECISION> x1, mpfr::real<MPFR_BITS_PRECISION> y1, mpfr::real<MPFR_... | true |
9eb3e66ad4a947a27d6df12f058109940134530d | C++ | ant512/WoopsiExtras | /classes/fixedwidthfontbase.h | UTF-8 | 4,489 | 3.0625 | 3 | [] | no_license | #ifndef _FIXED_WIDTH_FONT_BASE_H_
#define _FIXED_WIDTH_FONT_BASE_H_
#include <nds.h>
#include "fontbase.h"
namespace WoopsiUI {
/**
* Abstract class defining the basic properties of a fixed-width font and
* providing some of the essential functionality. Should be used as a base
* class for all fix... | true |
0b9e9e570c9612dce937312f1ee0f35e3fa5feff | C++ | kbm0818/Portfolio | /GameProject_L/Systems/GameSystems/Fog.h | UTF-8 | 881 | 2.8125 | 3 | [] | no_license | #pragma once
#include "Object\Shader\ShaderBuffer.h"
class FogBuffer : public ShaderBuffer
{
public:
FogBuffer()
: ShaderBuffer(&data, sizeof(Data))
{
data.fogColor = D3DXCOLOR(0.7f, 0.7f, 0.7f, 1.0f);
data.zStart = 10.0f;
data.zEnd = 50.0f;
data.yStart = 3.0f;
data.yEnd = 0.0f;
}
void SetZFog(float s... | true |
80589e02e0ce810bf65e3c948b69afed2d6aa33b | C++ | johnjsb/projectChimaera | /Soft_Nodes/logger/src/log.cpp | UTF-8 | 4,321 | 2.796875 | 3 | [] | no_license | /* *******************************************************************
Rule:
Each team will produce a log file of the mission within around 10 minutes of the end of
the run.
The format of the log file will be a comma separated ASCII file of the format:
Time, position, action, a comment between simple quotes.
(SSSSS,... | true |
e1d143aaa1666840a231a30e710351eaf5f2215c | C++ | gozwei/fuw-programowanie-mikrokontrolerow | /CW04/button_ls/button.cc | UTF-8 | 1,414 | 2.8125 | 3 | [] | no_license | #include <avr/io.h>
#include <avr/interrupt.h>
#include <inttypes.h>
#include "biblio.h"
// Program rozpoznaje krotkie i dlugie (powyzej sekundy) nacisniecie
// przycisku.
//
// Wymagane polaczenia w ukladzie ZL15AVR:
//
// PB0 - SW0
// PD1 - TxD
//
// Autor: Pawel Klimczewski, 12 marca 2012.
static uint8_t t = 0;
... | true |
58c219efbf059122c69040295ebcd0b97368b401 | C++ | thijsking/AirHandlingUnit | /Eind code AHU/_TheUnit/Include/CoolingElement.h | UTF-8 | 627 | 3.015625 | 3 | [] | no_license | #ifndef COOLINGELEMENT_H
#define COOLINGELEMENT_H
#include "iActuator.h"
/**
* \brief This class handles a CoolingElement.
*/
class CoolingElement : public iActuator
{
public:
/**
* \brief Creates a CoolingElement object.
*
* @param iCommunication* is the type of communication that the actuator uses.
* @param uint8_t... | true |
d6c94367c83172eb4d8562bdc3263862763f3add | C++ | ogutetsu/CppDesignPattern | /CppDesignPattern/Composite/NeuralNetwork.cpp | UTF-8 | 1,780 | 3.296875 | 3 | [] | no_license | //
// NeuralNetwork.cpp
// CppDesignPattern
//
// Created by ogurotetsuro on 2019/06/10.
// Copyright © 2019 ogurotetsuro. All rights reserved.
//
#include "NeuralNetwork.hpp"
#include <vector>
#include <iostream>
using namespace std;
struct Neuron;
template<typename Self>
struct SomeNeurons
{
template<ty... | true |
4156326590cbfe918fe81080388066ed461c7b59 | C++ | MoraxAlvizo/ProyectoADA | /GLEngine/src/GLShader.cpp | UTF-8 | 1,193 | 2.703125 | 3 | [] | no_license | #include "GLShader.h"
GLShader::GLShader(string shaderFile, unsigned int typeShader)
{
this->shaderFile = shaderFile;
this->typeShader = typeShader;
codigoGLSL = NULL;
if( !readShader() )
cerr << "Error al leer archivo: " << shaderFile << endl;
compileShader();
}
GLShader::~GLShader(void)
{
if(codigoGLSL)
... | true |
6ccc2fbdc89ad47013b3922350040029575b9f3d | C++ | Mayur1496/Solutions-to-UVa | /augustLunchTime17.cpp | UTF-8 | 581 | 2.65625 | 3 | [] | no_license | #include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int cases;
scanf("%d",&cases);
while(cases--){
int cost[26];
char temp;
vector<char> c;
vector<char>::iterator it;
for(int i=0;i<26;i++){
scanf("%d ",&cost[i]);
c.push_back(i+97);
}
while((temp=getchar())!='\n... | true |
ebed1b6a690cd0a7783e3996b2773d4a0224ec65 | C++ | galaxysd/GalaxyCodeBases | /c_cpp/etc/KaKs_Calculator/src/ConcatenatePairs.cpp | UTF-8 | 2,145 | 3.171875 | 3 | [] | no_license | /************************************************************
* Copyright (C) 2005, BGI of Chinese Academy of Sciences
* All rights reserved.
* Filename: ConcatenatePairs.cpp
* Abstract: Concatenate all pairs of sequences with AXT format
to a pair of sequences (maybe very long).
* Version: 1.0
* Author: Zhang Zha... | true |
5bff30c65d856be58e52ad86cf537ffc8d192454 | C++ | AndreiutDev/Lab2OOP | /complex_main.cpp | UTF-8 | 482 | 3.140625 | 3 | [] | no_license | // lab2_oop.cpp : This file contains the 'main' function. Program execution begins and ends there.
///
#include <iostream>
#include "complex.h"
using namespace std;
NumarComplex add(NumarComplex c1, NumarComplex c2) {
NumarComplex c3(0, 0);
c3.setReal(c1.getReal() + c2.getReal());
return c3;
... | true |
d0f783d6feecbef531089ce4ec89428e70fb2a48 | C++ | kBeliczynski/umcs-asd1 | /zad6/main.cpp | UTF-8 | 12,233 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
struct licznik{ // kazda komorka posiada własny licznik ktory pokazuje ile przejsc i miejsc monitorowanych bylo po drodze
int licznik_przejsc=0;
int miejsca_monitorowane=0;
};
int nS,mS; // wspolrzedne siedziby opercyjnej
int nX,mX; // ws... | true |
59d7d26d47979ff4eec57eddc2c7680c0450ef70 | C++ | danilodesouzapereira/plataformasinap_exportaopendss | /Fontes/Mapa/TParede.cpp | ISO-8859-1 | 5,374 | 2.53125 | 3 | [] | no_license | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "TParede.h"
#include "..\Rede\VTBarra.h"
#include "..\..\DLL_Inc\Funcao.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------... | true |
62f0e9c293bdb60d9a5065854eb0cd25fd556785 | C++ | LimitW/ACM-repo | /AOAPC/AOAPC I book/AOAPC_11_2_4.cpp | UTF-8 | 1,419 | 2.53125 | 3 | [] | no_license | /************************************************
* Title:
* Author:LimitW
* Date:2014.9.12
* Source:AOAPC I
* Note:SPFA, Bellman-Ford的队列优化
*************************************************/
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>... | true |
0493db7b866b9b99ccff5c84f1a66faebc563fba | C++ | sosch17/SysProg_2 | /Parser/src/ParseTree.cpp | UTF-8 | 21,088 | 3.359375 | 3 | [] | no_license | #include "../includes/ParseTree.h";
/*
* basis von treenode und leafnode, vor allem für linkedList von Children.
* Type: für TypeCheck (type oder operation für leafnode)
*/
BasicNode::BasicNode() {
this->type = noType;
this->leaf = false;
}
Types BasicNode::getTypes() {
return this->type;
}
void BasicNode::set... | true |
9e69fe70ca166f659898d17a353e7db61abc7f7d | C++ | Tako-San/ILab | /MAP/node.cpp | UTF-8 | 5,842 | 3.609375 | 4 | [] | no_license | #include "node.h"
Node::Node() : data(),
parent(nullptr),
left(nullptr),
right(nullptr)
{
//std::cout<<"Node constructor without arguments. "<<this<<"\n\n";
}
Node::Node(Data_t &n_data) : data(n_data),
parent(nullptr),
... | true |
1cbff9bf21d558c4ae301c7eacba7a64f42a5ea8 | C++ | script0Brand/cis202-examples | /book-source/cccfiles/ccc_wxw.cpp | UTF-8 | 13,550 | 2.53125 | 3 | [] | no_license | /*
CCC Graphics Library
COPYRIGHT (C) 1994 - 2011 Cay S. Horstmann. All Rights Reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at you... | true |
98240f1479852f97c97f47865cc3a1894a5d3030 | C++ | boranyldrm/Bilkent-Courses | /CS315/CS315/adsız klasör/Yacc/manual_calculator/Numeric.cpp | UTF-8 | 1,893 | 3.5625 | 4 | [] | no_license | #include "Numeric.h"
using namespace std;
Numeric operator+(Numeric lhs, Numeric rhs)
{
if (lhs.isInteger()) {
if (rhs.isInteger())
return Numeric(lhs.getIntegerValue()+rhs.getIntegerValue());
else
return Numeric(lhs.getIntegerValue()+rhs.getFloatValue());
} else {
if (rhs.isInteger())
... | true |
a71dbfec8a297eefae93152ca5960ff0ee896be0 | C++ | MenglaiWang/Leetcode | /61. Rotate List.cpp | UTF-8 | 714 | 3.3125 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* rotateRight(ListNode* head, int k) {
if(!head) return head;
int size = 0;
ListNode* p1 = head,*p2 =head;... | true |
3472ea1e0de8cade8163fa3cd265473ec0740005 | C++ | dw5450/win | /WinAPI Project/Player.cpp | UHC | 3,805 | 2.921875 | 3 | [] | no_license | #include "stdafx.h"
// 100 κ ϴ° ٲ۴. ҳ ũ. -> ʴ ϳ .
// ǵ ٲܰŸ ؾ߰. ٵ //Ѵ ֳĸ ϰͱ ̴!
Player::Player(const long x, const long y, const SIZE size){ //int -> long ȯ Ͼ ʿ long
p.x = x; p.y = y;
ObjectSize = size;
ObjectRect.left = x - size.cx / 2;
ObjectRect.top = y - size.cy / 2;
ObjectR... | true |
aa5232cd43fc3ccd877d43a80c2b109bd67ac28f | C++ | danieldugas/Vitrified-Code | /C++/High Performance Computing Examples/Roofline/computepower.cpp | UTF-8 | 4,977 | 2.59375 | 3 | [] | no_license | /*
* computepower.cpp
*
* Created by Christian Conti on 9/21/11.
* Extended by Panagiotis Hadjidoukas on 11/1/14
* Copyright 2015 ETH Zurich. All rights reserved.
*
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <map>
#include <vector>
#include <string>
#include <cas... | true |
f91f781bca16226fcc64b7bbee49db0eab414b7b | C++ | WaerjakSC/Oblig1 | /stack.cpp | UTF-8 | 1,532 | 3.640625 | 4 | [] | no_license | #include "stack.h"
#include <iostream>
#include <memory>
namespace ADS101 {
stack::stack(char ch) { head = new CharNode(ch); }
/**
* @brief stack::push
* @param ch
* Add a new item to the stack
*/
void stack::push(char ch) {
auto *tmp = new CharNode(ch, head);
head = tmp;
}
/**
* @brief stack::top
* @return
... | true |
e04ae98ba4a1bd2e9000f22cc2226539c5c010ca | C++ | dntowers/Squeak | /StateChange.cpp | UTF-8 | 2,619 | 2.625 | 3 | [] | no_license | #include "StdAfx.h"
#include "MouseLL.h"
#include "StateChange.h"
StateChange::StateChange(void)
{
_InitRequired();
_DefaultAll();
}
StateChange::StateChange(int new_StateID)
{
_InitRequired();
_DefaultAll();
StateID = new_StateID;
}
#pragma region Initialization
// initialize required v... | true |
9f7a6af7bd6d3d39f1b3e0d035d1ebc88a19d0d4 | C++ | xuebai5/StaticNFrame | /Server/Dependencies/common/ctlib/include/CTServerUtils.h | UTF-8 | 4,027 | 2.515625 | 3 | [] | no_license | /**
* Server开发的一些常用函数
*/
#ifndef __CTLIB_SERVERUTILS_H__
#define __CTLIB_SERVERUTILS_H__
#include <signal.h>
#include "CTFileUtils.h"
namespace CTLib
{
/**
* 封装了Server开发的一些常用函数
*/
class CTServerUtils
{
public:
#ifndef WIN32
static void Ignore(int signum)
{
struct sigaction sig;
sig.sa_handle... | true |
c18984d394ab02583b2c176c61db028838814bb6 | C++ | justin-harper/cs122 | /Assignment 4/Assingnment 4/Assingnment 4/RemoveGreenEffect.cpp | UTF-8 | 556 | 2.75 | 3 | [
"MIT"
] | permissive | /*
Assignment: 4
Description: Paycheck Calculator
Author: Justin Harper
WSU ID: 10696738 Completion Time: 4hrs
In completing this program, I received help from the following people:
myself
version 1.0 (major relese) I am happy with this version!
*/
#include "RemoveGreenEffect.h"
using namespace std;
//class to r... | true |
a16c03457f0791f21f2a54cea602ddd96308c64c | C++ | taidangit/lap-trinh-c-tran-duy-thanh | /HocKieuDuLieuVaKhaiBaoBien/main.cpp | UTF-8 | 361 | 2.609375 | 3 | [] | no_license | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int age;
float f=1.5f;
cout<<f<<endl;
bool b=true;
char c='c';
int x, y, z=7, k=0;
double dtb;
cout<<"Nhap diem trung binh:";
cin>... | true |
e870f4831bf2bf94b41d9ae634aa53df9992d07b | C++ | RFlor14/GameEngine | /GameEngine/Engine/Rendering/3D/Model.h | UTF-8 | 1,869 | 2.9375 | 3 | [] | no_license | #ifndef MODEL_H
#define MODEL_H
#include <glm/gtc/matrix_transform.hpp>
#include <string>
#include "LoadOBJModel.h"
class Model
{
public:
/*
Give all params default value so when it's needed to be updated,
there's no errors because it assumes you're using a default value.
[shaderProgram_] makes sure each model ... | true |
e2831d2d9f1cffa6cf2ea4c3c5d314582e7b16c5 | C++ | AshwathVS/Programming | /codeforces/codeforces_rating_less_than_1300/elephant.cpp | UTF-8 | 348 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n,sum = 0,k;
cin >> n;
k = n/5;
sum += k;
n -= (k * 5);
k = n/4;
sum += k;
n -= (k * 4);
k = n/3;
sum += k;
n -= (k * 3);
k = n/2;
sum += k;
n -= (k * 2);
k = n/1;
sum += k;
n -= (k * 1);
cout << sum << endl;
}
int main ... | true |
aa8ce17b6ccd03334c5a5363d092597068e1f68c | C++ | daria-grebneva/OOD | /composite/composite/CGroupShape.cpp | UTF-8 | 3,772 | 2.578125 | 3 | [] | no_license | #include "stdafx.h"
#include "CGroupShape.h"
#include <algorithm>
#include <functional>
CGroupShape::CGroupShape()
{
m_shapes = std::make_shared<CShapes>();
m_groupLineStyle = std::make_shared<CGroupLineStyle>(m_shapes);
m_groupFillStyle = std::make_shared<CGroupFillStyle>(m_shapes);
}
RectD CGroupSh... | true |
2d81384666dda0c6b6d3ad3cb30d9aeff5699571 | C++ | aidanmcalaine/USC-CSCI103 | /PA5 (Arbitrary Precision Integers)/decipher.cpp | UTF-8 | 1,283 | 3.125 | 3 | [] | no_license | #include "bigint.h"
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char* argv[]) {
if (argc != 2) {
cout<<"\033[1;41m----Missing an argument----\033[0m"<<endl;
cout << "Usage: ./decipher <file>"<<endl;
cout << "Examples:" << endl;
cout << "\t./decipher secret/message1... | true |
d7c86414247f9ddfe8880f6126220eedbb42879b | C++ | JHYOOOOON/Collection | /baekjoon/18429.cpp | UTF-8 | 665 | 2.75 | 3 | [] | no_license | #include <iostream>
using namespace std;
int n, k;
int kit[9];
bool isused[9];
int cnt = 0;
void select(int count, int weight) {
if (weight < 500) return;
if (count == n) {
cnt++;
return;
}
for (int i = 0; i < n; i++) {
if (!isused[i]) {
isused[i] = 1;
... | true |
d9dadf33456039d884d1edac0d3b7bdda6a56e5b | C++ | zjin-lcf/HeCBench | /merkle-sycl/ff_p.cpp | UTF-8 | 2,641 | 2.890625 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | #include "ff_p.hpp"
#include <climits>
uint64_t
ff_p_add(uint64_t a, uint64_t b)
{
if (b >= MOD) {
b -= MOD;
}
uint64_t res_0 = a + b;
bool over_0 = a > UINT64_MAX - b;
uint32_t zero = 0;
uint64_t tmp_0 = (uint64_t)(zero - (uint32_t)(over_0 ? 1 : 0));
uint64_t res_1 = res_0 + tmp_0;
bool over_1 ... | true |
8d030327b681ea0cbc26901c0bc9b74636359edf | C++ | stephenosullivan/Guide-to-Scientific-Computing-in-cpp | /Guide_to_Scientific_Computing/Exercise5_2.cpp | UTF-8 | 405 | 3.34375 | 3 | [] | no_license | //
// Exercise5_2.cpp
// Guide to Scientific Computing
//
// Created by Stephen O'Sullivan on 10/14/15.
// Copyright (c) 2015 Stephen O'Sullivan. All rights reserved.
//
// Send the address of an int to a func that changes the value of the int
#include <iostream>
void times2(int* i){
*i = 2 * (*i);
}
int ma... | true |
ec9b0544eead6fdde1d2387186f8fa4c1a0d96ed | C++ | MohammadAlhourani/AI-In-Games | /Ai Labs/AI Lab/AI Lab/Player.cpp | UTF-8 | 2,247 | 3.03125 | 3 | [] | no_license | #include "Player.h"
Player::Player()
{
setUpPlayer();
}
Player::~Player()
{
}
void Player::update(sf::Time t_deltaTime)
{
m_behaviours.boundary(m_position , m_playerSprite);
movement();
}
/// <summary>
/// the draw function simply draws the player
/// </summary>
/// <param name="t_renderWindow"></param>
void P... | true |
2912106ff73971c5dc50bc5280a9514e6c6c2260 | C++ | NGPGeeks/CPP | /AssignmentOOP/025Overload_new_delete_operators_in_a_class.cpp | UTF-8 | 2,106 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include<string.h>
#include<new>
#include<stdlib.h>
using namespace std;
const int MAX = 5;
const int FREE = 0;
const int OCCUPIED = 1;
void memwarning( )
{
cout << endl <<"Free store has now gone empty";
exit( 1 );
}
class employee
{
private:
char name[20];
int age;
float sal;
public:
... | true |
dfa3de56a9963ec867b32a8c32e556e537700270 | C++ | nvnnv/Leetcode | /1376. Time Needed to Inform All Employees.cpp | UTF-8 | 807 | 2.625 | 3 | [] | no_license | void findMinR(unordered_map<int, vector<pair<int, int>>>& g, int i, int r, int& minR)
{
for (int j = 0; j < g[i].size(); ++j)
{
if (g[i][j].second > 0)
{
findMinR(g, g[i][j].first, r + g[i][j].second, minR);
}
}
minR = max(r, minR);
}
int numOfMinutes(int n, int headI... | true |
c93b392f5fb566cfb28553caf0f1418ceddaec25 | C++ | tangya3158613488/Practice | /TCP/tcpServer.cc | UTF-8 | 780 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<unordered_map>
#include"tcp_server.hpp"
std::unordered_map<std::string,std::string> dict;
void Translate(const std::string& req,std::string& resp)
{
auto it=dict.find(req);
if(it==dict.end())
{
*resp="未找到";
return;
}
*resp=it->second;
return;
}
int m... | true |
0050b4f85666028bccabf0ced15b67db7ca42aaf | C++ | jaybroker/dstore | /dstore/test/simple_packet_client_test.cpp | UTF-8 | 2,867 | 2.796875 | 3 | [
"MIT"
] | permissive | #include <list>
#include <memory>
#include "tcp_client.h"
#include "connection.h"
#include "message.h"
#include "errno_define.h"
#include "log.h"
using namespace dstore::common;
using namespace dstore::network;
struct simple_packet
{
int32_t data_len;
char *data;
};
int decode_message(std::shared_ptr<Connection>... | true |
8c3a108c7c56decbf7bcccbc8481857c06d15650 | C++ | anhstudios/swganh | /src/swganh_core/object/slot_exclusive.cc | UTF-8 | 1,023 | 2.640625 | 3 | [
"MIT"
] | permissive | // This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#include "slot_exclusive.h"
#include "object.h"
using namespace swganh::object;
std::shared_ptr<swganh::object::Object> SlotExclusive::insert_object(const std::shared_ptr<swganh::object::Obj... | true |
41d9b61bef4e449a46c20f4f0dbd3fd2e195a132 | C++ | jacobgus/Speed-Detector | /SpeedDetector.ino | UTF-8 | 3,119 | 2.84375 | 3 | [] | no_license | // The sensor send and recieve code is based off David Mellis and Tom Igoe's code PING)))
// Created by Jacob Gus June 9th 2017
// this constant won't change. It's the pin number
// of the sensor's output:
const int pingPin = 7;
void setup() {
// initialize serial communication:
Serial.begin(9600);
}
void lo... | true |
083d369f9b7100263182336bb27e722bf70bd976 | C++ | KentoNishi/JOI-Solutions | /2019-2020/competitions/joi2020-yo2/digits/main.cpp | UTF-8 | 991 | 2.65625 | 3 | [] | no_license | // Test case path: [path]
// url
#include <bits/stdc++.h>
using namespace std;
vector<bool> seen;
vector<bool> dp;
int N;
bool possible(int i, int h) {
//cout << i << " " << h << endl;
if (i == N) {
return true;
}
if (i > N) {
return false;
}
if (seen[i]) {
return dp[i... | true |
b14b4fb3afe90f6a687211092a162bc5f41239ff | C++ | Grayer123/Algorithm-Design | /Rule_of_Three/Rule_of_Three/GCharacter.h | UTF-8 | 881 | 3.171875 | 3 | [] | no_license | /*
* GCharacter.h
*
* Created on Dec 26, 2015
* Author: Hongmin
*/
#ifndef GCHARACTER_H
#define GCHARACTER_H
#include"Header.h"
class GCharacter{
//Overload the insertion operator to output a GCharacter object
friend std::ostream& operator<<(std::ostream& os, const GCharacter& gc);
public:
sta... | true |
4cfa924298750967f3af5ca9ef4cc0ff0592e245 | C++ | username13459/URL-Distributor | /src/log.h | UTF-8 | 310 | 2.734375 | 3 | [] | no_license | #pragma once
#include<string>
using std::string;
namespace progLog
{
//Prepares for logging, opening the log file and etc.
void startLog();
//Writes a message to the log, with the timestamp appended to the front
void write(string message);
//Closes the current log
void closeLog();
}
| true |
b582e1453c62318c4448743c22ae99ec248ffa54 | C++ | martinpiper/ReplicaNetPublic | /ExampleMarmalade1/source/Enemy.cpp | UTF-8 | 3,910 | 2.53125 | 3 | [] | no_license | #include "s3e.h"
#include <math.h>
#include "main.h"
#include "Enemy.h"
#include "RNReplicaNet/Inc/ReplicaNet.h"
Enemy::Enemy()
{
int32 width = s3eSurfaceGetInt(S3E_SURFACE_WIDTH);
int32 height = s3eSurfaceGetInt(S3E_SURFACE_HEIGHT);
if (IsMaster())
{
mSeed = rand();
mPosX = (float)(rand() % width);
mPosY =... | true |
ab87a038429ea00d5fab7f1da8c95c8461220a07 | C++ | riven521/CLU18 | /Slu_CluVNS2/src/CluVRPinst.cpp | GB18030 | 2,757 | 3.046875 | 3 | [] | no_license | #include "CluVRPinst.h"
#include <iostream>
//**********************************************************************************************//
CluVRPinst::CluVRPinst(std::vector<Cluster> vClusters, int nVehicles)
{
this->nVehicles_ = nVehicles; //ijΪó
this->vehicleCapacity_ = Globals::vehicleCapacity; //ͬ
... | true |
027a35808ef6ffad024948df328173c4e9b738a2 | C++ | ScorpionMLG/cpp1 | /7..cpp | UTF-8 | 196 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main(){
float a, b;
cout<<"vvedite kateti treugolnika: ";
cin>>a>>b;
cout<<"gipotenuza: "<< sqrt(a*a + b*b);
return 0;
} | true |
2f3bf60f27d80d8352738c2f94b2111585657b2a | C++ | Mitza23/Video_Player_CPP | /Domain/Commands/User/AddCommandUser.h | UTF-8 | 564 | 2.609375 | 3 | [] | no_license | //
// Created by mitza on 31-May-21.
//
#ifndef A10_MITZA23_1_ADDCOMMANDUSER_H
#define A10_MITZA23_1_ADDCOMMANDUSER_H
#include <Commands/Command.h>
#include <string>
#include <Repository.h>
class AddCommandUser : public Command{
private:
Repository& repository, dataBase;
std::string title;
public:
AddCo... | true |
787b917e45658b08563e283785331dd540b53d77 | C++ | BlastTNG/flight | /stars/code/tools/stats.h | UTF-8 | 1,802 | 2.6875 | 3 | [] | no_license | /*
* © 2013 Columbia University. All Rights Reserved.
* This file is part of STARS, the Star Tracking Attitude Reconstruction
* Software package, originally created for EBEX by Daniel Chapman.
*/
#pragma once
#ifndef TOOLS__STATS_H
#define TOOLS__STATS_H
#include <cmath>
#include <vector>
template <typename ... | true |
a4ca0a02a0695b1ead1d677d72c5690f671019ce | C++ | xinyuyao22/BattleShip | /MVC/View.h | UTF-8 | 1,085 | 2.5625 | 3 | [] | no_license | //
// Created by mfbut on 3/9/2019.
//
#ifndef BATTLESHIP_VIEW_H
#define BATTLESHIP_VIEW_H
#include <unordered_map>
#include "PlayerConfiguration.h"
#include "ShipPlacement.h"
#include "Player.h"
#include "AttackResult.h"
namespace BattleShip {
class Player; //forward declaration
class Model;
class Move;
class View {... | true |
355cf350b10ef211b6079680345fcf15900b8d8f | C++ | gshovkoplyas/ITMO | /Discrete Math/Sort/antiqs/main.cpp | UTF-8 | 590 | 2.640625 | 3 | [] | no_license | /*Grigory Shovkoplyas in the house*/
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<cstdlib>
#include<ctime>
using namespace std;
#define taskname "antiqs"
int main()
{
freopen(taskname".in", "r", std... | true |
e4cbbc984e6343aac8798f26670c9fcfbd3e98c0 | C++ | rcallan/csv_tools | /tools/statistics/statistics.cpp | UTF-8 | 983 | 2.859375 | 3 | [] | no_license | //
// csvstatistics.cpp
//
#include "CsvOperations.h"
#include "StringOperations.h"
#include "parameters.h"
void showHelp()
{
std::cout << "usage- csvstatistics [--path <path>] [--columns COLUMNS] [--other_stat OTHERSTATISTIC]\n"
"optional arguments\n--other_stat - provides desired information about the colum... | true |
aedab97f211f94fd13a54b307b861b8b88be3b7a | C++ | lukeulrich/alignshop-qt | /src/app/gui/models/AbstractBaseTreeModel.h | UTF-8 | 6,885 | 2.890625 | 3 | [] | no_license | /****************************************************************************
**
** Copyright (C) 2011 Agile Genomics, LLC
** All rights reserved.
** Author: Luke Ulrich
**
****************************************************************************/
#ifndef ABSTRACTBASETREEMODEL_H
#define ABSTRACTBASETREEMODEL_H
#in... | true |
4354dba8e23e93b6f15e29d68b9f5ce919b20415 | C++ | dragon-web/review_cpp | /leetcode_9_14/leetcode_9_14/day_9_14.cpp | GB18030 | 1,523 | 3.3125 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<math.h>
using namespace std;
/*
class Solution {
public:
int minNumberInRotateArray(vector<int> rotateArray) {
if (rotateArray.size() == 0) return 0;
int first = 0, last = rotateArray.size() - 1;
while (first < last... | true |
e7543c80734ae9e20b3857b92f12251bed0109ff | C++ | melnikos/navilation | /Util/include/math_util.h | UTF-8 | 929 | 2.8125 | 3 | [] | no_license | //
// Created by sigi on 12.06.19.
//
#ifndef EPIPHANY_UMATH_H
#define EPIPHANY_UMATH_H
namespace U {
namespace Math{
/**
* converts degrees to radiant
* @param degrees unit as degrees
* @return converted value
*/
double d2r(double degrees);
double r2... | true |
4d27f9a54e69a5553d2a5e935b1804023a4fb152 | C++ | Ashe/4D-Geometry-Viewer | /src/Viewer.h | UTF-8 | 2,456 | 2.71875 | 3 | [
"MIT"
] | permissive | // Viewer.h
// A scene used to view geometry
#ifndef EDITOR_H
#define EDITOR_H
#include <math.h>
#include <memory>
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <glm/matrix.hpp>
#include "Scene.h"
#include "Camera.h"
#include "Camera4D.h"
#include "Shader.h"
#include "shaders/Vertex.h"
#include "shaders/Fr... | true |
12b8b4672a1d8bf0d1b2262e978db43453e58621 | C++ | Jason-Addison/MicBoard | /Soundboard/Texture.h | UTF-8 | 300 | 2.546875 | 3 | [] | no_license | #pragma once
#include "GL\glew.h"
#include "GLFW\glfw3.h"
#include <string>
class Texture
{
public:
Texture();
Texture(GLuint texture, int width, int height);
~Texture();
GLuint texture;
int width;
int height;
std::string name;
GLuint getTexture();
int getWidth();
int getHeight();
};
| true |
0a6f9892476415bd0120478bb76b60400645486c | C++ | ddolzhenko/training_algos_2016_05 | /akozoriz/components/include/search.h | UTF-8 | 1,414 | 2.6875 | 3 | [] | no_license | #include <vector>
typedef std::vector<int> IntVector;
namespace components {
namespace search {
namespace linear {
int linear_search_1(IntVector& Array, const int key);
int linear_search_2(IntVector& Array, const int key);
int linear_search_3(IntVector& Array, const int key);
int linear_search_4(IntVector& Array, con... | true |
99006b0e7ddb2bce342e86124ffa08cdf0f50e2f | C++ | Mortano/PnDC | /PnDC/main.cpp | UTF-8 | 3,715 | 2.96875 | 3 | [] | no_license |
#include "Sorting.h"
#include "ParallelUtil.h"
#include <vector>
#include <random>
#include <numeric>
#include <iostream>
#include <numeric>
#include <chrono>
#include "RuntimeMeasurement.h"
auto RandomNumbers(size_t count)
{
static std::random_device s_rnd;
static std::uniform_int_distribution<size_t> s_distr... | true |
a66b0a22bd3bbc34c7486301769ec98f910ca9df | C++ | PPTGamer/cs171-project | /gameobj/AnimatedSprite.h | UTF-8 | 487 | 2.59375 | 3 | [] | no_license | #ifndef ANIMATEDSPRITE_H
#define ANIMATEDSPRITE_H
#include <SFML/Graphics.hpp>
class AnimatedSprite : public sf::Sprite
{
int animationFrame;
int animationNumber;
int maxFrame;
int width;
int height;
void refreshFrame();
public:
AnimatedSprite(int width=64, int height=64);
void setAnimationLength(int frames);
... | true |
315f4b8d6e8da3f7ad6621885fe0a2c63ff5e0f5 | C++ | Ckiddo/ACMproblemsove | /ThePreliminaryContestForICPCAsiaShenYang2019/F.cpp | UTF-8 | 4,837 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
#include <algorithm>
int n,k;
int a[500002];
int maxa[500002];
int mina[500002];
int _range[22][2];
int _rangeLength;
void solve();
void input(){
while(scanf("%d %d",&n, &k) != -1){
for(int i = 0;i < n;i++){
scanf("%d", &a[i]);
}
std::fill(maxa,maxa+n,-1);
std::fill(mina,mina+n,100000000... | true |
2f032d5909ff907e756d7524b73b44acfd5e2d1a | C++ | TzashiNorpu/Algorithm | /Clion/ZeroTrac/1500_1600/validTicTacToe_794.cpp | UTF-8 | 1,080 | 2.734375 | 3 | [
"MIT"
] | permissive | //
// Created by TzashiNorpu on 7/13/2022.
//
#include "../header/1500_1600.h"
using namespace ZeroTrac;
bool validTicTacToe_794::validTicTacToe(vector<string> &board) {
int turns = 0;
bool xwin = false, owin = false;
vector<int> rows(3, 0), cols(3, 0);
int pie = 0, na = 0;
for (int i = 0; i < 3; i++) {
... | true |
42ff4002e72c2f55a4b32b2b2be957caca34a26b | C++ | Skuaka/BackpackManager | /ItemBar.cpp | UTF-8 | 3,692 | 2.875 | 3 | [] | no_license | //
// Created by 苏嘉凯 on 2019-04-29.
//
#include "ItemBar.h"
std::mutex ItemBar::__m_instance_mutex;
ItemBar* ItemBar::__m_pInstance;
ItemBar &ItemBar::GetInstance() {
if(!__m_pInstance)
{
std::unique_lock<std::mutex> lk(__m_instance_mutex);
if (!__m_pInstance) {
__m_pInstance = ne... | true |
3672606390b19b42f8805448c43d0e48235934ad | C++ | amirreza-art/Golkhone_Buali | /Golkhone/person.cpp | UTF-8 | 15,738 | 3.03125 | 3 | [] | no_license | #include "person.h"
#include <cstring>
#include <stdexcept>
Person::Person()
{
}
void Person::set_flower(Flower *ptr)
{
flowers.push_back(ptr);
}
void Person::pick_Tulip()
{
for (size_t i = 0; i < flowers.size(); i++)
{
if (flowers.at(i)->get_name() == "Tulip")
{
flowers.at(i... | true |
6f1af5ff293f6a8e210e70fbf1dd9cfed7e8fc3e | C++ | c3coding100/koi_ba | /8주차/C/8.cpp | UTF-8 | 412 | 2.890625 | 3 | [] | no_license | #include <cstdio>
void gugudan(int a,int b)
{
int i=0,j=0;
if(a > b){
i=a;
a=b;
b=i;
}
for(j=a;j <= b;j++){
printf("== %ddan ==\n",j);
for(i=1;i<=9;i++){
printf("%d * %d = %2d\n",j,i,j*i);
}
printf("\n");
}
}
int ma... | true |
aa292b7d4dc5967e7aaab7dd91f134fd21910cd5 | C++ | 00mjk/Ventilator | /software/controller/lib/non_volatile/nv_vars.h | UTF-8 | 3,338 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | /* Copyright 2021, RespiraWorks
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... | true |
fba8769a21ffcb0f35f1bd830cd63002ceb9140f | C++ | riddhi2000/Competitive-programming | /interviewbit/substring-concatenation.cpp | UTF-8 | 1,082 | 2.953125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector<int> findSubstring(string A, const vector<string> &B) {
vector<int> ans;
int n=B.size();
int count=0;
for(int i=0;i<A.length();i++){
vector<int> index(n,0);
count=0;
int j=0;
int e,s=i;
int f=0;
... | true |
70845bda2ca5f471e513b3d917f3a216fa09d29e | C++ | atulRanaa/problem-solving-directory | /Problem Solving/Tries_maxXor.cpp | UTF-8 | 1,287 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct Node{
int value;
Node *ar[2];
Node(){value=0, ar[0]=ar[1]= NULL;}
};
ll pow2[33];
void powof2(){
pow2[0]=1;
for(int i=0;i<33;i++) pow2[i] = (pow2[i-1]+pow2[i-1]);
}
void insert(Node *head, int n){
Node *t = head;
fo... | true |
ae4b9d8ea063971be8db10dc3b0a3d54d0024e1d | C++ | mantoniogr/imgproc_cpp | /src/morphology.cpp | UTF-8 | 14,586 | 2.984375 | 3 | [] | no_license | //
// morphology.cpp
// image_processing
//
// Created by Marco Garduño on 24/07/17.
// Copyright © 2017 Marco Garduño. All rights reserved.
//
#include <iostream>
#include <vector>
#include <opencv2/highgui/highgui.hpp>
#include "morphology.h"
#include "functions.h"
#include <queue>
cv::Mat dilation(cv::Mat imag... | true |
3c2185907299c37646be3fe7d5b452022988a1fa | C++ | nerds-odd-e/mahjong | /tst/DataCreationHelpers.h | UTF-8 | 2,313 | 3.234375 | 3 | [
"MIT"
] | permissive | #ifndef DATA_CREATION_HELPERS
#define DATA_CREATION_HELPERS
#include "Hand.h"
#include "Perspective.h"
class DummyUIEvent: public UIEvent {
public:
virtual ~DummyUIEvent() {
}
virtual std::string toString() {
return "";
}
};
const Tile WINNING_TILE = 10;
const Tile ANY_TILE = 8;
const Tile defaultTilesPongTheW... | true |
f377fd6a7a0917d032d3fa1c9552d9622d586909 | C++ | codingbycoding/codingbycoding.github.io | /cpp/effective_cpp/effective.h | UTF-8 | 7,226 | 3.328125 | 3 | [] | no_license | #ifndef ADAM_EFFECTIVE_CPP_EFFECTIVE_H_
#define ADAM_EFFECTIVE_CPP_EFFECTIVE_H_
#include <iostream>
#include <cassert>
#include <new>
class AgainstDefaultCompilerGen {
private:
AgainstDefaultCompilerGen(const AgainstDefaultCompilerGen&);//on purpose only declare this to against compiler default gen ctor... | true |
f964dbdb82cde5fa9172d609c05441a2500080d6 | C++ | ajayguna-96/LeetCode | /Keyboard Row.cpp | UTF-8 | 985 | 3.109375 | 3 | [] | no_license | class Solution {
public:
int FindRow (char letter , vector<string> dict){
for(int i = 0; i < dict.size() ; i++){
for( int j = 0 ; j < dict[i].length() ; j++){
if( tolower(letter) == dict[i][j]){
return i + 1;
}
}
}
r... | true |
9b9f543aaea5da0454263dba4138b4df30c16f58 | C++ | aryabhatta22/CompetitiveCoding | /Sudo Placement GFG/Array/2_LeaderInArray/main.cpp | UTF-8 | 1,186 | 3.09375 | 3 | [] | no_license | /**************************
Description : https://practice.geeksforgeeks.org/problems/leaders-in-an-array/0/?track=sp-arrays-and-searching&batchId=152
Date : 13 Aug, 2019
**************************/
#include<iostream>
using namespace std;
int main()
{
//code
int test{0};
long int size{0... | true |
fa54f8b81c285c8756fff501b55366b4d6e80715 | C++ | sunbinbin1991/myfirstcode | /example/leetCode/739_daliyTemperatures.h | UTF-8 | 601 | 3.140625 | 3 | [] | no_license | #pragma once
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> dailyTemperatures(vector<int>& temperatures)
{
int n = temperatures.size();
vector<int> ans;
int len = temperatures.size();
for (int i = 0; i < len; ++i) {
int count = 0;
for (int j = i; ... | true |
50a2b03c6ac14470f6356e555b77d3fae94f41ad | C++ | templeblock/Portfolio | /ASpaceGame/GameSolution/Engine/Randomness.cpp | UTF-8 | 387 | 2.90625 | 3 | [] | no_license | #include "Randomness.h"
Randomness::Randomness()
{
srand ((unsigned int)time(NULL));
}
float Randomness::randomFloat()
{
return (float) rand()/RAND_MAX;
}
Vector2D Randomness::randomUnitVector()
{
float angle = TWO_PI * randomFloat();
return Vector2D(cos(angle), sin(angle));
}
float Randomness::randomInRange... | true |
3122b44f277d533006ba5f2dcea3c128c7beffeb | C++ | rishav2416/ProjectEuler | /problem33-DigitCancelingFractions.cpp | UTF-8 | 680 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <set>
using namespace std;
bool checkDigitCanceling(int nom, int den){
if(nom%10==0 || den%10==0){return 0;} //trivial example;
if((nom/10) == (den/10) && (nom*(den%10)== den*(nom%10)) ){return 1;}
if((nom/10) == (den%10) && (nom*(den/10)== den*(nom%1... | true |
b30e67fb2cea9b81d0062e00496b8d71ea28e530 | C++ | Ramnirmal0/Audrino-codes | /Arduino/soil classisfication/SOIL_CLASSIFICATION.ino | UTF-8 | 1,283 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | /*
MQ A4 D7
MQ3 A0 D8
SOIL A5
*/
/* MQ-3 Alcohol Sensor Circuit with Arduino */
int analog_IN = A4; // This is our input pin
const int AOUTpin = 0; //the AOUT pin of the alcohol sensor goes into analog pin A0 of the arduino
const int DOUTpin = 8; //the DOUT pin of the alcohol sensor goes into... | true |
761d72db88425ae6c5718d33ea1f6e6cdea3be6a | C++ | chinagdlex/yggdrasil | /developing/yggdrasil/test/charset/const_strings_test.cpp | UTF-8 | 1,711 | 2.53125 | 3 | [] | no_license | //const_strings_test.cpp
#ifndef _MSC_VER
# error "this file test msvc only !!!!"
#endif // _MSC_VER
#include <iostream>
#include <yggr/charset/string.hpp>
#include <yggr/ppex/pp_debug.hpp>
#include <yggr/charset/const_strings.hpp>
//#define YGGR_USE_STL_STRING
#define YGGR_USE_BOOST_STRING
#ifdef _MSC_VER
#includ... | true |
861951ae136fcd8e605ba7d4f4626e47c054eee8 | C++ | Lin6797/Lin6797-stu-warehouse | /数据结构实验/实验7/minHeap_detail.cpp | GB18030 | 2,354 | 3.6875 | 4 | [] | no_license | //Сѵľʵ
#include "minHeap_class.h"
#include <iostream>
using namespace std;
template<class T>
minHeap<T>::minHeap(int n){ //캯
Num=0; Capacity=n; //ʼ
tHeap=new T[n]; //ٿռ
eHeap=new int[n];
}
template<class T>
bool minHeap<T>::IsEmpty(){//ж϶ǷΪ
if(Num==0) return true;
else return false;
}
template<class T>
boo... | true |