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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9b51305b2c92ca6b699ed435037ae2239b23875e | C++ | almoreir/algorithm | /cd3/정보올림피아드관련/정보올림피아드관련/문제들/문제/문제모음2/12월13일-4문제/hong/forecast/forecast.cpp | UTF-8 | 1,486 | 2.75 | 3 | [] | no_license | #include <fstream.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX 100000
ifstream in("forecast10.in");
ofstream out("forecast10.out");
int m, n;
double percent, volume, depth;
struct _c {
int height;
int flow;
} city[MAX];
int sortf(void const *p, void const *q)
{
struct _c *a=(struct _c ... | true |
2a7d461dcbd58c0a59f40ccceb9ff13bd119f1a7 | C++ | thesidjway/Fuzzy-Robot-Planning | /withoutobstacleavoidance/Projectcode.ino | UTF-8 | 15,114 | 2.65625 | 3 | [] | no_license | #include <FuzzyRule.h>
#include <FuzzyComposition.h>
#include <Fuzzy.h>
#include <FuzzyRuleConsequent.h>
#include <FuzzyOutput.h>
#include <FuzzyInput.h>
#include <FuzzyIO.h>
#include <FuzzySet.h>
#include <FuzzyRuleAntecedent.h>
#include <Encoder.h>
#define LM1 6
#define LM2 13
#define RM1 11
#define RM2 5
#define EN... | true |
45d51dfd74ea9c89d217c8746e3948cc2517ad5f | C++ | sbrunodev/estrutura-de-dados | /Arquivo Texto/Lista Exercicios - Arquivo Texto/Ex 12/Ex 12.cpp | UTF-8 | 703 | 2.671875 | 3 | [] | no_license | #include <conio2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int contLetra (char nomeArq[50])
{
FILE *Arq = fopen (nomeArq,"r");
char linha[99];
int i,lin=0,y=0,x,contl=0;
if (Arq==NULL)
printf ("\n Arquivo nao aberto ! ");
else
{
char letra;
printf ("Informe a Letra :\n ");
scanf ("%... | true |
9e6996153a16840fef4d073197e3fd5bc374f876 | C++ | dagil02/TaxiRevengeDLC | /GTT/MouseClickIC.h | UTF-8 | 478 | 2.59375 | 3 | [] | no_license | #pragma once
#include "ControlType.h"
class Button;
class MouseClickIC :
public ControlType {
public:
MouseClickIC(int key = SDL_BUTTON_LEFT);
virtual ~MouseClickIC();
//redefnie el m�todo dado que esta clase s�lo usa Button para tratar su input
virtual void handleInput(GameObject* o, Uint32 deltaTime, const... | true |
de0718464f5e770d68d814ab0e0160f8e056a8f0 | C++ | felixnaredi/wrum | /Playground/HelloTriangle/App.cpp | UTF-8 | 1,058 | 2.671875 | 3 | [] | no_license | // App.cpp
//
// Author: Felix Naredi
// Date: 2018-07-18 18:30:19 +0200
//
#include <stdexcept>
#include <sstream>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
namespace plg
{
GLFWwindow* window;
void key_callback(
GLFWwindow* window,
int key,
int scancode,
int action,
int mods)
{
if((mods & GLFW... | true |
99ef64d5b720070cd8329d45269f8a65fc3982d4 | C++ | marcuslamounier/SI-DataStruc | /Ex03/main.cpp | UTF-8 | 3,725 | 3.515625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <iomanip>
#include <iostream>
using namespace std;
typedef struct produto produto;
struct produto {
char nome[40];
int codigo;
double preco;
int quantidade;
};
void cadastrarNome(char *nome) {
char n[40];
... | true |
a40539a51e736eff16a88a1c9d8017c2cabc3a17 | C++ | Kiritow/OJ-Problems-Source | /HDOJ/3178_autoAC.cpp | UTF-8 | 818 | 2.78125 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
using namespace std;
#define N 1005
#define L 0.0000001
double a[N];
double b[N];
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
int i = 0;
for(i = 1; i <= n; i++)
scanf("%lf%lf",&... | true |
69819615deeab9b5c7b73799ec95dbf847ee92e4 | C++ | jatin-js/Data-Structures-And-Algorithms | /DataStructure/Trees/Adelson-VelskiiLandes/AVLFakeDriver.cpp | UTF-8 | 388 | 2.765625 | 3 | [] | no_license |
#include<iostream>
#include"AVL.h"
using namespace std;
#include"AVL.cpp"
int main()
{
struct Node *root=NULL;
for(int i=5;i<=55;i+=10){
struct Node* newNode=new struct Node(i);
insertNode(&root, newNode);
}
for(int i=1;i<=4;i++){
struct Node* newNode=new struct Node(i);
insertNode(&root, newNode);
}
... | true |
815d460e9048228eda8209117fc8c8b7328ded0d | C++ | MatosThiago/ProgramacaoCompetitiva | /Módulo 2/Aplicação/C. Pássaros Famintos.cpp | UTF-8 | 963 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int check(long long N, long long Q);
int main() {
int T;
scanf("%d", &T);
long long X, Y, Q;
for(int i = 0; i < T; i++) {
scanf("%lld %lld", &Y, &X);
if(X >= Y) {
printf("%lld\n", Y);
} else {
Q = Y - X;
... | true |
87721794da9abc8ffa37b2831157987b3721555c | C++ | dklollol/newton | /square/square.cc | UTF-8 | 1,416 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <libplayerc++/playerc++.h>
using namespace PlayerCc;
void run_square(char* host, int port, int device_index) {
PlayerClient robot(host, port);
Position2dProxy pp(&robot, device_index);
double move_speed = 0.2;
double move_turn_init = -5;
timespec move_sleep_init = {0, 300000000}... | true |
4eacf959003c54631044e817a3a57f202e6f1654 | C++ | 0318648DEL/Graphics | /graphics drills/graphics drills/WHY.cpp | UHC | 8,363 | 3.09375 | 3 | [] | no_license | #include"pch.h"
#include<gl/freeglut.h>
#include<iostream>
#include<time.h>
#include<stdlib.h>
#include<math.h>
using namespace std;
///////////////////////////
// ݹ Լ //
///////////////////////////
GLvoid drawScene(GLvoid);
GLvoid Reshape(int w, int h);
GLvoid Keyboard(unsigned char key, int x, int y);//Ű
GLvoid Mous... | true |
87ff05ed864551feb3c84c63fe4def7dd5ea2ba8 | C++ | austinholst/RedBlackTreeInsertion | /rb.cpp | UTF-8 | 8,953 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstring>
#include <stdlib.h>
using namespace std;
/* Author: Austin Holst
* Date: 4 - 30 - 18
* Code: Creates and prints out a red black data tree from user input
*/
//Struct for nodes
struct Node {
Node* parent;
Node* left;
Node* right;
int color;
int d... | true |
b6a6869bb1994e2e03e83a92a6cdcf334abec7bb | C++ | FLynnGame/moleserver | /games/dzpk/GameLogic.h | UTF-8 | 2,391 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #ifndef GAME_LOGIC_HEAD_FILE
#define GAME_LOGIC_HEAD_FILE
#include "cdefines.h"
//数值掩码
#define LOGIC_MASK_COLOR 0xFF00 //花色掩码
#define LOGIC_MASK_VALUE 0x00FF //数值掩码
#define CT_HIGH_CARD 1 //高牌
#define CT_ONE_PAIR 2 //对子
#define CT_TWO_PAIR 3 //两对
#define CT_THRE... | true |
1348b9982433d1a8f7333c12918486334dee56fc | C++ | Frogger-Software/Cpp-Dictionary | /Assignment-03_PA_TicTacToe.cpp | UTF-8 | 3,901 | 3.625 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
bool isWon(char symbol, char board[][3])
{
// checks for matching symbols
if ((board[0][0] == symbol && board[0][1] == symbol && board[0][2] == symbol) || (board[0][0] == symbol && board[1][0] == symbol && board[2][0] == symbol)) { // checks first column (left) and firs... | true |
4ddd5a19c926d201ea56e87e55ed8195274705ab | C++ | mattBoros/dominion-hand-solver | /main.cpp | UTF-8 | 14,737 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <assert.h>
#include <sys/time.h>
using namespace std;
const bool DEBUG = false;
double get_time() {
struct timeval tp;
gettimeofday(&tp, NULL);
long int t = tp.tv_sec * 1000 + tp.tv_usec / 1000;
return t / 1000.0;
}
string spaces(const... | true |
4c77701cc18b7f33255c59a3cc74bc4285337bad | C++ | karthikramx/CodeBlocks-CPlusPlus-Examples | /OperatorOverloading/Karthik.cpp | UTF-8 | 298 | 2.59375 | 3 | [] | no_license | #include "Karthik.h"
#include <iostream>
using namespace std;
Karthik::Karthik()
{
}
Karthik::Karthik(int a)
{
num = a;
}
//overloaded function def
Karthik Karthik::operator+(Karthik ko){
Karthik brandNew;
brandNew.num = num + ko.num;
return brandNew;
}
| true |
bcdd61ba89c0a5acd0e640ffdb74150f020f29a7 | C++ | 00mjk/leetcode-1 | /GenerateParentheses/Solution.cpp | UTF-8 | 920 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <cstdint>
using namespace std;
class Solution {
public:
vector<string> ret;
vector<string> generateParenthesis(int n) {
genParent("", n, n);
printResult();
return ret;
}
void genParent(string tmp, int lRemain, ... | true |
543ff31e2197b57664afc459a75518df0889c206 | C++ | kmahsi/AP_apply | /advancedCoffeMaker.cpp | UTF-8 | 3,070 | 2.78125 | 3 | [] | no_license | #include "utils.cpp"
#include "advancedCoffeMaker.h"
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <list>
using namespace std;
void AdvancedCoffeMaker::getInputAnProcess()
{
string featureModelLine, descriptionLine ;
list<string> features;
featureModelLine.erase(remove_if(featureModelLine.b... | true |
0b9ad79da5e46baa7ddfae0509d775393924216b | C++ | moevm/oop | /8383/Larin_Anton/OOProject/Logger/AbstractLogger.h | UTF-8 | 544 | 2.734375 | 3 | [] | no_license | //
// Created by anton on 6/2/20.
//
#ifndef OOPROJECT_ABSTRACTLOGGER_H
#define OOPROJECT_ABSTRACTLOGGER_H
#include <memory>
#include <string>
class AbstractLogger {
public:
virtual void log(std::string str)=0;
virtual AbstractLogger&operator<<(std::string str){
log(str);
return *this;
... | true |
07ae78f711d5d959567e5c5356cffa0d4362b845 | C++ | hujianzhong-UOS/document2html | /src/main.cpp | UTF-8 | 6,488 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* @brief Document to HTML converter
* @package document2html
* @file main.cpp
* @author dmryutov (dmryutov@gmail.com)
* @version 1.0
* @date 04.01.2018 -- 05.01.2018
*/
#include <iostream>
#include <string>
#include "libs/getoptpp/getoptpp.hpp"
#include "libs/fileext/archive/archive.hpp"
#include ... | true |
abbfea4dc6f2eea2aeeb3a5c61e2ca1ec1446ae4 | C++ | SWQXDBA/my-ideas | /通讯录wancheng.cpp | UTF-8 | 6,201 | 3.015625 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
#include <cstdlib>
#define name_max 15
#define sex_max 15
#define number_max 15
#define address_max 15
void inputtel(struct teles *ps);
void delet(struct teles *ps);
void srch(struct teles *ps);
void printtel(struct teles *ps,int n);//打印单个人的数据
void showtel(struct teles ... | true |
fc25e4ce6af4f39e422450b02ea99ee3078050cb | C++ | Todd-Pidgeon/Programming_Portfolio | /C++/A4P2-hangman.cpp | UTF-8 | 9,983 | 3.25 | 3 | [] | no_license | //Program Name : A4P1-Hangman
//Programmer Name: Todd Pidgeon
//Overview : A Hangman Game
//Date Written : 02/23/2016
//Date Modified : 02/28/2016
#include <iostream>
#include <string>
#include <iomanip>
#include <conio.h>
#include <windows.h>
#include <limits>
using namespace std;
int hang_cnt;
int lette... | true |
9e728ffecc2cf9c6b6c9449b623327aa7b946984 | C++ | GhulamMustafaGM/C-Programming | /09-C++ Programming/PythangoreanTheorem.cpp | UTF-8 | 620 | 4.125 | 4 | [] | no_license | // Pythagorean theorem
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a, b;
float c;
cout << "Enter a value of the first side of a triangle ";
cin >> a;
cout << a << endl;
cout << "Enter a value of the second side of a triangle ";
cin >> b;
cout << b << en... | true |
f2725508706251bcb38acd4478cee76721891b3d | C++ | raquel-oliveira/Computer-Graphics | /include/vec3.h | UTF-8 | 2,156 | 3.34375 | 3 | [] | no_license | #ifndef _VEC3_H_
#define _VEC3_H_
#include <cmath> // fabs
#include <iostream>
#include <cassert> // assert
/*!
* Represents a 3D vector, that might be used to represent
* points, directions, vectors, colors, offset
*/
namespace utility {
class Vec3
{
public:
//=== Aliases
typedef float value_t... | true |
9fde6a47a160dad17b435795809f7abf85523cb6 | C++ | cyberfenrir/programs-C | /DIVSIB_5.CPP | UTF-8 | 241 | 3 | 3 | [] | no_license | #include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a;
cout<<"Enter the number: ";
cin>>a;
if((a%5)==0)
{
cout<<"The number is divisible by 5. ";
}
else
{
cout<<"The number is not divisible by 5. ";
}
getch();
} | true |
2fff4457aab93f162a213d0be575f3c5ed421269 | C++ | supersoulsoul/ProgrammingExercises | /折线分割.cpp | GB18030 | 809 | 3.390625 | 3 | [] | no_license | #include<stdio.h>
int main(){
int n,a;
scanf("%d",&n);
while(n--){
scanf("%d",&a);
printf("%d\n",2*a*a-a+1);
}
return 0;
}
/*߷ƽ
ֱ߷ƽ֪ɽߺ߶εn-1ʱΪfn-1Ϊʹӵ࣬ߵߵ߶Ҫn-1ߵıߣ2*n-1߶ཻô߶Ϊ4*n-1Ϊ2Ҫעǣ߱ڵ߶ֻһ
ʣf(n)=f(n-1)+4(n-1)+2-1
=f(n-1)+4(n-1)+1
=f(n-2)+4(n-2)+4(n-1)+2
... | true |
325886f1ce439101b999afc6e3f0b5c4c01b1412 | C++ | meksconways/Multivibrators | /eleman/Eleman.cpp | UTF-8 | 1,103 | 3.03125 | 3 | [] | no_license | //
// Created by macbook on 2019-07-11.
//
#include <iostream>
#include "Eleman.h"
using namespace std;
const ElemanTurleri &Eleman::getTur() const {
return this -> elemanTurleri;
}
const void Eleman::setTur(const ElemanTurleri &value) {
this -> elemanTurleri = value;
}
const string &Eleman::getDetay() co... | true |
0de44651555f75383a3f9c4f9b82d4a9da5d5550 | C++ | unaxcess/qUAck | /ua.cpp | UTF-8 | 2,888 | 2.59375 | 3 | [] | no_license | /*
** UNaXcess II Conferencing System
** (c) 1998 Michael Wood (mike@compsoc.man.ac.uk)
**
** Concepts based on Bradford UNaXcess (c) 1984-87 Brandon S Allbery
** Extensions (c) 1989, 1990 Andrew G Minter
** Manchester UNaXcess extensions by Rob Partington, Gryn Davies,
** Michael Wood, Andrew Armitage, Francis Cook, B... | true |
0e8a32196fc440a20c97a225ef33981eb58525b4 | C++ | priyanshi9692/GenericAreaCalculator | /Circle.cc | UTF-8 | 213 | 2.8125 | 3 | [] | no_license | #include "Circle.h"
#include<iostream>
using namespace std;
double Circle:: area()
{
double circleArea= 3.14*R*R;
return circleArea;
}
Circle:: Circle(XYPoint &point, double R1)
{
A=point;
R=R1;
}
| true |
80aefcb522e9d1744225380f212b785f913845d4 | C++ | SothicT/algorithm | /德才论(25)2019_2_28.cpp | GB18030 | 2,890 | 3.484375 | 3 | [] | no_license | /*
δʷѧ˾ڡͨһġ²ۡǹʲŵȫ
ν֮ʥˣŵ¼ν֮ˣʤν֮ӣʤν֮Сˡȡ֮
ʥˣӶ֮Сˣˡ
ָһĵ²ŷ˾۸¼ȡ
ʽ
һи 3 ֱΪN10^5L60
Ϊ¼ȡͷߣ·ֺͲŷ־ L Ŀʸ¼ȡ
H<100Ϊ¼ȡߡ
(1)·ֺͲŷ־ڴߵıΪŵȫ²ִܷӸ
(2)ŷֲ·ֵߵһڡʤšҲܷڵһ
֮
(3)²ŷ־ Hǵ·ֲڲŷֵĿڡŵ¼Сʤ
šߣܷڵڶ֮
(4)ﵽ L ĿҲܷڵ֮
N УÿиһλϢ֤ · ŷ֣
֤Ϊ 8 λ²ŷΪ [0, 100] ڵּԿո
ʽ
һȸﵽͷߵĿ M M Уÿа
ʽһλϢ˵ĹӸߵij
ܷͬʱ·ֽУ·ҲУ֤ŵ
*/
#include <st... | true |
7cbe8f7cff6cdba562ead7ab62e7bc02277ced1e | C++ | mariamsandhu/Cpp | /table.cpp | UTF-8 | 319 | 2.703125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int tableNo,Tablecounter=1, tableLength;
cout<<"Enter table no\n";
cin>>tableNo;
cout<<"Enter table length\n";
cin>>tableLength;
while (Tablecounter <= tableLength){
cout<<tableNo<<"*"<<Tablecounter<<"="<<(tableNo*Tablecounter)<<endl;
Tablecounter++;
}
}
| true |
5ea3aa8d1a4c32f9ca7cb1c05a7c4dd344221116 | C++ | praveen4698/competitiveProgrammingWithCpp | /graph/spoj roti prata.cpp | UTF-8 | 2,270 | 3.328125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<list>
#include<queue>
using namespace std;
class Graph
{
int V;
vector <pair<int,int> > *g;
int *distance;
public:
Graph(int V);
void addedge(int u,int v,int w);
void Dijkstra(int n);
... | true |
57f8c4547502a05fbd2ee33f5bce719089f1d7c3 | C++ | trieck/source | /c++/TorrentExplorer/StringTokenizer.cpp | UTF-8 | 2,627 | 2.65625 | 3 | [] | no_license | // StringTokenizer.cpp: implementation of the StringTokenizer class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "torrentexplorer.h"
#include "StringTokenizer.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//... | true |
6b7f687cbf6bb181afa4074757444ae68c9b1a22 | C++ | fiftyfivebells/book-store | /src/Customer.cc | UTF-8 | 699 | 2.703125 | 3 | [] | no_license | #include "../include/Customer.h"
Customer::Customer(string first, string last, string email, string pass) {
firstName = first;
lastName = last;
password = pass;
this->email = email;
}
Customer::~Customer() {
delete shipping;
delete billing;
}
Address *Customer::getShipping() { return shipping; }
void Cu... | true |
4b39437bcef55847d1a0c585acd4e9d6e94365b0 | C++ | borisblizzard/liteser | /include/liteser/Ptr.h | UTF-8 | 857 | 2.96875 | 3 | [
"BSD-3-Clause"
] | permissive | /// @file
/// @version 3.1
///
/// @section LICENSE
///
/// This program is free software; you can redistribute it and/or modify it under
/// the terms of the BSD license: http://opensource.org/licenses/BSD-3-Clause
///
/// @section DESCRIPTION
///
/// Represents a generic value pointer.
#ifndef LITESER_PTR_H
#def... | true |
0021fa855bf858ddca7f869e8ef01072e45ce939 | C++ | BenJilks/TinyEngine | /include/TinyShader.h | UTF-8 | 1,228 | 2.8125 | 3 | [] | no_license | #pragma once
#include "glad.h"
#include <string>
#include "TinyMaths.h"
using namespace std;
/* Create and handle OpenGL shaders */
namespace TinyEngine
{
class TinyShader
{
public:
TinyShader() {};
TinyShader(string vertex_path, string fragment_path);
/* Bind an attribute to a location in the... | true |
5cfb2b2f68c612ca6d7d6b0523d893b602f57e8f | C++ | hlzy/some_test | /shared_ptrtest/test2.cpp | UTF-8 | 932 | 2.78125 | 3 | [] | no_license | #include <memory>
#include <iostream>
#include <vector>
using namespace std;
class A;
static shared_ptr<A> c;
class A
{
public:
// A() {};
A(int b) {cout<<"init"<<endl;a=b;}
// A(const A& b) {cout<<"initx"<<endl;a=b.a;}
~A() {
cout<<"deinit "<<a<<endl;
}
int a;
};
int main(int argc, char **argv) {
// c.... | true |
5e7025ea2cb5bbcaede03ffe95fcb9f6aec62bb0 | C++ | qingmang178/learn | /浙大数据结构/Polynomials.cpp | UTF-8 | 301 | 2.890625 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
double f1(int n ,double a[], double x)
{
int i;
double p =a[0];
for(i=1;i<=n;i++)
p+=(a[i]*pow(x,i));
return p;
}
double f2(int n, double a[], double x)
{
int i;
double p =a[n];
for(i=n;i>0;i--)
p=a[i-1]+x*p;
return p;
}
int main()
{
}
| true |
cc6169fd817c21beb454248ec61f98afdb6a4a9c | C++ | ghj0504520/UVA | /10000/10019.cpp | UTF-8 | 750 | 3.484375 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int de_to_hex(int num);
int binary_count(int num);
int main()
{
int t;
while(cin>>t)
{
while(t--)
{
int num_de;
cin>>num_de;
int b_1=binary_count(num_de);
int b_2=binary_c... | true |
dee168095707dee534d9849cbe1e45f5c18072dc | C++ | ToxicGLaDOS/sentinel | /values/IntValue.cpp | UTF-8 | 1,080 | 3.40625 | 3 | [] | no_license | /*
* Definitions for IntValue
*
* See IntValue.h for more information
*/
#include "IntValue.h"
IntValue::IntValue(int value)
: SentinelValue(SentinelValue::INT)
, value(value){}
std::shared_ptr<SentinelValue> IntValue::add(const SentinelValue& other) const{
if(other.isInt()){
// Not sure if ... | true |
19ee50e2d369fa32e60e2e7df45e78056fd856df | C++ | siyeonparkk/C-study | /WEEK1-2 수정.cpp | WINDOWS-1252 | 481 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
void main(float x, int y)
{
cout << "Firstnumber ";
cin >> x;
char ch;
cout << "Secondnumber ";
cin >> y;
cout << "==========";
cout << x << "+" << y << "=" << x + y << endl;
cout << x << "-" << y << "=" << x - y << endl;
cout <... | true |
d9ff5e7c58c6254f16e7605bee2564c1587303fe | C++ | Ol5xHd/tasks | /Yandex_algorithms/sprint2_recursion/taskI/main.cpp | UTF-8 | 5,593 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <set>
#include <map>
using namespace std;
typedef unsigned short UShort;
typedef unsigned int UInt;
/**
* @brief основной метод перебора комбинаций монеток
* @param coins - множество монеток, из которого выбираем
* @param combina... | true |
24fdf48fd06f987aade189da7f460f01f7d024a2 | C++ | mmrahman01/CS491 | /main.cpp | UTF-8 | 3,806 | 3.03125 | 3 | [] | no_license | /*
--- Collaborative filtering----
1. M x N matrix.
2.Determine similarity between users.
(Correlation coefficient and Vector Space (Cosine Similarity)
3.R'ut + ( Total Wu, ut (Ru(o) - R'u) / (Total |Wa, Ut|
How to from here
4.Train Data, Each user, add non zero divide by number of non zero to... | true |
c164785429daf7f815d5be4e2ec279902d6e69a8 | C++ | danposch/itec-scenarios | /extensions/droppingPolicy/droppingpolicy.cc | UTF-8 | 835 | 2.953125 | 3 | [] | no_license | #include "droppingpolicy.h"
DroppingPolicy::DroppingPolicy()
{
// init metric with 0.0
metric = 0.0;
}
void DroppingPolicy::SetMetric(double metric)
{
if (metric < 0.0)
return;
if (metric > 1.0)
return;
this->metric = metric;
}
void DroppingPolicy::Feed(LevelStatistics& L)
{
t... | true |
91979cafb7ac4c0c68dba3cde0911cc48f0deaed | C++ | harrison-aw/NeuralNetworkProject | /Neural Network Project/src/main.cpp | UTF-8 | 1,827 | 2.71875 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: May 6, 2013
* Author: Tony
*/
#include <algorithm>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include "art2network/ART2Network.h"
#include "frequency/FrequencyTable.h"
using namespace std;
using namespace art2nn;
using namespace nnproject;
... | true |
1bc7dce8f07674a7f68defbe16f3173a13611f48 | C++ | chiranjeevbitm/C_and_Cpp | /Geek_Practice/DynamicPrograming/WineProblem.cpp | UTF-8 | 900 | 2.734375 | 3 | [] | no_license | #include<iostream>
using namespace std;
#include<cstring>
#include<limits.h>
//int ncall =0;
int calls = 0;
int memo[100][100];
int max_profit(int arr[],int s,int e,int y)
{
// ++ncall;
if(s>e) return 0;
int q1 = arr[s] * y + max_profit(arr,s+1,e,y+1);
int q2 = arr[e] * y + max_profit(arr,s,e-1,y+1);
return... | true |
da9310bc79c4b0127a8cf3e2c6dc35fee817295b | C++ | George55555/Stealth | /contrib/pyHash9/pyHash9.cpp | UTF-8 | 1,435 | 2.609375 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2016-2019 Stealth R&D LLC
#include <stddef.h>
#include "hashblock.h"
#include <Python.h>
static const int HASHLEN = 32;
PyObject* hash9(PyObject *self, PyObject *args)
{
char* stringIn;
int size = 0;
/* can't parse args */
if (! PyArg_ParseTuple(args, "s#", &stringIn, &size)) {
... | true |
6cce829f331a7e843021b7089263efbed48e66d3 | C++ | thrawn01/io-perf | /read-threaded.cpp | UTF-8 | 6,078 | 2.59375 | 3 | [] | no_license | #include <boost/thread/mutex.hpp>
#include "boost/threadpool.hpp"
#include "boost/bind.hpp"
#include <openssl/md5.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <inttypes.h>
#include <getopt.h>
#include <stdlib.h>... | true |
cb8f82f96590fef00815e2314ae10f30784c6b29 | C++ | Satar07/code | /1.4编程基础之逻辑表达式与条件分支/03奇偶数判断.cpp | UTF-8 | 144 | 2.6875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int a;
cin>>a;
if (0==a%2){
cout <<"even";
return 0;
}
cout<<"odd";
return 0;
}
| true |
3ff15f6aab763447b03152f3de0ae3e9e32fc525 | C++ | AlazzR/Digital-Image-Processing-Cpp | /Chapter_5_Image_Restroration_and_Reconstruction/Section_5_8.cpp | UTF-8 | 2,964 | 2.671875 | 3 | [
"CC0-1.0"
] | permissive | #include "Section_5_8_H_.h"
void wiener_filtering(const cv::Mat& img, std::string type, float k, float a , float b, float T, std::string imageName, float K)
{
cv::Mat kernel;
if (type == "Atmospheric")
kernel = creating_H_atmospheric(k, img.rows, img.cols);
else
kernel = creating_H_motion(a, b, T, img.rows, img... | true |
3b7f518ad3a656e9e738094d2b4fb2ac64ecaa6c | C++ | bcontant/TentGine | /Renderer_Base/Text.cpp | UTF-8 | 9,458 | 2.578125 | 3 | [] | no_license | #include "precompiled.h"
#include "Text.h"
#include "Renderer.h"
#include "../Base/FontDataFile.h"
#include "../Base/Profiler.h"
#include "VertexBuffer.h"
//--------------------------------------------------------------------------------
struct SimpleVertex
{
vec3 Pos;
vec2 UV;
u32 Color = 0xfff... | true |
b872fb38d061c4af5da9d2ee39a1c0a0d2c8fb23 | C++ | tomasmussi/concurrentes | /tp1/utils/Logger.h | UTF-8 | 847 | 2.734375 | 3 | [] | no_license | #ifndef TP1_LOGGER_H
#define TP1_LOGGER_H
#include <iostream>
#include <string>
#include <fstream>
#include "../ipc/LockFile.h"
#include "../constants.h"
class Logger {
private:
static std::ofstream file_stream;
static LockFile lock;
static int log_level;
static std::string get_error_flag(int error_t... | true |
33f13bcaa321972fb9c2212da5cdb433bd9825de | C++ | HozanaSurda/ILS-SCVRP | /src/DataReader.cpp | UTF-8 | 9,191 | 3.328125 | 3 | [] | no_license | #include "DataReader.hpp"
/*
* \brief takes a line and breaks it into tokens
*
* \param line_to_tokenize line to separate into tokens.
* \param delimiter the delimiter between tokens (default is space ' ')
* \param tokens an array of strings, which will save the tok... | true |
b9b89a7414ad2be66f3b81775eb24fbf45c4c282 | C++ | HamzaBhatti/Final-Project_OOP | /temp_library.cpp | UTF-8 | 4,600 | 2.734375 | 3 | [] | no_license | #include<conio.h>
#include<string.h>
#include<iostream>
#include<fstream>
#include <fstream>
using namespace std;
class book
{
protected:
char b_name [50];
char b_publish[50];
char b_author[50];
char b_serial[50];
int n;
int choice;
char temp1[50];
int count = 0;
pub... | true |
23cba5953ecf395ab08993f40c409300bebef603 | C++ | Matheus-Rangel/Lab6 | /src/MatheusRangel.cpp | UTF-8 | 1,116 | 2.921875 | 3 | [] | no_license | #include "include/MatheusRangel.h"
namespace geometria{
double triangulo::area(){ return (formas::largura * formas::altura) / 2;}
double triangulo::perimetro(){return lado1 + lado2 + lado3;}
double quadrado::area() { return formas::largura * formas::altura; }
double quadrado::perimetro() { return formas::largura... | true |
fc926f2427396d86e6537e7143903194306ce2ea | C++ | jomorales1/Competitive-Programming | /Contests/Codeforces Round 669/B.cpp | UTF-8 | 879 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n = 0; cin >> n;
vector<int> sequence(n);
for (int i = 0; i < n; i++) {
cin >> sequence[i];
}
sort(sequence.rbegin(), sequence.rend());
int m = INT_MIN;
int gcd = sequence[0];
for (int i = 1; i < n - 1; i++) {
... | true |
e77bcdaef49507f33d37d20df99f62b7e12c68ff | C++ | bjpark0805/Problem_solvings | /examples/baekjoon_14891.cpp | UTF-8 | 929 | 2.75 | 3 | [] | no_license | #include <stdio.h>
#include <vector>
using namespace std;
int main(){
vector<int> top(4, 0);
int K;
vector<vector<int> > gear(4, vector<int>(8, 0));
for(int i = 0; i < 4; ++i){
for(int j = 0; j < 8; ++j){
scanf("%1d", &gear[i][j]);
}
}
scanf("%d", &K);
for(int i = 0; i < K; ++i){
int num, d;
scan... | true |
4899da6fdf09248ae2864c0a179016c3afb90d2f | C++ | xuelei7/AOJ | /Volume20(JAG)/aoj2005_WaterPipeConstruction.cpp | UTF-8 | 4,129 | 2.734375 | 3 | [] | no_license | // Water Pipe Construction
// 21XX 年,ついに人類は火星への移住計画を開始させた.火星への移住第一陣に選抜されたあなたは,火星行政中央局(the Administrative Center of Mars)に配属され,火星で起こる様々な問題に対処している.行政中央局の目下の最大の問題は自立した需要供給サイクルの確保である.月からの援助物資が届くまでには数ヶ月単位の時間がかかるため,基本的には火星内の需要は火星内で解決する必要がある.それに加えて,循環システムを確立するまでは資源を極力節約することが求められる.
// 行政中央局は極地にある氷の採掘を開始した.太陽光でこれを溶かし,水として個々... | true |
4ce75f8e6ed944cbff8358eaa2380f6c473d1869 | C++ | James-Bartulis/Tetris | /Tetris.cpp | UTF-8 | 6,809 | 2.5625 | 3 | [] | no_license | void Tetris::Display()
{
system("CLS");
cout << string(width + 2, char(178)) << "Score: " << Score << endl;
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
if(j == 0)
cout << char(178);
if(pieceOnCoord(j, i, currentPiece))
cout << char(177);
else if(setPiecesOnCoord(j, i))
... | true |
7600088d063552093c214aa78c19aa8a0ac79be7 | C++ | antjowie/Runaway | /Runaway/source/Core.cpp | UTF-8 | 14,522 | 2.59375 | 3 | [] | no_license | #include "Core.h"
#include "DataManager.h"
#include "Config.h"
void Core::draw(sf::RenderTarget & target, sf::RenderStates states) const
{
target.draw(m_whiteOverlay, states);
target.draw(m_body, states);
target.draw(m_eyes, states);
target.draw(m_leftLauncher, states);
target.draw(m_middleLauncher, states);
tar... | true |
05234bb4c484a203399e3ab888484b61bf5e9258 | C++ | HungMingWu/futures_cpp | /include/futures/Stream.h | UTF-8 | 5,154 | 2.703125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #pragma once
#include <iterator>
#include <futures/Core.h>
#include <futures/Exception.h>
#include <futures/Async.h>
#include <futures/Future.h>
namespace futures {
template <typename T>
class IStream {
public:
virtual Poll<Optional<T>> poll() = 0;
virtual ~IStream() = default;
};
template <typename T>
stru... | true |
7af8ae645313c343601784c5850844ebcbf76a28 | C++ | yaominzh/CodeLrn2019 | /boboleetcode/Play-Leetcode-master/0509-Fibonacci-Number/cpp-0509/main5.cpp | UTF-8 | 554 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | /// Source : https://leetcode.com/problems/fibonacci-number/
/// Author : liuyubobobo
/// Time : 2019-01-09
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
/// Closed Form
/// https://en.wikipedia.org/wiki/Fibonacci_number
///
/// Time Complexity: O(logn)
/// Space Complexity: O(logn)
... | true |
a82a087442f3fbffd25cd63bad58998802631760 | C++ | aspose-cells/Aspose.Cells-for-C | /Examples/CellsCPP/TechnicalArticles/ApplyCustomThemeColorsOfWorkbookUsingArrayOfColors.cpp | UTF-8 | 1,822 | 2.90625 | 3 | [] | no_license | #include "../CellsExamples.h"
//Apply Custom Theme Colors of the Workbook using Array of Colors
void ApplyCustomThemeColorsOfWorkbookUsingArrayOfColors()
{
//Output directory path
StringPtr outPath = new String("..\\Data\\Output\\");
//Path of output excel file
StringPtr outputApplyCustomThemeColorsOfWorkbookUs... | true |
46fa291c1bb1eea9c37920e0b542e6049116ed82 | C++ | xClima/Probleme-de-programare-Moodle | /Subiecte complexe/Gradina zoologica.cpp | UTF-8 | 4,507 | 2.640625 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
bool sortare(const pair<string,int>&a,const pair<string,int>&b){
if(a.second==b.second){return a.first<b.first;}else{return a.second<b.second;}
}
struct Animale{
string x,y;
int v;
};
boo... | true |
5c2b6f0fc85170ff1584022504d4d8bf6fd839c4 | C++ | jrrodgers68/ParticleMQTTWrapper | /src/LogMessagePayloadFormatter.cpp | UTF-8 | 1,294 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "application.h"
#include "LogMessagePayloadFormatter.h"
#include "Buffer.h"
#include "BufferMgr.h"
#include <SparkJson.h>
#include <time.h>
using namespace ParticleMQTTWrapper;
LogMessagePayloadFormatter::LogMessagePayloadFormatter()
{
}
Buffer* LogMessagePayloadFormatter::writeMessage(const char* source... | true |
50ccddb5e71bd807bd185d4c6ae136783d0be0b2 | C++ | truongan012/InterviewKit_cpp | /src/TwoStrings.cpp | UTF-8 | 792 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <set>
#include <algorithm>
#include <iterator>
using namespace std;
// Complete the twoStrings function below.
string twoStrings(string s1, string s2)
{
string result = "";
set<char> set1(begin(s1), end(s1));
set<char> set2(begin(s2), end(s2... | true |
272a236b53788037b26237a500b459188f4c687a | C++ | accessmvsk/CodingPractice | /SingleNumber.cc | UTF-8 | 1,432 | 3.921875 | 4 | [] | no_license | #include <iostream>
#include <string>
#define MAX_COUNT 15
using namespace std;
// Program to find unique value in an array with all pairs except 1 value.
// This solution assumes the array doesn't have 0. If so, we are screwed
// If array has 0, use hash map solution. Keep adding and removing elements from array
//... | true |
020bf29c381d2179ee0731610030c2ecab55d212 | C++ | reenigne/reenigne | /8088/demo/pitpulse/pitpulse.cpp | UTF-8 | 6,093 | 2.578125 | 3 | [
"Unlicense"
] | permissive | // Scheme X: the outer interrupt is triggered by audio channel A pulse (more accurate)
// Scheme Y: the outer interrupt is triggered whichever audio channel is pulsing when the time runs out (faster)
// Implement both schemes: scheme Y will suffice for note/volume changes, scheme X will probably be necessary for ISAV
/... | true |
8d947bf22720788b84ddb3101211058f4c054449 | C++ | zhushh/cplusplus | /cplusplus_course_projects/small_code/template_determine_smaller.cpp | UTF-8 | 586 | 3.6875 | 4 | [] | no_license | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
template <class T>
T min(T a, T b)
{
T min = a;
if (min > b) {
min = b;
}
return min;
}
int main()
{
int a, b;
cout << "Enter two integers: ";
cin >> a >> b;
cout << "The smaller one is: " << min(a, b) << endl;
do... | true |
212e6d50e1c9edf596aad081a514c52ee4532c0b | C++ | Sscftolicsz/AVL-Tree-Practice | /AVL.cpp | UTF-8 | 9,696 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
struct Node{
char productName[100];
char productQuality[15];
int productPrice;
int productStock;
int height;
Node* left;
Node* right;
};
Node* createNode(char productName[100], char productQuality[15], int productPrice, int productSt... | true |
2255074ca7efed920387818c9078f644a584e4b8 | C++ | osamu-k/QtStudy | /DrawingChat001/NetDraw001/model/shapespace.cpp | UTF-8 | 1,840 | 2.984375 | 3 | [] | no_license | #include "shapespace.h"
#include "freehandfactory.h"
#include "rectanglefactory.h"
ShapeSpace::ShapeSpace()
{
m_factoryMap[Shape::TYPE_FREEHAND] = new FreeHandFactory();
m_factoryMap[Shape::TYPE_RECTANGLE] = new RectangleFactory();
}
ShapeSpace::~ShapeSpace()
{
}
ShapeSpace *ShapeSpace::m_instance = 0;
Sha... | true |
0441758eb8bfc82e562246790fa53f77f249e60b | C++ | stephanie-wang/ray | /src/ray/raylet/lineage_cache.cc | UTF-8 | 13,802 | 2.578125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | #include "lineage_cache.h"
#include <sstream>
#include "ray/gcs/redis_gcs_client.h"
#include "ray/stats/stats.h"
namespace ray {
namespace raylet {
LineageEntry::LineageEntry(const Task &task, GcsStatus status)
: status_(status), task_(task) {
ComputeParentTaskIds();
}
GcsStatus LineageEntry::GetStatus() cons... | true |
00490317e5a33228493244a1c4862163257d25e3 | C++ | bdharshini08/my-captian-c-assignment-codes | /bus reservation system.cpp | UTF-8 | 3,578 | 3.140625 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
#include<string.h>
#include<cstdio>
#include<cstdlib>
using namespace std;
static int p = 0;
class a
{
char busno[5],drivername[10],arrival[5],depart[5],from[10],to[10],seat[8][4][10];
public:
void install();
void allotment();
void empty();
void s... | true |
d65c1721457c4c80a02cd11c4fd83dc851df9359 | C++ | tsemkaloalena/click_game | /click_game/GameObject.cpp | UTF-8 | 5,502 | 2.875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <SFML/Graphics.hpp>
#include <map>
#include <fstream>
#include <ctime>
#include "GameObject.h"
using namespace sf;
GameObject::MaskOfGameObject::MaskOfGameObject() {
std::map<const Texture*, int*>::const_iterator end = Bitmasks.end();
for (std::map<const Textu... | true |
5052c5bc7d872f25c4da1effc2f385c3eff545cf | C++ | ZhenyaVasilevskiy/CourseWork | /CourseWork/user.cpp | UTF-8 | 2,170 | 3.46875 | 3 | [] | no_license | #include "user.h"
user::user(){
}
user::user (std::string login, std::string password){
this->name = login;
this->password = password;
}
bool user:: SaveUser(){
bool result = true;
ofstream outputFile;
outputFile.open("Users.txt", ios::app);
if (!outputFile.is_open()){
result = fa... | true |
c6d4c508302df947f36085aa165d471af389480a | C++ | moficodes/cpp-tutorial-projects | /hangman/main.cpp | UTF-8 | 2,873 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
vector<string> readFile(string fileName){
string line;
ifstream myfile (fileName);
vector<string> lines;
if (myfile.is_open())
{
while ( getline (myfile,line)... | true |
ed21b79987e788d75abf031c6e71a3c0dcd50fca | C++ | stranxter/lecture-notes | /samples/03_sdp/2017/04_trie/trie.cpp | UTF-8 | 3,053 | 3.125 | 3 | [
"MIT"
] | permissive | #include <string>
#include "../03_hmap/hmap.cpp"
using namespace std;
template <class ValueType>
struct TrieNode
{
TrieNode ();
TrieNode (const TrieNode<ValueType>&);
~TrieNode();
TrieNode& operator = (const TrieNode<ValueType>&);
ValueType *data;
HashMap<char,TrieNode> children;
};
size_t charHash (con... | true |
437eda3995ee75120d473eaeeadfd66aa2ae474b | C++ | benjamingrant/StackLinkedList | /stack.cpp | UTF-8 | 989 | 3.6875 | 4 | [] | no_license | #include "stack.h"
#include "node.h"
Stack::Stack() {
head = nullptr; // the original head node is a nullptr
numElements = 0;
}
Stack::~Stack() {
}
void Stack::push(int value){
Node *newNode = new Node(value, head); // pointer to a new node
head = newNode; // switching the head node to the new node
... | true |
136db73faecb4ba84491bb20b711f314306e6191 | C++ | johnmadison/johnmadison.github.io | /C++/arrays.cpp | UTF-8 | 2,898 | 3.96875 | 4 | [] | no_license | // Array Testing - Recursion Examples
// Created by John Madison on 8/19/15.
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
// recursively gets the minimum and maximum values of the array
int minvalue(int a[], int length)
{
if (length == 1) return a[0];
else if (a[length-1] < ... | true |
41a618c9c849e39a782449519168ed20044530f3 | C++ | monocilindro/MBES-lib | /src/math/Interpolation.hpp | UTF-8 | 4,331 | 3.140625 | 3 | [
"MIT"
] | permissive | /*
* Copyright 2019 © Centre Interdisciplinaire de développement en Cartographie des Océans (CIDCO), Tous droits réservés
*/
#ifndef INTERPOLATOR_HPP
#define INTERPOLATOR_HPP
#include <stdexcept>
#include <cmath>
#include "../Position.hpp"
#include "../Attitude.hpp"
#include "../utils/Exception.hpp"
/*!
* \brief In... | true |
d33b73aa4be750c788736f1010afee7f94c60cdd | C++ | josephsivits/ACCA2019 | /catAndMiceCollin.cpp | UTF-8 | 605 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int numMice, cat = 1, count;
cout << "Enter number of mice: ";
cin >> numMice;
cout << "Enter the count: ";
cin >> count;
int mice[100] = { 0 };
for (int i = 1; i < numMice; i++)
{
mice[i] = 1;
}
for (int i = 0; i < numMice; i+... | true |
447bf221464f9f1f6f326db8ab6764ba003faa80 | C++ | Shreyansh252001/just-codes | /least_frequent_element.cpp | UTF-8 | 880 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define max(x,y) (x>y)?x:y
#define min(x,y) (x<y)?x:y
#define mid(a,b) (a+b)>>1
#define all(p) p.begin(),p.end()
#define F first
#define S second
#defi... | true |
4d23399c096aa654b00011e00cf65ba5225ae1c7 | C++ | ganya7/cg-algorithms | /2D.CPP | UTF-8 | 3,586 | 3.140625 | 3 | [] | no_license | #include <iostream.h>
#include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <math.h>
float trikone[3][3] = { {100+200,150+200,200+200}, {100+200,200+50,200+100}, {1,1,1} };
float result[3][3] = {0};
void matmul(float a[3][3], float b[3][3])
{
int i,j,k;
int c[3][3];
for ( i = 0; i < ... | true |
3c9ee5218ad06254e0b222e0d67a415b54333f88 | C++ | andu1989anand/VTU_OOC_18CS45 | /C++/cincout.cpp | UTF-8 | 291 | 2.625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
char a[100];
string name;
cout<<"enter your name:";
// cin>>name;
cout<<"Hi "<<name<<", Greetings of the day";
int p=20;
int &x=p;
cout<<endl<<p<<endl<<x;
x++;
cout<<endl<<p<<endl<<x;
return 0;
}
| true |
504ad284bcec198486bb6f80b8a1df80724065a9 | C++ | CoBr8/eps-tlm-firmware | /src/avgVal.cpp | UTF-8 | 1,686 | 3.609375 | 4 | [] | no_license | /* *****************************************************
Function name : float avgVal(vector<float> vals)
returns : avg; the average value of the 18/20
samples
arg1 : vals; a 20 item vector containing raw
sensor values.
created by : Colton Broughton
Date creat... | true |
14e0ffdd87f31792fb9cd8c0db3f0b9a8a378b55 | C++ | huangqx/NRAlignment | /Code/Operation/NonRigid/target_point_generator.h | UTF-8 | 1,616 | 2.546875 | 3 | [] | no_license | #ifndef target_point_generator_h_
#define target_point_generator_h_
#include "linear_algebra_templcode.h"
#include "linear_algebra.h"
#include "data_container.h"
#include "octree.h"
#include <vector>
using namespace std;
struct RefSurfPara {
public:
RefSurfPara() {
gridRes = 0.01;
halfWindowWidth = 1;
... | true |
19dd43a4a05205f010ba12fa6bec393242a30376 | C++ | gridl/graphics-book | /Code/Chapter-2/intersect.cpp | UTF-8 | 1,804 | 3.015625 | 3 | [
"MIT"
] | permissive | bool doLinesCoincide ( const glm::vec2& n1, float d1,
const glm::vec2& n2, float d2 )
{
if ( glm::dot ( n1 , n2 ) > 0 ) // assume normals are both uni t
return fabs ( d1 - d2 ) < EPS;
else
return fabs ( d1 + d2 ) < EPS;
}
bool findLineIntersection ( const glm::vec2& n1, float d1,
... | true |
29de9044e086688303bf972bb87c8f65820f9e3f | C++ | Goalt/InformaticsSolutions | /Поиск и сортировки/Сортировка подсчетом/1406/main.cpp | UTF-8 | 1,493 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
bool isAnagram(string s, string t) {
int mas[256];
memset(mas, 0, sizeof(int) * 256);
for(int i = 0; i < s.size(); i++)
mas[s[i]]++;
for(int i = 0; i < s.size(); i++)
mas[t[... | true |
ea1e7dcb27cd1512ad6618b3306ff2b152337fdb | C++ | Bennigan88/QuantitativeEngine | /main.cpp | UTF-8 | 27,281 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
double xi, xf, vi, vf, ac, t;
char cxi, cxf, cvi, cvf, ca, ct;
bool bxi, bxf, bvi, bvf, ba, bt;
bool even(int x);
double f(double x);
int choose_coef_s(int i, int n);
int choose_coef_m(int i, int n);
int choose_coef_t(int... | true |
9eaa6694c5b3346c3d8c23bbb10f777ceaf1aaec | C++ | ezhou2008/algorithm-basic | /cpp1/JZ-312_474-Lowest-Common-Ancestor-II.cpp | UTF-8 | 4,041 | 3.90625 | 4 | [] | no_license | /*Lowest Common Ancestor II
Description
Given the root and two nodes in a Binary Tree.
Find the lowest common ancestor(LCA) of the two nodes.
The lowest common ancestor is the node with largest depth
which is the ancestor of both nodes.
The node has an extra attribute parent which point to the father of itself.
The... | true |
a234cec8a9299e7f59a21f0398faaac32859711b | C++ | hanaumc/SGpp | /datadriven/examplesPipeline/dataMatrixDatabase.cpp | UTF-8 | 5,707 | 2.875 | 3 | [
"LicenseRef-scancode-generic-exception",
"BSD-3-Clause"
] | permissive | // Copyright (C) 2008-today The SG++ project
// This file is part of the SG++ project. For conditions of distribution and
// use, please see the copyright notice provided with SG++ or at
// sgpp.sparsegrids.org
#include <sgpp/base/grid/Grid.hpp>
#include <sgpp/datadriven/algorithm/DBMatOffline.hpp>
#include <sgpp/data... | true |
2a073ce5d378332d100b2a18a0e735cd369d8964 | C++ | tolma488/censor | /censor/encoder.h | UTF-8 | 1,979 | 3.0625 | 3 | [] | no_license | #ifndef ENCODER_H
#define ENCODER_H
#include "includes.h"
#include "MyEx.h"
class Encoder
{
private:
using Byte = int8_t;
using ByteArray = shared_ptr<Byte>;
// asciiToUTFxx converts ascii string to utf string with BOM (BE - BigEndian / LE - LittleEndian)
static u16string asciiToUTF16s... | true |
4793a3c4bea5ef9ee8a613434c42ed88c0689060 | C++ | RobertDaleSmith/cosc-1410-help | /code/uh/lab-array.cpp | UTF-8 | 771 | 3.296875 | 3 | [] | no_license | #include <iostream> //Library included for Input/Output Functions.
#include <iomanip> //Library included for spacing and formating.
#include <ctime> //For generating random number based on the time.
using namespace std;
const int ARRAY_SIZE_INT = 10;
int numbers[ARRAY_SIZE_INT] = {1,2,3,4,5,6,7,8,9,10};
... | true |
ea9e955ea1db9087b84b04a5679caf1b47de2f80 | C++ | epakhomenko/LearningStroustrup | /function.cc | UTF-8 | 635 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | //
//Пример из 2.3.10
//
#include <iostream>
using namespace std;
struct pair {
char* name;
int val;
};
const int large = 1024;
static pair vec[large+1];
pair*find(const char* p)
/*
//работает со множеством пар "pair",
//ишет p, если находит, возвращает его "pair"
//в противном случае возвращает неис... | true |
8cea2cc116afd4c44778b0017f0226b0948cb661 | C++ | Jeffrey-W23/AIE-CodeFolio | /project2D/PathFindEntity1.cpp | UTF-8 | 2,199 | 2.734375 | 3 | [
"MIT"
] | permissive | // #include, using, etc
#include "PathFindEntity1.h"
#include "IdleState.h"
#include "FollowState.h"
#include "CollisionManager.h"
//--------------------------------------------------------------------------------------
// Default Constructor.
//-------------------------------------------------------------------------... | true |
748228628da64467bd3db93c6cfc8c1813a571fb | C++ | towa7bc/SpotifyWebApiAdapter | /src/detail/HttpHelper.hpp | UTF-8 | 1,899 | 2.515625 | 3 | [
"Unlicense"
] | permissive | //
// Created by Michael Wittmann on 01/05/2020.
//
#ifndef SPOTIFYWEBAPIADAPTER_HTTPHELPER_HPP
#define SPOTIFYWEBAPIADAPTER_HTTPHELPER_HPP
#include <string> // for string
#include <string_view> // for string_view
#include <unordered_map> // for map
#include "../model/modeldata.hpp"
namespace spotify {
i... | true |
6aad322dacdb3960a412d46ae52c15dc266f78b4 | C++ | TUS-OSK/lecture-classical-raytracer-2021 | /src/scene.h | UTF-8 | 1,917 | 2.890625 | 3 | [] | no_license | #pragma once
#define TINYOBJLOADER_IMPLEMENTATION
#include "external/tinyobjloader/tiny_obj_loader.h"
#include <vector>
#include "sphere.h"
#include "intersectinfo.h"
#include "ray.h"
#include "shape.h"
#include <memory>
#include <iostream>
#include "triangle.h"
bool loadObj(const std::string &filepath,std::vector<fl... | true |
8406696fa2b9d994af9272eafa91f93898779113 | C++ | rigged-regie/NGU-inputs | /api-injector/injector/main.cpp | UTF-8 | 2,303 | 2.859375 | 3 | [
"WTFPL"
] | permissive | #include <iostream>
#include <Windows.h>
#include <tlhelp32.h>
#include <thread>
namespace cfg {
char const* default_dll_name = ".\\api.dll";
char const* default_proc_name = "NGUIdle.exe";
}
template <typename ...Args>
void assert(bool cond, Args &&...args) {
if (cond) return;
std::cout << "asserti... | true |
34688b946b622954bcfe26a68a0efce432f3b37d | C++ | iv-sergius/oop | /lab3/1-car/RemoteControl.h | WINDOWS-1251 | 1,037 | 2.609375 | 3 | [] | no_license | #pragma once
#include <boost/noncopyable.hpp>
class CCar;
// boost::noncopyable -
class CRemoteControl : boost::noncopyable
{
public:
CRemoteControl(CCar & car, std::istream & input, std::ostream & output);
bool HandleCommand();
// ,
// CRemoteControl& operator=(const CRemoteControl &) = de... | true |
a0f6fc06ecf722e66ad3f11e87c4968e2e25303f | C++ | nikitos-net/- | /1.cpp | UTF-8 | 709 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
long int func(long int n){
n=abs(n);
int first, last;
if(n/10==0){
return 0;
}
last=n%100;
while(n/100!=0){
n=n/10;
}
first=n;
if (last==first){
return 0;
}
else{
return first-last;
}
}
int main(){
long int a, b, max, total=0;
cin>>a;
ci... | true |