This file contains hidden or 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
import Foundation | |
// A custom error type for cancellation | |
enum TaskError: Error { | |
case canceled | |
} | |
// A struct to manage tasks and handle cancellation | |
class ConcurrentTaskManager { | |
This file contains hidden or 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
import re | |
from sklearn.model_selection import train_test_split, GridSearchCV | |
from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier | |
from sklearn.metrics import accuracy_score | |
from sklearn.preprocessing import LabelEncoder | |
from sklearn.impute import SimpleImputer | |
import pandas as pd | |
from sklearn.ensemble import AdaBoostClassifier | |
from sklearn.model_selection import train_test_split | |
import xgboost as xgb |
This file contains hidden or 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
import gymnasium as gym | |
import numpy as np | |
from tqdm import tqdm | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pickle | |
import os | |
env_train = gym.make('InvertedPendulum-v5') | |
# Define the dimensions of your state space | |
dim1 = 5 |
This file contains hidden or 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-learning Update rule | |
def q_learning_update(Q, state, action, reward, next_state, lr, discount): | |
""" | |
Q-learning update rule | |
Q(s, a) <- Q(s, a) + α * [r + γ * max_a Q(s', a) - Q(s, a)] | |
""" | |
# Compute the Q-value update using Q-learning formula | |
Q[state][action] += lr * (reward + discount * np.max(Q[next_state]) - Q[state][action]) | |
return Q |
This file contains hidden or 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
verified on Tplink Vc220-g3u | |
Dns cache disable from your os | |
Dhcp ip rental set 1 or 5 or 8 min not like 60 | |
Ağ geçidi sil | |
qos [ssid] = (max download) - 1000~ | |
Reset | |
;) | |
dns cache i windowstan disable edin |
This file contains hidden or 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 <queue> | |
#include <thread> | |
#include <mutex> | |
#include <condition_variable> | |
std::queue<int> dataQueue; | |
std::mutex mtx; | |
std::condition_variable cv; | |
const int maxQueueSize = 10; // Maximum queue size before backpressure is applied |
This file contains hidden or 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 <vector> | |
#include <cmath> | |
#include <string> | |
int main(){ | |
std::vector<std::pair<int, int>> vec; | |
std::vector<std::pair<int, int>> vecquen; | |
This file contains hidden or 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 <vector> | |
#include <cmath> | |
#include "attention.h" | |
// Function to compute the attention weights | |
std::vector<double> computeAttentionWeights(const std::vector<double>& query, const std::vector< std::vector<double> >& keys) { | |
int numKeys = keys.size(); | |
std::vector<double> attentionWeights(numKeys, 0.0); | |
double totalWeight = 0.0; |
This file contains hidden or 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
import Foundation | |
class ThreadInterruptionSimulator { | |
var threads: [Thread] = [] | |
var interrupterThread: Thread? | |
// Function to simulate work done by threads | |
func worker(threadNum: Int) { | |
// for _ in 0..<5 { | |
This file contains hidden or 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
/* This is the original elf.h file from the GNU C Library; I only removed | |
the inclusion of feature.h and added definitions of __BEGIN_DECLS and | |
__END_DECLS as documented in | |
https://cmd.inp.nsk.su/old/cmd2/manuals/gnudocs/gnudocs/libtool/libtool_36.html | |
On macOS, simply copy the file to /usr/local/include/. | |
Mathias Lafeldt <mathias.lafeldt@gmail.com> */ | |
/* This file defines standard ELF types, structures, and macros. |
NewerOlder