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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bc33cfe263c7bb51b7517a531fca436de23639f6 | C++ | Taohid0/Contest-programming-problems-and-graph | /codeforces 360-1/main.cpp | UTF-8 | 598 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int oppo,days;
int r = 0;
int temp;
cin>>oppo>>days;
getchar();
string s;temp = 0;
while(days--)
{ bool test = false;
cin>>s;
// int len = (int)s.length();
for(int i=0;i<oppo;i++)
{
if(s[i]=='0')
{
... | true |
db7a2fec00d946738c2cae76352067f0f9fdaa5d | C++ | laumaya/three.cpp | /threepp/objects/Node.h | UTF-8 | 524 | 2.75 | 3 | [
"MIT"
] | permissive | //
// Created by byter on 1/7/18.
//
#ifndef THREEPP_NODE_H
#define THREEPP_NODE_H
#include <threepp/core/Object3D.h>
namespace three {
/**
* a non-renderable scenegraph node
*/
class Node : public Object3D
{
protected:
Node(std::string name) : Object3D(object::ResolverT<Node>::make(*this)) {
_name = name;
... | true |
860fbe6c4db8434b211dc346bed772996fe8f640 | C++ | bossbobster/USACO-Training | /Censoring.cpp | UTF-8 | 452 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
string s, t;
int idx = 0;
cin >> s >> t;
while(idx < (s.length() - t.length()))
{
if(s.substr(idx, t.length()) == t)
{
s = s.substr(0, idx) + s.substr(idx + t.length(), s.length() - idx - t.length... | true |
19082cb8eedc95bca7db30df9ec3d76d1de898b5 | C++ | DaveMold/FYP | /Project Y4/Project Y4/DistructionObject.cpp | UTF-8 | 632 | 2.609375 | 3 | [] | no_license | #include "DistructionObject.h"
DistructionObject::DistructionObject(float size, float sides, sf::Vector2f pos, Menu::ColorPresets preSet)
:GameEntity(size, sides , sf::Vector2f(pos.x - size/2.f,pos.y), preSet) {
//Color Preset
switch (preSet)
{
case Menu::ColorPresets::PRESETONE:
shape.setOutlineColor(sf::Color... | true |
bc7df3d33909da225fe2294c9a92dc3955144cb7 | C++ | MidnightDrifter/CS541Project1-2016 | /CS541-framework/texture.cpp | UTF-8 | 1,732 | 2.765625 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////
// A slight encapsulation of an OpenGL texture. This contains a method
// to read an image file into a texture, and methods to bind a texture
// to a shader for use, and unbind when done.
////////////////////////////////////////////////////////////... | true |
d7f75a99c8d4f128938142182c88b159b2d05582 | C++ | Claypuppet/OSM-factorysim | /src/libs/patterns/statemachine/State.h | UTF-8 | 890 | 2.734375 | 3 | [] | no_license | /*
* State.h
*
* Created on: 5 mrt. 2018
* Author: henri
*/
#ifndef STATE_H_
#define STATE_H_
#include "Event.h"
namespace patterns {
namespace statemachine {
class Context;
class State;
typedef std::shared_ptr<State> StatePtr;
class State {
public:
/**
* Function that handle... | true |
1013d395b321ed3a95586534ea475ac973401a84 | C++ | bw2850273/WilliamsBrandon_CIS17A_49285 | /Homework/Review Homework 1/Chapter 7 Exercise 6/main.cpp | UTF-8 | 5,748 | 4.0625 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Brandon Williams
* Edition: 8th edition
* Chapter: 7
* Problem: 6
* Created on September 1, 2020, 12:04 PM
* Purpose: Read data from a textfile to indicate how many days are rainy,
* cloudy, and sunny
*/
#include <iostream>
#include <fstream>
using namespac... | true |
a8dfb3acfee2c017a7ae56feaefd8ff232d876dd | C++ | TheSmallPixel/IOL-IF | /F.I. Fondamenti Informatica/Esercizi sessione live 3 CV2/esercizio+prima+lezione+2017.cpp | UTF-8 | 1,079 | 3.109375 | 3 | [] | no_license | //
#include <iostream>
namespace pini {
int cout = 12;
char lettera = 'x';
}
using namespace pini;
//using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
char lettera = 'z';
std::cout << "Hello, World! " << cout <<"\n";
pini::lettera = lettera;
st... | true |
91ee26c74313a02961fe2a85dcc9e606f48028de | C++ | PabloMorenoUm/Projekt | /pages/MainMenu.hpp | UTF-8 | 914 | 2.640625 | 3 | [
"MIT"
] | permissive | //
// Created by Pablo Moreno Um on 24.07.21.
//
#ifndef PROJEKT_MAINMENU_HPP
#define PROJEKT_MAINMENU_HPP
#include "BasicPage.hpp"
class MainMenu: public BasicPage {
unsigned titleSize = 150;
unsigned itemSize = 80;
Words title{"Super Duper Game", titleSize, m_WindowSize.getX() / 2, m_WindowSize.getY() ... | true |
72946b6e78c9ac90dbd4d57672fd0b27fe66ff36 | C++ | omnigoat/TwitchApplication | /include/sooty/frontend/syntactic_analysis/algorithm/detail/algorithms.hpp | UTF-8 | 6,692 | 2.671875 | 3 | [] | no_license | //=====================================================================
//
//
//=====================================================================
#ifndef SOOTY_ALGORITHM_ALGORITHMS_HPP
#define SOOTY_ALGORITHM_ALGORITHMS_HPP
//=====================================================================
#include <soo... | true |
42bebbd35e7c17f39fb5649e236fdec9ed2839f9 | C++ | josecarreno/Solitariopp | /solitario_0_3/Pila.cpp | UTF-8 | 1,733 | 3.0625 | 3 | [] | no_license | #include "StdAfx.h"
#include "Pila.h"
CPila::CPila(Image ^imgBaraja, int pX, int pY)
{
ancho = imgBaraja->Width / 13;
alto = imgBaraja->Height / 5;
x = pX;
y = pY;
seleccionado = false;
next = 0;
}
CPila::CPila(void)
{
}
CPila::~CPila(void)
{
while (!pila.empty())
pila.pop();
}
int CPila::getX()
{
return x;... | true |
fabd234c534f5e2591b616f3af2994f13e0fd735 | C++ | thegamer1907/Code_Analysis | /Codes/AC/1817.cpp | UTF-8 | 589 | 2.734375 | 3 | [] | no_license | #include <iostream>
using namespace std;
long long int n,m,k;
long long int nb_elements_in_table_strictly_less_than_mid(long long int mid){
long long int result = 0;
for(long long int i=1;i<=min(mid-1,n);i++)
result+=min((mid-1)/i,m);
return result;
}
int main() {
cin>>n>>m>>... | true |
12c912a53657c1dbc687102f76c7aa7dc31f4fa2 | C++ | imadeit/TopAI | /application/model_check/ctl_calculator/source/kripke.h | UTF-8 | 3,499 | 2.796875 | 3 | [] | no_license | #pragma once
#include <stdext.h>
#include <map>
#include <vector>
typedef size_t STATUS_TYPE;
typedef size_t PROP;
class CKripke;
///////////////////////////////////////////////////////////////////////////////
// -- CPropLabel
class CPropLabel : public IJCInterface
{
public:
CPropLabel(void);
~... | true |
1db423b2a57322f104f345f79980e3c3169f8765 | C++ | limlimg/WC2-ModLib | /app/src/main/cpp/code/Camera.cpp | UTF-8 | 5,899 | 2.890625 | 3 | [
"Unlicense"
] | permissive | //Zooming the camera without limit
#include <cmath>
#include "CScene.h"
#include "CGameSettings.h"
static const float pi = 3.141592653589793238462643383279502884197939937;
//Infinite zoom
void CCamera::SetPosAndScale(float x, float y, float scale) {
float fWidth = (this->ScreenHalfSize[0] + this->ScreenHalfSize[... | true |
2061a01f5eecebca550e6de2bb2b50b56512656a | C++ | belse-de/LiquidSim | /src/cfluid.cpp | UTF-8 | 27,969 | 2.609375 | 3 | [] | no_license | #include "cfluid.h"
#include "cmatrix.h"
#include <cmath>
#include <cstdio>
#include <iostream>
CFluid::CFluid(int m, int n):
_pressure_old(m,n), _pressure_new(m,n),
_ink_old(m,n), _ink_new(m,n),
_heat_old(m,n), _heat_new(m,n),
_velocity_x_0(m,n), _velocity_y_0(m,n),
_velocity_x_1(m,n), _velocity_y... | true |
a2413b83958bb7c0730000e3594d872a4bff4bb3 | C++ | FungluiKoo/CodeForceSolutions | /122A.cpp | UTF-8 | 832 | 3.328125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <bitset>
#include <cmath>
#define N 1001
using namespace std;
bool isLucky(unsigned int n){
while(n){
if(n%10==4 || n%10==7){
n/=10;
}else{
return false;
}
}
return true;
}
// bool isAlmostLucky(unsigned int n){
// for(unsig... | true |
802d587b6fecabdbde58087e907bf2d4c6433ff5 | C++ | AndyJZhao24/AVL-Tree | /app/MyAVLTree.hpp | UTF-8 | 12,470 | 3.859375 | 4 | [] | no_license | #ifndef __MY_AVL_TREE_HPP
#define __MY_AVL_TREE_HPP
#include "runtimeexcept.hpp"
#include <string>
#include <vector>
class ElementNotFoundException : public RuntimeException
{
public:
ElementNotFoundException(const std::string & err) : RuntimeException(err) {}
};
template<typename Key, typename Value>
struct Node... | true |
ceb45d1def60f6346fc01079b99ff218822fca28 | C++ | lawy623/Algorithm_Interview_Prep | /Algo/CC150/081_MaxSumSubMatrix.cpp | UTF-8 | 882 | 3.484375 | 3 | [] | no_license | // Add each subsection of rows and find max_sub_array
class SubMatrix {
public:
int sumOfSubArray(vector<int> arr, int n) {
int max_sum = arr[0];
int res = max_sum;
for(int i=1; i<n; i++) {
if (max_sum<=0)
max_sum = arr[i];
else
max_sum... | true |
49bb89775f98fef869fa57096642faefc73ffca4 | C++ | Ucchwas/Data-Structure | /HW6-MergeSort/1505109.cpp | UTF-8 | 1,011 | 2.984375 | 3 | [] | no_license | #include<stdio.h>
#define INFINITY 99999;
int merge(int A[ ],int p,int q,int r)
{
int count=0;
int n1=q-p+1;
int n2=r-q;
int L[n1+1],R[n2+1],i,j;
for(i=1; i<=n1; i++)
L[i]=A[p+i-1];
for(j=1; j<=n2; j++)
R[j]=A[q+j];
L[n1+1]=INFINITY;
R[n2+1]=INFINITY;
i=1;
j=1;
... | true |
bb2023ccc0f0d4349188d0128042e1e3fd3b7e60 | C++ | tinchop/tp-taller-1-2018 | /src/shared/model/match.cpp | UTF-8 | 12,769 | 3 | 3 | [] | no_license | #include "match.h"
#include "../logger.h"
Match::Match(Pitch* pitch, Team* team_a, Team* team_b, Ball* ball) {
this->team_a = team_a;
this->team_b = team_b;
this->team_a->SetMatch(this);
if (team_b != NULL) {
this->team_b->SetMatch(this);
}
this->pitch = pitch;
this->ball = ball;
... | true |
b7786b887ac0ba13d282bbf69af573ce67d406c5 | C++ | kryzthov/gooz | /store/small_integer.inl.h | UTF-8 | 642 | 2.8125 | 3 | [] | no_license | #ifndef STORE_SMALL_INTEGER_INL_H_
#define STORE_SMALL_INTEGER_INL_H_
#include <boost/format.hpp>
using boost::format;
namespace store {
inline
void SmallInteger::ToASCII(string* repr) const {
if (value_ < 0)
repr->append((format("~%i") % -value_).str());
else
repr->append((format("%i") % value_).str());... | true |
e269a7a8e0037da8eee1b05512ffd1ce04e40953 | C++ | cerww/cw | /slider.cpp | UTF-8 | 1,538 | 2.71875 | 3 | [] | no_license | #include "slider.h"
#include "things.h"
#include <algorithm>
//pics that all sliders use!
bool slider::Loaded = 0;
texture slider::bar;// = imgLoader::loadPNG("sliderBar.png");
texture slider::barSlider;// = imgLoader::loadPNG("sliderThing.png");
slider::slider(glm::vec4 dims, int min, int max, int start) :
m_dims(di... | true |
188dc420c3eb71f9d84a28e04c4947c4a9412d51 | C++ | mchobbylong/COMP1013 | /Assignment3/Power2.cpp | UTF-8 | 242 | 2.921875 | 3 | [] | no_license | /*
Author: Michael
Date: 2018-05-06
Function: Calculate the sum of 2^n1, 2^n2 and 2^n3 using header file and Power2() function
*/
#include<stdio.h>
int Power2(int n){
return (1 << n); //Equals to 2^n
}
//Last modified time: 2018-05-06 16:34 | true |
f58615265788d9357794986e6a7068a4955df046 | C++ | farhadreza/LeetCode_Solutions | /Remove Duplicates from Sorted List/Remove_Duplicates_from_Sorted_LinkedList.cpp | UTF-8 | 746 | 3.484375 | 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* deleteDuplicates(ListNode* head) {
if(head==NULL) return NULL;
if(head->next==NULL) return h... | true |
2e3781930caa635af70522b843de37a8f0b4bf5a | C++ | gx-njx/study | /drawMFC/drawMFC/main_clip_polygon.cpp | GB18030 | 8,070 | 2.734375 | 3 | [] | no_license | #include "pch.h"
#include "mainclass.h"
struct clipPoint
{
CPoint point;
clipPoint *drop;//˫ָ
clipPoint *next;//һ
bool follow;//Ƿ
bool cross;//ǷΪ
};
void mainclass::ClipPolygon(GPolygon & pgin, GPolygon &pgc)
{
CList<clipPoint, clipPoint>polyin;
CList<clipPoint, clipPoint>polyclip;
//εѭ
if... | true |
237fd89b599f334a67417520dbf1d69ed179d386 | C++ | RoutingKit/RoutingKit | /src/generate_constant_vector.cpp | UTF-8 | 712 | 2.78125 | 3 | [
"BSD-2-Clause"
] | permissive | #include <routingkit/vector_io.h>
#include <iostream>
#include <stdexcept>
#include <vector>
#include <random>
using namespace RoutingKit;
using namespace std;
int main(int argc, char*argv[]){
try{
unsigned value;
unsigned size;
string file;
if(argc != 4){
cerr << argv[0] << " size value file" << en... | true |
f986b179501838661fbd32358bab387952f90c65 | C++ | ptersilie/tree-sitter | /spec/integration/compile_grammar_spec.cc | UTF-8 | 5,984 | 2.953125 | 3 | [] | no_license | #include "spec_helper.h"
#include "runtime/alloc.h"
#include "helpers/load_language.h"
START_TEST
describe("compile_grammar", []() {
TSDocument *document;
before_each([&]() {
document = ts_document_make();
});
after_each([&]() {
ts_document_free(document);
});
auto assert_root_node = [&](const ... | true |
7705dd7625c071a971a2e7158792c3513a3b110b | C++ | stdstring/leetcode | /Algorithms/Tasks.0501.1000/0745.PrefixAndSuffixSearch/solution.cpp | UTF-8 | 3,005 | 3.296875 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <iterator>
#include <string>
#include <unordered_map>
#include <vector>
#include "gtest/gtest.h"
namespace
{
class WordFilter
{
public:
WordFilter(std::vector<std::string> const &words)
{
std::string bufferKey;
bufferKey.reserve(MaxPrefixSize + MaxSuffixSize + 1)... | true |
d2e9cdb0b7e05ead902f51ff21fece2ed80febb9 | C++ | antaramishra/guvi_antara | /beginner/set1/guvi_beg_s1_4.cpp | UTF-8 | 230 | 3.109375 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int x,y,z;
printf("enter the numbers\n");
scanf("%d%d%d",&x,&y,&z);
if(x>y && x>z)
{
printf("%d",x);
}
else if(y>z && y>x)
{
printf("%d",y);
}
else
{
printf("%d",z);
}
return 0;
}
| true |
984a0b9c94833b7addaeaaee3e879820288f9d0c | C++ | VictorTOON/Vinganca-das-Arvores-Part2-EA872 | /client/include/sdl_keyboard_handler.hpp | UTF-8 | 1,021 | 3.0625 | 3 | [] | no_license | #pragma once
#define KEYBOARD_FORCE 10
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <iostream>
typedef enum {
KEYBOARD_UP=1,
KEYBOARD_DOWN,
KEYBOARD_LEFT,
KEYBOARD_RIGHT,
KEYBOARD_SPACE,
KEYBOARD_ZERO,
KEYBOARD_P,
KEYBOARD_O
} KeyBoardReturns;
/*! \brief Classe para lidar com as entradas do te... | true |
3f2ecd7e7edc3c2628f67d5293aa0a14cd707742 | C++ | yuyuyu00/Tesi | /RHeroes/slam/geometry/point.h | UTF-8 | 4,619 | 2.96875 | 3 | [] | no_license | /*
* point.h
*
* Created on: 05/mar/2012
* Author: Mladen Mazuran
*/
#ifndef POINT_H_
#define POINT_H_
#include "data/serializable.h"
#include "shared/logger.h"
#include <cmath>
#include <QPointF>
namespace SLAM {
namespace Geometry {
class Point : public Data::Serializable
{
public:
... | true |
d2f4a7945c4367bcdcd02605b196562037236818 | C++ | pbysu/BOJ | /~2017/2096.cpp | UTF-8 | 868 | 2.53125 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define INF 1987654321
#define MAX 100010
#define MOD 1000000007
int main() {
int n;
cin >> n;
int dp[2][3] = { 0, };
int ret[2][3] = { 0, };
for (int i = 0; i < n; i++) {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
ret[0][0] = m... | true |
94d7480ba61ee1479e3716f7cceaa2bc83c24555 | C++ | hackerlank/YAPOG | /YAPOG/include/YAPOG/Collection/Set.hxx | UTF-8 | 2,916 | 3.171875 | 3 | [] | no_license | #ifndef YAPOG_SET_HXX
# define YAPOG_SET_HXX
# include "YAPOG/Macros.hpp"
namespace yap
{
namespace collection
{
template <typename T, typename C>
inline Set<T, C>::Set ()
: data_ ()
{
}
template <typename T, typename C>
inline Set<T, C>::Set (const Set<T, C>& copy)
: data_ (c... | true |
84cab11f87dced64e494671a70b386e4e04e40a0 | C++ | deanlee-practice/toheaven-2 | /교육/C++ Basic/Day_07/example.cpp | UHC | 235 | 3.34375 | 3 | [] | no_license | /*
for
for(:պ)
*/
#include<iostream>
using namespace std;
int main() {
int arr[] = { 1, 2, 3, 4, 5 };
for (int i : arr)
cout << i << " ";
cout << endl;
return 0;
} | true |
c677244b6c684d6c128fdb1009a99d065bc145c3 | C++ | lubkoll/friendly-type-erasure | /tests/pimpl_tests/plain_interface.hh | UTF-8 | 617 | 3.171875 | 3 | [
"MIT"
] | permissive | // %<int.hh>%
struct Int;
/**
* @brief class Fooable
*/
class Fooable
{
public:
/// void type
typedef void void_type;
using type = int;
static const int static_value = 1;
enum class Enum { BLUB };
explicit Fooable( int value ) : value_... | true |
9bb9356e2d45dd4a9a499e015229fadab77fb604 | C++ | sunyd0112/Coursera-PKU | /Course6 高级数据结构与算法/wk8 双队列.cpp | UTF-8 | 649 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <map>
using namespace std;
map<long long, long long> m; map<long long, long long>::iterator mi;
int n;
int main() {
while (cin >> n) {
if (n == 0) { return 0; }
if (n == 1) {
long long p, id; cin >> id >> p;
m.insert(map<long long, long long>::value_type(p, id))... | true |
df27011d5383672f1858b3a309d75513b0643439 | C++ | robert-adrian99/DynaBlaster-Bomberman | /DynaBlasterTests/EnemyTest.cpp | UTF-8 | 1,318 | 2.828125 | 3 | [] | no_license | #include "pch.h"
#include "CppUnitTest.h"
#include "../DynaBlaster/Enemy.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace DynaBlasterTests
{
TEST_CLASS(EnemyTest)
{
public:
TEST_METHOD(Constructor)
{
Map map;
Enemy enemy(EnemyType::Barom,map);
Assert::IsTrue(enemy.AllowTo... | true |
e65d415364963a8cb0bda32f4a819cfa047f145c | C++ | ZhenghengLi/G4_SIM_Template | /DIGI/sim_digitalize/src/OptionsManager.cc | UTF-8 | 3,997 | 2.828125 | 3 | [] | no_license | #include "OptionsManager.hh"
using namespace std;
OptionsManager::OptionsManager() {
init();
}
OptionsManager::~OptionsManager() {
}
bool OptionsManager::parse(int argc_par, char** argv_par) {
if (argc_par < 2)
return false;
TString cur_par_str;
int idx = 0;
while (idx < argc_par - 1) {... | true |
6fe20847c1d0905626fbddcb9c1fe49215479fea | C++ | MiroK/dolfin-dg-poisson | /cpp/main.cpp | UTF-8 | 3,425 | 2.734375 | 3 | [] | no_license | // Copyright (C) 2006-2011 Anders Logg and Kristian B. Oelgaard
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (... | true |
d0802b3dae025b83534088251f9d5d5d01b7ccb2 | C++ | githubxj/utn | /software/Web/cgi/CTopoView.h | UTF-8 | 1,842 | 2.609375 | 3 | [] | no_license |
using namespace std;
class CTopoView : public CgiRequest
{
public:
/*!
* \brief constructor.
*
*/
CTopoView():CgiRequest()
{
m_onu_number = 0;
link_end1 = -1;
link_end2 = -1;
ring_error1 = -1;
ring_error2 = -1;
}
/*!
* \brief Destructor
*
* Del... | true |
ad9a206f32776ddcd6b48faca9c21820321d34d5 | C++ | D6C92FE5/oucLibrary | /Library_Management_System/main.cpp | GB18030 | 18,018 | 3.046875 | 3 | [] | no_license | #include "UserManager.h"
#include "booker.h"
#include <stdlib.h>
#include <fstream>
#include<iostream>
#include <conio.h>
#include <iomanip>
using namespace UserManager;
using namespace Booker;
using namespace std;
/*
*¼һҪIJ˵־λ
* ˵ͳһmain()
* ڷֹ˵ջ
*/
int menuTag = 1;
/*
* 1 οͲ˵
* 2 ͨû˵
* 3 Ա˵
* 22 ûϢ˵
* 33 ĿϢ˵
*
... | true |
840248a7b9b3aef9d6898365b47cc21549cf8c33 | C++ | KrzysztofKowaczek/Student-times | /inc/Complex.hh | UTF-8 | 783 | 3.03125 | 3 | [] | no_license | #pragma once
/*!
* Plik zawiera definicje struktury Complex oraz zapowiedzi
* przeciazen operatorow arytmetycznych dzialajacych na tej
* strukturze.
*/
/*!
* Modeluje pojecie liczby zespolonej
*/
struct Complex
{
double re; /*! Pole repezentuje czesc rzeczywista. */
double im; /*! Pole repezentuje c... | true |
90904862d7a53e9968b1953bcf3ca941562d98e6 | C++ | robotx211/DemoEngine | /src/myengine/RenderTexture.cpp | UTF-8 | 2,572 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include "RenderTexture.h"
namespace myEngine
{
RenderTexture::RenderTexture()
{
}
RenderTexture::RenderTexture(int _width, int _height)
{
setSize(_width, _height);
}
RenderTexture::RenderTexture(glm::ivec2 _size)
{
setSize(_size);
}
RenderTexture::~RenderTextu... | true |
a308a3ef545dfb751b17887f12d52325de424d8e | C++ | ucas-joy/my_leetcode | /77Combinations.cpp | UTF-8 | 2,104 | 3.609375 | 4 | [] | no_license | /*Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is :
[
[2, 4],
[3, 4],
[2, 3],
[1, 2],
[1, 3],
[1, 4],
]
Subscribe to see which companies asked this question
*/
#include<iostream>
#include<vector>
#include<set>
using namespa... | true |
90cf8121e89a6a1d4f08aca2f879e2f935e4398d | C++ | jossefloress/COSC-2336--Progamming-Fundamentals-3 | /Lab 3_RandomAccessFile/Main.cpp | UTF-8 | 2,137 | 3.28125 | 3 | [] | no_license | /******************
RAFile
*******************/
#pragma warning (disable:4996)
#include <iostream>
using namespace std;
#include <stdlib.h>
#include "RAFile.h"
int main ()
{
RAFile DB1;
WCS_String inputCommand, inputStr, gotRqstedStr;
size_t inputIndex;
bool done = false;
char command... | true |
4900fc264663190f390681e913432ce5dfe7dada | C++ | Irfanbsse2060/arduino | /sketch_mqtt/sketch_mqtt.ino | UTF-8 | 5,182 | 2.609375 | 3 | [] | no_license | //ItKindaWorks - Creative Commons 2016
//github.com/ItKindaWorks
//
//Requires PubSubClient found here: https://github.com/knolleary/pubsubclient
//
//ESP8266 Simple MQTT light controller
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged... | true |
4561c0b96e38331b7b68bb36e2ab6aced9a386fd | C++ | mseefelder/miniDB | /src/src/DataBase.cpp | UTF-8 | 4,339 | 3.046875 | 3 | [] | no_license | #include "DataBase.h"
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include "HashIndex.h"
#include "Relation.h"
using namespace std;
//Creates a table in the database and stores it in the "tables" map
//Table creation through "csvFile" (relative path to csv file)
bool DataBase::createTable(... | true |
a5b26424fe1119d6ccc334b06cc429ae177157d2 | C++ | dkaulukukui/Magma_Mini_Bot | /MiniBot.cpp | UTF-8 | 3,200 | 2.96875 | 3 | [] | no_license | #include <string.h>
#include <Arduino.h>
#include "MiniBot.h"
//////////////////////////////////////////////////////////////////////
/* This Function is where you assign an action to each button press*/
void buttoncommands(int buttnum,boolean pressed){
//switch statement to assign actions to different buttons
... | true |
e30c70a4d349108cf96ba29e06dfd0f183ef28b8 | C++ | Kikoman90/piscine_cpp | /D01/ex09/Logger.cpp | UTF-8 | 2,279 | 2.8125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Logger.cpp :+: :+: :+: ... | true |
57193fe8ab4d43c65c400c764b0c422c717621c4 | C++ | MingzhenY/code-warehouse | /CodingWebsites/LeetCode/CPP/Volume1/99.cpp | UTF-8 | 3,021 | 3.484375 | 3 | [] | no_license | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution ... | true |
6dacf424736dafe1ab2451ab86b7b4e615c3fd98 | C++ | ThakeeNathees/PixelEngine | /Pixel-Engine/src/api/entities/Background.cpp | UTF-8 | 1,356 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | #include "pch.h"
#include "Background.h"
namespace pe
{
int Background::s_bg_count = 0;
int Background::s_next_id = static_cast<int>(Asset::Type::Background);
void Background::setTexture( Texture& texture) {
m_texture = &texture;
sf::Sprite::setTexture(*m_texture,true);
}
void Background::setRepeated(bool ... | true |
17903474154f2d1d826ac0ce9565a193d82f3815 | C++ | VipulMalhotra/Wedding_Planner_Application | /IP_PROJECT_HAMILTONIAN_CYCLES/Hamilton_Cycle.cpp | UTF-8 | 5,354 | 3.21875 | 3 | [] | no_license | #include<stdio.h>
#include<cstdlib>
#include<time.h>
#include<cstring>
#include<string>
clock_t begin, end;
int job_done=0;
void swap(int graph[V][V],int index){
int temp[V];
int i,j;
//copy graph[0][] inside temp[] and then move temp[] to graph[index][]
for(i=0;i<V;i++){
temp[i]=graph[0][i];
}
for(i=... | true |
38dd846592bfeba1fc9a86ff52a1bb85cb5eb061 | C++ | kyeokabe/crackingCodingInterview | /code/LeetCode/746_MinCostClimbingStairs.cpp | UTF-8 | 446 | 2.96875 | 3 | [] | no_license | class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
vector<int> v(cost.size(),0);
//v[i] ... cost to arrive at i
for(int i=2;i<v.size();i++)
v[i]=min(v[i-2]+cost[i-2],v[i-1]+cost[i-1]);
//the last two elements of v + cost to ... | true |
ae35b663ef4b158e39c12e6b33227d5564084014 | C++ | IvanLavuna/NumericalMethods | /include/Matrix.h | UTF-8 | 1,378 | 3.203125 | 3 | [] | no_license | //
// Created by ivan on 18.10.20.
//
#ifndef NUMERICALMETHODSLABS_MATRIX_H
#define NUMERICALMETHODSLABS_MATRIX_H
// TODO: make this class be more like "matrix" - NOT like some piece of shit
// Also add RowMatrix and ColumnMatrix
/** Matrix class that uses int his basis vector of vectors
*
* **/
using std::vecto... | true |
be1df22bb730d9d4e53209a03fcfa671529e8534 | C++ | Pangeamt/nectm | /tools/mosesdecoder-master/mert/Timer.cpp | UTF-8 | 2,920 | 2.828125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LicenseRef-scancode-other-copyleft",
"GPL-2.0-only",
"Apache-2.0"
] | permissive | #include "Timer.h"
#include "Util.h"
#if !defined(_WIN32) && !defined(_WIN64)
#include <sys/resource.h>
#include <sys/time.h>
#endif
#if defined __MINGW32__
#include <sys/time.h>
#endif // defined
namespace
{
#if (!defined(_WIN32) && !defined(_WIN64)) || defined __MINGW32__
uint64_t GetMicroSeconds(const struct tim... | true |
0b442080a3e037109d0586964508efc3ad150af3 | C++ | thisisziihee/algorithm | /inflearn/22_온도의최댓값.cpp | UHC | 700 | 3.53125 | 4 | [] | no_license | /*
µ ־ , ĥ µ ū ϴ α ۼϽÿ.
*/
#include<stdio.h>
#include<vector>
int main() {
int n, k, i;
scanf("%d %d", &n, &k);
std::vector <int> a(n);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int max; int sum = 0;
for (i = 0; i < k; i++) { sum += a[i]; }
max = sum;
// [i-k] [i] ؼ k
... | true |
f1bb2f352566bb323a0676aa521f31eba6a1f0dd | C++ | seunghyukcho/algorithm-problems-solved | /baekjoon/15307.cpp | UTF-8 | 542 | 2.703125 | 3 | [] | no_license | #include <iostream>
using namespace std;
typedef long long ll;
ll P = 1000000007;
ll fac[200010];
void get_fac()
{
fac[0] = 1;
fac[1] = 1;
for(int i = 2; i < 200010; i++)
{
fac[i] = (fac[i - 1] * i) % P;
}
}
ll max(ll a, ll b)
{
return a > b ? a : b;
}
int main()
{
get_fac();... | true |
08852453bfcdacbcaf41811cc744ef1a8dee1ccf | C++ | magalieV/NanoTekSpice | /src/Component/True.cpp | UTF-8 | 728 | 2.71875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2020
** OOP - Matthias Schafter
** File description:
** Nanotekspice - IComponent
*/
#include "True.hpp"
True::True(std::string name)
{
_name = name;
_link._component = nullptr;
_link._pin = 0;
_value = nts::TRUE;
}
True::~True()
{
}
void True::setValue(nts::Tristate value)
{
... | true |
a6806bb096fa47d595a4d5a226333af712766c5e | C++ | wofka72/Yandex_algorithms | /semester2/homeworks/Домашка3/Algo_Home3-6_Tandem/main.cpp | UTF-8 | 10,305 | 3.34375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
using std::istream;
using std::ostream;
using std::vector;
template <typename size_type>
struct Interval {
size_type left;
size_type right;
Interval() : left(0), right(0)
{}
inline bool isElement() {
return (left == ... | true |
60a0993e7c047ebc4d026f90e1f1a1ab15e8abe1 | C++ | arangodb/arangodb | /3rdParty/boost/1.78.0/libs/geometry/doc/src/examples/io/read_wkt.cpp | UTF-8 | 1,159 | 2.609375 | 3 | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
// Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE... | true |
d60618fb1f878a3097128e8bd6d4d815f6fdeb73 | C++ | louise365/To-be-SDE | /leetcode_836/leetcode_836.cpp | UTF-8 | 1,393 | 2.859375 | 3 | [] | no_license | // leetcode_836.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2) {
if (rec1.empty() || rec2.empty())
return false;
if (rec1.siz... | true |
106c8dc3b0d24a45eeffe2c545122d302e2e715a | C++ | feiyu007/rala | /src/pile.cpp | UTF-8 | 20,597 | 2.84375 | 3 | [
"MIT"
] | permissive | /*!
* @file pile.cpp
*
* @brief Pile class source file
*/
#include <algorithm>
#include <sstream>
#include <deque>
#include "overlap.hpp"
#include "pile.hpp"
namespace rala {
using Subpile = std::deque<std::pair<int32_t, int32_t>>;
void subpileAdd(Subpile& src, int32_t value, int32_t position) {
while (!sr... | true |
8cf969c849cbf0b60417edc051e1ed89e5f6e369 | C++ | nguyentduc/Arduino | /Vumeter/Vumeter.ino | UTF-8 | 594 | 2.640625 | 3 | [] | no_license |
int music = A0;
int output,i;
int potval=A1;
int led[8] = { 2,3,4,5,8,9,10,11}; // Assign the pins for the leds
void setup()
{
for (i = 0; i < 8; i++)
pinMode(led[i], OUTPUT);
}
void loop()
{
potval=analogRead(A1);
output = analogRead(music);
potval=map (potval,0,1024,5,40);
output = output/potval;
if (out... | true |
6e360071a30df9dcbf23b7cd43ba0e2b9812f403 | C++ | sajalagrawal/BugFreeCodes | /GeeksforGeeks/Pythagorean Triplet.cpp | UTF-8 | 693 | 3.015625 | 3 | [] | no_license | //http://www.practice.geeksforgeeks.org/problem-page.php?pid=283
//Author- Sajal Agrawal
//Username:sajalagrawal
#include <iostream>
#include<algorithm>
using namespace std;
bool isTriplet(int a[],int n);
int main() {
int t,n,i,k;
cin>>t;
while(t--){
cin>>n;
int a[n];
for(i=0;i<n;i++){
cin>>... | true |
a3cd28dfbab68b29f71bb0e4448614684e8b8a54 | C++ | seal-git/atcoder | /2020-04-04-B/main.cpp | UTF-8 | 608 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
using namespace std;
int main(int argc, char* argv[])
{
int N, M;
int A[100];
scanf("%d %d", &N, &M);
for(int i=0; i<N; i++){
scanf("%d", &A[i]);
}
// printf("%d %d %d\n", N, M, A[N-1]);
int sum_A = 0;
for(int i=0; i<N; i++){
sum... | true |
6e9d170d6a63e8ba759e88e7e0cc6dda0e97defd | C++ | MursalMousumi/finalprojectinventory | /q2.cpp | UTF-8 | 3,923 | 3.921875 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Perishables {
private:
string name;
double price;
int quantity;
public:
void inventoryStock(){
Perishables items[100];
int numItems = 0;
float total = 0;
float StockWorth = 0;
cout << "How many items you want to ente... | true |
49e9b6604f5b1333adac040166f00e8fcea8bca2 | C++ | blanham/spoon | /system/source/libraries/spoon/base/ThreadLock.cpp | UTF-8 | 725 | 2.6875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <kernel.h>
#include <spoon/base/ThreadLock.h>
ThreadLock::ThreadLock()
{
m_atomic_lock = 0;
m_count = 0;
m_tid = 0;
}
ThreadLock::~ThreadLock()
{
}
int ThreadLock::lock()
{
bool gotit = false;
while ( gotit == false )
{
smk_acquire_spinlock( &m_atomic_lock );
if ( m_count == 0 )
{
m_cou... | true |
1742d89ff278b47dffc3785c0facbef742427a88 | C++ | kelele67/Unix-Network | /TTCP/Socket.h | UTF-8 | 1,093 | 3.09375 | 3 | [] | no_license | #ifndef SOCKET_H
#define SOCKET_H
#include "Common.h"
#include <utility> // swap
class InetAddress;
// RAII handle for socket fd
class Socket : noncopyable
{
public:
// explicit关键字(只对有一个参数的类构造函数有效)的作用就是防止类构造函数的隐式自动转换
explicit Socket(int sockfd);
~Socket(); // close sockfd_
// right hand side
Socket(Socket && ... | true |
f217b0c3f4c617d5a4466a33ea7def3033cdafb7 | C++ | dw5450/2DGP | /2D/2014180026 원동욱 프로그래밍 파일/WinAPI Project/Object.h | UHC | 1,363 | 2.65625 | 3 | [] | no_license | #pragma once
#include <Windows.h>
#include "Math.h"
//߰
#define MAXRESISTANCE (long)100.0 // ִ밪 //߰
// Ŭ(̽)
class Object{
public:
POINT cp;
SIZE ObjectSize;
RECT ObjectRect;
double resistanceXpos = MAXRESISTANCE; //װ
double resistanceYpos = MAXRESISTANCE; //װ
double SpeedXpos = 0; ... | true |
b87e3b3e7a382a1106e294ee5b9ef4fc81ac23dd | C++ | 1412904892/LeetCode | /Medium/odd-even-linked-list.cpp | UTF-8 | 664 | 3.34375 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* oddEvenList(ListNode* head) {
if (head==NULL || head->next==NULL) return head;
List... | true |
82e7b8d659dcb325451c0e9164dea4acf9ff4e71 | C++ | LexSheyn/TopDownRacing | /Game/src/GUI/DropDownList.cpp | UTF-8 | 3,114 | 2.953125 | 3 | [] | no_license | #include "../stdafx.h"
#include "DropDownList.h"
namespace gui
{
// Constructors and Destructor:
DropDownList::DropDownList
(
const float x, const float y, const float width, const float height,
sf::Clock& keyTimer, float& keyTimeMax,
std::string defaultString,
sf::Font& font, std::string list[],
uint32 n... | true |
e6ed9ceea038adaeeb2b83c55413cf6e8863fbf5 | C++ | fvivaudo/Piscine-CPP | /D07/ex00/whatever.cpp | UTF-8 | 2,004 | 2.9375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | true |
d592ec8c0ce843ccf07701403a475a65a0ee90c7 | C++ | wuyou33/Enabling-Robust-State-Estimation-through-Measurement-Error-Covariance-Adaptation | /3rdparty/GPSTk/core/lib/Utilities/ValidType.hpp | UTF-8 | 3,946 | 2.6875 | 3 | [
"GPL-3.0-only",
"LGPL-2.0-or-later",
"LGPL-3.0-only",
"LGPL-2.1-or-later",
"GPL-1.0-or-later",
"MIT"
] | permissive | //============================================================================
//
// This file is part of GPSTk, the GPS Toolkit.
//
// The GPSTk is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; ei... | true |
efd0f1330b0e56a2b63809ac761488f0435884e2 | C++ | joseCornejoLupa/AlgebraAbstracta | /cifradoCesar/cesar.cpp | UTF-8 | 490 | 3.046875 | 3 | [] | no_license | #include <string>
#include "cesar.h"
#include <iostream>
using namespace std;
Cesar::Cesar(int desplazamiento){
this -> desplazamiento = desplazamiento;
}
string Cesar::cifrar(string mensaje){
string cifrado;
for(int i = 0; i < mensaje.size(); i++){
cifrado[i] = mensaje[i] + desplazamiento;
cout << "original:... | true |
cf1f1c0d79c16776f1fd05b22b19eedfabaa47d6 | C++ | naren951/Practice-codes | /array/subArraySumOptimized.cpp | UTF-8 | 450 | 2.65625 | 3 | [] | no_license | #include<iostream>
#include<climits>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int b[n+1];
b[0]=0;
int sum;
for(int i=1;i<=n;i++){
b[i]=b[i-1]+a[i-1];
}
int maxsum=INT_MIN;
for(int i=1;i<n+1;i++)... | true |
808fd7788840c7df8c03a0e08031cc5bd746186b | C++ | renato-yuzup/axis-fem | /UnitTests/Axis.BLAS.TestProject/MatrixAlgebraTest.cpp | UTF-8 | 60,771 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "foundation/blas/blas.hpp"
#include "foundation/DimensionMismatchException.hpp"
#include "foundation/ArgumentException.hpp"
#include "foundation/blas/ColumnVector.hpp"
#include "foundation/blas/RowVector.hpp"
#include "foundation/blas/DenseMatrix.hpp"
#include "System.hpp"
namespace afb =... | true |
bf44df00c5f9a131b451f1561f2a5f6148261180 | C++ | nembiven/T1Paralela | /main.cpp | UTF-8 | 1,367 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include "Estudiantes.h"
#include "Funciones.h"
using namespace std;
int main(){
Estudiantes A[15000]; //Arreglo inicial de 15000 estudiantes
leeProcesa(A); //Asignamos los valores correspondientes a cada elemento de A
quicksort(A,0,14999); // ordenamiento de los 150000 estudi... | true |
5eb1b010e02a2191ef7f9da632e18bcd33e3b703 | C++ | Infra17/Coding-Fundamentals | /Bit by Bit/Brian and Kernighan Algorithm.cpp | UTF-8 | 967 | 3.453125 | 3 | [] | no_license | //Count set bits by Brian and Kerninghan Algorithm and others
//Author : Infra
#include <bits/stdc++.h>
using namespace std;
int Brutforce(int n) //o(logn) approach
{
int c=0;
while(n)
{
c+=n&1;
n>>=1;
}
return c;
}
int BrianKerninghan(int n) //using toggling effect if right most ... | true |
2cbc1304703fc2e5f74610230fa836f1565dafea | C++ | rohansuri17/SpaceDodge | /Board.cpp | UTF-8 | 3,138 | 2.6875 | 3 | [] | no_license | #include "Board.h"
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QtWidgets>
#include <QTimer>
//Overloaded Constructor that takes in Board x, y, width, and length value
Board::Board(int Board_x, int Board_y,int Board_width,int Board_length)
{
int random = qrand() % 100;... | true |
00240e673c2cb5b2a95719ce230881082221421d | C++ | youyouzh/DataStructure | /DataStructure/avl_tree.h | UTF-8 | 477 | 3.09375 | 3 | [] | no_license | #pragma once
#include "dictionary.h"
#include "avl_tree_node.h"
#include <utility>
template <class K, class V>
class AVLTree : public Dictionary<K, V>
{
public:
typedef std::pair<K, V> Pair;
bool empty() const override;
int size() const override;
void insert(const Pair& pair) override;
void erase(const K& key) ... | true |
b3ed9613254281a977152d9aea84ebc24fc50c90 | C++ | Mozarek/WDI | /cwiczenia 02/cw02zad19.cpp | UTF-8 | 298 | 2.96875 | 3 | [] | no_license | #include <iostream>
#define MAX 10
using namespace std;
int main()
{
for(int n = 1 ; n<MAX;n++)
{
for(int m = n+1;m<MAX;m++)
{
cout << m*m - n*n << " ";
cout << 2*m*n << " ";
cout << m*m + n*n << endl;
}
}
return 0;
}
| true |
a18a16d6f2dd57e786d95933976da346e1289240 | C++ | kaist-uvr-lab/GraphOptimizer | /src/Vertex.cpp | UTF-8 | 1,633 | 2.59375 | 3 | [] | no_license |
#include <Vertex.h>
GraphOptimizer::Vertex::Vertex():bFixed(false){}
GraphOptimizer::Vertex::Vertex(int idx, int _size, bool _b) :index(idx), bFixed(_b), dsize(_size) {
H = Eigen::MatrixXd(dsize, dsize);
b = Eigen::VectorXd(dsize);
ResetHessian();
}
GraphOptimizer::Vertex::~Vertex() {}
void GraphOptimizer::Vert... | true |
dd52b768536776a661c8643ae35d2a36680b73b6 | C++ | SwagSoftware/Kisak-Strike | /ivp/ivp_utility/ivu_float.hxx | UTF-8 | 3,338 | 2.515625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifdef WIN32
#include <float.h>
#endif
#if defined(IVP_NO_DOUBLE) && !defined(SUN)
# include <math.h>
# if defined(WIN32) || defined(PSXII) || defined(LINUX)
union p_float_ieee { IVP_FLOAT val;
struct {
unsigned int valh:23; unsigned int exp:8; unsigned int signum:1;
} ln; ... | true |
822a908b39376e2c310ba28765ee35bd5a9498b5 | C++ | HorstBaerbel/NerDisco | /src/GLSLCompileThread.h | UTF-8 | 1,850 | 2.703125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | #pragma once
#include <QOpenGLContext>
#include <QOpenGLShader>
#include <QOffscreenSurface>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
class GLSLCompileThread : public QThread
{
Q_OBJECT
public:
/// @brief Constructor.
/// @param shareContext Non-NULL context to share.
/// @param parent Par... | true |
a850b462955a141640262bd7add90b13aa9ea144 | C++ | mattiasflodin/starfraaas | /matrix.cpp | UTF-8 | 636 | 3.21875 | 3 | [] | no_license | #include "matrix.hpp"
matrix4f matrix4f::operator*(matrix4f const& rhs) const
{
matrix4f r;
matrix4f const& lhs = *this;
for(std::size_t row=0; row!=4; ++row)
{
for(std::size_t col=0; col!=4; ++col)
{
r[row][col] =
lhs[row][0] * rhs[0][col]
+ lhs[row][1] * rhs[1][col]
+ lhs[row][2] * rhs[2... | true |
35a417085dfd5938b54ee743f73a3ad06e3c3d1a | C++ | Jackfrost2639/ex | /377a.cpp | UTF-8 | 720 | 2.78125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pa;
int n, m, k;
char maze[500][501];
bool visited[500][500];
void dfs(int x, int y)
{
if(x < 0 || y < 0 || x >= n || y >= m) return;
if(maze[x][y] == '#') return;
if(visited[x][y]) return;
visited[x][y] = true;
dfs(x+1, y);
... | true |
145fe9fb34f9cf8ab4bc44aa196cc1bac02a00c1 | C++ | kux/sam-archiver | /SamArchiveManager/Parser.h | UTF-8 | 1,047 | 2.890625 | 3 | [] | no_license | #ifndef Parser_H_
#define Parser_H_
#include "StandardHeaders.h"
#include "ImageBuilder.h"
//enum of structures that can be parsed
enum FileType { directory, archive };
//class responsible for parsing a filesystem or archive
//this is the builder's director
class Parser
{
public:
//the class's only ... | true |
e291d1bc44e90a926b9ae9c2c277f487165a6c5c | C++ | Creeper20428/Data | /VMachine/VMachine/Pic/Pic.h | UTF-8 | 1,639 | 2.71875 | 3 | [] | no_license | // VMachine
// Programmable interrupt controller class
//
// Copyright (c) 2006, Paul Baker
// Distributed under the New BSD Licence. (See accompanying file License.txt or copy at
// http://www.paulsprojects.net/NewBSDLicense.txt)
#pragma once
class VMachine;
class Pic : private boost::noncopyable
{
public:
//Cons... | true |
76f3d7f20e6e2e5bf2984de0006fe142f930bf47 | C++ | grahfoster/PPPUCPP | /Drills/Ch_19/Drill/Drill/Drill.cpp | UTF-8 | 1,771 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
template<class T>
struct S {
S(const T& v = T{}) : val{ v } {};
const T& get() const;
T& get();
T& operator=(const T&);
private:
T val;
};
template <class T>
const T& S<T>::get() const { return val; }
template <class T>
T& S<T>::get() { return val; }
template <class T>
T... | true |
93ff0a5f0ee250c71860e5c9e4d11eaa72a48134 | C++ | yeahhhhhhhh/BPlusTree | /myCode/BPlusTree.cc | UTF-8 | 4,680 | 3.15625 | 3 | [] | no_license | #include "BPlusTree.h"
#include "InternalNode.h"
Node* BPlusTree::root = NULL;
BPlusTree::BPlusTree(){}
BPlusTree::~BPlusTree(){}
bool BPlusTree::insert(KeyType key, const DataType& data){
// 判断是否重复
if(search(key)){
return false; // 暂定不允许有重复
}
// 判断是否有根节点
if(root == NULL){
root = ... | true |
69bc21a18522bea2bdc73414fdb6ab922b264762 | C++ | bchampp/Q20 | /CAN/testbench/testbench.ino | UTF-8 | 2,074 | 2.796875 | 3 | [
"MIT"
] | permissive | // CAN Testbench
// runs between two CAN shields and adjusts the brightness of an LED
// connected to the receiver based off potentiometer readings from the sender
#include "mcp_can.h"
#include <SPI.h>
#define SPI_CS_PIN 9
// Set to 0 to run receiver code
#define SENDING 0
// LED and Potentiometer Defin... | true |
c016c1dcae51334ed24ace5fef498f217c732922 | C++ | Shubhamag12/Data-Structures-and-Algorithms | /Leetcode/RangeSumQuery2D.cpp | UTF-8 | 1,012 | 3.078125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
//TLE solution
class NumMatrix {
public:
vector<vector<int>>arr;
NumMatrix(vector<vector<int>>& matrix) {
arr=matrix;
}
int sumRegion(int row1, int col1, int row2, int col2) {
int sum=0;
for(int i=row1;i<=row2;i++){
f... | true |
d558708593f6134a0ddb81c5ddd00d3b1a8ecb99 | C++ | TereSolano15/partial-test-2---question-2-TereSolano15 | /src/Phone.h | UTF-8 | 533 | 2.546875 | 3 | [] | no_license | //
// Created by Tere Solano on 14/11/2020.
//
#ifndef MY_PROJECT_NAME_PHONE_H
#define MY_PROJECT_NAME_PHONE_H
#include <iostream>
using namespace std;
class Phone {
private:
string home;
string mobile;
public:
Phone(const string &home, const string &mobile);
Phone();
virtual ~Phone();
cons... | true |
3c242e68606f69c325441efbe917e55c8144df89 | C++ | MichaelJTroughton/Planet-Rocklobster | /prototypes/src/Parts/Empty.cpp | UTF-8 | 578 | 2.546875 | 3 | [
"Unlicense"
] | permissive | #include "include.h"
// define the class, so it can be constructed from the startup.ini
DEFINE_CLASS(Empty, Effect);
Empty::Empty()
{
// initialize your class here
}
Empty::~Empty()
{
// free up your class here
}
void Empty::Init( Gfx *_gfx, Input *_input )
{
Effect::Init(_gfx,_input);
// put your ef... | true |
88b74de0ecc731bc069add6c9bc9ec43eda2b6a2 | C++ | james-sungjae-lee/2018_CPP | /STUDY/MidTerm/06/포인터증감연산.cpp | UTF-8 | 350 | 2.765625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
char *pc;
int *pi;
double *pd;
pc = (char *)10000;
pi = (int *)10000;
pd = (double *)10000;
std::cout << (void *)pc << " " << pi << " " << pd << '\n';
pc++;
pi++;
pd++;
std::cout << (void *)pc << " " << pi << " " ... | true |
8e3ace40d4db5f3294d3078f4379cad8e6ce1cbc | C++ | KongkaMozumderSUST/library | /Number_Theory/BigNumber/Divide.cpp | UTF-8 | 593 | 2.578125 | 3 | [] | no_license | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
string DIV(string s, ll a)
{
string ans="";
ll temp=0,r,i=0;
while(i<s.size())
{
temp=(temp*10+s[i++]-'0');
r=temp/a;
temp=temp%a;
ans+=to_string(r);
}
for(i=0; i<ans.size(); i++)
{
if(... | true |
ec488431e5f6679d31e0d3a560457dd61191ed39 | C++ | ruhulsbu/NanoBLASTer | /nano_src/optimize_kband.cpp | UTF-8 | 7,381 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "library.h"
#include "constant.h"
#include "global.h"
#include "structure.h"
#include "functions.h"
void trace_path_cell_back(cell **path, int row, int column, string& str1, string& str2, vector<pair<char, char> >& alignment)
{
int dir, k;
char x, y;
while(row != 0 || column != 0)
{
dir = (int) path[r... | true |
01e6ab6f0ca59ce13e7be9c6ab77274b0cd150ae | C++ | black-shadows/Cracking-the-Coding-Interview | /Solutions/Chapter 5 Bit Manipulation/5.6.cpp | UTF-8 | 1,223 | 4.0625 | 4 | [] | no_license | /*
*Q5.6 Write a program to swap odd and even bits in an integer with as few insttuctions as possible
*(e.g.,bit 0 and bit 1 are swapped,bit 2 and bit 3 are swapped,etc)
*/
#include <iostream>
#include <string>
using namespace std;
void print_binary(int x)
{
string s = "";
for (int i = 0; i < 32 && x... | true |
15b46ac601a0f9b7270dc98af65d527546b8c6b3 | C++ | Nadd3564/2DActionPuzzleGame | /Classes/StateMachine.h | UTF-8 | 668 | 2.546875 | 3 | [] | no_license | //
// StateMachine.h
//
// Created by athenaeum on 2014/11/15.
//
//
#ifndef __StateMachine__
#define __StateMachine__
#include <vector>
#include "GameState.h"
class StateMachine
{
public:
StateMachine();
~StateMachine();
void pushState(GameState* pState);
void changeState(GameState* pState);... | true |
b83d60623ddf3155f9d540909d8d93f98483374f | C++ | DaggeNRoll/OOP | /lab10/task3/main.cpp | WINDOWS-1251 | 1,658 | 3.859375 | 4 | [] | no_license | #include <iostream>
class Distance //
{
private:
int feet;
float inches;
public: //
Distance() : feet(0), inches(0.0) // ( )
{}
// (2 )
Distance(int ft, float in) : feet(ft), inches(in) {}
Distance(double x) {
feet = static_cast<int>(x);
inches = 12 * (x - feet);
... | true |