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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c476b40c7a4cbe78a52b8b9d76ae932821fa67c0 | C++ | robotsupc/balance | /arduino/src/MPU6050.cpp | UTF-8 | 1,199 | 2.71875 | 3 | [] | no_license | #include <MPU6050.h>
#include <Wire.h>
MPU6050::MPU6050() {
}
void MPU6050::begin(int sda, int scl) {
this->sda = sda;
this->scl = scl;
this->addr = 0x68;
Wire.begin(sda, scl); // sda, scl
Wire.beginTransmission(this->addr);
Wire.write(0x6B); // PWR_MGMT_1 register
Wire.write(0); // set to zero (... | true |
21f5efcc9c33dedb03f1a426377beac4541dc416 | C++ | 401040579/cpts122-Data-Structures | /RanTaoPA6_122/RanTaoPA6_122/RanTaoPA6_122/BSTNode.h | UTF-8 | 6,264 | 3.28125 | 3 | [] | no_license | /*******************************************************************************************
* Programmer: Ran Tao
* Class: CptS 122, Spring 2016
* Programming Assignment: PA 6
* Created: March 19, 2016
* Last Revised: March 23, 2016
* Description: a Binary Search Tree (BST) data structure is a nonlinear data s... | true |
f919c681c59839d74c1d17c4a3fdaf54ee8ebb2a | C++ | Do-ho/Linear-Algebra | /HW06/HW06/KDH_function.h | UHC | 3,851 | 3.171875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <cstdio>
#include <cmath>
#include <array>
using namespace std;
void print_matrix(array<array<float, 4>, 4> matrix, int row, int col);
void rref07(array<array<float, 4>, 4>* matrix, int row, int col);
void rref16(array<array<float, 4>, 4>* matrix, int row, int col);
void swap... | true |
468274cf49fc365bf4dabfe46af376c538937523 | C++ | amankumartiwari/Leetcode-Challenges | /jewels and stones.cpp | UTF-8 | 314 | 2.59375 | 3 | [] | no_license | class Solution {
public:
int numJewelsInStones(string J, string S) {
map<char,int>mp;
for(char c:S){
mp[c]++;
}
int ans=0;
for(char c:J){
if(mp.count(c)==1){
ans+=mp[c];
}
}
return ans;
}
}; | true |
9dabbebddbea28c5dde467efba19fb4627d4a5c0 | C++ | pencilCool/design-partten-c- | /template1.cpp | UTF-8 | 1,214 | 3.140625 | 3 | [] | no_license | //
// main.cpp
// template1
//
// Created by Tang yuhua on 16/6/17.
// Copyright © 2016年 Tang yuhua. All rights reserved.
//
#include <iostream>
#include <string>
using namespace std;
class TestPaper{
public:
void question1(){
cout<<"1+1"<<answer1()<<endl;
}
void question2(){
cout<<"1*... | true |
5aa75478b95340debdf273e60abaf56e51d04561 | C++ | BravoXavi/Swashbuckler | /Swashbuckler/creature.cpp | UTF-8 | 305 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "creature.h"
Creature::Creature(const char* creatureName, const char* creatureDescription, Room* loc) : Entity(creatureName, creatureDescription)
{
name = creatureName;
description = creatureDescription;
entityType = creature;
location = loc;
}
Creature::~Creature()
{} | true |
a07910fe1330fdcd50d7641b5a793318d9d944cf | C++ | oscarpfernandez/SubtitleBroadcast | /Str2Creator/src/projectsetupconfig.cpp | UTF-8 | 10,702 | 2.71875 | 3 | [] | no_license | #include "projectsetupconfig.h"
#include "mainwindow.h"
/******************************************************************************
* Description: the purpose of this class is to create a project setup confi-
* ration GUI, the allows the user to setup primary project conditions:
* - base path, supported languag... | true |
3c279d5d9d6e0b23909385b4caa5f3334a9cf6ab | C++ | BruceleeThanh/Backup_CppBasicTLU | /Special_Cac bai tap ve Mang/Bai 5_chi chay duoc tren Dev C/Source.cpp | UTF-8 | 645 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
string S, S1;
int giaTri[1000], N, i, j;
void sapXep();
void sapXep()
{
int temp;
for (i = 0; i < N - 1; i++)
{
for (j = i + 1; j < N; j++)
{
if (giaTri[i]>giaTri[j])
{
temp = giaTri[i];
giaTri[i] = giaTri[j];
giaTri[j] = temp;
}
}... | true |
2184f21f4b353f8bfb506f2e3e3783d2cd808333 | C++ | tblenahan/CSCI1300-Library | /Library.hpp | UTF-8 | 1,142 | 2.515625 | 3 | [] | no_license | /*
CS1300 Spring 2018
Author: Timothy Lenahan
Recitation: 205 - Harshini Muthukrishnan
Cloud Workspace Editor Link: http://ide.c9.io/tblenahan/tl_csci_1300
Hmwk7 - partII
*/
#ifndef LIBRARY_HPP
#define LIBRARY_HPP
#include "Book.hpp"
#include "User.hpp"
using namespace std;
class Library
{
private:
Book b... | true |
56e990f43552e864b34b5b54a506d1f9a10c07d7 | C++ | runguanner/C-Programme | /010. 正则表达式匹配(Hard).cpp | UTF-8 | 3,552 | 3.890625 | 4 | [] | no_license | // 递归
// '*'表示之前那个字符可以有0个,1个或是多个,就是说,字符串a*b,可以表示b或是aaab,即a的个数任意。
// '.'表示匹配任意单个字符。
class Solution {
public:
bool isMatch(string s, string p) {
if(p.empty()) return s.empty(); //(1)若p为空,若s也为空,返回true,反之返回false。
if(p.size() == 1) { //(2)若p的长度为1,若s长度也为1,且相同或是p为'.'则返回true,反之返回false。
return ... | true |
f693457d6d49523e6727b9fea0073063e4890dff | C++ | Humungus-Fungus/project-swyft | /NEA_Project_Swyft/CPP_files/Looper.cpp | UTF-8 | 1,128 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "../FunctionDeclarations.h"
// This method will be be responsible for getting the final seq
// This method is complicated
// "seqs" represents the vector holding all other vectors
// "vals" represents the items we are looking for within seqs (the ideal sequence)
// "fina... | true |
da62739e17bd072c43c01e829c5b7f2a23d1a8e8 | C++ | osoman2/Compiladores | /Semana 0/grafo/grafo.cpp | UTF-8 | 801 | 3.109375 | 3 | [] | no_license | #ifndef GRAPH_H
#define GRAPH_H
#include "vertice.cpp"
template<class N,class A>
class Grafo
{
private:
vector <Arista<N,A>*> aristas;
vector <Vertice<N,A>*> vertices;
public:
Grafo(){
aristas.clear();
vertices.clear();
}
~Grafo();
void makelink(Vertice<N,A>&p,Vertice<N,A>&ll,A a... | true |
15855b2c0be1f51fc7376bc1419ce135b4501ec8 | C++ | Jaoxvalen/mcs.imageprocessing | /camera_cal4/t1/SelectorFrame.h | UTF-8 | 5,080 | 2.546875 | 3 | [] | no_license | #include <map>
#include "RingsDetector.h"
#include "ProcManager.h"
using namespace std;
using namespace cv;
namespace vision
{
struct classcomp {
bool operator() (const Rect& lhs, const Rect& rhs) const
{
if (lhs.x != rhs.x ) return lhs.x < rhs.x;
if (lhs.y != rhs.y ) return lhs.y < rhs.y;
return tr... | true |
2a40d047f9b886061c091e34f439ac7f88405c3c | C++ | 15757170756/All-Code-I-Have-Done | /hihoCode/[Offer收割]编程练习赛31/题目3-数组分拆II.cpp | UTF-8 | 2,785 | 3 | 3 | [] | no_license | /*
题目3 : 数组分拆II
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
描述
给定一个包含N个整数的数组A=[A1, A2, ... AN]。小Ho想将A拆分成若干连续的子数组,使得每个子数组中的整数都是两两不同的。
在满足以上条件的前提下,小Ho想知道子数组数量最少是多少。
同时他还想知道,在数量最少的前提下有多少中不同的拆法。
例如对于[1, 2, 3, 1, 2, 1],最少需要3个子数组。有5种不同的拆法:
[1], [2, 3, 1], [2, 1]
[1, 2], [3, 1], [2, 1]
[1, 2], [3, 1, 2], [1]
[1, 2, 3], [1], [... | true |
f77f4ec3a1f5fb778c35683a2389cc1397482865 | C++ | dmpots/ra-chow | /rc.h | UTF-8 | 1,252 | 2.59375 | 3 | [] | no_license | #ifndef __GUARD_RC_H
#define __GUARD_RC_H
#include <Shared.h>
#include "types.h"
namespace RegisterClass {
/* types */
enum RC {INT, FLOAT};
//this struct holds information about the registers reserved for a
//given class. these reserved registers are used during register
//assignment to provide machine reg... | true |
84c1beff9716d73dbfd38b3e6ee0084ad5bc2708 | C++ | rkrupka/uefa2021 | /Match.h | UTF-8 | 370 | 2.515625 | 3 | [] | no_license | #ifndef MATCH_H
#define MATCH_H
//////////////////////////////////////////
// Plik: Match.h
//////////////////////////////////////////
#include "team.h"
struct LineUp {
Team* team;
std::vector<Player*> playing;
int score;
};
class Match
{
public:
Match();
Team* winner() const;
private:
LineUp ... | true |
3a26eaf4210ccff9ba080dcaacf664371c299ed4 | C++ | Naruse27/Haguruma | /Sources/GameSources/Character.h | SHIFT_JIS | 2,883 | 2.65625 | 3 | [] | no_license | #ifndef CHARACTER
#define CHARACTER
#include "GameLibSource/Vector.h"
#include "GameLibSource/Model.h"
#include "GimmickManager.h"
class Character
{
public:
Character() {}
virtual ~Character() {}
// sXV
void UpdateTransform();
const Vector3& GetPosition() const { return position; }
void SetPosition(const Vect... | true |
6bdd0489a44cdc65d283e7fa0e0601888ab30f8e | C++ | ekverma26/Stack-queue-and-Linked-lists | /DOUBLY.CPP | UTF-8 | 4,248 | 3.109375 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<alloc.h>
#include<stdlib.h>
# define NULL 0
void inla();
void inbeg();
void inbet();
void display();
void input();
void dela();
void debeg();
void debet();
void count();
void search();
void hmax();
void secmax();
void reverse();
void sort();
int co=0;
s... | true |
8b36a41f49e5980dcf2e05282a7b36542de9d2e7 | C++ | fzls/CLRS | /chapt12~13/testBST.cpp | UTF-8 | 1,435 | 3 | 3 | [] | no_license | /*
+----------------------------------------------------------
*
* @authors: 风之凌殇 <1054073896@qq.com>
* @FILE NAME: testBST.cpp
* @version:
* @Time: 2015-11-30 19:41:40
* @Description: test the BinarySearchTree Class
*
+----------------------------------------------------------
*/
#include <algorithm>
#include <fu... | true |
e70bd85fa888eb434e062be0a0756bbe5c1a08de | C++ | suraj021/Codeforces-Solutions | /cf600C.cpp | UTF-8 | 1,156 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
char ans[200005];
int freq[10000];
bool exist[27];
int main(){
memset( freq, 0, sizeof freq );
memset( exist, 0, sizeof exist );
string s;
cin >> s;
for( int i= 0; i< (int)s.length(); ++i ){
freq[ s[i] - 'a' ]++;
exist[ s[i] - 'a' ]= true;
}
//for( int i=... | true |
dc732cef1a084aeac9a8a5354a6a072f432d72b7 | C++ | thetimeofblack/USC-EE569-Digital-Image-Processing-Spring-2017 | /Homework-1/prob2a/Prob2a.cpp | UTF-8 | 10,842 | 2.890625 | 3 | [] | no_license | // ------------------------------------------------------------------------------------
// EE569 Homework Assignment #1 Prob2a
// Date: February 5, 2017
// Name : Chinmay Chinara
// USC-ID : 2527-2374-52
// email : chinara@usc.edu
// --------------------------------------------------------------------------------... | true |
99bcd7f0ee8b532d509b0d00ed62ed7de35cd90c | C++ | cuby-tec/mitoPrinter | /statuslabel.cpp | UTF-8 | 1,889 | 2.625 | 3 | [] | no_license | #include "statuslabel.h"
#include <QDebug>
StatusLabel::StatusLabel(QWidget *parent) : QWidget(parent)
, ui(new Ui::StatusLabel)
{
// this->parent = parent;
ui->setupUi(parent);
}
void StatusLabel::statusFailed()
{
// qDebug()<<__FILE__<<__LINE__<<"statusFailed";
indicateTemperature(eiFail,QString("... | true |
e027ed7c5dfdefa8790120ceab69fedec62ef219 | C++ | jiadaizhao/LeetCode | /0901-1000/0929-Unique Email Addresses/0929-Unique Email Addresses.cpp | UTF-8 | 713 | 2.734375 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int numUniqueEmails(vector<string>& emails) {
unordered_set<string> table;
for (string email : emails) {
auto it = email.begin();
bool ignore = false;
string s;
for (; *it != '@'; ++it) {
char c = *it;
... | true |
e572cbe117ebe90e6b5783cbf8c70d2674d115db | C++ | NCTU-Kemono/CodeBook | /Graph/MMC.cpp | UTF-8 | 1,438 | 2.84375 | 3 | [] | no_license | const int MAXN = 55;
const double INF = 0x3f3f3f3f;
const double EPS = 1e-4;
double min_mean_cycle(vector<vector<pii> > &G) {
int n = G.size(); G.resize(n + 1);
for (int i = 0 ; i < n ; i++)
G[n].push_back(MP(i, 0));
double d[MAXN][MAXN]; // dp[i][j] := 從起點到j走i條的最短路徑
int s = n++;
for (int ... | true |
29e6f9b6552d9da74ac4b6298a575bca745c8f6b | C++ | davidlove/omrp | /regularized_decomposition/src/history.cpp | UTF-8 | 5,058 | 2.6875 | 3 | [] | no_license | /*------------------------------------------------------------------------------
MODULE TYPE: Project core code.
PROJECT CODE: Simplex
PROJECT FULL NAME: Advanced implementation of revised simplex method
for large scale linear problems.
MODULE AUTHOR: Artur Swietanowski.
PROJECT SUPERVISOR: prof. Andrzej... | true |
3da4abba25d471f55539e1de3918169f6b859625 | C++ | bwbruno/projeto-lp1 | /src/animal_silvestre/animal_exotico.cpp | UTF-8 | 794 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "animal_silvestre/animal_exotico.h"
using namespace std;
// ------------------------------------------------------------------------
// Construtores e destrutor
// ------------------------------------------------------------------------
AnimalExotico::AnimalExotico(){
pais_origem = "País não definido"... | true |
ad9c96c6a539ac34cb268cbf523fc440f539e6df | C++ | WireLife/FightingCode | /2020备战蓝桥/王浩杰/第十一次作业/11.1.cpp | UTF-8 | 627 | 2.9375 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<conio.h>
#include<string>
using namespace std;
void f()
{
}
int main()
{
int n=0,a1=0,a2=0,a3=0,a4=0,a5=0;
char a='0';
while(a!='\n')
{
a = cin.get();
if (65 <= a && a <= 90)a1++;
else if (97 <= a&& a <= 122)a2++;
else if (48 <= a && a <= 57)a3++;
else if (... | true |
7b866a70e042ec14ac1ce07c4e9aec358030995f | C++ | gshanbhag525/CP_Practice | /FacePrep/TestYourSkill/Strings/SpecialSchool.cpp | UTF-8 | 1,331 | 3.90625 | 4 | [] | no_license | #include <iostream>
#include <string.h>
using namespace std;
int main()
{
char str[50], str1[50], rev[50];
cin >> str >> str1;
int size = strlen(str);
// Swap character starting from two
// corners
for (int i = 0; i < size / 2; i++)
swap(str[i], str[size - i - 1]);
if (strcmp(str1, ... | true |
c14a79dc80cb8e594ccd3928d0a77102a12f798b | C++ | qypluobo/leetcode-solution | /14.Longest_Common_Prefix.cpp | UTF-8 | 1,441 | 3.140625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "uthash.h"
char * longestCommonPrefix(char ** strs, int strsSize){
if (strsSize <= 0) {
return strdup("");
}
int i, j;
int tmpLen;
int minLen = strlen(strs[0]);
char cur;
char* ans;
bool find = false;
for ... | true |
b4aec09734d7795bd69850b7de465b194cf9182c | C++ | nksymsym/atcoder | /abc/121/c.cpp | UTF-8 | 759 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pr;
typedef priority_queue<pr> pq;
int main()
{
ll n, m;
cin >> n >> m;
vll a(n), b(n);
pq q;
for (... | true |
00aef92056b8d5d0ef3a024cf1ac0a4566bdeaa0 | C++ | per1234/SirHenry | /examples/example5/example5.ino | UTF-8 | 1,891 | 2.6875 | 3 | [] | no_license | #include <Servo.h>
#include <NewPing.h>
#include <SirHenry.h>
/* Sir Henry example5.
* By Cobus Truter (20 Jan 2017)
*
* Demo code for 21 January 2017.
*
* TODO: Explanation.
*
*/
SirHenry bot;
int head_straight = 0; // Head alignment offset
int repeat_right = 0;
int repeat_left = 0;
long rand_num;
... | true |
7dfc63e387f51be854bf5f4600aa972a2d184a6d | C++ | PascualPhil/CSC-5_40107_Winter_2017 | /Homework/Assignment_2/Gaddis_8thEd_Ch3_Pr3_TestAverage/main.cpp | UTF-8 | 1,330 | 3.734375 | 4 | [] | no_license | /*
File: main.cpp
Author: Phillip Pascual
Created on January 9, 2017, 1:00 PM
Purpose: Test average calculator.
*/
//System Libraries
#include <iostream>
#include <iomanip> //For setprecision
using namespace std;
//User Libraries
//Global Constants
//Such as PI, Vc, -> Math/Science values
//as well as c... | true |
da436eeb2db971f2dc0e4c71dc62be8b02ee3bc9 | C++ | matangeorgi/SuperMario-Bros-1 | /src/Enemys/Tortoise.cpp | UTF-8 | 1,610 | 2.578125 | 3 | [] | no_license | #include "Tortoise.h"
Tortoise::Tortoise(int row, int col)
: Enemy(TextureHolder::instance().getEnemy(I_TORTOISE), LEFT, TORTOISE_SIZE, row ,col),
m_shell(false), m_jumped(false)
{
m_sprite.setPosition((float)(col * ICON_SIZE),
(float)((row * ICON_SIZE)) + TORTOISE_Y_POS);
}
//--------------------... | true |
4f4b27a5b7cad638745becc3ca82fd80e162bb55 | C++ | sswroom/SClass | /src/Crypto/Hash/SuperFastHash.cpp | UTF-8 | 1,304 | 2.671875 | 3 | [] | no_license | #include "Stdafx.h"
#include "MyMemory.h"
#include "Crypto/Hash/SuperFastHash.h"
#include "Text/MyString.h"
extern "C"
{
UInt32 SuperFastHash_Calc(const UInt8 *buff, UOSInt buffSize, UInt32 currVal);
}
Crypto::Hash::SuperFastHash::SuperFastHash(UInt32 len)
{
this->currVal = len;
}
Crypto::Hash::Supe... | true |
2cd44862f0c169e7f59ebf6ac1435e7b21097a51 | C++ | CompaqDisc/chippy | /src/chippy.cc | UTF-8 | 6,177 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | #define OLC_PGE_APPLICATION
#include <stdint.h>
#include "olcPixelGameEngine.h"
#include "display.h"
#include "chip8.h"
#define CANVAS_OFFSET 8
namespace Chippy
{
class Chippy : public olc::PixelGameEngine
{
public:
enum EmulatorState
{
STATE_INIT,
STATE_MENU,
STATE_RUNNING,
STATE_EXITING
};
D... | true |
eb05ff51cfbcf316e27b3574b8f28c4c785a9cef | C++ | artheadsweden/cpp_fund_mar_2021 | /day1/dynamic.cpp | UTF-8 | 208 | 2.734375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
{
int x = 10;
}
{
int* ip = new int;
*ip = 20;
cout << *ip << endl;
delete ip;
}
return 0;
} | true |
fa739316ccdfb8d2f2f0923931f7892cd460c6de | C++ | rmoswela/cppBootcamp | /day04/ex01/SuperMutant.hpp | UTF-8 | 323 | 2.734375 | 3 | [] | no_license | #ifndef SUPERMUTANT_HPP
#define SUPERMUTANT_HPP
#include "Enemy.hpp"
class SuperMutant : public Enemy
{
public:
SuperMutant(void);
~SuperMutant(void);
SuperMutant(SuperMutant const & target);
SuperMutant &operator=(SuperMutant const & target);
virtual void takeDamage(int amount);
};
#end... | true |
ad8a6a006c3fe5d0d04fca157080660b03fbd1de | C++ | Batishavo/codeforces | /A. Splitting into digits.cpp | UTF-8 | 223 | 2.765625 | 3 | [] | no_license | #include<cstdio>
int n,num;
int main(){
scanf("%d",&n);
for(int i=9;i>=1;i--){
if(n%i==0){
num=i;
break;
}
}
printf("%d\n",n/num);
while(n>0){
n-=num;
printf("%d ",num);
}
return 0;
}
| true |
1a954567b95173fd6a6f419350e7fee65432c390 | C++ | nonocodebox/computer-graphics | /ex3-ray-tracing/polygon.h | UTF-8 | 2,739 | 3.25 | 3 | [] | no_license | //
// polygon.h
// cg-projects
//
// Created by HUJI Computer Graphics course staff, 2012-2013.
// Purpose : A class that represents a convex polygon on the 3d space.
// Inherits from Object class, implementing the method to
// test intersection of a given ray with the polygon.
//
#ifndef _PO... | true |
5a2a1440d21d3e552c4fb8ec29272150ac2f221f | C++ | yingziyu-llt/OI | /c/杂项/评分系统.cpp | GB18030 | 1,331 | 2.59375 | 3 | [] | no_license | #include<stdio.h>
//ϵͳ
int main()
{
int a[12][6],i,j,max[12],min[12];//ans[a][x] a=0ave[x] a=1: a=2
float ave[12]={0},b[12],temp,ans[3][12];
freopen(".in","r",stdin);
freopen("ֽ.ans","w",stdout);
for(i=0;i<12;i++)
{
for(j=0;j<6;j++)
{
scanf("%d",&a[i][j]);
}
}
for(i=0;i<12;i... | true |
74b290b6f74393f8aaf381f48b0a4321eddc3258 | C++ | kuflex/ofxKu | /src/ofxKuDrawUtils.cpp | UTF-8 | 426 | 2.625 | 3 | [] | no_license | #include "ofxKuDrawUtils.h"
//--------------------------------------------------------------
void ofxKuDrawTextureFit(ofTexture &tex, float x, float y, float w, float h) {
float tw = tex.getWidth();
float th = tex.getHeight();
if (tw>0 && th>0) {
float scl = min(w/tw,h/th);
tw *= scl;
th *= scl;
tex.draw(... | true |
066133ae420994a6af867e106a589f5492d34b96 | C++ | CMilby/Game_Engine | /Game_Engine/Core/Math/math3d.h | UTF-8 | 9,490 | 2.875 | 3 | [] | no_license | //
// math3d.h
// Game_Engine_New
//
// Created by Craig Milby on 10/14/16.
// Copyright © 2016 Craig Milby. All rights reserved.
//
#ifndef __MATH3D_H__
#define __MATH3D_H__
#include <cmath>
#include "matrix.h"
#include "quaternion.h"
#include "vector.h"
#define ToRadian(x) (float)(((x) * 3.1415926536f / 180.0... | true |
172768276604772dde914b3fed58c46496a369ec | C++ | mugisaku/gamebaby-20170912-dumped | /rogie/rogie_piece__autoplay.cpp | UTF-8 | 3,193 | 2.8125 | 3 | [] | no_license | #include"rogie_piece.hpp"
#include"rogie_field.hpp"
void
Piece::
autoplay()
{
if(action_currency > 0)
{
for(auto cb: callback_list)
{
(this->*cb)();
if(own_task.callback || task_stack.size())
{
return;
}
}
action_c... | true |
c5d25102972eeb503d7d8580adf57db21cb152fe | C++ | xSpacklesx/CSI230-lab10.2 | /src/earth_utils.cpp | UTF-8 | 1,710 | 2.71875 | 3 | [] | no_license | //Author: Hunter Spack
//File: earth_utils.cpp
//Breif: defines functions
#include "earth_utils.h"
#include <sstream>
int processCSV(std::ifstream& inFile, std::string kmlFileName)
{
int recordsWrit = 0;
std::string strCountry, strCapital, strLat, strLong, strName;
std::string strLine;
std::ofstream k... | true |
6c79f0b9d556f8a492c889c6e6054c289907d54e | C++ | QuanHBui/OpenGL-Compute | /src/PrototypePhysicsEngine/P3CpuNarrowPhase.h | UTF-8 | 2,059 | 2.578125 | 3 | [
"MIT"
] | permissive | /**
* 3D Triangle-triangle intersection test
* There are 2 special cases to worry about: (1) Degenerate tri input, (2) coplanar tri-tri
*
* @author: Quan Bui
* @version: 04/28/2020
* @reference: Tomas Moller, "A Fast Triangle-Triangle Intersection Test"
* https://fileadmin.cs.lth.se/cs/Personal/Toma... | true |
80c1c6c3eb917f984c0da10cbf1e3a0072ee6f3e | C++ | maple-ysd/data_structure_and_algorithm | /Sort/PrimarySort/main.cpp | GB18030 | 2,619 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <ctime>
#include <random>
#include "PrimarySort.h"
using namespace std;
// Եʱ
clock_t runTime(string str, double *arr, int n)
{
char c;
if (str == "selectSort") c = 's';
else if (str == "insertSort") c = 'i';
else if (str == "insertSortWithSentinel") c = 'b... | true |
192d8ba1eae080f8a1537e601363bee99f4c142f | C++ | sauravstark/Preparations | /013 - Sum Tree.cpp | UTF-8 | 927 | 3.390625 | 3 | [] | no_license | #include <tuple>
struct Node
{
int data;
Node *left, *right;
};
std::tuple<int, bool> sumTree(Node* root) {
if (root == nullptr)
return std::make_tuple(0, true);
else if ((root->left == nullptr) && (root->right == nullptr))
return std::make_tuple(root->data, true);
auto left_... | true |
209dc1cc5822253c00de52d5e6bc14b6b4dadf72 | C++ | CJHMPower/Fetch_Leetcode | /data/Submission/240 Search a 2D Matrix II/Search a 2D Matrix II_1.cpp | UTF-8 | 927 | 3.140625 | 3 | [] | no_license | //-*- coding:utf-8 -*-
// Generated by the Fetch-Leetcode project on the Github
// https://github.com/CJHMPower/Fetch-Leetcode/
// 240 Search a 2D Matrix II
// https://leetcode.com//problems/search-a-2d-matrix-ii/description/
// Fetched at 2018-07-24
// Submitted 2 years ago
// Runtime: 212 ms
// This solution defeats... | true |
244db96c5d2bf5d147a2dd15a00a405f1ff0b694 | C++ | Olysold/ArenaShooter-SFML | /extlibs/Thor/include/Thor/Particles/ParticleInterfaces.hpp | UTF-8 | 4,108 | 2.5625 | 3 | [
"Zlib"
] | permissive | /////////////////////////////////////////////////////////////////////////////////
//
// Thor C++ Library
// Copyright (c) 2011-2013 Jan Haller
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this... | true |
3f614f0dcf5f7ef1fe2b0a58e6ada1d79e878858 | C++ | tallerify/app-server | /src/api/domain/Track.cpp | UTF-8 | 277 | 2.5625 | 3 | [] | no_license |
#include "Track.h"
#include <ostream>
Track::Track(int id, std::string fileLocation) : id(id), fileLocation(fileLocation) {
}
Track::~Track() {
}
int Track::getId() const {
return id;
}
const std::string &Track::getFileLocation() const {
return fileLocation;
}
| true |
a8c1f590f82130b7ecc192556bdddb7e59aa6024 | C++ | glennychen/cp3 | /leetcode/sink/2114.cpp | UTF-8 | 651 | 3.40625 | 3 | [] | no_license | //https://leetcode.com/problems/maximum-number-of-words-found-in-sentences/
#include <string>
#include <vector>
#include <cctype>
#include <sstream>
using namespace std;
class Solution {
public:
int mostWordsFound(vector<string>& sentences) {
int max_words=0;
for(const auto& elem: sentences){
int count... | true |
d57e53d27163d00555c1afb2e7a12f3a0f09dc07 | C++ | dhanendraverma/InterviewBit-Solutions | /Flip.cpp | UTF-8 | 1,122 | 3.484375 | 3 | [] | no_license | vector<int> Solution::flip(string A) {
int count = 0, maxcount = 0, left=-1, right, ansleft=0, ansright=0;
int n = A.length();
vector<int> ans;
for(int i=0;i<n;i++)
{
if(A[i]=='0') //whenevr encounter '0' increase the count of substring having 0 and set the right index at which
... | true |
0054f63cd3352bf9dc07e0d5fea93a0b05af38bb | C++ | lemon123456/ksc-archive | /cs225/CProgAss04A_PetroulesJ/GridFormatter.cpp | UTF-8 | 5,665 | 3.203125 | 3 | [] | no_license | /*
* File: GridFormatter.cpp
* Author: Jake Petroules
*
* Created on February 22, 2011, 11:21 AM
*/
#include "GridFormatter.h"
#include <cstdarg>
#include <algorithm>
#include <cctype>
GridFormatter::GridFormatter(int columns)
: m_columnCount(columns), m_padding(2), m_nullDisplayText(""), m_upperCaseHead... | true |
20a3fbacbc32950e12d407e0752a09180fd51a38 | C++ | sooyun429/Learn-C-plus-plus | /C++ self study/inflearn_두들낙서/inflearn_두들낙서/day03_연산자.cpp | UHC | 597 | 3.515625 | 4 | [] | no_license | // inflearn | C C++ ÿ - ε鳫 C/C++
//
#include <stdio.h>
int main() {
// :
// + = * / % =
// += -= *= /= %=
// ++ --
// ġ ġ - ++a a++ ϴ
int a = 10;
int b;
printf(" === ġ === \n");
b = ++a;
printf("a: %d\n", a); //11
printf("b: %d\n", b); //11
printf(" === ġ === \n");
b = a++;
printf("a: %d\n... | true |
4e6b2c7cab1b0cacd7a7d14a53228a322ddc91fa | C++ | byapparov/CarND-Extended-Kalman-Filter-Project | /src/tools.cpp | UTF-8 | 2,895 | 3.359375 | 3 | [
"MIT"
] | permissive | #include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
using std::cout;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
* Calculates... | true |
e54d9f63f45898d5f79321fccb8adf1d42408dde | C++ | neveza/EconomyGame | /Line.h | UTF-8 | 806 | 2.6875 | 3 | [] | no_license | #ifndef LINE_H
#define DATE_H
const int MAX_X = 25;
const int MAX_Y = 20;
const double FE_GDP = 180;
//Economy data, may change into a proper table
struct Economy
{
double marketPrice = 10; //y
double priceIndex = 100;
double realGDP = FE_GDP; //x
char aggGraph[MAX_X][MAX_Y];
};
//... | true |
da4d29e8789a97b42326e627cf7f1b655343544f | C++ | ruchirsharma1993/SPOJ-Codes | /nicenessofthestring.cpp | UTF-8 | 566 | 2.765625 | 3 | [] | no_license | #include<stdio.h>
#include<string>
#include<vector>
#include<iostream>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
for(int i=0;i<t;i++)
{
char s[1005];
vector<char *>v;
int count=0;
cin.getline(s,1004);
int count=0;
char *tok=strtok(s," ,\t");
while(tok!=NULL)
{
int flag=0;
for... | true |
39d8d1cfd3d69b95f22e5fcc83bbecc67e0c274c | C++ | andyanidas/Saraa | /25FEB/10.cpp | UTF-8 | 394 | 3.203125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int given;
cout<<"Enter amount: ";
cin>>given; // 587
if(given>=100){
cout<<"100: "<<given/100;
given = given - given/100*100;
}
if(given>=50){
cout<<"50: "<<given/50;
given = given - given/50*50;
}
if(given>=20){
cout<<"2... | true |
d4f98bf91ebae8569d60fa4b6d32d7ac2ac80475 | C++ | MarcSeebold/simpleRacerAdmin | /SRAdmin/ClientConnectionManager.cc | UTF-8 | 1,343 | 2.703125 | 3 | [] | no_license | #include "ClientConnectionManager.hh"
ClientConnectionManager::ClientConnectionManager(QObject *_parent) : QAbstractListModel(_parent)
{
}
SharedClientConnection ClientConnectionManager::makeNew()
{
_ c = std::make_shared<ClientConnection>(this);
mClients.push_back(c);
insertRow(rowCount());
connect(c.get(... | true |
1a9475ecfa5040fd2a02ea1898d07969f1c71477 | C++ | stoimenoff/oop16-17 | /week05/practicum/tasks/task.h | UTF-8 | 582 | 2.921875 | 3 | [] | no_license | #ifndef __TASK_H__
#define __TASK_H__
#include <cstddef>
#include <cstring>
#include <iostream>
class Task {
public:
Task(const char* name, int priority, const char* desc);
~Task();
Task(const Task& other);
Task& operator= (const Task& other);
const char* getName() const;
int getPriority() c... | true |
c6dd2dfe286423799ca6b7cb02f5b09a3dd6d8fe | C++ | PriyanshBordia/CodeForces | /979A.cpp | UTF-8 | 440 | 2.828125 | 3 | [] | no_license | #include <iostream>
typedef long long ll;
#define sci(x) scanf("%d", &x);
#define pfi(x) printf("%d\n", x);
#define scll(x) scanf("%lld", &x);
#define pfll(x) printf("%lld\n", x);
#define scs(s) scanf("%s", &s);
#define pfs(s) printf("%s\n", s);
using namespace std;
int main()
{
ll n;
scll(n);
if (n == 0)
c... | true |
2a831269c3650c85f5a2abb369656eb026578a1d | C++ | tomduval/complexity-oslo-model | /OsloModelPy/OsloModelPy/OsloModelPy.cpp | UTF-8 | 1,248 | 2.8125 | 3 | [] | no_license |
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <ctime>
#include <fstream>
#include <iterator>
#include <sstream>
using namespace std;
int randNum(float p) {
float random = ((float)rand()) / (float)RAND_MAX;
if (random <= p) {
return 1;
}
else {
return 2;
}
}
void randsSet(int L, int *ra... | true |
0c292a1a0676af642caef6d5421b2909a2938983 | C++ | tenso/subphonic | /subphonic/sig/window.h | UTF-8 | 988 | 2.6875 | 3 | [] | no_license | #ifndef WINDOW_H
# define WINDOW_H
#include "defines.h"
//FIXME: names w_ or something
namespace spl{
template<class T=smp_t>
class Window
{
public:
enum TYPE {BLACKMAN, HAMMING, HANN, RECTANGLE, TRIANGLE};
Window(TYPE type, uint len);
~Window();
Window(const Window& f);
Window& operat... | true |
1f327a2a79c932cd1508ee8ddac08234c87e8e9d | C++ | kartikarcot/ParticleFilter | /include/LogReader.hpp | UTF-8 | 1,122 | 2.65625 | 3 | [] | no_license | #ifndef LOGREADER_H
#define LOGREADER_H
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <boost/optional.hpp>
#include <ParticleFilter.hpp>
enum LogType {ODOM, LASER};
#define LASER_SIZE 180
struct Log
{
public:
LogType logType;
std::vector<int> laserdata;
Pose2D robotPose; ... | true |
79480084191438287c4fc2d0a15a26b0935e50ee | C++ | intel/lms | /CIM_Framework/CimFrameworkUntyped/include/CimDateTime.h | UTF-8 | 5,921 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | //----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2021 All Rights Reserved.
//
// File: CimDateTime.h
//
// Contents: Classes for working with times and intervals, definitions.
//
//----------------------------------------------------... | true |
be22dfc84dd23156d273f0b3f2e41ff76750eb44 | C++ | kaito1111/GameTemplete | /GameTemplate/myEngine/ksEngine/graphics/GPUBuffer/VertexBuffer.cpp | UTF-8 | 859 | 2.5625 | 3 | [] | no_license | #include "stdafx.h"
#include "graphics/GPUBuffer/VertexBuffer.h"
VertexBuffer::VertexBuffer()
{
}
VertexBuffer::~VertexBuffer()
{
Release();
}
bool VertexBuffer::Create(int numVertex, int stride, const void * pSrcVertexBuffer)
{
Release();
D3D11_BUFFER_DESC bd;
ZeroMemory(&bd, sizeof(bd));
bd.Usage = D3D11_USAG... | true |
0f95138fb74ca1c45138845c43884c514f12e709 | C++ | williamisfranciscodasilva/vendas-c | /vendas.cpp | UTF-8 | 461 | 2.609375 | 3 | [] | no_license | #include <conio.h>
#include <stdio.h>
main()
{
float salario_fixo, vendas_mes, comissao, salario_total;
salario_fixo = 800;
printf("Figite o valor das vendas do mes: ");
scanf("%f",&vendas_mes);
comissao = (vendas_mes / 100) * 15;
salario_total = salario_fixo + comissao;
printf("Salario fixo: %f",salario_fix... | true |
ea4ba54b1273bc545f275c00d92358597e53a400 | C++ | jb1717/BombAERman | /src/graphics/GraphicString.cpp | UTF-8 | 2,771 | 2.765625 | 3 | [] | no_license | //
// GraphicString.cpp for CPP_BOMBERMAN in /home/Jamais/cpp_bomberman
//
// Made by Jamais
// Login <Jamais@epitech.net>
//
// Started on Wed Jun 3 11:24:34 2015 Jamais
// Last update Fri Jun 12 00:12:18 2015 Jamais
//
#include "GraphicString.hh"
#include "AssetManager.hh"
GraphicString::GraphicString() : Compl... | true |
97521b165157c52af573e0f34906ee22d6faa895 | C++ | MehrdadAP/acm_codes | /UVa/The Knights Of Round Table - 10195.cpp | UTF-8 | 681 | 2.59375 | 3 | [] | no_license | /*ba yade oo */
#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <cstring>
#include <sstream>
#include <queue>
#include <vector>
using namespace std;
#define PI 3.14159265358997
#define absol(x) ((x)>(0) ? (x):(-1)*(... | true |
9d4d780e90d13cc6ba91d409f029450157ac2c66 | C++ | HSE-SWB2-OOS/OOS-LB5 | /Aufgabe 3/MyList.hpp | UTF-8 | 648 | 2.8125 | 3 | [] | no_license | #include "MyData.hpp"
#include <iostream>
using namespace std;
#pragma once
class MyList
{
public:
MyList();
MyList(MyList & list);
~MyList();
class MyListElement;
int listSize;
MyListElement *first;
MyListElement *last;
void push_back(const MyData & content);
void pop_back();
MyData & front();
MyData &... | true |
6cb9ed0736a97504a8a3b227725c0054af61215f | C++ | Kenneth-Nicholas/COSC-1560-03-C-Plus-Plus-Programming-II | /Programming_II_HELP/5139145_54863694_Fall+2016+COSC+1550+Homework+Solutions/Homework Solutions/Homework5/Centigrade2Fahrenheit.cpp | UTF-8 | 775 | 3.6875 | 4 | [] | no_license | // Paul Biolchini
// COSC 1550
// Homework 5 Assignment 1
// Chapter 3, Problem 11
// Convert Centigrade temperatures to Fahrenheit.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double tempCen,
tempFah,
convert;
convert = 9./5; // 9./5. => 1.8
cout << "Please enter the tempera... | true |
b31d2c46f8a9e7922887bd68c33a53c12e13bd6a | C++ | Kicer86/sudoku_solver | /rules/row_rule.cpp | UTF-8 | 1,289 | 3.296875 | 3 | [] | no_license |
#include "row_rule.hpp"
#include "utils.hpp"
RowRule::RowRule(const IGrid<int>& grid)
: m_grid(grid)
{
}
std::vector<int> RowRule::validNumbers(int row, int col) const
{
std::vector<int> valid;
const int columns = m_grid.columns();
const int numbers = columns; // possible numbers == nu... | true |
4e113cc9370ba783ce9ea52f79091cea15b87794 | C++ | funemy/TAP-Predictor | /my_predictor_perceptron.h | UTF-8 | 8,532 | 2.59375 | 3 | [] | no_license | // my_predictor.h
// This file contains a my_predictor class.
// It has a perceptron-based TAP indirect branch predictor
#include <vector>
#include <map>
#include <iostream>
#include <bitset>
// a BTB-set is indexed by a branch address
// 32-way associated
// using the LFU replacement policy when the set is full
clas... | true |
a04aa44272a14955939c14e89c35d2a3fed4aa29 | C++ | frozenbanana/3Dproject | /openGLHenryAlone/src/InputHandler.h | UTF-8 | 537 | 2.65625 | 3 | [] | no_license | #pragma once
#include <SDL2\SDL.h>
#include "Camera.h"
class InputHandler
{
public:
InputHandler();
void Update(Camera* camPtr);
bool IsKeyPressed();
bool IsMouseButtonPressed(int mouseButton);
~InputHandler();
private:
enum
{
MOUSE_LEFT,
MOUSE_CENTER,
MOUSE_RIGHT,
NUM_BUTTONS
};... | true |
13ea246601589e5b68e9ea7ad6d9dfb9e647fcf2 | C++ | yucucsd/poj | /3264_RMQ_ST.cpp | UTF-8 | 1,379 | 2.640625 | 3 | [] | no_license | #define _CRT_SECURE_NO_DEPRECATE
#include <cstdio>
#include <math.h>
#include <algorithm>
using namespace std;
#define maxn 50002
int minh[maxn][21];
int maxh[maxn][21];
void init_st(int row)
{
for (int i = 1; (1 << i) < row; i++)
{
for (int j = 0; j < row; j++)
{
min... | true |
a05700801766964ea453863721f01f4ef4461ac6 | C++ | Mehedi-Hassan/Competitive-Programming | /atcoder/abc159/B.cpp | UTF-8 | 722 | 2.703125 | 3 | [] | no_license | #include<bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define f first
#define s second
using namespace std;
int main()
{
string t, s, rev, r2;
cin>>s;
int n = s.size();
t = s.substr(0, (n-1)/2);
// cout<<t<<endl;
rev = t;
reverse(rev.begin(), rev.end()... | true |
bdf309910469ca5c00d7799f753e8d8c521edc98 | C++ | Sidewinder22/SideFileEditor | /src/log/Logger.cpp | UTF-8 | 1,066 | 3.15625 | 3 | [] | no_license | /**
* @author {\_Sidewinder22_/}
* @date 02.01.2019
*
* @brief Class responsible for application logging.
*/
#include <cstring>
#include "Logger.hpp"
namespace log
{
Logger::Logger( std::string prefix )
: prefix_( prefix )
, beginLine_( true )
{ }
template<>
Logger& operator<<( Logger& log, std::... | true |
c415fae46fc703534644b8749a26be111842c685 | C++ | Renardjojo/FuzzyLogic | /include/AI/FuzzyLogic/FuzzySets/Point2D.hpp | UTF-8 | 2,633 | 3.109375 | 3 | [
"MIT"
] | permissive | /*
* Project : FuzzyLogic
* Editing by Six Jonathan
* Date : 2021-01-07 - 13 h 33
*
* Copyright (C) 2021 Six Jonathan
* This file is subject to the license terms in the LICENSE file
* found in the top-level directory of this distribution.
*/
#pragma once
#include "Macro/ClassUtility.hpp"
namespace AI::Fuzz... | true |
84fc3c59fe6cdbc623b2884bee961b23fd027cc9 | C++ | alexandraback/datacollection | /solutions_2449486_1/C++/lambdapioneer/b.cpp | UTF-8 | 1,520 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII... | true |
ac7a030d8dfc0053fc908e6d84fc5b5af3cf133d | C++ | Mindjolt2406/Competitive-Programming | /Codeforces/GYM/2020_Shenyeng/I_Brute.cpp | UTF-8 | 4,656 | 2.59375 | 3 | [
"MIT"
] | permissive | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T>
std::ostream & operator << (std::ostream & os, const std::vector<T> & vec);
template <typename T>
std::ostream & operator << (std::ostream & os, const std::set<T> & vec);
template <typename T>
std::ostream & operator << (std::ostr... | true |
c3c6a7aa1ac3993975d6b591de91c6a59a3f2729 | C++ | MaxMade/ARMOS | /kernel/device_tree/property.cc | UTF-8 | 943 | 2.578125 | 3 | [] | no_license | #include <kernel/utility.h>
#include <kernel/device_tree/property.h>
#include <kernel/device_tree/definition.h>
using namespace DeviceTree;
Property::Property() : valid(false), ptr(nullptr), stringBlock(nullptr) {}
Property::Property(void* ptr, const char* stringBlock) :
valid(false), ptr(static_cast<uint32_t*>(ptr... | true |
1f9b1ca7e82b6a6917a974cca9738254bbe8550b | C++ | thomoncik/hexadoku | /src/State/BoardCreator/ConfirmExitBoardCreatorState.cpp | UTF-8 | 1,181 | 2.59375 | 3 | [
"MIT"
] | permissive | //
// Created by Jakub Kiermasz on 2019-06-10.
//
#include "State/BoardCreator/ConfirmExitBoardCreatorState.hpp"
#include <State/Menu/MainMenuState.hpp>
#include <State/BoardCreator/InsertionBoardCreatorState.hpp>
#include <State/BoardCreator/MoveBoardCreatorState.hpp>
#include <View/BoardCreator/ConfirmExitBoardCreat... | true |
c4f648b22200bdea922f8d0d414143d69fb876b2 | C++ | xBece/DGIIM | /FP/Sesión 5/Casa/18 - Potencia.cpp | ISO-8859-1 | 1,032 | 3.59375 | 4 | [] | no_license | /* Calcular mediante un programa en C++ la funcin potencia x^n, y la funcin factorial n! con
"n" un valor entero y ""x un valor real. No pueden usarse las funciones de la biblioteca cmath. */
#include <iostream>
using namespace std;
int main () {
// DECLARACIN DE LAS VARIABLES A GUARDAR
double x, au... | true |
762b69513c89ad01d369658a9a8f067bd22ea829 | C++ | Something-Specific/SpecificEngine | /Gin/src/Utils/Log.h | UTF-8 | 629 | 2.796875 | 3 | [] | no_license | #pragma once
#include "spdlog/spdlog.h"
#include "spdlog/fmt/ostr.h"
namespace Gin
{
class Log
{
public:
static void Init();
// For multiple args, use {} as a placeholder in the first arg and the remaining args are placed inside.
// Example CORE_INFO("This is a {}", "test") outputs: "This is a test"
inlin... | true |
b6ccdc8424b06c51d19d15c92781e7234d76f816 | C++ | eunho5751/BarrageShooting | /source files/ResourceMgr.cpp | UHC | 2,057 | 2.75 | 3 | [] | no_license | #include "PCH.h"
#include "ResourceMgr.h"
#include "Game.h"
#include "def.h"
CResourceMgr::CResourceMgr()
{
LoadImages(CHAR_RESOURCE_FOLDER);
LoadImages(ENEMY_RESOURCE_FOLDER);
LoadImages(BULLET_RESOURCE_FOLDER);
LoadImages(BACKGROUND_RESOURCE_FOLDER);
LoadImages(ETC_RESOURCE_FOLDER);
}
CResourceMg... | true |
64805c7d90a436b11b96535e63e49d21102f150a | C++ | NicoG60/NumPyCpp | /test/test_npz.cpp | UTF-8 | 2,181 | 2.6875 | 3 | [] | no_license | #include <catch2/catch.hpp>
#include <numpycpp/numpycpp.h>
#include "global.h"
TEMPLATE_TEST_CASE("Open npz file", "[npz]",
bool,
int8_t, uint8_t,
int16_t, uint16_t,
int32_t, uint32_t,
int64_t, uint64_t,
f... | true |
0c97c3f0a439ad5428618e6e9c192ce62d9e30ba | C++ | katya-varlamova/4-sem-oop | /lab_02/matrix/matrix_base.cpp | UTF-8 | 500 | 2.578125 | 3 | [] | no_license | //
// MatrixBase.cpp
// lab_02
//
// Created by Екатерина on 18.04.2021.
// Copyright © 2021 Екатерина. All rights reserved.
//
#include "matrix_base.hpp"
MatrixBase::MatrixBase(size_t rows, size_t columns):
rows(rows), cols(columns)
{
}
size_t MatrixBase::get_cols() const noexcept
{
return cols;
}
size_t ... | true |
9e0a77df2627269ed35a58fbb70bcf0e44368751 | C++ | mstraughan86/Undergraduate-Studies | /UMUC - CMSC405/Project 1/graphic.cpp | UTF-8 | 486 | 3.09375 | 3 | [] | no_license | // CMSC 405 Computer Graphics
// Project 1
// Duane J. Jarc
// August 1, 2013
// Function bodies of class that defines all graphic objects
#include "stdafx.h"
// Constructor that can only be called by the subclasses to initialize the color
Graphic::Graphic(Color color)
{
this->color = color;
}
// Sets the color o... | true |
bf4586ec0219155b9d6647800efcaa840285207c | C++ | holy-bit/LinkedList_Example | /List.h | ISO-8859-10 | 1,441 | 3.09375 | 3 | [] | no_license | #pragma once
template<typename E>
class List {
private:
class Node {
public:
Node* prev;
E elem;
Node* next;
Node(Node*, const E&, Node*);
Node(Node*, E&&, Node*);
Node() = delete;
Node(const Node&)=delete;
Node(Node&&) = delete;
Node& operator=(const Node&) = delete;
Node& operator=(Node... | true |
60d2eb244cfd0b225889a33a60f0e568e2cfed95 | C++ | InsightSoftwareConsortium/ITK | /Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx | UTF-8 | 11,002 | 2.578125 | 3 | [
"IJG",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"SMLNJ",
"BSD-3-Clause",
"BSD-4.3TAHOE",
"LicenseRef-scancode-free-unknown",
"Spencer-86",
"LicenseRef-scancode-llnl",
"FSFUL",
"Libpng",
"libtiff",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
... | permissive | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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
*
* https://www.apache.o... | true |
c472413eb0062b2cb4ddd430f31e62698eae0455 | C++ | yami/DBricks | /src/diagram/ZoomWindow.hxx | UTF-8 | 1,115 | 2.515625 | 3 | [] | no_license | #ifndef ZOOMWINDOW_HXX
#define ZOOMWINDOW_HXX
#include <geom/Point.hxx>
#include <geom/Rect.hxx>
#include <sigc++/sigc++.h>
namespace DBricks {
class ZoomWindow {
public:
ZoomWindow(const Rect& visible, double factor);
double to_display_length(double length) const;
Point to_display_coord(const Poi... | true |
c8920ba2adff4acd3ebc7135bf757a2459b2198e | C++ | Fiereu/SimpleCheatLoader | /Loader/Crypt.cpp | UTF-8 | 136 | 2.828125 | 3 | [] | no_license | #include "Crypt.h"
void XOR(BYTE* data, DWORD size)
{
for (int i = 0; i < size; i++)
{
data[i] = data[i] ^ 0x83FE + i;
}
} | true |
ffa49dc34e91bdceee9147e3fc694ff7be0c2a0e | C++ | najosky/darkeden-v2-serverfiles | /src/server/gameserver/quest/ActionOriginalDeleteGetItem.h | UHC | 1,775 | 2.890625 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////
// Filename : ActionPcGetItem.h
// Written By : excel96
// Description :
// Creature PC . NPC ȭâ µȴ.
//////////////////////////////////////////////////////////////////////////////
#ifndef __ACTION_ORIGINAL_DELETE_GETITEM_H__
#define... | true |
9249d5de008513977254bd75f7324a1119ba797a | C++ | Sometrik/sqldb | /include/MySQL.h | UTF-8 | 779 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef _SQLDB_MYSQL_H_
#define _SQLDB_MYSQL_H_
#include "Connection.h"
#include <mysql.h>
namespace sqldb {
class MySQL : public Connection {
public:
MySQL() { }
~MySQL();
void connect(std::string host_name, int port, std::string user_name, std::string password, std::string db_name);
void c... | true |
a23fedda0d3e068776e618a4d632b8c6403eb5d0 | C++ | kazuuuuuuuuui/RaceGame | /第4ターム作品審査会/Vec3.cpp | SHIFT_JIS | 3,891 | 3.28125 | 3 | [] | no_license | #include"Vec3.h"
#include<math.h>
#include<assert.h>
namespace oka {
//-------------------------------------
//ftHgRXgN^
Vec3::Vec3():
m_x(0), m_y(0), m_z(0)
{}
//-------------------------------------
//tRXgN^
//ƂĎlŃo
Vec3::Vec3(const float _x, const float _y, const float _z):
m_x(_x), m_y(_y), m_z(_... | true |
00954865409f4a05122caec8032acef104b29e45 | C++ | hhcoder/StudyTMP | /std_function.cpp | UTF-8 | 3,082 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <vector>
template <typename Container>
void PrintAllElements(Container& c)
{
std::cout << std::endl << "(";
for (auto i = c.begin(); i!=c.end(); i++)
std::cout << *i << ",";
std::cout << ")" << std::endl;
}
#include <chrono>
#include <utility>
nam... | true |
6c6e2a7b4bb7fc94cc474f8f865de76d214ebeed | C++ | Parveen-jangra/hacktoberfest-competitiveprogramming | /Binary Tree/Verify Preorder Serialization of a Binary Tree/main.cpp | UTF-8 | 734 | 3.015625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isValidSerialization(string preorder)
{
stringstream ss(preorder);
string curr;
int nodes = 1;
while (getline(ss, curr, ','))
{
nodes--;
if (nodes < 0)... | true |
7632cb1cfc6e335e9efba4e2e16289e2dbe91ba3 | C++ | hbruintjes/ceema | /src/protocol/data/Poll.h | UTF-8 | 4,326 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2017 Harold Bruintjes
*
* 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 agre... | true |
cf3e49aeb12ecc32b1e14971696479bfda6adf87 | C++ | rechhabra/Cattis | /enlarginghashtables.cpp | UTF-8 | 1,297 | 3.078125 | 3 | [] | no_license | #include <iostream>//std
#include <cstring>//strlen
#include <algorithm>//math stuff
#include <math.h>//pow,ceil,sin,cos,etc.
#include <vector>//vector
#include <string>//string opers
#include <stack> //stack list
#include <sstream> //split asst., string to int
#include <stdio.h>//extra
#include <iomanip>//round n digi... | true |
4e81b23df59741f1c41eca376cf99ca6c7f1e99a | C++ | weidi0629/general_coding | /lc/general.data.management.vector.etc/300 1187 longest increasing subsequence/solution.cpp | UTF-8 | 1,976 | 3.75 | 4 | [] | no_license | /*
首先先做300, lis。
方法1是building tail in the fly
(1) if x is larger than all tails, append it, increase the size by 1
(2) if tails[i-1] < x <= tails[i], update tails[i]
tail[i] 表示len = i 的数组,最小的tail
比如 [4,5]
[4,5,6]
现在来一个7, 他不会去更新len=2的数组,因为7比6还大,所以至少要更新len=3的数组
*/
public int lengthOfLIS(int[] nums) {
int[]... | true |