repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
ashuping/m328pb_sound_processing
sampling.c
/* ATMega238pb sound processing experiments - data sampling 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 Unle...
ashuping/m328pb_sound_processing
goertzel.h
/* ATMega238pb sound processing experiments - Goertzel algorithm and related operations - header-file 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://ww...
ashuping/m328pb_sound_processing
usart.c
/* ATMega238pb sound processing experiments - USART 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 requi...
ashuping/m328pb_sound_processing
leds.h
<filename>leds.h /* ATMega238pb sound processing experiments - LED PWM setup - header file 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/l...
ashuping/m328pb_sound_processing
common.h
<gh_stars>0 #include <avr/io.h> #pragma once #ifndef bool typedef uint8_t bool; #define true 1 #define false 0 #endif
ashuping/m328pb_sound_processing
sampling.h
/* ATMega238pb sound processing experiments - data sampling header-file 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-...
ashuping/m328pb_sound_processing
leds.c
<filename>leds.c<gh_stars>0 /* ATMega238pb sound processing experiments - LED PWM setup 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/lice...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/J_Debug_v2.h
<reponame>M8s-Inc/M8s-Magic-Leap-Playground namespace J_Debug; // class declarations class J_Debugger; class J_DebugSystem; class SubsystemNameException; class J_DebugSystem_Plus; class J_Debugger { // class delegates // class events // cla...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/RADCommon.h
<gh_stars>0 namespace Crestron.RAD.Common.Transports; // class declarations class ATransportDriver; class TelnetTransport; class TcpSSLTransport; class IrFileReader; class HttpTransport; class DataObjects; class DriverMetadata; class RestTr...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/Crestron_Tools_Runtime_Core_Simpl.h
<gh_stars>0 namespace Crestron.Tools.Runtime.Core.Simpl; // class declarations class RegistryObjectCaller; class FileSystemHelper; static class RegistryObjectCaller { // class delegates // class events // class functions STRING_FUNCTION ToString (); ...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/Crestron_Tools_Runtime_HomeKit.h
namespace Crestron.Tools.Runtime.HomeKit.Tokens.Mocks; // class declarations class TokenRecord; namespace Crestron.Tools.Runtime.HomeKit.Devices.Remote; // class declarations class HomeKitRemoteTargetButton; class RemoteTargetButtonDTO; class HomeKitRemoteTarget; ...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/PixNBitsLighting.h
<gh_stars>0 namespace PixNBitsLighting; // class declarations class LightingConverter; class LightingConverter { // class delegates // class events // class functions FUNCTION RGBToHSV (); STRING_FUNCTION ToString (); SIGNED_LONG_INTEGER_FUNCT...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/MediaRemoteClient.h
namespace Ultamation.SimplSharp.AppleTvClient; // class declarations class AppleTvClient; class AppleTvClient { // class delegates delegate FUNCTION UShortDelegate ( INTEGER val ); delegate FUNCTION NakedDelegate ( ); // class events // class function...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/AVSwitchSharp_JANUSVER.h
<gh_stars>0 namespace AVSwitchSharp; // class declarations class AVSwitchCS; class SetOut; class MatrixMode; class AVSwitchCS { // class delegates delegate FUNCTION StringParamDelegate ( SIMPLSHARPSTRING str ); delegate FUNCTION IntParamDelegate ( INT...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/RADSystemManager.h
namespace Crestron.RAD.SystemManager; // class declarations class SMWrapper; class RadSystemManager; class TransportType; class DriverManifestItem; class ComunicationSettings; class ManifestDeviceTypes; class DeviceDriverManifest; class SMWrapp...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/J_SerialPort_v1.h
namespace J_SerialPort_NS; // class declarations class J_SerialPort_New; class J_SerialPort; class J_SerialPort_New { // class delegates delegate FUNCTION StringParamDelegate ( SIMPLSHARPSTRING str ); // class events // class functions FUNCTI...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/AppleHomeKitHelper.h
namespace AppleHomeKitHelper; // class declarations class AppleHomeKitSSharpComponent; class AppleHomeKitSSharpComponent { // class delegates delegate FUNCTION DelegateFnString ( INTEGER myInt , SIMPLSHARPSTRING myString ); delegate FUNCTION DelegateFnInteger ( INTEGER...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/J_Networking_v1.h
<gh_stars>0 namespace J_Networking; // class declarations class J_Socket; class J_SocketStatus; class J_TCPClient; class J_HTTP; class J_WebSocket; class J_UDP; class J_Socket { // class delegates // class events // class ...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/J_MessageHandler_v3.h
namespace J_MessageHandler; // class declarations class MessageHandler; class MessageItem; class MessageHandler { // class delegates // class events // class functions FUNCTION AddMessage ( MessageItem msgItm ); FUNCTION SetHeartbeat ( Messag...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/SimplSharpCloudClientInterface.h
<filename>CrestronFiles/SPlsWork/SimplSharpCloudClientInterface.h namespace Crestron.SimplSharp.SimplSharpCloudClient; // class declarations class CloudClient; class CloudArgs; class CloudActivationKeyArgs; class OnUploadFileToCloudArgs; class OnDownloadFileFromCloud...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/RADDisplay.h
<reponame>M8s-Inc/M8s-Magic-Leap-Playground namespace Crestron.RAD.DeviceTypes.Display; // class declarations class Power; class Input; class Audio; class Connection; class EnergyStar; class VideoMute; class Projector; class ADisplayProtoco...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/J_Timers_v2.h
<gh_stars>0 namespace J_Timers; // class declarations class J_Timer; class J_Timer { // class delegates delegate FUNCTION J_TimerCallback ( J_Timer firedBy ); // class events // class functions FUNCTION CreateTimerWithRepeat ( SIGNED_LONG_INTEGER time...
M8s-Inc/M8s-Magic-Leap-Playground
CrestronFiles/SPlsWork/Crestron_Tools_Runtime_HomeKitSimpl.h
namespace Crestron.Tools.Runtime.HomeKitSimpl; // class declarations class SimplProvisioningHelper; class HomeKitAppleTvSimpl; class SimplProvisioningHelper { // class delegates // class events // class functions FUNCTION RestoreFactoryDefault (); ...
yketa/UBC---Spring-2018---code
cmkde.c
// Extension cmkde.c (together with cmkde.h) provides functions to efficiently // compute the asymptotic mean squared integrated error (AMISE), its gradient // and Hessian matrix. It is meant to be used by the active_particles.mkde // Python module. (see // https://yketa.github.io/UBC_2018_Wiki/#Multivariate%20kernel%2...
yketa/UBC---Spring-2018---code
cmkde.h
#ifndef CMKDE_H #define CMKDE_H // ---- STRUCTURES ---- typedef struct SampleData{ // Structure containing all data relevant to computation in this library. // Reflected by active_particles.mkde._SampleData. // // data sample int n; // number of data points int d; // number of di...
Bu11etmagnet/string-benchmark
string-benchmark/string-benchmark.h
<gh_stars>0 // string-benchmark.h : Include file for standard system include files, // or project specific include files. #pragma once #include <benchmark/benchmark.h> #include <absl/strings/str_cat.h> #include <iostream> #include <sstream> #include <cassert>
JoeyBodnar/WhiteFlowerFactory
Sources/WhiteFlowerFactory/WhiteFlowerFactory.h
// // WhiteFlowerFactory.h // WhiteFlowerFactory // // Created by <NAME> on 8/16/19. // Copyright © 2019 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for WhiteFlowerFactory. FOUNDATION_EXPORT double WhiteFlowerFactoryVersionNumber; //! Project version string for Wh...
isandboy/SYWechatOpenSDK
SYWechatOpenSDK/SYWechatOpenSDKDummp.h
// // SYWechatOpenSDKDummp.h // Pods // // Created by Allen on 29/07/2017. // // #import <Foundation/Foundation.h> @interface SYWechatOpenSDKDummp : NSObject @end
DandilionLau/Visually-Imbalanced-Stereo
models/layers/SeparableConv/src/SeparableConvolution_kernel.h
<reponame>DandilionLau/Visually-Imbalanced-Stereo #ifdef __cplusplus extern "C" { #endif void SeparableConvolution_kernel_forward( THCState* state, THCudaTensor* input, THCudaTensor* vertical, THCudaTensor* horizontal, THCudaTensor* output ); void SeparableConvolution_kernel_forward_only_vertical( THCState* st...
DandilionLau/Visually-Imbalanced-Stereo
models/layers/SeparableConv/src/SeparableConvolution_cuda.h
<reponame>DandilionLau/Visually-Imbalanced-Stereo int SeparableConvolution_cuda_forward( THCudaTensor* input, THCudaTensor* vertical, int size_vertical, THCudaTensor* horizontal, int size_horizontal, THCudaTensor* output ); int SeparableConvolution_cuda_backward( THCudaTensor* input, THCudaTensor* vertic...
DandilionLau/Visually-Imbalanced-Stereo
models/layers/SeparableConv/src/SeparableConvolution_cuda.c
<gh_stars>1-10 #include <THC.h> #include <THCGeneral.h> #include "SeparableConvolution_kernel.h" extern THCState* state; int SeparableConvolution_cuda_forward( THCudaTensor* input, THCudaTensor* vertical, int size_vertical, THCudaTensor* horizontal, int size_horizontal, THCudaTensor* output ) { if(...
burakkozluca/42
Libft/Libft/ft_itoa.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_itoa.c :+: :+: :+: ...
burakkozluca/42
ft_printf/src/ft_print_utils.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_print_utils.c :+: :+: :+: ...
burakkozluca/42
Libft/Libft/ft_strtrim.c
<filename>Libft/Libft/ft_strtrim.c /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strtrim.c ...
burakkozluca/42
ft_printf/include/ft_printf.h
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_printf.h :+: :+: :+: ...
burakkozluca/42
Libft/Libft/main.c
<filename>Libft/Libft/main.c #include <stdio.h> #include <ctype.h> #include <string.h> #include "libft.h" #include <fcntl.h> void alt_cizhi() { printf("\n------------------------ 000000 ------------------------\n"); } void test_isalpha () { printf("*** isalpha ***\nmain dosyası yazılmadı"); alt_cizhi(); } void ...
burakkozluca/42
Libft/Libft/ft_memcmp.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memcmp.c :+: :+: :+: ...
burakkozluca/42
ft_printf/src/ft_formats.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_formats.c :+: :+: :+: ...
burakkozluca/42
Libft/Libft/ft_strmapi.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strmapi.c :+: :+: :+: ...
burakkozluca/42
Libft/Libft/ft_strlcat.c
<reponame>burakkozluca/42 /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strlcat.c ...
burakkozluca/42
Libft/Libft/ft_atoi.c
<reponame>burakkozluca/42 /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_atoi.c ...
burakkozluca/42
ft_printf/src/ft_print_ptr.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_print_ptr.c :+: :+: :+: ...
burakkozluca/42
Libft/Libft/libft.h
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* libft.h :+: :+: :+: ...
burakkozluca/42
Libft/Libft/ft_memmove.c
<reponame>burakkozluca/42<filename>Libft/Libft/ft_memmove.c /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memmove.c...
burakkozluca/42
Libft/Libft/ft_split.c
<reponame>burakkozluca/42 /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_split.c ...
Overtorment/rn-ldk
ios/LDKFramework.xcframework/ios-x86_64-simulator/LDKFramework.framework/Headers/ldk_ver.h
<reponame>Overtorment/rn-ldk #ifndef _LDK_HEADER_VER static inline int _ldk_strncmp(const char *s1, const char *s2, uint64_t n) { if (n && *s1 != *s2) return 1; while (n && *s1 != 0 && *s2 != 0) { s1++; s2++; n--; if (n && *s1 != *s2) return 1; } return 0; } #define _LDK_HEADER_VER "v0.0.102-7-g79146f02973cb02...
RPI-HPC/libmctp
tests/test_bridge.c
/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <libmctp.h> #include <libmctp-alloc.h> #include "test-utils.h" struct mctp_binding_bridge { struct mctp_binding binding; int rx_count; int tx_count; uint8_t ...
aymanexpo/snake-game
defs.h
<reponame>aymanexpo/snake-game /* *************************************************** defs.h **************************************************** Constantes symboliques **************************************************** par ://-----------------------AYMANE TALIBI----------------------------------- */ //------...
aymanexpo/snake-game
stdinc.h
//-----------------------AYMANE TALIBI----------------------------------- //declaration de l entete stdinc //-----------------------AYMANE TALIBI----------------------------------- #ifndef __STDINC_H__ #define __STDINC_H__ //-----------------------AYMANE TALIBI----------------------------------- typedef unsigned ...
bngesp/arduino-mqtt-sn-client
TransmissionProtocolUartBridge.h
/* * The MIT License (MIT) * * Copyright (C) 2018 Copyright (c) 2018 <NAME> */ #ifndef ARDUINO_MQTTSN_CLIENT_TRANSMISSIONPROTOCOLUARTBRDIGE_H #define ARDUINO_MQTTSN_CLIENT_TRANSMISSIONPROTOCOLUARTBRDIGE_H #include "MqttSnMessageHandler.h" #include "System.h" #include <cstdint> #include <cerrno> #include "global_defin...
bngesp/arduino-mqtt-sn-client
mqttsn_messages.h
<reponame>bngesp/arduino-mqtt-sn-client<filename>mqttsn_messages.h /* The MIT License (MIT) Copyright (C) 2014 <NAME> heavily edited by <NAME> 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 with...
cmonr/meta-pelion-edge
recipes-wigwag/panic/files/panic.c
<filename>recipes-wigwag/panic/files/panic.c // panic.c #include <linux/module.h> static int __init panic_init_module(void) { panic(" panic has been called"); } module_init(panic_init_module); MODULE_LICENSE("GPL");
chibinz/ParallelBFS
src/bfs.c
<filename>src/bfs.c #include <assert.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include "bfs.h" #include "bitmap.h" #include "csr.h" #include "queue.h" #include "types.h" void write_bfs_result(bfs_result r, u32 n, FILE *f) { for (u32 i = 0; i < n; i += 1) { fprintf(f, "%u\t%u\t%u\n", i, r....
chibinz/ParallelBFS
src/coo.c
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include "coo.h" #include "types.h" coo *coo_new(u32 m, u32 n, u32 nz) { coo_tup *tup = malloc(sizeof(coo_tup) * nz); coo *ret = malloc(sizeof(coo)); *ret = (coo){m, n, nz, tup}; return ret; } coo *coo_from_mkt(FILE *mkt) { u32 m, n, nz, i = 0; ...
chibinz/ParallelBFS
src/csr.c
<reponame>chibinz/ParallelBFS #include <stdio.h> #include <stdlib.h> #include <string.h> #include "coo.h" #include "csr.h" #include "types.h" void write_csr(csr *mat, FILE *f) { for (u32 i = 0; i < mat->m; i += 1) { for (u32 j = csr_row_begin(mat, i); j < csr_row_end(mat, i); j += 1) { fprintf(f, "%u\t", ...
chibinz/ParallelBFS
include/coo.h
<gh_stars>1-10 #pragma once #include <stdio.h> #include "types.h" /// 3 - tuple containing single coordinate list matrix element typedef struct { /// Row index u32 i; /// Column index u32 j; /// Actual value u32 v; } coo_tup; /// 'Coordinate List' representation of sparse matrix typedef struct matrix_co...
chibinz/ParallelBFS
src/bitmap.c
<filename>src/bitmap.c #include <assert.h> #include <stdatomic.h> #include <stdbool.h> #include <stdlib.h> #include "bitmap.h" #include "types.h" bitmap *bitmap_new(u32 capacity) { atomic_uint *map = calloc((capacity / 32 + 1), sizeof(atomic_uint)); bitmap *ret = malloc(sizeof(bitmap)); *ret = (bitmap){capacit...
chibinz/ParallelBFS
include/queue.h
#pragma once #include "types.h" typedef struct { u32 front; u32 end; u32 capacity; u32 *data; } queue; queue *queue_new(u32 n); void queue_push(queue *q, u32 e); u32 queue_pop(queue *q); void queue_free(queue *q); bool queue_empty(queue *q);
chibinz/ParallelBFS
include/bitmap.h
#pragma once #include <stdatomic.h> #include <stdbool.h> #include "types.h" typedef struct { u32 capacity; atomic_uint *map; } bitmap; bitmap *bitmap_new(u32 capacity); void bitmap_set(bitmap *b, u32 n); bool bitmap_test(bitmap *b, u32 n); /// Atomically changes the state of a bit to set (true) /// and retur...
chibinz/ParallelBFS
src/main.c
#include <assert.h> #include <math.h> #include <omp.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "bfs.h" #include "coo.h" #include "csr.h" #include "types.h" static coo_tup list[] = { {0, 1, 1}, {0, 2, 1}, {1, 3, 1}, {1, 4, 1}, {2, 4, 1}, {3, 4, 1}, {3, 5, 1}, {4, 5...
chibinz/ParallelBFS
include/frontier.h
#pragma once #include <stdbool.h> #include "types.h" #define SENTINEL (u32)(-1) typedef struct { u32 *node; u32 len; } frontier; void prefix_sum(u32 *a, u32 len); void prefix_sum_omp(u32 *a, u32 len); frontier *frontier_new(u32 n); frontier *frontier_with_src(u32 src); bool frontier_empty(frontier *f); vo...
chibinz/ParallelBFS
include/csr.h
#pragma once #include "coo.h" #include "types.h" /// 'Compressed Sparse Row' representation of sparse matrix typedef struct matrix_csr { /// Number of rows u32 m; /// Number of columns u32 n; /// Number of non-zero elements u32 nz; /// Top level column pointers u32 *r; /// Secondary row indices u3...
chibinz/ParallelBFS
src/bfs_omp.c
#include <assert.h> #include <stdbool.h> #include <stdlib.h> #include "bfs.h" #include "bitmap.h" #include "frontier.h" #include "types.h" bfs_result bfs_omp(csr *adj, u32 src) { // Adjacency matrix should be square matrix assert(adj->m == adj->n); frontier *f = frontier_new(adj->nz); frontier *fnext = front...
chibinz/ParallelBFS
src/frontier.c
#include <omp.h> #include <stdatomic.h> #include <stdbool.h> #include <stdlib.h> #include "frontier.h" #include "types.h" void prefix_sum(u32 *a, u32 len) { for (u32 i = 1; i < len; i += 1) { a[i] = a[i] + a[i - 1]; } } void prefix_sum_omp(u32 *a, u32 len) { u32 *local; #pragma omp parallel { u32 id ...
chibinz/ParallelBFS
src/queue.c
#include <assert.h> #include <stdbool.h> #include <stdlib.h> #include "types.h" typedef struct { u32 front; u32 end; u32 capacity; u32 *data; } queue; queue *queue_new(u32 capacity) { u32 *data = malloc(sizeof(u32) * capacity); queue *ret = malloc(sizeof(queue)); *ret = (queue){0, 0, capacity, data}; ...
chibinz/ParallelBFS
include/types.h
<reponame>chibinz/ParallelBFS #pragma once #include <stddef.h> #include <stdint.h> typedef int8_t i8; typedef uint8_t u8; typedef int16_t i16; typedef uint16_t u16; typedef int32_t i32; typedef uint32_t u32; typedef int64_t i64; typedef uint64_t u64; // typedef size_t usize;
chibinz/ParallelBFS
include/bfs.h
#pragma once #include "csr.h" #include "types.h" /// Output Format /// <id> <distance> <parent> typedef struct { u32 *parent; u32 *distance; } bfs_result; typedef bfs_result (*bfs_func)(csr *, u32); /// Serial breadth first search on csr matrix bfs_result bfs(csr *adj, u32 src); /// Parallel breadth first sear...
KPO-2020-2021/zad3-RafalSzyinski1
include/GNUPlot.h
<reponame>KPO-2020-2021/zad3-RafalSzyinski1 // // Created by rafal on 07.04.2021. // #ifndef ROTATION2D_GNUPLOT_H #define ROTATION2D_GNUPLOT_H #include <string> #include <fstream> #include <iostream> #include "lacze_do_gnuplota.hh" #include "Rectangle.h" class GNUPlot { private: std::string vertexFile; sta...
KPO-2020-2021/zad3-RafalSzyinski1
include/Transform.h
<gh_stars>0 // // Created by rafal on 07.04.2021. // #ifndef ROTATION2D_TRANSFORM_H #define ROTATION2D_TRANSFORM_H #include "Rectangle.h" #include <vector> class Transform { private: Vector2D<double> tra; Matrix22<double> rot; Matrix22<double> rotArZero; double sca; public: Transform(); Tran...
KPO-2020-2021/zad3-RafalSzyinski1
include/Matrix22.h
// // Created by rafal on 06.04.2021. // #ifndef ROTATION2D_MATRIX22_H #define ROTATION2D_MATRIX22_H #include "Vector2D.h" template<typename T> class Rectangle; template<typename T> class Matrix22{ private: Vector2D<T> x; Vector2D<T> y; public: Matrix22(); Matrix22(T _x1, T _x2, T _y1, T _y2); M...
KPO-2020-2021/zad3-RafalSzyinski1
include/Menu.h
<filename>include/Menu.h // // Created by rafal on 08.04.2021. // #ifndef ROTATION2D_MENU_H #define ROTATION2D_MENU_H #include "Transform.h" #include "GNUPlot.h" class Menu { private: Transform transform; Rectangle<double> rectangle; int loop_times; GNUPlot plot; public: Menu(); explicit Menu...
KPO-2020-2021/zad3-RafalSzyinski1
include/Vector2D.h
<filename>include/Vector2D.h // // Created by rafal on 05.04.2021. // #ifndef ROTATION2D_VECTOR2D_H #define ROTATION2D_VECTOR2D_H #include <iostream> #include <cmath> #include <iomanip> #define DEC_PLACE 10 template<typename T> class Matrix22; template<typename T> class Rectangle; template<typename T> class Vecto...
KPO-2020-2021/zad3-RafalSzyinski1
include/Rectangle.h
<reponame>KPO-2020-2021/zad3-RafalSzyinski1 // // Created by rafal on 06.04.2021. // #ifndef ROTATION2D_RECTANGLE_H #define ROTATION2D_RECTANGLE_H #include "Vector2D.h" #include "Matrix22.h" #include <array> template<typename T> class Rectangle { private: Vector2D<T> a; Vector2D<T> b; Vector2D<T> c; ...
muhammadali175302/ubank-api
ubank.c
<gh_stars>0 #include <stdio.h> #include <curl/curl.h> void main () { CURL *curl; CURLcode response; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { struct curl_slist *chunk = NULL; chunk = curl_slist_append(chunk, "Authorization: Bearer -<KEY>"); curl_easy_set...
gnipbao/simple-demos
src/webassembly/hello_world.c
#include <stdio.h> long factorial(int num) { if (num <= 0) return 1; else { return num * factorial(num - 1); } } int main() { int num = factorial(10); printf("The Result: %d \n", num); }
mabdelaal86/python-courses
Basics/1/c_examples/rectangle.c
#include <stdio.h> int main() { int width, length; printf("Enter rectangle width: "); scanf("%d", &width); printf("Enter rectangle length: "); scanf("%d", &length); int area = width * length; int perimeter = (width + length) * 2; printf("Area = %d\n", area); printf("Perimeter = ...
mabdelaal86/python-courses
Basics/1/c_examples/gui.c
#include <gtk/gtk.h> GtkWidget *hscale, *vscale; static void cb_pos_menu_select( GtkWidget *item, GtkPositionType pos ) { /* Set the value position on both scale widgets */ gtk_scale_set_value_pos (GTK_SCALE (hscale), pos); gtk_scale_set_value_pos (GTK_SCALE (vscale)...
romgrk/pg_fzy
fzy.c
/* * fzy.c */ #include "postgres.h" #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <sys/stat.h> #include <unistd.h> #include "funcapi.h" #include "fzy_native/src/match.c" #ifndef unlikely #define unlikely(x) __builtin_expect((x), 0) #endif PG_MODULE_MAG...
crosspass/leetcode
jewels_and_stones/c/src/num_jewels_in_stones.c
int num_jewels_in_stones(char *j, char *s) { char char_index[128]; char *p; int count = 0; p = j; for(int i = 0; i < 128; i++) { char_index[i] = 0; } while(*p != '\0') { char_index[*p] = 1; p++; } p = s; while(*p != '\0') { if (char_index[*p] == 1) { count++; } p++; }...
crosspass/leetcode
non_negative_integers_without_consecutive_ones/c/a.c
<filename>non_negative_integers_without_consecutive_ones/c/a.c #include <minunit.h> #include <stdio.h> #include <stdlib.h> // https://leetcode.com/problems/non-negative-integers-without-consecutive-ones/ int findIntegers(int num) { } MU_TEST(test_check) { int a = 5; mu_assert_int_eq(5, findIntegers(a)); } MU_TE...
crosspass/leetcode
gas_station/c/gas_station.c
<reponame>crosspass/leetcode<filename>gas_station/c/gas_station.c #include <minunit.h> #include <stdio.h> #include <stdlib.h> // https://leetcode.com/problems/gas-station/description/ int _canCompleteCircuit(int* gas, int* cost, int size, int index) { int tank = gas[index]; int end = index; int last_index = si...
crosspass/leetcode
number_of_segments_in_a_string/c/a.c
<reponame>crosspass/leetcode<filename>number_of_segments_in_a_string/c/a.c<gh_stars>1-10 #include <minunit.h> #include <stdio.h> #include <stdlib.h> // https://leetcode.com/problems/non-negative-integers-without-consecutive-ones/ int countSegments(char* s) { int number = 0; int word_start = 1; for(; *s != '\0';...
crosspass/leetcode
c/test.c
<reponame>crosspass/leetcode<gh_stars>1-10 #include <stdio.h> #include <stdlib.h> int main() { int *array = malloc(200 * sizeof(int)); int * array_start = array; const int MAX = 10; /* for(int i = 0; i < MAX; i++) { */ /* *array++ = i; */ /* } */ for (int i = 0; i < MAX; i++) { printf("array[%d] =>...
crosspass/leetcode
hamming_distance/c/hamming_distance.c
#include <minunit.h> int countBit(int x); int hammingDistance(int x, int y) { int dist = 0; unsigned val = x ^ y; // Count the number of bits set while (val != 0) { // A bit is set, so increment the count and clear the bit dist++; val &= val - 1; } // Return the number of differ...
crosspass/leetcode
split_array_into_fibonacci_sequence/c/split_array_into_fibonacci_sequence.c
#include <minunit> // https://leetcode.com/problems/split-array-into-fibonacci-sequence/description/ /** * Return an array of size *returnSize. * Note: The returned array must be malloced, assume caller calls free(). */ int* splitIntoFibonacci(char* S, int* returnSize) { for(i = 1; i < 11; i++) { } } in...
crosspass/leetcode
to_lowercase/c/test/check_to_lowercase.c
#include <stdio.h> #include <minunit.h> #include "../src/to_lowercase.h" MU_TEST(test_string_eq){ char s[] = "A HERO"; mu_assert_string_eq("a hero", to_lowercase(s)); char s2[] = "a [hero"; mu_assert_string_eq("a [hero", to_lowercase(s2)); char s3[] = "a hero"; mu_assert_string_eq("a hero", to_lowercase(s3...
crosspass/leetcode
to_lowercase/c/src/to_lowercase.h
<gh_stars>1-10 char* to_lowercase(char* str);
crosspass/leetcode
to_lowercase/c/src/to_lowercase.c
<reponame>crosspass/leetcode<filename>to_lowercase/c/src/to_lowercase.c<gh_stars>1-10 #include <minunit.h> char* to_lowercase(char* str) { char *s = str; static char char_index[128]; char_index[65] = 'a'; char_index[66] = 'b'; char_index[67] = 'c'; char_index[68] = 'd'; char_index[69] = 'e'; char_index...
crosspass/leetcode
qsort.c
<gh_stars>1-10 # include <stdio.h> void qsort(int array[], int lo, int hi); void qsort2(int array[], int lo, int hi); int partition(int array[], int lo, int hi); int partition2(int array[], int lo, int hi); void swap(int array[], int i, int j); void lprintf(int array[], int size); int main() { /* int array[] = { ...
crosspass/leetcode
jewels_and_stones/c/test/check_num_jewels_in_stones.c
#include <minunit.h> #include "../src/num_jewels_in_stones.h" MU_TEST(test_check) { int count = num_jewels_in_stones("aA", "aAAbbbb"); mu_check(3 == count); mu_assert(2 == num_jewels_in_stones("abcdef", "abz"), "(abcdef, abz) => 2"); } MU_TEST_SUITE(test_suite) { MU_RUN_TEST(test_check); } int main(void) { ...
crosspass/leetcode
robot_return_to_origin/c/robot_return_to_origin.c
#include <minunit.h> // https://leetcode.com/problems/robot-return-to-origin/description/ int judgeCircle(char * str) { int l_count = 0; int r_count = 0; int u_count = 0; int d_count = 0; char c; while((c = *str++) != '\0') { switch(c) { case 'L': l_count++; break; case 'R': ...
crosspass/leetcode
merge_sorted_array/c/merge_sorted_array.c
#include <minunit.h> #include <stdio.h> // https://leetcode.com/problems/merge-sorted-array/description/ void merge(int* nums1, int m, int* nums2, int n) { int end = n + m -1; m--; n--; while(n != -1 && m != -1) { if (nums2[n] >= nums1[m]) { nums1[end--] = nums2[n--]; } else { nums1[end--...
crosspass/leetcode
unique_mores_code_words/c/unique_mores_code_words.c
#include <stdlib.h> #include <string.h> #include <minunit.h> int check_uniq(char** words, int wordsSize, char *str); int unique_mores_representations(char** words, int wordsSize) { if (wordsSize < 1) { return 0; } static char *mores[] = { ".-", "-...", "-.-.", "-..", ".", "..-.", ...
crosspass/leetcode
binary_tree_postorder_traversal/c/binary_tree_postorder_traversal.c
#include <minunit.h> #include <stdio.h> #include <stdlib.h> /** * Definition for a binary tree node. */ typedef struct tnode { int val; struct tnode *left; struct tnode *right; } TreeNode; void postorderTraversal1(TreeNode* root, int* returnSize, int** array) { int l_size = 0; int r_size = 0; int* left...
crosspass/leetcode
jewels_and_stones/c/src/num_jewels_in_stones.h
int num_jewels_in_stones(char *j, char *s);
crosspass/leetcode
peak_index_in_a_mountain_array/c/peak_index_in_a_mountain_array.c
<reponame>crosspass/leetcode #include <minunit.h> #include <stdio.h> #include <stdlib.h> // https://leetcode.com/problems/peak-index-in-a-mountain-array/description/ /* 3 <= A.length <= 10000 */ /* 0 <= A[i] <= 10^6 */ /* A is a mountain, as defined above. */ int peakIndexInMountainArray(int* A, int ASize) { for(i...
crosspass/leetcode
flatten_nested_list_iterator/c/flatten_nested_list_iterator.c
// https://leetcode.com/problems/flatten-nested-list-iterator/description/ /** * ********************************************************************* * // This is the interface that allows for creating nested lists. * // You should not implement it, or speculate about its implementation * ***********************...
crosspass/leetcode
reorganize_string/c/reorganize_string.c
#include <minunit.h> #include <stdio.h> // https://leetcode.com/problems/reorganize-string/description/ char* reorganizeString(char* S) { } MU_TEST(test_check) { mu_check(mu_check_array(ret3, e, 6)); } MU_TEST_SUITE(test_suite) { MU_RUN_TEST(test_check); } int main(void) { MU_RUN_SUITE(test_suite); MU_REPO...
crosspass/leetcode
flipping_an_image/c/flipping_an_image.c
#include <stdlib> #include <minunit> // https://leetcode.com/problems/flipping-an-image/description/ /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *columnSizes array. * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free(). */...
crosspass/leetcode
single_number/c/single_number.c
<filename>single_number/c/single_number.c #include <minunit.h> #include <stdio.h> #include <stdlib.h> // https://leetcode.com/problems/single-number/description/ int singleNumber(int* nums, int numsSize) { int ret = nums[0]; for (int i = 1; i < numsSize; i++) { ret ^= nums[i]; } return ret; } MU_TEST(tes...