blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
c3e6334ab5bdba8e0729d52cf340a70d27d45246 | 93c01845fe40947e525d31a02dfd004b02530fad | TheophilusE/THEOE11 | /Source/Projects/ProjectTemplate/UI/Settings/UIOption.cpp | C++ | cpp | 19,889 | permissive | #include "UIOption.h"
#include <Urho3D/Core/Context.h>
#include <Urho3D/Core/StringUtils.h>
#include <Urho3D/IO/Log.h>
#include <Urho3D/Input/InputEvents.h>
#include <Urho3D/Resource/Localization.h>
#include <Urho3D/Resource/ResourceCache.h>
#include <Urho3D/UI/Slider.h>
#include <Urho3D/UI/Text.h>
#include <Urho3D/UI/... |
c51cd0ea2977120a08f4e31d7432200029b29861 | a84cf9d5b1172d6851287a89adeab5e26a720ced | PacosMartini/goFish | /Game.cpp | C++ | cpp | 3,206 | no_license | #include "Game.h"
#include <iostream>
#include <string>
#include <time.h>
using namespace std;
/* ~~~ GO-FISH RULESET ~~~
Five cards are dealt from a standard 52-card deck to each player
The remaining cards are shared between the players, usually spread out in a disorderly pile referred to as the "ocean" or "p... |
b39ab2f5faaa553d0fbd25cf510542321d0a23e2 | 9cfeddcfa4a2a97b2998979d72d4b777b1d3581f | nwjs/chromium.src | /chrome/browser/ash/input_method/longpress_diacritics_suggester.cc | C++ | cc | 11,820 | permissive | // Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ash/input_method/longpress_diacritics_suggester.h"
#include <algorithm>
#include <string>
#include "base/containers/flat_map.h"
#include "base/loggin... |
ed6f3a47d1e1576fd40fc7059eb564fe20b8d7e2 | ae50c519d421d5758fab1edf0a757de054a260c4 | danielfilipealmeida/AlmondGUI | /Sources/ImageMatrix.cpp | C++ | cpp | 4,262 | no_license | //
// ImageMatrix.cpp
// ofxAlmondGUI
//
// Created by Daniel Almeida on 03/06/18.
//
//
#include "ImageMatrix.hpp"
ImageMatrix::ImageMatrix()
{
className = "ImageMatrix";
style.hasBorder = true;
style.hasBackground = true;
lastPressedCell = std::make_pair(-1, -1);
lastAddedIndex = 0;
}
Image... |
97b44142945c5447627396289e2602122b757745 | c00a1f991c357ac5be134f787e4b38820f9e4b8d | luxalpa/openhexplore | /src/game/engine_init.cpp | C++ | cpp | 5,248 | no_license | //
// Created by Smaug on 2020-07-09.
//
#include "engine_init.h"
#include "../globals.h"
#include <math.h>
#include "../filedb.h"
// @ 415D80
void sub_415D80() {
sub_42B820(397425);
}
// @ 42B820
void sub_42B820(int a1) {
dword_4E6198 = a1;
}
// @ 4089E0
void initAnimatedObjects() {
... |
517725824c010fef60e57e1cc187a288ddbe6678 | 28c0dd02f7988febba1cbb8e23acdae64aae9020 | xtmacbook/glEngine | /example/optimization/NvmultriDrawIndirect.cpp | C++ | cpp | 16,712 | no_license |
#include <scene.h>
#include "resource.h"
#include <gLApplication.h>
#include <camera.h>
#include <windowManager.h>
#include <glinter.h>
#include <gli.h>
#include <log.h>
#include <renderNode.h>
#include <engineLoad.h>
#include <texture.h>
#include <helpF.h>
#include <flashBuffer.h>
#include <vertex.h>
#include <log.h>... |
9f37df912cfbcad4a537818c760f268705cf2113 | 7497fdf778cf506cc5f7e6a83bac8adb03c01320 | ElRobertt/C | /classes.cpp | C++ | cpp | 1,258 | no_license | //CALCULADORA CON CLASSES//
#include <iostream>
#include <windows.h>
using namespace std;
class Calculadora
{
public:
void mostrarSuma (int a, int b)
{
cout << "La suma es:" << a + b << endl;
}
void mostrarResta (int a, int b)
{
if (a> b)
cout << "La resta es:" << a - b << endl;
if (b> a)
cout << "No se pu... |
a11faaa2f73f7e389d37f05393da6ff53cda2bff | 2eb60b422f6fe93f5c1751d438a08a16eacf0e4e | Shandilier/Competitive-Programming-1 | /Cpp/Practice/segmentTree1.cpp | C++ | cpp | 575 | no_license | #include<bits/stdc++.h>
using namespace std;
int segArray[1000001];
void segTree(int arr[],int n,int low,int high,int index)
{
if(low==high)
{
segArray[index] = arr[low];
return segArray[index];
}
int mid = (low+high)/2;
segTree(arr,n,low,mid,2*index+1);
segTree(arr,n,mid+1,high,... |
a599321954cca8afd3f1c5d1902d51e3d3de66e3 | a539da919d445ec7eccda5d33120031e74be6c34 | Linfanty/Code-in-Freshman | /西北大学并查集入门/A.cpp | C++ | cpp | 2,563 | no_license | #include <cstdio>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <sstream>
#include <cstdlib>
#include <stack>
#include <climits>
#include <queue>
#include <map>
#include <set>
#define IO ios_base::sync_with_stdio(0),cin.tie(0)
#define maxn 100... |
10b6f2e1ecd7c8d1756530df129849bf6662724c | bf11f2d2f3fe404dd5e907519c4eaf64c4afc2d7 | alexistoigo/Competitive-Programming | /String/suffix_array-o(n^2log n).cpp | C++ | cpp | 769 | no_license | #include <bits/stdc++.h>
#define IO std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL);
#define FIN freopen("entrada.txt", "r", stdin);
#define FOUT freopen("saida.sol", "w", stdout);
#define ull unsigned long long int
#define ll long long int
#define pii pair<int, int>
#define pb push_back... |
a054ab5a1ec1d13eced0f118937a2d05d6d0076f | fb8eb238403a6b2b22ff7a692a9723f0918bb6e8 | alexander-koval/HelloWorld | /Grafit/include/Grafit/Graphics/BitmapData.hpp | C++ | hpp | 689 | no_license | #ifndef IMAGEDATA_HPP
#define IMAGEDATA_HPP
#include <vector>
#include <Grafit/Graphics/Shader.hpp>
#include <Grafit/Graphics/OpenGL.hpp>
#include <Grafit/System/Types.hpp>
namespace gf {
class BitmapData {
public:
BitmapData(void);
~BitmapData(void);
bool loadFromFile(const std::string& filename);
... |
ba5d030bfe1ebca1dad065b4beb81d0d2ff5fa09 | 86514555d5fe537cf67dffd0c3e38541ce41590e | lineCode/zaf | /src/zaf/graphic/size.cpp | C++ | cpp | 264 | no_license | #include <zaf/graphic/size.h>
#include <zaf/parsing/parsers/size_parser.h>
#include <zaf/reflection/reflection_type_definition.h>
namespace zaf {
ZAF_DEFINE_EQUALITY_TYPE(Size)
ZAF_DEFINE_REFLECTION_TYPE(Size)
ZAF_DEFINE_PARSER(SizeParser)
ZAF_DEFINE_END
} |
15c7d73f581d88cb339454fece9f4062d4dc745c | 03e136b4a44a2c80b6aa24e40c73c346a590b9c6 | JiangKevin/gearoenix | /gearoenix/math/gx-math-matrix-4d.hpp | C++ | hpp | 19,606 | no_license | #ifndef GEAROENIX_MATH_MATRIX_4D_HPP
#define GEAROENIX_MATH_MATRIX_4D_HPP
#include "gx-math-vector-4d.hpp"
namespace gearoenix::math {
/// It is a column major matrix
template <typename Element>
struct Mat4x4 {
Element data[4][4];
constexpr Mat4x4() noexcept
: data {
{ static_cast<Element>... |
5e8ae1884acddd176b57673ca1452db2d6f92da8 | 795abdc45282de74e7581b5c9d8a0508b3fd1863 | BigRabbit6/liblcf | /src/generated/rpg_item.cpp | C++ | cpp | 1,182 | permissive | /* !!!! GENERATED FILE - DO NOT EDIT !!!! */
/*
* Copyright (c) 2014 liblcf authors
* This file is released under the MIT License
* http://opensource.org/licenses/MIT
*/
// Headers
#include "rpg_item.h"
/**
* Constructor.
*/
RPG::Item::Item() {
ID = 0;
name = "";
description = "";
type = 0;
price = 0;
us... |
976d13cf5dbb401c04701fb6b2627d0f92ec0c7f | 4baa62b20b2d68210a0da477a53f0ee9348b6b3e | rainingYao/CodeWars | /Kata/Vasya - Clerk/Vasya - Clerk.cpp | C++ | cpp | 2,467 | no_license | #include "stdafx.h"
#include "CppUnitTest.h"
#include <vector>
using namespace std;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace CodeWarsCpp
{
TEST_CLASS(VasyaClerk)
{
public:
string yes = "YES";
string no = "NO";
vector<int> v[2];
VasyaClerk()
{
v[0] = { 25, 25, 50, 50 }... |
dc0079329b12cadbab180b04fab70a4464ea69e6 | 22f1fbdfb3a55b8b72b1d1289e138430c40ad351 | suxinde2009/Source | /Engine/Pipeline/PBRPipeline.cpp | C++ | cpp | 16,479 | no_license | #include "PBRPipeline.h"
#include "RenderTarget.h"
#include "SceneManager.h"
#include "engine_struct.h"
#include "ResourceManager.h"
#include "pass.h"
#include "RenderSystem.h"
#include "TextureManager.h"
#include "EGLUtil.h"
#include <random>
#include "Image.h"
#include "Texture.h"
void PBREffect::Init()
{
auto& rt... |
9cdc6fafbe26a6b190670376d4200dc4cbe9255d | ceaa6801db89c7a3a3cf0dd1939bf6a2e2c8db27 | vvasco/gazebo | /gazebo/gui/building/BuildingEditor.hh | C++ | hh | 3,363 | permissive | /*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... |
3e191814ea45cf145dc17d1999091c31e8489ff1 | e77dbe9d37134052224e1fd7f74c7a9a10c90705 | paupedra/SematEngine | /SematEngine/SourceCode/Main.cpp | C++ | cpp | 1,766 | permissive | #include <stdlib.h>
#include "Application.h"
#include "Globals.h"
#include "Dependecies/SDL/include/SDL.h"
#pragma comment( lib, "Dependecies/SDL/libx86/SDL2.lib" )
#pragma comment( lib, "Dependecies/SDL/libx86/SDL2main.lib" )
#include "Dependecies/Brofiler/Brofiler.h"
#pragma comment (lib, "Dependecies/Brofiler/Pro... |
ce6c501a8dcbdaacaf34bbb7668a16f56f55d530 | 8ab46fc66c6c6d8be1b155f5a4f84ffc6a82ee7d | emranCoder/Algos | /DFS+Merge Sort Tree.cpp | C++ | cpp | 2,141 | no_license | /*
You will be given an edge weighted graph with N nodes numbered from 1 to N.
If we want to drop all edges with weight lower than C, how many nodes will still be reachable from node 1?
*/
#include<bits/stdc++.h>
using namespace std;
#define MX 50000
vector<pair<int,int> >vec[MX];
vector<int>tree[4*MX... |
453e09783c7de31470b79dee2c2d830c461b44a7 | fd986f1babc4639c2cf2dbb0d139d1afe4f738fc | Ruben0303/Hackerrank | /Hash-Tables-Ice-Cream-Parlor.cpp | C++ | cpp | 2,792 | no_license | #include <bits/stdc++.h>
#include <algorithm>
#include <utility>
class Hash{
std::vector<std::vector<std::pair<int,int>>> hash;
int n;
public:
Hash(int n) : n(n) {hash.resize(n);}
void insert(int val, int ind)
{
int i = val % n;
hash[i].pus... |
2c02abce89a27e497fdc2e292a6aab51a7cbf5d9 | 351319abb4c543d4753196e5b6c1345088f3184b | visper/basicSample_iviLink-oldVersion | /iviLink/iviLink/include/common/UID.hpp | C++ | hpp | 1,350 | no_license | /*
* iviLINK SDK, version 1.2
* http://www.ivilink.net
* Cross Platform Application Communication Stack for In-Vehicle Applications
*
* Copyright (C) 2012-2013, Luxoft Professional Corp., member of IBS group
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the ... |
f28f7807e552102890c394c44e419ed163a0fc8a | 49bd1deb3af95614f9c628930197e2e5d13b0cd3 | bruce/rubinius | /vm/capi/class.cpp | C++ | cpp | 4,656 | permissive | #include "builtin/class.hpp"
#include "builtin/module.hpp"
#include "builtin/symbol.hpp"
#include "helpers.hpp"
#include "capi/capi.hpp"
#include "capi/ruby.h"
using namespace rubinius;
using namespace rubinius::capi;
extern "C" {
VALUE rb_class_new_instance(int arg_count, VALUE* args, VALUE class_handle) {
r... |
367b578c884f246c7ffab5ffb6336ccf478b248a | bb049979c641734b580ac756b060a952c7f6cb1a | huxingyi/dust3d | /application/third_party/fbx/src/fbxdocument.cpp | C++ | cpp | 10,140 | permissive | #include "fbxdocument.h"
#include "fbxutil.h"
using std::string;
using std::cout;
using std::endl;
using std::ifstream;
using std::ofstream;
using std::uint32_t;
using std::uint8_t;
namespace fbx {
FBXDocument::FBXDocument()
{
version = 7400;
}
void FBXDocument::read(string fname)
{
ifstream file;
// bu... |
1b7e2fd07d6be620cd62b856b96e95882c992315 | 405b0a6d8ed2f070c69589c48e62de86dabd1631 | wtmarcek/WTEngine | /WTEngine/src/WTEngine/Math/Geometry/Triangle.cpp | C++ | cpp | 294 | no_license | #include "wtfpch.h"
#include "Triangle.h"
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include <glad/glad.h>
WTF::Triangle::Triangle()
{
float vertices[] =
{
-0.5f, -0.5f, 0.0,
0.5f, -0.5f, 0.0,
0.0f, 0.5f, 0.0
};
unsigned int VBO;
glGenBuffers(1, &VBO);
}
|
8a59c44e9c9965ed05c135e50eb050988a166f33 | 64b172d3f83c5c1edfec58d8d3c83c3d3d98ab0f | eduardodextil/PowerToys | /src/modules/fancyzones/FancyZonesLib/Layout.cpp | C++ | cpp | 11,018 | permissive | #include "pch.h"
#include "Layout.h"
#include <FancyZonesLib/FancyZonesData/CustomLayouts.h>
#include <FancyZonesLib/FancyZonesWindowProperties.h>
#include <FancyZonesLib/LayoutConfigurator.h>
#include <FancyZonesLib/Settings.h>
#include <FancyZonesLib/WindowUtils.h>
#include <common/logger/logger.h>
namespace ZoneS... |
7f39fe4b35206ac46bf3137baf0917819f86f488 | 2d91f8a0cc0ed6cfd95663d85b6e21f51f912422 | rim0621/Algorithm-study | /4.DynamicProgramming/exchangeCoin.cpp | C++ | cpp | 1,886 | no_license | #include<bits/stdc++.h>
using namespace std;
void countCoin(int *coin, int *coinUsed,int *coinLast,int money,int n)
{
coinUsed[0]=coinLast[0]=0;
for(int k=1;k<=money;k++)
{
int minCoin=k;
int newCoin=1;
for(int i=0;i<n;i++)
{
if(coin[i]>k)
{
continue;
}
if(coinUsed[k-coin[i]]+1<minCoin)
{... |
c2bc0f943d461160c278085ffc739aeda50412de | ff92f946887c009ece3bc06926864ac21e5bda98 | BakiAdol/Techonique | /Divide and Conquer/01_SeriesSumModM.cpp | C++ | cpp | 589 | no_license | // (x + x^2 + x^3 + x^4.....)%m = ?
#include<bits/stdc++.h>
using namespace std;
int bigMod(int num, int power, int mod)
{
if(power==0) return 1;
int v=bigMod(num,power/2,mod);
v= (v*v)%mod;
if((power&1)==1) v=(v*num)%mod;
return v;
}
int seriesSum(int x, int element, int mod)
{
int ans=0;
if(e... |
55944e47d967b48d147c68f915d15ce98ff8873a | 3819b96f7768423c1d77930e675077901646117b | Griizz/Fortnite-Hack | /SDK/FN_MissionGen_BuildtheRadarGrid_classes.hpp | C++ | hpp | 686 | no_license | #pragma once
// Fortnite SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass MissionGen_BuildtheRadarGrid.M... |
4cd95b006a97a14244014384fa20c9a339a3f2f6 | e8cbd35c2ec3168276f21dcde5fbaa1d702fa275 | Toinoux/Epitech | /cpp_indie_studio/src/Object/APowerUp/PowerRange.cpp | C++ | cpp | 259 | no_license | /*
** EPITECH PROJECT, 2018
** PowerRanger
** File description:
** Class PowerRange
*/
#include "PowerRange.hpp"
bbm::PowerRange::PowerRange(const int pos)
: APowerUp(1, false, pos)
{
}
void bbm::PowerRange::assignPlayer(bbm::ICharacter &character)
{
}
|
ab4607c72382c3d80a76d6d7c943f4b9c05163da | 87737a8b0d79b2c2d3aa5563930fc6063a3f5fd3 | jjzhang166/WinNT5_src_20201004 | /NT/windows/advcore/ctf/sapilayr/propstor.cpp | C++ | cpp | 105,202 | no_license | //
// property store class implementation
//
// includes
#include "private.h"
#include "globals.h"
#include "sapilayr.h"
#include "propstor.h"
#include "ids.h"
#include "cicspres.h"
#include "lmlattic.h"
#ifdef DEBUG
#include "wchar.h"
void DebugPrintOut(WCHAR *pwszStrName, WCHAR *pwszStr)
{
... |
10116d60833724f3953e28ef898a9cea7682a102 | db956c75247451814af2254af22a2e255f7eb262 | Wytchwood/unified | /Plugins/Administration/Administration.cpp | C++ | cpp | 25,459 | permissive | #include "Administration.hpp"
#include "API/CAppManager.hpp"
#include "API/CExoString.hpp"
#include "API/CNetLayer.hpp"
#include "API/CNetLayerPlayerInfo.hpp"
#include "API/CNWSPlayer.hpp"
#include "API/CNWSCreature.hpp"
#include "API/CNWSCreatureStats.hpp"
#include "API/CServerExoApp.hpp"
#include "API/CServerExoAppIn... |
abb9af56165fa3d252e21ef7e75d2af1679a5520 | 0c04ef75b35a08b00decc360d51621b06947cf78 | 3013216006/ACM | /9-17/12.cpp | C++ | cpp | 234 | no_license | #include <iostream>
using namespace std;
int main(){
int T;
scanf("%d",&T);
while(T--){
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i].x);
a[i].id=i;
}
sort(a+1,a+n+1,cmp);
memset(dp,0,sizeof(dp));
}
}
|
63ce1e5de96c97cf97f70da612e1c8668b880a63 | 9f5718c2160e552813de000a814603993beefe78 | Hyukli/leetcode | /211.cpp | C++ | cpp | 2,964 | no_license | #include<iostream>
#include<string.h>
#include<vector>
#include<map>
using namespace std;
class WordDictionary {
public:
/** Initialize your data structure here. */
WordDictionary() {
}
/** Adds a word into the data structure. */
void addWord(string word) {
m[word.size()].push_back(word);... |
8d580c7061a2c354aba5198366d954c525fea3ec | 9947e24e2fdbc4ef870307f4dee3905fcdf9bd85 | NaruFGT/xcbuild | /Libraries/xcassets/Sources/Asset/MipmapSet.cpp | C++ | cpp | 2,396 | permissive | /**
Copyright (c) 2015-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
*/
#include <xcassets/Asset/MipmapSet.h>
#include <plist/Keys/Unpack.h>
#include <plist/Array.h>
#include <plist/Boolea... |
c949e52c2cf626a52b4e2a21351cbfc7f1358a61 | d33babc0005f35414ca30cc61645703fc7876910 | SamuelPavlik/MyGameEngine | /MyGameEngine/main.cpp | C++ | cpp | 252 | no_license | #include <SFML/Graphics.hpp>
#include "Game.hpp"
int main() {
Game game;
while (game.IsRunning()) {
game.CaptureInput();
game.Update();
game.LateUpdate();
game.Draw();
game.CalculateDeltaTime();
}
} |
ee94d3b6d6ac1e51cd4194cb424f6f3e2d4f7cd7 | d73daeac081a5fa31440a9aec5c95cb0b6b142e0 | weirme/leetme | /65.valid-number.cpp | C++ | cpp | 2,466 | no_license | #include <string>
#include <stdlib.h>
using namespace std;
class AutoMachine {
private:
int state = 0;
public:
void step(char c) {
switch (state) {
case 0:
if (isspace(c));
else if (isdigit(c)) state = 1;
else if (c == '+' || c == '-') state... |
21647210a6e46677f87932b1202bd099e90033b6 | fb93b3c732811a259ef9a5fbe73efec3d54eaa98 | CU-0xff/juliet-cpp | /000/248/668/CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnv_72a.cpp | C++ | cpp | 5,843 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnv_72a.cpp
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-72a.tmpl.cpp
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: listen_socket Read data usin... |
801a3270fae2af647a75e83614ff71c8405b2cec | 51e0ebe63f5db7f4ca0650e59746f9dad8e57d00 | sdsmt-blue-team/Programming-Team-Code | /dontKnow/geometry1.cpp | C++ | cpp | 6,333 | no_license | // C++ routines for computational geometry.
double INF = 1e100;
double EPS = 1e-12;
struct PT {
double x, y;
PT() {}
PT(double x, double y) : x(x), y(y) {}
PT(const PT &p) : x(p.x), y(p.y) {}
PT operator + (const PT &p) const { return PT(x+p.x, y+p.y); }
PT operator - (const PT &p) const { return PT(... |
7ba9bc92c6e5dee6fc42b2dd198e0eceacf76634 | dcaa7f1bb8f0d25cf791b247dd11b9876e0ad25b | Edward-jiang495/ImageLab | /ImageDSPUtils/opencv2.framework/Headers/contrib/openfabmap.hpp | C++ | hpp | 12,807 | no_license | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
71ab5576c4153548aa731f754c03e17691870c4d | 77757ea74416b4b4de1749a69cfec5275df53ca3 | gary-zhh/Computer-Science-Skill | /Algorithms/Count_Primes.cpp | C++ | cpp | 856 | no_license | /************************************/
/* */
/* Count_Primes */
/* */
/************************************/
// param:
// int n : non-negative number
// return:
// the number of prime numbers less than the non-negative number n
// ... |
66cb759cbad30bea1626d034fedf85fda6fba31a | 6105c2dcbeb0ae808c66b14b141d4c381380e924 | vloxomire/WildGunman | /WildGunMan/src/engine.cpp | C++ | cpp | 1,937 | no_license | #include "engine.h"
#include<iostream>
Engine::Engine(int windowWidth,int windowHeight,std::string windowTitle)
:m_renderWindow(*(new sf::RenderWindow(sf::VideoMode(windowWidth,windowHeight),windowTitle)))
{
m_isRunning=true;
}
Engine::~Engine()
{
delete &m_renderWindow;
}
bool Engine::getIsRunning()const
{
... |
161ecb67af5c26996eb66b29e08654083fd7db40 | fae7c6ff17e4db0944f8a76e3039fba92e2cf6df | airloaf/ChipM8-Core | /tests/InterpreterInitialization.cpp | C++ | cpp | 5,041 | no_license | #include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
#include <ChipM8/System/Interpreter.h>
// Alias namespace to bdata
namespace bdata = boost::unit_test::data;
BOOST_AUTO_TEST_SUITE(InitializationTests);
/**
* Ensures the register starts with th... |
42a2275cd4a66c2933162486cd3166e5f4c6c55e | e2ff8703948185c289ce9b0a9e01c140a669c6db | yeshwanthsomu/Grades_Calculator | /GradesCalculations.cpp | C++ | cpp | 2,801 | no_license |
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
typedef struct{
char ID[8];
char last_name[30];
char first_name[30];
double labs[15];
double hw[15];
double midterm;
double final;
}Grade;
double percentange(Grade *G);
double overall(Grade *G);
int main(int argc, char... |
caf364568b992dbd6b79c8ff3b9a41f5cad52484 | 3c74971ba54729bcceb464a6c4e64c176fd80508 | bathepawan/chromium | /chrome/browser/ui/browser_navigator.cc | C++ | cc | 33,927 | permissive | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/browser_navigator.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "base/command_... |
03f9891f2960bb65636b720e1be1384581c46e81 | 7d2e5ba138a74cac0cfcabba9539721188f16c12 | lakulako/media-driver | /media_driver/agnostic/gen11_icllp/media_interfaces/media_interfaces_g11_icllp.cpp | C++ | cpp | 18,821 | permissive | /*
* Copyright (c) 2017, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publis... |
81ae5176f29b22bd6bbd83586be0cb733a8ee94c | 0f99abf1eb1556daab321e61b03c2e7f81f626c3 | firstep710/coding-test | /프로그래머스/Level_1/09.cpp | C++ | cpp | 270 | no_license | #include <string>
#include <vector>
using namespace std;
string solution(string s) {
string answer = "";
if (s.length() % 2)
answer = s.substr(s.length() / 2, 1);
else
answer = s.substr(s.length() / 2 - 1, 2);
return answer;
} |
0d0fa22d98acdccbd0a730b30ef873b561c9fb43 | d4aff499cda54288408c8803b1dbd9a50d3747ed | habibrahmanbd/Code-Lab | /Important Algorithm (Dip Vai)/Important Algorithms BY DIP VAI/LongestPathInTree.cpp | C++ | cpp | 5,053 | no_license | //#pragma warning (disable: 4786)
#include <sstream>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <complex>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>
... |
4ddea2b6a87376c06e667f8197628432bf92868a | da8b87babc2dd4bfbc53d3bf0376feb08a2297dc | triSYCL/sycl | /llvm/lib/CodeGen/TargetLoweringBase.cpp | C++ | cpp | 90,371 | permissive | //===- TargetLoweringBase.cpp - Implement the TargetLoweringBase class ----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
673720551862073f61c4cb95a8063d60a38b2c69 | 99997d1e5cfc48715ab6f18100676e258cdccf02 | godinj/PlayRho | /PlayRho/Common/Math.cpp | C++ | cpp | 7,774 | permissive | /*
* Original work Copyright (c) 2007-2009 Erin Catto http://www.box2d.org
* Modified work Copyright (c) 2017 Louis Langholtz https://github.com/louis-langholtz/PlayRho
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* a... |
2c4a75a1ac09de3d8f2117f6a608ee95e534387c | 70bc4e516270781365d6e4aa42c163ebf257acfb | ibrahimtastan/Approximate-CPU-with-RISCV | /hls/tb_old.cpp | C++ | cpp | 3,184 | no_license | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <math.h>
#include "datapath.hpp"
int main()
{
//uint32_t indx = 0;
//uint32_t inst;
//data_path(0x30000113); // init Stack Pointer 768
//todo
/*
data_path(0x7f010113); // init Stack Pointer 2032
data_path(0x7f01011... |
50f52cefa3cb3060d1be10fb537f6e01e49f96ef | f02861e10f1be9f3f3eb132e7ff5c28b09ad0e43 | mhochsteger/blaze | /blazetest/src/mathtest/smatdmatschur/MCbDDb.cpp | C++ | cpp | 4,155 | permissive | //=================================================================================================
/*!
// \file src/mathtest/smatdmatschur/MCbDDb.cpp
// \brief Source file for the MCbDDb sparse matrix/dense matrix Schur product math test
//
// Copyright (C) 2012-2019 Klaus Iglberger - All Rights Reserved
//
// Thi... |
0536add054a607bbc95f8c9c7935f7eec9cd4437 | ab2e8775ba32575b5a08a122c8cb1eee254e211a | ccoincharity/ccoin | /src/rpcmining.cpp | C++ | cpp | 18,811 | permissive | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "main.h"
#include "db.h"
#include "txdb.h"
#include "init.h"
#include "miner.h... |
2f255d9f88fb6b3c01458ddad54f9a39a4662657 | c60b0f5d126e264fcafbca0ca219836f8bc35e63 | KaisHasan/UVa | /UVA_10006_Carmichael_Numbers.cpp | C++ | cpp | 1,554 | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int , int> pi;
typedef pair<double , int > dpi;
typedef pair<long long , long long> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef unsigned long long ull;
#define MP make_pair
#define mem(a , v) mems... |
c2e51aae31b3597ca4cfef4092d4db7599a8f999 | 33b2f7ed2ee5ed55d36e0110b732ad71820b3426 | Automannn/automan_jvm | /native/sun_misc_VM.cpp | C++ | cpp | 582 | no_license | //
// Created by 14394 on 2020/2/27.
//
#include "../automan_jvm.h"
#include "sun_misc_VM.h"
#include <vector>
#include <algorithm>
#include <cassert>
#include "native.h"
static unordered_map<wstring, void*> methods = {
{L"initialize:()V", (void *)&JVM_Initialize},
};
void JVM_Initialize(list<Oop *> & _st... |
27077fb29b38cff2271e8bc7633e7b6045179150 | e7c3b299d88316755a874d6c20cf2cda4345a1a6 | 15800688908/poj-codes | /3417/7453371_WA.cpp | C++ | cpp | 2,184 | no_license | #include<stdio.h>
const int maxn=200100;
int m,n,tot,sum;
int a[maxn],b[maxn],c[maxn],d[maxn];
int flag[maxn],father[maxn];
struct node
{
int x,y,next;
};
node e[maxn],tree[maxn];
void add(node *e,int *q,int x,int y)
{
++tot;
e[tot].x=x;
e[tot].y=y;
e[tot].next=q[x];
q[x]... |
fb7ff9c9e9b40db08d7299dd74eb5a8f9ce178ef | 88ded44464747e51a04524748a345f66122ea03f | iop90cwl/Tri-Tech-Digi | /pythtriple-cwc-class.cpp | C++ | cpp | 921 | no_license | // example: Pythagorean Triple Check class example
// save file as pyth-triple-intials.cpp example pyth-triple-intials-cwc.cpp)
// https://github.com/tritechsc/PythagoreanTriple
#include <math.h>
#include <iostream>
using namespace std;
class CalcPythagorean {
int a, b;
public:
void set_values (int,int);
... |
cedcac2ca8ac2c31086b38fc31643b49588aa8ee | 2395a789b7a34072be44a6798410c89344ace1cf | saleh1204/FaceRecognitionProject | /GUI/mainwindow.cpp | C++ | cpp | 7,303 | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
#include <iostream>
#include <pthread.h>
//#include <QtGui/QApplication>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsPixmapItem>
#include <stdio.h>
#include "opencv2/core/core.hpp"
#include "opencv2/contrib/contrib.hpp"... |
fde2ff43c2838d38f4bfffd64b9c7994812f9ac1 | edf6e7e4318895c99b3d6026df848c0b5aa2c57b | sakerbuild/performance-comparisons | /msvc-cluster-realistic-1000/src/dir_13/perf675.cpp | C++ | cpp | 294 | no_license | #include <Windows.h>
#include <vector>
#include <inc_7/header_145.h>
static_assert(sizeof(GenClass_145) > 0, "failed");
#include <inc_9/header_187.h>
static_assert(sizeof(GenClass_187) > 0, "failed");
std::vector<int> perf_func_675() {
LoadLibrary("abc.dll");
return {675};
}
|
366637105ad447bea7914d5f136c2be1d8c50061 | 6df30321d63db8d9c5bc2369ee597990302dc1d0 | Trisfald/mixme | /mixme/gift/type_properties.hpp | C++ | hpp | 2,053 | permissive | // Copyright (C) 2017 Andrea Spurio. All rights reserved.
//
// Licensed under the MIT License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in wri... |
797160be6a566cab7bc145610620ae0d54ed475e | 663bfdcd4bbe0ee3791fb4414f387b370dad92d9 | knagakura/procon_library | /test/DPL_5_A.test.cpp | C++ | cpp | 322 | no_license | #define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/library/7/DPL/all/DPL_5_A"
#include "../macro/macros.hpp"
#include "../math/mint.hpp"
/*
@title 玉区別する、箱区別する、制限なし($k^{n}$)
@category 写像12相
*/
int main(){
int n, k;
cin >> n >> k;
cout << mint(k).modpow(n) << endl;
} |
f7c5e70546aad672fc02a60fecf6864770805928 | 5c425d065892b619698f7aa152029eb9aad97347 | st3v3nmw/competitive-programming | /codechef/GCD_and_LCM.cpp | C++ | cpp | 1,432 | permissive | #include <bits/stdc++.h>
using namespace std;
#define eol "\n"
#define _(x) #x << "=" << to_str(x) << ", "
#define debug(x) { ostringstream stream; stream << x; string s = stream.str(); cout << s.substr(0, s.length() - 2) << eol; }
string to_string(basic_string<char>& x) { return "\"" + x + "\""; }
string to_string(ch... |
84e9307d54eef2f4627cce2f62cc5f26db9d42ca | c55dd392f7730e1b455f13f13d92e5c937fd6010 | my04337/libsynthpp | /libsynthpp/src/lsp/midi/sequencer.hpp | C++ | hpp | 804 | permissive | /**
libsynth++
Copyright(c) 2018 my04337
This software is released under the MIT License.
https://opensource.org/license/mit/
*/
#pragma once
#include <lsp/core/core.hpp>
namespace lsp::midi
{
// SMFファイル シーケンサ
class Sequencer
: non_copy_move
{
public:
Sequencer(juce::MidiInputCallback& receiver);
~Sequenc... |
10f5da0acf2ee572821b63a5337cd01e98cd8dc2 | 945f6b6166f454dd8e67689004a3bfda2a7015ac | 736229999/zzy_fish | /Trunk/frameworks/runtime-src/Classes_backup/library/hall/FrameData.cpp | C++ | cpp | 57,956 | no_license | #include "FrameData.h"
#include "SpriteStdafx.h"
#include "CCLuaEngine.h"
#include "ByteArray.h"
#include "CMD_LogonServerRef.h"
#include "HelloWorldScene.h"
#include "SDKControl.h"
#include "network/HttpClient.h"
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)
#include "NDKHelper.h"
#endif
CFrameData* GetFrameData(){
... |
140d7f1ace5330caa7f7e6a272bf879b04fecbf2 | 00f524101cae57707576f8b1e8ac01cc449cf927 | fewo/appleseed | /src/appleseed/renderer/modeling/edf/coneedf.cpp | C++ | cpp | 8,681 | permissive |
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited
// Copyright (c) 2014 Francois Beaune, The appleseedhq Organization
//
// Pe... |
65e9ef17f8355525779b28e0534712df688607c3 | ca9ec29d209bfe95216c58539ff60c044e4685a8 | eagletmt/procon | /poj/3/3517.cc | C++ | cc | 389 | permissive | #include <cstdio>
using namespace std;
int josephus(int n, int k, int s)
{
long long x = static_cast<long long>(k)*s;
while (x > n) {
x = ((x-n)*k-1)/(k-1) ;
}
return x;
}
int main()
{
int N, K, M;
while (scanf("%d %d %d", &N, &K, &M) != EOF && N != 0) {
const int ans = ((josephus(N, K, N) - K + M... |
1591b433bdc4cbe216936dd3fa9f81a6adc89d8b | 1fb5b35cf0978bef302e6caefdb9a5ee9444194b | P3ntagon/Section_04_BattleTank | /BattleTank/Source/BattleTank/TankPlayerController.cpp | C++ | cpp | 552 | no_license | // Copyright Marlon Schacherl 2018
#include "TankPlayerController.h"
void ATankPlayerController::BeginPlay()
{
Super::BeginPlay();
auto ControlledTank = GetControlledTank();
if (!ControlledTank)
{
UE_LOG(LogTemp, Warning, TEXT("PlayerController not possessing a tank"))
}
else
{
UE_LOG(LogTemp, Warning, TE... |
c774ad920b5f6da62e8b32c1cd16b0654f9f1efa | 92e2cd15460940402632b50b2875a6d12736d235 | starmap0312/leetcode | /implement_strStr.cpp | C++ | cpp | 1,035 | no_license | /* - when subtracting size, eg. vector v; v.size() or string s; s.size(), remember to explicitly
* convert the type into signed int, otherwise negative value will underflow to large positive
* - C function strstr() of string.h ==> char s[] = "a simple string";
* char * ptr = strstr(s, "simple") is the first mat... |
d07540ae0b0e23af839b7bf4004314aa2479a513 | f6885fe76c8ce617145fc63c1e0539e649983b3c | alexandraback/datacollection | /solutions_2645486_0/C++/zjwoody/3.cpp | C++ | cpp | 993 | no_license | #include<iostream>
#include<string.h>
#include<vector>
#include<stdio.h>
#include<algorithm>
using namespace std;
int arr[15];
int dp[15][10];
int T, E, R, N;
int ans;
int solve(int a, int e)
{
if(e<0)
return 0;
if(e>E)
e = E;
if(dp[a][e])
return dp[a][e];
int t = e, s = e;
for(int i =... |
9cb8930fd3792c1397dab09346315aa0b2f64a6e | 6b16e42449f34bf9a7fb44e6439c7f2a3e468d56 | Sarwar05/LightOJ | /1379 - Toll Management.cpp | C++ | cpp | 2,336 | no_license | #include<bits/stdc++.h>
using namespace std;
#define mx 10004
#define inf 1000000000
vector<int> adj[mx],cost[mx];
vector<int> rev[mx],rcost[mx];
int dist1[mx],dist2[mx];
struct Node
{
int now;
int weight;
Node(int a, int b)
{
now = a;
weight = b;
}
bool operator<... |
ad2c90038e61a75147f544c82a7d18a413a3ecb8 | 4bc45e8c589b56bd663d40d302b927b417d822ae | chandler767/FusionPanel-OLD | /src/Hardware/Buzzer.hpp | C++ | hpp | 334 | no_license | /*
* Buzzer.h
*
* Created: 13/11/2014 22:56:34
* Author: David
*/
#ifndef BUZZER_H_
#define BUZZER_H_
namespace Buzzer
{
void Init();
void Beep(uint32_t frequency, uint32_t ms, uint32_t volume);
void Tick();
bool Noisy();
const uint32_t MaxVolume = 5;
const uint32_t DefaultVolume = 3;
}
#endif /*... |
becd9f82f2650d801933f8fb888d3d99b782caa2 | e2bbe406c35acde81851687a2e824bb91adb65fc | pingsoli/cpp | /basics/timer.cpp | C++ | cpp | 724 | no_license | #include <chrono>
#include <iostream>
#include <thread>
class Timer
{
private:
using clock_t = std::chrono::high_resolution_clock;
using milli_t = std::chrono::duration<double, std::milli>;
std::chrono::time_point<clock_t> m_begin;
public:
Timer() : m_begin(clock_t::now())
{
}
void reset()
{
m_b... |
2c25096e7b1ed3b89c950ffa8fcc71ce1868f642 | d5402cb52f8cda97852d765b24def09b37db7af9 | FrameSoftware/OPTIC_LASER | /main.cpp | C++ | cpp | 679 | no_license | #include <QApplication>
#include <QStyleFactory>
#include "appmanager.h"
#include "interauthentif.h"
#include "acceuil.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QApplication::setStyle(QStyleFactory::create("Fusion"));
a.setWindowIcon(QIcon("icon_op+.png"));
//a.setStyleSheet("QPushButt... |
8505c0d92f92ad2845176fba56a5bd645e198689 | e9eee391e32e980ff1267ce2397cfa8254099104 | cnyy7/dayi | /大一上/程序设计基础/hanjia/成绩排序.cpp | C++ | cpp | 1,163 | no_license | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<iostream>
#include<math.h>
#include<map>
#include<algorithm>
using namespace std;
struct student{
char name[21];
int s;
int b[11];
int summ;
};
struct score{
int already=0;
int sco;
};
bool cmp(struct student a,struct student b);
struct score scores... |
62b07f51a1d45e21f176cb6b6ba77be531d76f9d | 3e3dd74948b5d9c2888fb3f4dfced40321524485 | Shivabindraban/CSDgitmap | /csd2b/C++/Inheritance/main.cpp | C++ | cpp | 854 | no_license | #include "percussion.h"
#include "strings.h"
#include "drumset.h"
// #include <iostream>
using namespace std;
int main(){
//Construct
Drumset drum1("BassKick");
Drumset drum2("Snare");
Drumset drum3("Tom");
Drumset drum4("Fault BassKick");
Percussion percussion1("Tabla");
Percussion percussion2("Shakers"... |
851c16d5c480a7bcd6e552e02706b5c574c99c19 | 09c14e901f6c4874c51f579093993219ca1279de | codeAligned/acm-icpc-1 | /Poland/PA/2015/haz.cc | C++ | cc | 2,396 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
struct FastIO {
static const int S = 2310720;
inline int xchar() {
static char buf[S];
static int len = 0, pos = 0;
if (pos == len)
pos = 0, len = fread(buf, 1, S, stdin);
if (pos == len) return -1... |
a488c2200fae96ca81942482c17729d19dc97c77 | d5a3c124c6564d8c2a75d94a9fa697c785b589a6 | FredericCanaud/AlgorithmesC-CPP | /Bibliotheque/fonctionsGestionLivre.cpp | C++ | cpp | 9,028 | no_license | #include <iostream>
#include <string>
#include "Livre.h"
int RecherchePosition(biblio bib, string titre) // Recherche la position d'un livre dans la bibliothèque
{
int i;
int num;
num = -1;
for (i = 0; i <= bib.nb_livres - 1; i++)
{
if (titre == bib.liste_livre[i].titre)
{
num = i;
}
}
... |
bbb90751a9c551d7a027083f0d178a1555f9133a | 44060b7e14b3dfc714b69fb6b2e841abc470f0de | SephirothBizarro/GithubGameOff | /GlitchPrototype/Temp/StagingArea/Data/il2cppOutput/Il2CppCompilerCalculateTypeValues_4Table.cpp | C++ | cpp | 146,120 | no_license | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "class-internals.h"
#include "codegen/il2cpp-codegen.h"
#include "object-in... |
72c66e79cbc5e7788e5b5d825048ed5392a39f2d | 5e23106072167867093cbd012f09f00d43742a84 | awyhhwxz/KiteOpenGLDriver | /KiteOpenGLDriverCore/RenderItem/RenderItem01.cpp | C++ | cpp | 5,953 | permissive | #include "stdafx.h"
#include "RenderItem01.h"
#include "KiteDriverMouseController.h"
#include "KiteDriverGeometryGenerator.h"
#include "KiteDriverGrayPostEffect.h"
#include "KiteDriverBlurPostEffect.h"
#include "KiteDriverHighLightingPostEffect.h"
#include "KiteDriverFastAccess.h"
using namespace kite_math;
using name... |
b54f73513090a467e27a99d68eb4adaae62b12b6 | dfcd1a4502c9ab69d7ecacfe3a66ea4e9822715a | parsa/blaze | /blazetest/src/mathtest/operations/dvecsvecadd/V3bVCb.cpp | C++ | cpp | 3,807 | permissive | //=================================================================================================
/*!
// \file src/mathtest/operations/dvecsvecadd/V3bVCb.cpp
// \brief Source file for the V3bVCb dense vector/sparse vector addition math test
//
// Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
//
// ... |
61df0179dfafbf07d6d3d587f8ccd248c63003d9 | a041e02197d35f186aaabc37f2d56c11ab6cca38 | sdk-team/aliyun-openapi-cpp-sdk | /ehpc/src/model/ListVolumesRequest.cc | C++ | cc | 1,577 | permissive | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... |
e23c7a5dfa7a2bfafea28facf8fcc778f2e87705 | 4261518a09a06adfca8a88603d4d42399347c955 | praveen4698/competitiveProgrammingWithCpp | /contest/edu_41/sixth.cpp | C++ | cpp | 539 | no_license | #include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define scan(a) scanf("%d",&a)
#define scan2(a,b) scanf("%d %d",&a,&b);
#define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define print(x) printf("%d\n",x)
#define pb push_back
#define mp... |
e84dc6e3f3569c0be0745b8218af4b94f3779e42 | a8457aee74f0c912f8887e983c5b40e3b0a22dab | 9gel/hellopcl | /frameworks/pcl.framework/Headers/pcl/features/impl/3dsc.hpp | C++ | hpp | 14,053 | no_license | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2011, Willow Garage, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditi... |
7c085a7b49277f20a9e70486be9f84f838fc834c | 19e47dc05753aeb93f53395d87bf79adeefd86a5 | Asylum7/TheSloppyDisk | /CheckOut.cpp | C++ | cpp | 1,451 | no_license | #include "Robot.h"
#include "Earth.h"
#include "Air.h"
#include "Sea.h"
#include "Accounts.h"
#include "header.h"
void DisplayCart(vector<Earth> &eBots,
vector<Air> &aBots,
vector<Sea> &sBots,
unsigned int &numBots);
//prints out the receipt for the user to view total costs
void PrintReceipt(vector<Ear... |
195228ada155e8f212126d823d44643b55a7a16a | a0189d1d254a35fd12b12acfbe24c214d016a267 | louisfghbvc/Leetcode | /Tree/1530. [Like] Number of Good Leaf Nodes Pairs.cpp | C++ | cpp | 2,895 | no_license | // I use lca to calculate all leaf distance. straight.
// the val doesn't matter.
// O(NlogN).
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(... |
ee9e1f7ce6c280d7f0075fb01115d179351a5e1d | 8e26dfbca4bee538aea92df30a97fd7dc9d086cc | vapour18/acm_code | /hdu/dfs HDOJ 4337.cpp | C++ | cpp | 904 | no_license | //给出朋友的组合,判断所有人是否能和朋友坐一起,注意桌子是圆形的,首尾必须是朋友!
//dfs
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,m,ans[155];
bool a[155][155],vis[155],flag;
void dfs(int x,int dep)
{
if(dep>=n)
{
if(a[ans[n-1]][ans[0]]==0)//首尾必须是朋友!
return;
flag=1;
for(int i=0;i<n;i++)
{
if(i==0)
... |
79b3a02763fac34eb4a3a1f94ace9717e5b8fe5b | f166850d26d895df0f2d7f0af1ae75477c7197f2 | anuj1560/Hackerearth_Anuj | /TrailingZeros.cpp | C++ | cpp | 226 | no_license | #include <iostream>
using namespace std;
int main() {
int n;
cin >>n;
int temp;
int count=0;
int divisor=5;
while(divisor<=n)
{
temp=n/divisor;
count=count+temp;
divisor*=5;
}
cout<<count<<endl;
return 0;
}
|
e7550acf8b13ad7b2b9ce993bedfe46880e829c1 | 817c659dd54e148c6964bfda818ec96d7b7d7ff2 | zjr954/os | /nachos_dianti/nachos-3.4/code/threads/scheduler.cc | C++ | cc | 5,271 | permissive | // scheduler.cc
// Routines to choose the next thread to run, and to dispatch to
// that thread.
//
// These routines assume that interrupts are already disabled.
// If interrupts are disabled, we can assume mutual exclusion
// (since we are on a uniprocessor).
//
// NOTE: We can't use Locks to provide mutual exclus... |
232710d4fdbe11392334264539bac43c631140ca | 56fb340b37ece4693305dec9629aa3e7c03200dc | budhiahimanshu96/coding | /Codechef/Snackdown'17/Pre Elim A/ISSNAKE.cpp | C++ | cpp | 571 | no_license | /* */
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
void check(ll a) { cout<<a<<endl; }
bool prime [1000001];
int sieve(int a){memset(prime,true,sizeof(prime));int p;int i;for(p=2;p*p<=a;p++){if(prime[p]==true){for(i=p*2;i<=a;i+=p)prime[i]=false;}}return 0;}
//vector<ll... |
5f286e6091a70f4a8d04bd61dd1bf50d92dc53bb | 54df769aa260c2f52a442733b875ff2cdff2300b | krittindev/OCOM64 | /CAMP1/4-15-THU_exam1/olympic/olympic.cpp | C++ | cpp | 388 | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, rank = 1;
float w[3], num[1000], sum, temp;
cin >> n >> w[0] >> w[1] >> w[2];
for(int i = 0; i < n; i++){
sum = 0;
for(int j = 0; j < 3; j++){
cin >> temp;
sum += temp * w[j];
}
num[i] = sum;
}
for(int i = 1; i < n; i++)... |
9b1c0c5b85c16b100b543f13ae14f705b581b972 | 7617e1d520133d1080a91301b057f0d5cfeb70b7 | NCAR/lrose-core | /codebase/apps/trec/src/TrecGauge2Spdb/Args.cc | C++ | cc | 4,923 | permissive | // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
// ** Copyright UCAR (c) 1990 - 2016
// ** University Corporation for Atmospheric Research (UCAR)
// ** National Center for Atmospheric Research (NCAR)
// ** Bo... |
b4087744ef25db20d5fe42bc66727c392917bf9b | 43c00ea816bdb529afa666a7023035c6044f99da | kiranarsam/understanding-cpp-step-by-step | /basics/references-cpp.cpp | C++ | cpp | 1,476 | no_license | #include<iostream>
#include <vector>
using namespace std;
void swap (int& first, int& second)
{
int temp = first;
first = second;
second = temp;
}
struct Student {
string name;
string address;
int rollNo;
};
// If we remove & in below function, a new
// copy of t... |
16c4b6feb622dba92af36c07c99e10e499486c42 | 0baa1fad8d6cd81c6812f7bb14ec534599f02caa | omarama/Secure-File-Encryption | /App/Edger8rSyntax/Arrays.cpp | C++ | cpp | 2,901 | no_license | /*
* Copyright(C) 2011-2018 Intel Corporation All Rights Reserved.
*
* The source code, information and material ("Material") contained herein is
* owned by Intel Corporation or its suppliers or licensors, and title to such
* Material remains with Intel Corporation or its suppliers or licensors. ... |
d928dbdf2cb50f20a7ac08e3bd77bd95d348b664 | 7232e376168ff36c1d5635ba63027748851d23bf | stritzelm/cs312 | /hw21/class21/c211_io/io03_showpos.cpp | C++ | cpp | 527 | no_license | // io03_showpos.cpp
#include <iostream>
int main()
{
int n = 1234;
std::cout << "Default number display" << std::endl;
std::cout << n << std::endl; // show positive
std::cout << -n << std::endl;
std::cout << "std::showpos for plus sign" << std::endl;
std::cout << std::showpos << n << std::end... |
e356b0663171a1b248bd1208c9eb46e7267f65ef | a13527ba8bd11df23f82325039b1eaac2c0c83e5 | brock7/TianLong | /Client/SceneEdit/src/MonsterOperator.cpp | C++ | cpp | 5,295 | no_license | #include "MonsterOperator.h"
#include "MonsterEditAction.h"
////////////////////////////////////////////////////////////////////////////
//
// 怪物redo undo 基类操作.
//
namespace WX
{
CMonsterOperator::CMonsterOperator(void)
:m_strMonsterName("")
{
}
CMonsterOperator::~CMonsterOperator(void)
{
}
// 怪物名字.
void ... |
d871b2b808644f3761e477429b2b2f8b7d868b39 | 42425b430255901b60bed7d051a4a72224f7d2dd | zehamarall/challenge_c_plus_plus | /session.cpp | C++ | cpp | 1,707 | no_license | #include "session.h"
Session::Session(boost::asio::io_service& io_service, short lengthMaxFile)
: socket_(io_service), lengthMaxFile_(lengthMaxFile), streamLength(0), streamPath()
{
generatePath();
}
tcp::socket& Session::socket()
{
return socket_;
}
void Session::generatePath()
{
std::ti... |
8cb836414f5ee6eec09675419e49925875d1f219 | 097099ad0b3cd9760d226e4481dcc161c94fc7c5 | zcx185973968/ZFFramework | /ZF/ZFCore/zfsrc/ZFCore/ZFOutputForConsole.cpp | C++ | cpp | 1,636 | permissive | /* ====================================================================== *
* Copyright (c) 2010-2018 ZFFramework
* Github repo: https://github.com/ZFFramework/ZFFramework
* Home page: http://ZFFramework.com
* Blog: http://zsaber.com
* Contact: master@zsaber.com (Chinese and English only)
* Distributed under MIT ... |
7aa3e5ed88abe4acb314a11148c53afd637ec89a | ba2bcb1cfbe76401488ebd97489dc5aff626df14 | IamHungDo/SFSU_Coursework | /CSC 340 - Programming Methology/Shape Polymorphism/shapeMain.cpp | C++ | cpp | 655 | no_license | //
// shapeMain.cpp
// CSC340HW#9P1
// Hung Do
// ID: 913160981
// Hung95do@yahoo.com
// Xcode
// Created by Hung Do on 5/17/15.
// Copyright (c) 2015 Hung Do. All rights reserved.
//
#include <iostream>
#include "Figure.h"
#include "Rectangle.h"
#include "Triangle.h"
using std::cout;
int main()
{
... |
cc28952e9ccec29f2e4ff32caeab3a265d4aa02f | cdc9f8cce714b5ec36e7b2036529a231a93f8719 | yukioc/tscrpt | /tscrpt.cpp | C++ | cpp | 7,653 | no_license | /*!
* \file
* \brief tiny script language
* \mainpage
* \include README
*/
//#include <map>
#include <cstdio> //printf
#include <cstdlib> //strtol
#include <cctype> //isspace,isdigit,isalpha,isalnum
#include <cstring> //strndup,strcmp
#include <cassert> //assert
#include <stdexcept> //logic_error
#include <sstream... |
a5f8f04801821a0a8075cc6dcbfe06f3503b4f2b | 98bdf24df8746f5a7c6df7991bb21f93c4e98f37 | Iolana/common | /XArch/reportmodel.cpp | C++ | cpp | 2,248 | no_license | #include "reportmodel.h"
#include <QMessageBox>
#include <QDomDocument>
#include <QTextStream>
#include "dbadapter.h"
ReportModel::ReportModel(QObject *parent)
: IdTextModel(parent)
{
}
ReportModel::~ReportModel()
{
}
QVariant ReportModel::data(const QModelIndex &index, int role) const
{
if(role == Qt::BackgroundR... |
0072d61e0c2a798d71c0c94e5647edd335ea0623 | 33347b5484c5a648490b8e388b64f6605759e4ad | BruceKangCN/prime | /src/MT/mt.cpp | C++ | cpp | 1,954 | permissive | #include "main_mt.h"
namespace prime {
unsigned running_count = 0;
std::mutex value_mutex;
std::mutex list_mutex;
std::mutex m;
std::list<uint64_t>::iterator search_r(std::list<uint64_t>& list, uint64_t v)
{
if (v > list.back()) {
return list.end();
}
auto place = list.end();
uint64_t prime;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.