This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type MessageProcessor struct { | |
sendChannel chan<- string // Канал для отправки сообщений | |
receiveChannel <-chan string // Канал для приема сообщений |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cache | |
import ( | |
"context" | |
"database/sql" | |
"encoding/json" | |
"fmt" | |
"time" | |
"github.com/go-redis/redis/v8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"time" | |
"github.com/gin-gonic/gin" | |
"github.com/gorilla/websocket" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from catboost import CatBoostClassifier | |
from dask_ml.model_selection import train_test_split | |
from dask.distributed import Client, wait | |
import dask.dataframe as dd | |
# Start a Dask cluster with multiple workers | |
client = Client(n_workers=4) | |
# Read the data into a Dask DataFrame | |
data = dd.read_csv('data.csv') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
#define PIXEL_WIDTH 8 | |
#define IMAGE_WIDTH 640 | |
#define IMAGE_HEIGHT 480 | |
volatile uint8_t pixel_count = 0; | |
volatile uint8_t line_count = 0; | |
volatile uint8_t frame_count = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*###ICF### Section handled by ICF editor, don't touch! ****/ | |
/*-Editor annotation file-*/ | |
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ | |
/*-Specials-*/ | |
define symbol __ICFEDIT_intvec_start__ = 0x08000000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__global__ void cubic_interp(float* x, float* y, int n, float* x_new, float* y_new, int m) { | |
int idx = blockIdx.x * blockDim.x + threadIdx.x; | |
if (idx >= m) return; | |
int i = 1; | |
while (i < n && x[i] <= x_new[idx]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q: | |
By default, Linux builds user-space programs as dynamically linked applications. Please describe scenarios where you would change the default behavior to compile your application as a statically linked one. | |
A: | |
There are several scenarios where you would change the default behavior to compile your application as a statically linked one: | |
1. Portability: If you want to ensure that your application will run on any system without having to worry about missing shared libraries or different versions of the same libraries, then compiling it statically is a good option. | |
2. Security: If you want to reduce the attack surface of your application by eliminating the need for external dependencies, then compiling it statically can help improve security. | |
3. Performance: If your application requires fast startup times and low memory usage, then compiling it statically can provide a performance boost since it eliminates the overhead of dynamic linking. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <nlohmann/json.hpp> | |
using namespace std; | |
using json = nlohmann::json; | |
struct HistoryEntry { | |
std::string action; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <thread> | |
#include <vector> | |
#include <deque> | |
#include <mutex> | |
#include <condition_variable> | |
#include <boost/asio.hpp> | |
using boost::asio::ip::tcp; |