repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
sevskii111/test_2 | src/examples/nxpcup_old/nxpcup_start.cpp | /****************************************************************************
*
* Copyright 2019 NXP.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the abo... |
wolf9970/CST276SRS01 | Observer/ConcreteSubject.cpp | <gh_stars>0
//
// Created by wolf on 7/9/18.
//
#include "ConcreteSubject.h"
bool ConcreteSubject::GetState() const {
return subjectState_;
}
void ConcreteSubject::SetState(bool const state) {
subjectState_ = state;
} |
wolf9970/CST276SRS01 | Observer/Observer.cpp | <filename>Observer/Observer.cpp
//
// Created by wolf on 7/9/18.
//
#include "Observer.h" |
wolf9970/CST276SRS01 | Observer/Subject.cpp | <filename>Observer/Subject.cpp
//
// Created by wolf on 7/9/18.
//
#include "Subject.h"
void Subject::Attach(Observer* observer)
{
observers_.emplace_back(observer);
}
// code from Mitch's in-class slide on erase-remove idiom
void Subject::Detach(Observer* observer)
{
observers_.erase(std::remove_if(observe... |
wolf9970/CST276SRS01 | Observer/ConcreteObserver.cpp | //
// Created by wolf on 7/9/18.
//
#include "ConcreteObserver.h"
ConcreteObserver::ConcreteObserver() : observerState_(false)
{
}
void ConcreteObserver::Update()
{
observerState_ = subject->GetState();
}
|
wolf9970/CST276SRS01 | WeatherViewer/current.cpp | <gh_stars>0
#include "stdafx.h"
#include <iomanip>
#include "station.h"
#include "current.h"
namespace WeatherViewer
{
std::ostream& operator<<(std::ostream& os, WeatherViewer::Current const& current)
{
auto const& station{ current.getStation() };
auto const temperature{ station.getTemperature... |
MetalYos/CG1_HW4 | CGWork/Scene.cpp | <reponame>MetalYos/CG1_HW4
#include "Scene.h"
#include "StdAfx.h"
Scene::Scene() : camera(new Camera()), isBBoxOn(false), vertexNormals(false),
polyNormals(false), isCalcNormal(true), bgColor((AL_BLACK)), fineNess(20)
{
}
Scene::~Scene()
{
while (models.size() > 0)
{
Model* model = models.back();
models.pop... |
MetalYos/CG1_HW4 | CGWork/CGWorkView.cpp | <gh_stars>0
// CGWorkView.cpp : implementation of the CCGWorkView class
//
#include "ALMath.h"
#include "stdafx.h"
#include "CGWork.h"
#include "CGWorkDoc.h"
#include "CGWorkView.h"
#include <iostream>
using std::cout;
using std::endl;
#include "MaterialDlg.h"
#include "LightDialog.h"
#ifdef _DEBUG
#define new DEBUG... |
naveen298/AlgorithmsAndDataStructure | C++/Algorithms/DynamicPrograming/wordBreak.cpp | <reponame>naveen298/AlgorithmsAndDataStructure
/*
* Title: Segment a given string into space-separated sequence of the dictionary words.
* Input: string and araay of dictionary words
*/
#include <bits/stdc++.h>
using namespace std;
bool wordBreak(string s, vector<string>& wordDict) {
if(wordDict.size()==0) /... |
gameBear/olcPGEX_UI | Single_menu.cpp | <reponame>gameBear/olcPGEX_UI
#define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
#include "olcPGEX_UI.h"
static int screenW = 640, screenH = 480;
class Example : public olc::PixelGameEngine
{
public:
int w = screenW;
olc::UI_CONTAINER myUI;
Example()
{
sAppName = "UI Sample";
}
public:
bool OnUser... |
gameBear/olcPGEX_UI | Multiple_menu_demo.cpp | <reponame>gameBear/olcPGEX_UI
#define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
#include "olcPGEX_UI.h"
static int screenW = 640, screenH = 480;
class Example : public olc::PixelGameEngine
{
public:
int w = screenW;
//We need a stage controller for multiple stages
olc::UI_STAGE_CONTROLL myUI;
// a sta... |
abhinavpola/project_euler | solutions/project_euler_4.cpp | #include <iostream>
bool is_palindrome(int N) {
int num, digit, rev = 0;
num = N;
do {
digit = num % 10;
rev = (rev * 10) + digit;
num = num / 10;
} while (num != 0);
return N == rev;
}
/* optimization:
j must be a multiple of 11
ref: https://euler.beerbaronbill.com/... |
abhinavpola/project_euler | solutions/project_euler_6.cpp | #include <iostream>
long solve(long N) {
long sum_of_n = (N * (N + 1))/2;
long sum_of_squares = 0;
for (long i = 1; i <= N; i++) {
sum_of_squares += i*i;
}
return abs(sum_of_squares - sum_of_n * sum_of_n);
}
int main(int argc, char **argv) {
std::cout << solve(10) << std::endl;
re... |
abhinavpola/project_euler | solutions/project_euler_3.cpp | #include <iostream>
#include <math.h>
long largest_prime_factor(long N) {
long div = 2;
while (div <= floor(sqrt(N))) {
if (N % div == 0) {
N /= div;
} else {
div++;
}
}
return N;
}
int main(int argc, char **argv) {
std::cout << largest_prime_factor... |
abhinavpola/project_euler | solutions/project_euler_5.cpp | #include <iostream>
//Euclidean algorithm
int gcd(int a, int b) {
int R;
while ((a % b) > 0) {
R = a % b;
a = b;
b = R;
}
return b;
}
int solve(int N) {
int result = 1;
for (int i = 1; i <= N; i++) {
result = (result * i) / gcd(result, i);
}
return res... |
abhinavpola/project_euler | solutions/project_euler_7.cpp | <reponame>abhinavpola/project_euler<filename>solutions/project_euler_7.cpp
#include <iostream>
#include <math.h>
#include <stdio.h>
int solve(int N) {
if (N == 1) { // edge case?
return 2;
}
const auto logn = log(N);
int len = ceil(N * (logn + log(logn) + 1)) + 1;
int prime[len] = {0}; // A... |
abhinavpola/project_euler | solutions/project_euler_2.cpp | <gh_stars>0
#include <iostream>
long even_fibonacci_sum(long N) {
long sum_of_even = 0;
long f0 = 1;
long f1 = 1;
for (long i = 2; i <= N; i++) {
long temp = f1 + f0;
f0 = f1;
f1 = temp;
if (temp > N) {
return sum_of_even;
}
if (temp % 2 == ... |
abhinavpola/project_euler | solutions/project_euler_1.cpp | <reponame>abhinavpola/project_euler<gh_stars>0
#include <iostream>
long arithmetic_sequence_sum(long N, int d) {
long result = d * (N * (N+1) / 2);
return result;
}
long solve(long N) {
N -= 1;
long result = 0;
long num_3s = N / 3;
long num_5s = N / 5;
long num_15s = N / 15;
... |
zilliu/OpenCC | src/MarisaDictTest.cpp | /*
* Open Chinese Convert
*
* Copyright 2020 <NAME> <<EMAIL>>
*
* 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 require... |
zilliu/OpenCC | src/ConversionChainTest.cpp | /*
* Open Chinese Convert
*
* Copyright 2015 <NAME> <<EMAIL>>
*
* 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 require... |
zilliu/OpenCC | src/Common.hpp | <gh_stars>1-10
/*
* Open Chinese Convert
*
* Copyright 2010-2014 <NAME> <<EMAIL>>
*
* 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
... |
zilliu/OpenCC | src/benchmark/Performance.cpp | <reponame>zilliu/OpenCC<filename>src/benchmark/Performance.cpp
#include <benchmark/benchmark.h>
#include <fstream>
#include <iostream>
#include <memory>
#include <streambuf>
#ifdef _MSC_VER
#include <direct.h>
#else
#include <unistd.h>
#endif
#include "SimpleConverter.hpp"
#include "TestUtilsUTF8.hpp"
namespace open... |
zilliu/OpenCC | src/SimpleConverter.hpp | /*
* Open Chinese Convert
*
* Copyright 2010-2014 <NAME> <<EMAIL>>
*
* 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 re... |
zilliu/OpenCC | src/BinaryDict.cpp | /*
* Open Chinese Convert
*
* Copyright 2010-2020 <NAME> <<EMAIL>>
*
* 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 re... |
zilliu/OpenCC | src/DartsDictTest.cpp | <gh_stars>0
/*
* Open Chinese Convert
*
* Copyright 2015 <NAME> <<EMAIL>>
*
* 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
*
* Un... |
zilliu/OpenCC | src/DictGroupTest.cpp | /*
* Open Chinese Convert
*
* Copyright 2015 <NAME> <<EMAIL>>
*
* 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 require... |
zilliu/OpenCC | src/py_opencc.cpp | #include <pybind11/pybind11.h>
#include "opencc.h"
namespace py = pybind11;
PYBIND11_MODULE(opencc_clib, m) {
py::class_<opencc::SimpleConverter>(m, "_OpenCC")
.def(py::init<const std::string&>())
.def(
"convert",
py::overload_cast<const char*, size_t>
(&opencc:... |
zilliu/OpenCC | src/Lexicon.hpp | <gh_stars>1-10
/*
* Open Chinese Convert
*
* Copyright 2010-2014 <NAME> <<EMAIL>>
*
* 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
... |
SunilRao01/SpaceSim | solarsystem.cpp | <filename>solarsystem.cpp
#include "solarsystem.h"
void solarsystem::renderSolarSystem()
{
if (!changingParameters)
{
glPushMatrix();
// Center solar system
glTranslatef(centerX, centerY, 0.0f);
// Render sun
sun.renderPlanet(0, 0);
// Render planets
for (int i = 0; i < numPlanets; i++)
{
... |
SunilRao01/SpaceSim | planet.cpp | #include "planet.h"
void planet::renderPlanet()
{
int num_segments = 8;
for(int ii = 0; ii < num_segments; ii++)
{
float theta = 2.0f * 3.1415926f * float(ii) / float(num_segments);//get the current angle
float x = radius * cosf(theta);//calculate the x component
float y = radius * sinf(theta);//cal... |
SunilRao01/SpaceSim | main.cpp | <filename>main.cpp
#include "lutil.h"
// This file constains the driver source code
// that puts everything together for us.
// Function used to render 60 frames per second
void runMainLoop(int val);
int main(int argc, char **args)
{
// Init FreeGLUT
glutInit(&argc, args);
// Create OpenGL v2.1 context (a contai... |
SunilRao01/SpaceSim | lutil.cpp | <filename>lutil.cpp
#include "lutil.h"
#include <GL/freeglut.h>
// Camera transform position
int camX, camY, camZ;
const int camMovement = 5;
// Solar System
solarsystem ss(1, 3, 0.0f, 0.0f);
solarsystem ss_2(1, 3, 500.0f, 0.0f);
// Fot font rendering
unsigned char image[SCREEN_WIDTH][SCREEN_HEIGHT];
bool initGL()... |
lalcmellkmal/doushio | tripcode/tripcode.cc | <filename>tripcode/tripcode.cc
#define _XOPEN_SOURCE
#include <errno.h>
#include <iconv.h>
#include <unistd.h>
#include <string.h>
#include "napi.h"
using namespace Napi;
static char SECURE_SALT[21] = "$5$";
#define TRIP_MAX 128
/// Call this once at startup to set the salt for secure (!!) tripcodes.
Value set_salt(... |
renato2099/weld | weld_rt/cpp/runtime.cpp | <filename>weld_rt/cpp/runtime.cpp
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <pthread.h>
#include <setjmp.h>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <exception>
#include "assert.h"
#include "runtime.h"
// These is needed to ensure each... |
renato2099/weld | examples/cpp/vector_benchmark/vector_benchmark.cpp | <filename>examples/cpp/vector_benchmark/vector_benchmark.cpp
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// Include the Weld API.
#include "../../../c/weld.h"
struct weld_vector {
int32_t *data;
int64_t length;
};
struct args {
struct weld_vector vector;
int32_t a;... |
renato2099/weld | examples/cpp/serialization/deserialize_vec_pointers/deserialize_test.cpp | <gh_stars>1-10
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
// Include the Weld API.
#include "../../../../c/weld.h"
template <class T>
struct weld_vec {
T *data;
int64_t length;
};
struct pair {
int32_t a;
int32_t b;
};
struct vpair {
int32_t a... |
renato2099/weld | examples/cpp/composite_types/composite_types.cpp | <reponame>renato2099/weld<gh_stars>1-10
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// Include the Weld API.
#include "../../../c/weld.h"
const char *program = "|x:i32, ys:vec[i64]|\
let a = result(for(ys, appender[i32], |b, i, y| merge(b, x)));\
let b = result(for(ys, appender[i64... |
renato2099/weld | weld_rt/cpp/gb-new.cpp | <filename>weld_rt/cpp/gb-new.cpp
#include "runtime.h"
#include "dict.h"
#include <algorithm>
// The initial capacity of a growable vector.
const int INITIAL_CAPACITY = 16;
// The canonical layout for a weld vector.
class WeldVec {
public:
void *data;
int64_t size;
};
// A growable weld vector, which is a WeldVe... |
renato2099/weld | weld_rt/cpp/inline.cpp | <reponame>renato2099/weld
#include "runtime.h"
extern "C" void *weld_rt_get_merger_at_index(void *m, int64_t size, int32_t i) {
intptr_t ptr = reinterpret_cast<intptr_t>(m);
ptr = (ptr + (CACHE_LINE - 1)) & CACHE_MASK;
return reinterpret_cast<void *>(ptr + num_cache_blocks(size) * i * CACHE_LINE);
}
// a non-fu... |
renato2099/weld | examples/cpp/serialization/serialize_vec/serialize_test.cpp | #include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
// Include the Weld API.
#include "../../../../c/weld.h"
template <class T>
struct weld_vec {
T *data;
int64_t length;
};
struct triple {
int a;
int b;
int c;
};
struct args {
struct weld_vec<weld... |
renato2099/weld | weld_rt/cpp/merger.cpp | <reponame>renato2099/weld<gh_stars>1-10
#include "runtime.h"
// zero-initializes storage
extern "C" void *weld_rt_new_merger(int64_t size, int32_t nworkers) {
int64_t total_blocks = num_cache_blocks(size) * nworkers;
// extra space to ensure first block is aligned to boundary
void *space = malloc(total_blocks * ... |
renato2099/weld | weld_rt/cpp/dict.cpp | // See dict-new.cpp for a re-implementation of this dictionary.
#if 0
#include "runtime.h"
#include "assert.h"
#include "stdio.h"
// power of 2
#define LOCK_GRANULARITY 16
#define MAX_LOCAL_PROBES 5
#define GLOBAL_BATCH_SIZE 128
struct simple_dict {
void *data;
volatile int64_t size;
volatile int64_t capacity;... |
renato2099/weld | weld_rt/cpp/gb.cpp | // See gb-new.cpp for a re-implementation of this dictionary.
#if 0
#include "runtime.h"
#include <algorithm>
struct weld_arr {
void *data;
int64_t size;
};
struct weld_arr_growable {
weld_arr a;
int64_t capacity;
};
inline void resize_weld_arr(weld_arr_growable *arr, int32_t val_size, int64_t new_cap) {
... |
renato2099/weld | examples/cpp/udfs_from_library/lib.cpp | // This file will be built as a dynamically loaded library, called
// libudf.so or libudf.dylib, to show use of weld_load_library in udfs.cpp.
#include <stdint.h>
#include <stdio.h>
extern "C" void add_five(int64_t *x, int64_t *result) {
*result = *x + 5;
printf("called add_five: %lld + 5 = %lld\n", *x, *resu... |
AustinSanders/usgscsm | bin/usgscsm_cam_test.cc | <filename>bin/usgscsm_cam_test.cc
// A tool to perform some basic tests and operations on a CSM camera model.
//
// Functionality:
//--------------
//
// - Load a CSM model in ISD format or model state format, via:
// --model <model file>
//
// - Save the model state if invoked with:
// --output-model-state <model... |
AustinSanders/usgscsm | tests/PluginTests.cpp | #include "UsgsAstroFrameSensorModel.h"
#include "UsgsAstroLsSensorModel.h"
#include "UsgsAstroPlugin.h"
#include <fstream>
#include <sstream>
#include <gtest/gtest.h>
#include "Fixtures.h"
TEST(PluginTests, PluginName) {
UsgsAstroPlugin testPlugin;
EXPECT_EQ("UsgsAstroPluginCSM", testPlugin.getPluginName());
}
... |
AustinSanders/usgscsm | tests/UtilitiesTests.cpp | <reponame>AustinSanders/usgscsm
#define _USE_MATH_DEFINES
#include "Fixtures.h"
#include "UsgsAstroPlugin.h"
#include "Utilities.h"
#include <gtest/gtest.h>
#include <nlohmann/json.hpp>
#include <math.h>
#include <functional>
#include <stdexcept>
using json = nlohmann::json;
TEST(UtilitiesTests, calculateRotationM... |
AustinSanders/usgscsm | src/UsgsAstroPlugin.cpp | <gh_stars>1-10
#include "UsgsAstroPlugin.h"
#include "UsgsAstroFrameSensorModel.h"
#include "UsgsAstroLsSensorModel.h"
#include "UsgsAstroPushFrameSensorModel.h"
#include "UsgsAstroSarSensorModel.h"
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <string>
#include <Error.h>
#include <Plugin.h>
#i... |
AustinSanders/usgscsm | tests/EigenUtilitiesTests.cpp | <reponame>AustinSanders/usgscsm<filename>tests/EigenUtilitiesTests.cpp
#include "EigenUtilities.h"
#include <gtest/gtest.h>
#include <cmath>
// See if fitting a projective transform to points which were created
// with such a transform to start with can recover it.
TEST(EigenUtilitiesTests, createProjectiveApproxima... |
AustinSanders/usgscsm | src/EigenUtilities.cpp | <reponame>AustinSanders/usgscsm
#include "EigenUtilities.h"
#include <Error.h>
#include <Eigen/Dense>
#include <iostream>
// Keep these utilities separate as using Eigen in an existing source
// file results in a 50% increase in compilation time.
// Compute the best-fitting projective transform that maps a set of 3... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_eckey.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_eckey.h"
#include <assert.h>
#include <openssl/objects.h>
// TODO: temporarily keeping the un-prefixed signature of this method
// to keep tests runni... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_pkcs12.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_pkcs12.h"
// TODO: temporarily keeping the un-prefixed signature of this method
// to keep tests running in CI. This will be removed once the managed a... |
mellinoe/corefx | src/Native/System.Native/pal_interfaceaddresses.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_config.h"
#include "pal_interfaceaddresses.h"
#include "pal_maphardwaretype.h"
#include "pal_utilities.h"
#include <assert.h>
#include <ifaddrs.h>
#inclu... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_x509_name.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_x509_name.h"
// TODO: temporarily keeping the un-prefixed signature of this method
// to keep tests running in CI. This will be removed once the manage... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_x509ext.cpp | <filename>src/Native/System.Security.Cryptography.Native/pal_x509ext.cpp
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_x509ext.h"
#include <assert.h>
// TODO: temporarily keeping the un-prefixed sig... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_evp_pkey_rsa.cpp | <reponame>mellinoe/corefx<filename>src/Native/System.Security.Cryptography.Native/pal_evp_pkey_rsa.cpp
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_evp_pkey_rsa.h"
// TODO: temporarily keeping the u... |
mellinoe/corefx | src/Native/System.Net.Http.Native/pal_curlinit.cpp | <reponame>mellinoe/corefx<gh_stars>1-10
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_config.h"
#include "pal_curlinit.h"
#include <pthread.h>
#include <curl/curl.h>
extern "C" int32_t HttpNative_En... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_bignum.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_bignum.h"
// TODO: temporarily keeping the un-prefixed signature of this method
// to keep tests running in CI. This will be removed once the managed a... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_ssl.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_ssl.h"
#include "pal_crypto_config.h"
#include <assert.h>
static_assert(PAL_SSL_ERROR_NONE == SSL_ERROR_NONE, "");
static_assert(PAL_SSL_ERROR_SSL == SS... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_bio.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_bio.h"
#include <assert.h>
// TODO: temporarily keeping the un-prefixed signature of this method
// to keep tests running in CI. This will be removed ... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_ecdsa.cpp | <gh_stars>1-10
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_ecdsa.h"
#include "pal_utilities.h"
// TODO: temporarily keeping the un-prefixed signature of this method
// to keep tests running in CI... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_err.cpp | <gh_stars>1-10
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_err.h"
#include "pal_utilities.h"
#include <openssl/err.h>
// TODO: temporarily keeping the un-prefixed signature of this method
// to ... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_evp_pkey.cpp | <filename>src/Native/System.Security.Cryptography.Native/pal_evp_pkey.cpp<gh_stars>1-10
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_evp_pkey.h"
// TODO: temporarily keeping the un-prefixed signatur... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_evp_pkey_eckey.cpp | <filename>src/Native/System.Security.Cryptography.Native/pal_evp_pkey_eckey.cpp
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_evp_pkey_eckey.h"
// TODO: temporarily keeping the un-prefixed signature ... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_x509.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_x509.h"
#include <assert.h>
#include <openssl/pem.h>
#include <openssl/x509v3.h>
static_assert(PAL_X509_V_OK == X509_V_OK, "");
static_assert(PAL_X509_V... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_evp.cpp | <reponame>mellinoe/corefx
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_evp.h"
#include <assert.h>
#define SUCCESS 1
// TODO: temporarily keeping the un-prefixed signature of this method
// to ke... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_evp_cipher.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_evp_cipher.h"
#include <assert.h>
#include <memory>
#define SUCCESS 1
#define KEEP_CURRENT_DIRECTION -1
// TODO: temporarily keeping the un-prefixed si... |
mellinoe/corefx | src/Native/System.Security.Cryptography.Native/pal_pkcs7.cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_pkcs7.h"
#include <openssl/pem.h>
// TODO: temporarily keeping the un-prefixed signature of this method
// to keep tests running in CI. This will be r... |
mellinoe/corefx | src/Native/System.Native/pal_string.cpp | <reponame>mellinoe/corefx
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_config.h"
#include "pal_string.h"
#include "pal_utilities.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#includ... |
mellinoe/corefx | src/Native/System.Net.Http.Native/pal_slist.cpp | <reponame>mellinoe/corefx
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_slist.h"
extern "C" curl_slist* HttpNative_SListAppend(curl_slist* list, const char* headerValue)
{
return curl_slist_appen... |
mellinoe/corefx | src/Native/System.IO.Compression.Native/pal_zlib.cpp | <gh_stars>1-10
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pal_zlib.h"
#include "pal_utilities.h"
#include <assert.h>
#include <zlib.h>
static_assert(PAL_Z_NOFLUSH == Z_NO_FLUSH, "");
static_assert(PA... |
JulyKe/LogCabinRemote | Client/ClientInterceptor.cc | /*
* ClientInterceptor.cc
*
* Created on: Feb 29, 2016
* Author: jeff
*/
#include "Core/Debug.h"
#include "Client/ClientInterceptor.h"
#include <thread> // std::this_thread::sleep_for
#include <chrono> // std::chrono::seconds
ClientInterceptor::ClientInterceptor(int sendNode, int recvNode, i... |
JulyKe/LogCabinRemote | Server/StateMachine.cc | <gh_stars>0
/* Copyright (c) 2012-2014 Stanford University
* Copyright (c) 2015 <NAME>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOF... |
JulyKe/LogCabinRemote | Server/RaftConsensus.cc | <filename>Server/RaftConsensus.cc<gh_stars>0
/* Copyright (c) 2012 Stanford University
* Copyright (c) 2015 <NAME>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear ... |
JulyKe/LogCabinRemote | Server/EventInterceptor.cc | <reponame>JulyKe/LogCabinRemote<filename>Server/EventInterceptor.cc
#include "Core/Debug.h"
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <time.h>
#include <cstdlib>
#include <string>
#include <thread> // std::this_thread::sleep_for
#include <chrono> // std::chro... |
JulyKe/LogCabinRemote | Event/Loop.cc | <filename>Event/Loop.cc<gh_stars>0
/* Copyright (c) 2011-2014 Stanford University
* Copyright (c) 2015 <NAME>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in al... |
JulyKe/LogCabinRemote | Server/Main.cc | /* Copyright (c) 2012 Stanford University
* Copyright (c) 2014 <NAME>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED... |
bad-ed/pint | include/pint/pint.hpp | <gh_stars>1-10
// Copyright 2019 <NAME>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to... |
bad-ed/pint | tests/pint_bench.cpp | #include <chrono>
#include <iostream>
#include <random>
#include <vector>
#include <benchmark/benchmark.h>
#if defined(__x86_64__) || defined(_M_X64)
#define PINT_HAVE_SSE
#endif
#ifdef PINT_HAVE_SSE
#include <emmintrin.h>
#endif
#ifdef __ARM_NEON
#include <arm_neon.h>
#endif
#include "pint/pint.hpp"
using TestVe... |
bad-ed/pint | tests/pint_test.cpp | #include <array>
#include <utility>
#include <gtest/gtest.h>
#include "pint/pint.hpp"
#if __cpp_lib_integer_sequence
template<size_t ...Indexes> using IndexSeq = std::index_sequence<Indexes...>;
template<size_t N> using MakeIndexSeq = std::make_index_sequence<N>;
#else
template<size_t ...Indexes> using IndexSeq = pin... |
ZER-0-NE/Software_engineering_lab | Lab 1.cpp | <filename>Lab 1.cpp
#include<bits/stdc++.h>
using namespace std;
class graph{
int V;
vector<int>*adj;
void printallpathsutil(int s,int d,bool visited[],int path[],int &path_index);
public:
graph(int V);
void addedge(int u,int v);
void printallpaths(int s,int d);
void printgraph();
int pred();
... |
ZER-0-NE/Software_engineering_lab | 1/main.cpp | <gh_stars>0
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,mi;
cin>>n>>mi;
vector<long long>arr[n+1]; // creating a graph
// inserting values in the graph
for(long long i=0;i<mi;i++)
{
long long a,b;
cin>>a>>b;
arr[a].push_back(b);
}
cout<<"Starting node: "<< 1 <<end... |
ZER-0-NE/Software_engineering_lab | 2/main.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,mi;
cin>>n>>mi;
vector<long long>arr[n+1];
for(long long i=0;i<mi;i++)
{
long long a,b;
cin>>a>>b;
arr[a].push_back(b);
}
//cout<<"starting node "<<1<<endl;
queue<long long>q;
q.push(1);
int m[n+1];
m[1]=1;
long... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/Robby.cpp | #include "Robby.h"
#include "GL.h"
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
Robby::Robby(const Point& iniPos, Maze*l, int maxSteps)
: Robot(iniPos, l, maxSteps)
{
srand(time(NULL));
roboTex = LoadTexture("img/artur.jpg", false);
}
void Robby::generateSteps()
{
i... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/TestMaze.cpp | <reponame>wolganens/Computer-Science<gh_stars>1-10
#include "TestMaze.h"
#include <iostream>
#include <cstdlib>
#include <stack>
TestMaze :: TestMaze() {
}
bool TestMaze :: isIdx(int x, int y){
if(x <= 0 || x >= dimx || y <= 0 || y >= dimy || (x >= dimx - 1 && y < dimy * 3 / 4) || (y >= dimy - 1 && x < dimx * 3 ... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/Texture.cpp | <reponame>wolganens/Computer-Science<gh_stars>1-10
#include <math.h>
#include <string.h>
#include <vector>
#include "Texture.h"
#define DEBUG
using namespace std;
// Texture list
vector<TEX*> _textures(0);
#ifndef __FREEGLUT_EXT_H__
// Draw bitmap text
void glutBitmapString(void *font,char *text)
{
while (*text)
... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/GL.cpp | #include "GL.h"
#include <sstream>
int GL::width,GL::height;
vector<Point> GL::steps;
int GL::current;
float GL::deltax, GL::deltay;
int GL::dimx, GL::dimy;
Maze* GL::lab;
Robot* GL::rob;
TEX* GL::wallTex;
void GL::drawRect(float x1, float y1, float x2, float y2) {
glBegin(GL_QUADS);
glTexCoord2f(0,1);
g... |
wolganens/Computer-Science | Programming-Languages-Project/haskell_factorial.hh | <gh_stars>1-10
<?hh
function recursive_fatorial(int $n): int{
return $n == 0 ? 1 : $n * fatorial($n - 1);
}
function iterative_fatorial(int $n): int{
if ($n < 2) {
return 1;
}
return iterative_fatorial($n - 1);
}
function matrix_multiplication(){
array<array> $arr = array(array());
array<array> $res... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/ArTur.cpp | <reponame>wolganens/Computer-Science<gh_stars>1-10
#include "ArTur.h"
#include "GL.h"
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
ArTur::ArTur(const Point& iniPos, Maze*l, int maxSteps)
: Robot(iniPos, l, maxSteps) {
srand(time(NULL));
roboTex = LoadTexture("img/artur.j... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/main.cpp | #include "TestMaze.h"
#include "ArTur.h"
#include "Robby.h"
#include "RobotB9.h"
#include "T800.h"
#include "GL.h"
#include <cstdlib>
using namespace std;
int main(int argc, char **argv){
if(argc != 4){
cerr << "Usage: " << argv[0] << " 1 in/maze<X>.txt <max_steps>" << endl;
exit(... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/T800.cpp | #include "T800.h"
#include "GL.h"
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <sstream>
using namespace std;
T800::T800(const Point& iniPos, Maze*l, int maxSteps)
: Robot(iniPos, l, maxSteps) {
srand(time(NULL));
roboTex = LoadTextu... |
wolganens/Computer-Science | General-Programming/Maze-Robots-Search/RobotB9.cpp | #include "RobotB9.h"
#include "GL.h"
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
RobotB9::RobotB9(const Point& iniPos, Maze*l, int maxSteps)
: Robot(iniPos, l, maxSteps)
{
srand(time(NULL));
roboTex = LoadTexture("img/b9.jpg", false);
}
void RobotB9::generateSteps()
{
... |
edmw/arduino-os | System.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated docume... |
edmw/arduino-os | OSTicker.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated docume... |
edmw/arduino-os | OS.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated docume... |
edmw/arduino-os | Storage.cpp | <reponame>edmw/arduino-os
#if OS_USE_STORAGE
///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a ... |
edmw/arduino-os | Signaling.cpp | <gh_stars>0
///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and assoc... |
edmw/arduino-os | Network.cpp | <filename>Network.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software... |
edmw/arduino-os | Files.cpp | <gh_stars>0
///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and assoc... |
edmw/arduino-os | Notification.cpp | <reponame>edmw/arduino-os
///////////////////////////////////////////////////////////////////////////////////////////////////
// Operating Support code for Arduino or ESP8266 projects.
//
// Copyright (c) 2017-2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this soft... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.