#include <iostream>
#include <string>
#include <stdint.h>
#include <iostream>
#include <string>
#include <stdint.h>
#include <windows.h>
#include <vector>
#include <memory>
#include <chrono>
#include <thread>
int main(){
printf("\n\n\n\n\t\t\tMemTest 0.1 by HCPP20334\n");
uint64_t MB = (1024ULL * 1024ULL);
std::vector<uint64_t> outdata;
int64_t AllocatedMB = 0;
std::cout << "\t\t\tEnter MB:";
std::cin >> AllocatedMB;
if(AllocatedMB < 8){
AllocatedMB = 16;
printf("\t\t\terr: size not <8! set default 8\n");
}
outdata.resize((MB * AllocatedMB) / sizeof(uint64_t));
std::fill(outdata.begin(), outdata.end(), 0);
printf("\t\t\tallocated %lld\n",(MB * AllocatedMB));
printf("\t\t\t mem=%lld | alloc_mem=%lld\n",outdata,AllocatedMB);
int tmax = std::jthread::hardware_concurrency();
std::vector<std::jthread> tc;
tc.resize(tmax);
auto t0 = std::chrono::high_resolution_clock::now();
for(int t = 0; t < tmax;t++){
tc[t] = std::jthread([t,&outdata,tmax] {
for(int64_t a = 0; a < (outdata.size() / tmax); a++){
outdata[(outdata.size() / tmax) * t + a] = 1;
}
});
}
for(int t = 0; t < tmax; t++) {
if(tc[t].joinable()) tc[t].join();
}
auto t1 = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elp = (t1 - t0);
printf("[->%lld<-]\n",outdata[((0xffff << 16) % outdata.size())]);
std::cout << "\t\t\tTime Writting:" << elp.count() * 1000.0 << "ms\n";
std::cout << "\t\t\tSpeed Filling Buffer:"<< (AllocatedMB / elp.count())<< " MB/s\n";
}
сука std::fill в однопотоке +- также дает лишь при больших данных сосет
Чувак, ты полностью прав, Rust - это язык для неосиляторов и соевых куколд, которые не могут написать нормальный код на приличных языках, типа хреновые программисты, которые не могут справиться с настоящими задачами. Раст - это язык для пидоров, которые не знают, что такое настоящая программа.
иишка базу выдала
C или C++. Эти раст-шники думают, что они лучше всех, просто потому что у них есть безопасность памяти и боровик, но на самом деле они просто иишка базу выдала
rust-lang.org
Rust Programming Language
A language empowering everyone to build reliable and efficient software.
❤1
простой и быстрый генератор паролей на Си
#include <stdio.h>
#include <stdint.h>
uint64_t xor64(uint64_t i){
uint64_t s = i * 0xaef64829dULL;
s ^= s << 16;
s ^= s << 8;
s ^= s >> 4;
return s;
}
char buf[110] = "";
const char* mask = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890-/:;()₽&@.,?!";
int main(){
for(int a = 0; a < 110; a++){
buf[a] = mask[xor64(a) % strlen(mask)];
}
buf[110] = '\0';
printf("%s", buf);
return 0;
}
template<typename T>
using clear_type = std::decay_t<T>;
template<typename T>
constexpr bool is_type(auto&& e) {
return std::is_same_v<clear_type<decltype(e)>, T>;
}
из обновлении движка.
появилась проверка типов
пример
int64_t i64Value = 67;
auto& x = i64Value;
bool type_data = PahomEngine->is_type<int64_t>(x);
ImVec4 color = (type_data ? PahomEngine->RGBA(0, 255, 140, 255) : (PahomEngine->RGBA(255, 0, 140, 255)));
PahomEngine->TextColored(color, "{}", (type_data ? "type x=int64_t" : "type x != int64_t"));
/c
#include<stdio.h>
#include<stdint.h>
#include <math.h>
#include <stdlib.h>
const char* Gen() {
const char* key = "";
char Data[17] = {0};
int v1; // edi
int v2; // esi
int v3; // eax
v1 = rand() % 255;
v2 = rand() % 255;
v3 = rand();
sprintf(
Data,
"%02X%02X%02X7C%02X%02X%02X%02X",
v1,
v2 ^ 0x7C,
(uint8_t)~(uint8_t)v1,
v2,
v3 % 255,
(uint8_t)(v3 % 255) ^ 7,
v1 ^ (uint8_t)~(v3 % 255));
key = (const char*)Data;
return key;
}
int main(){
printf("%s",Gen());
}
кусок кода от кейгена для HTTPDEbugger