Skip to content

Instantly share code, notes, and snippets.

View DieTime's full-sized avatar
Working from home

Denis Glazkov DieTime

Working from home
View GitHub Profile
#include <iostream>
#include <memory>
#include <mutex>
#include <type_traits>
namespace utils {
template <typename T, typename Interface>
struct singleton : public Interface
{
@DieTime
DieTime / async.cpp
Created August 1, 2022 16:38
Simple async C++
#include <chrono>
#include <functional>
#include <iostream>
#include <memory>
#include <queue>
namespace Async {
struct Task
{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
typedef enum {
JSON_STR,
JSON_INT,
JSON_FLOAT,
JSON_ARRAY,
@DieTime
DieTime / file10.c
Last active May 30, 2022 19:08
matrix multiplication
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <time.h>
void display(int *matrix, int dimension, const char *name) {
int i, j;
printf("Матрица %s:\n", name);
for (i = 0; i < dimension; i++) {
@DieTime
DieTime / linpack-fixed.c
Created February 17, 2022 06:57
Linpack overflow fix
# include <stdlib.h>
# include <stdio.h>
# include <math.h>
# include <time.h>
# include <stdint.h>
int main ( );
double cpu_time ( );
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy );
@DieTime
DieTime / targeted-sigals.c
Created November 25, 2021 17:10
DBus targeted signals
#include <stdio.h>
#include <glib.h>
#include "signal-test-dbus.h"
static GSList *subscribers = NULL;
static GDBusConnection *connection = NULL;
static void emit_targeted_signal(gpointer subscriber, G_GNUC_UNUSED gpointer user_data) {
g_print("Send signal to %s\n", (char *)subscriber);
g_dbus_connection_emit_signal(connection,
#include <iostream>
#include <deque>
using namespace std;
typedef int8_t i8;
typedef int16_t i16;
deque<int> int2arr(i8 a);
deque<int> int2arr(i16 a);
@DieTime
DieTime / rootwords.cpp
Created May 28, 2020 19:35
Finding root words in file
/* Отключение предупреждений Visual Studio при
использовании "небезопасных" функций (strtok) */
#pragma warning(disable : 4996)
#include <iostream>
#include <fstream>
#include <string>
#include <locale>
#include <windows.h>
@DieTime
DieTime / Queue.cpp
Last active May 28, 2020 06:45
Queue with insert ascending
#include <iostream>
#include <cassert>
using namespace std;
// Элемент очереди
class Node {
public:
int value; // Значение
Node *last; // Предыдущий элемент
@DieTime
DieTime / М3О-208Б-18 Глазков ЧМ Задания из методички.ipynb
Last active May 24, 2020 08:31
Решение задач из методички по численным методам
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.