Skip to content

Instantly share code, notes, and snippets.

View M0nteCarl0's full-sized avatar
evolve or repeat

Alex M0nteCarl0

evolve or repeat
View GitHub Profile
@M0nteCarl0
M0nteCarl0 / fast_memcpy.c
Created November 18, 2024 11:32
memcpy_implenations
void *fast_memcpy(void *dest, const void *src, size_t n) {
size_t *d = (size_t *)dest;
const size_t *s = (const size_t *)src;
size_t block_size = sizeof(size_t);
while (n >= block_size) {
*d++ = *s++;
n -= block_size;
}
@M0nteCarl0
M0nteCarl0 / package_deb.sh
Created July 14, 2024 14:24
debian_package build
#!/bin/bash
# Define package metadata
PACKAGE_NAME="myapp"
VERSION="1.0"
ARCHITECTURE="amd64"
MAINTAINER="Your Name <[email protected]>"
DESCRIPTION="Description of your application"
# Create package directories
@M0nteCarl0
M0nteCarl0 / syscl_lib_main.sh
Created June 6, 2024 16:49
Intel DPC SYCL build .so and link to cpp application
#bin/sh
icpx -fPIC -c -fsycl sycl-lib.cc
icpx -fsycl -shared sycl-lib.o -o libsycl-lib.so
g++ -o sycl-test test-main.cc -L. -lsycl-lib
./sycl-test
@M0nteCarl0
M0nteCarl0 / main.cpp
Created April 29, 2024 10:19
Intel DPCPP library functions linkage for host code
void func();
int main() {
func();
return 0;
}
@M0nteCarl0
M0nteCarl0 / JsonComand.cs
Created March 29, 2024 08:09
Cef Sharp json protocol snippet
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace TransportProto
{
public class JsonComand
@M0nteCarl0
M0nteCarl0 / OptrisTemperature.cs
Created March 13, 2024 14:26
OptrisTemperature data harvester
using System;
using System.IO.Ports;
using System.Runtime.CompilerServices;
using System.Threading;
using NLog;
public class OptrisTemperature
{
private Logger logger
{
@M0nteCarl0
M0nteCarl0 / graph-ql-server.go
Created February 12, 2024 10:34
GraphQL CRM base
package main
import (
"context"
"database/sql"
"log"
"net/http"
"github.com/graphql-go/graphql"
"github.com/graphql-go/handler"
@M0nteCarl0
M0nteCarl0 / Questions_cpp.md
Last active July 10, 2024 03:49
400 вопросов с собеседований C++

Junior

Общие вопросы

  1. В чем заключаются основные принципы ООП?

  2. Что такое сложность алгоритма?

  3. Код работает неправильно. Что делать?

@M0nteCarl0
M0nteCarl0 / LockFreeFIFO.cpp
Created December 27, 2023 12:17
C++ lock-free structures
#include <atomic>
#include <memory>
template <typename T>
class LockFreeFIFO {
private:
struct Node {
std::shared_ptr<T> data;
Node* next;
@M0nteCarl0
M0nteCarl0 / CRTP.cpp
Last active July 26, 2024 19:13
Senior Interview Q&A and code examples
#include <iostream>
// Base class using CRTP
template <typename Derived>
class Base {
public:
void doSomething() {
static_cast<Derived*>(this)->implementation();
}