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
// I have a special case where i need to create and give a c++ class with virtual methods, | |
// so i came up with this proof of concept. | |
// Known limitation: | |
// - accesing class member/methods from "this" is pertty impossible without storing the Cxx struct globaly | |
// - you can't pass struct methods since the struct ptr will overwrite the real "this" ptr | |
// use it: | |
// v -enable-globals -shared vxx.v (work well with autofree and prod) | |
// g++ vxx_class.cc |
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
// poc of a simple implementation of python range bases loop in c++ | |
#include "iostream" | |
#include "vector" | |
template <typename T> | |
struct Range { | |
private: | |
std::vector<T> _vecRange = { }; |
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 "vector" | |
#include <math.h> | |
struct Vec3 { | |
float x,y,z; | |
}; | |
template <class T> | |
Vec3 getClosest(std::vector<T> withPosVec, const Vec3 toPos) noexcept { |
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 "vector" | |
#include "cstdint" | |
// poc of a simple implementation of python list Enumerate in c++ | |
// I choosed to use struct over std::tuple like in (python) because of the way to get the data, i prefer use name over numbers: | |
// elem.pos > std::get<0>(elem) | |
template<class T> |
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 "cstdint" | |
#include "chrono" | |
// Mac M1 (Apple clang version 13.0.0) 2.9s | |
// - Highest palindrome -> 98344389 | |
// Ryzen 5 3600x (MinGW-W64 8.1.0) 1.6s | |
// - Highest palindrome -> 98344389 | |
uint16_t intLen(uint64_t forInt) { |
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 "cstdint" | |
uint16_t intLen(uint32_t forInt) { | |
uint64_t factor = 1; | |
uint16_t intLen; | |
for ( intLen = 0 ; (forInt / factor) != 0 ; intLen++ ) { | |
factor *= 10; | |
} |
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" | |
int find(const char* word, const char* in, const int startAt = 0, int endAt = 0) { | |
int begin; | |
int verifyCount = 0; | |
int withSize = std::strlen(in); | |
// loop jusqu'a trouver une égalité du premier characthere de word et le char de l'index dans la loop | |
for ( int i = startAt; i <= ((endAt == 0) ? withSize:endAt); i++ ) { | |
// si le premier char de word et le char de l'index dans la loop sont égaux alors ont enrefistre l'index | |
// qui correspond a la position du premier char de word |
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
/* | |
Two functions wich generate dice combinations for diceware list, the firstone is oriented to be compact and the seconds oriented to be efficient | |
- results: withMaxInt: 6 and andMinLenght: 5 (Imac 2013, i5, swift 5.3.2) | |
Efficient done in -> 62.49544095993042 seconds | |
Compact done in -> 76.10342800617218 seconds | |
- results: withMaxInt: 6 and andMinLenght: 5 (Macbook air 2020, M1, swift 5.4) | |
Efficient done in -> 0.06685197353363037 seconds | |
Compact done in -> 0.23580491542816162 seconds |
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
/* | |
Simple script wich make the suite of conway with a give limit (100 on this file) | |
with some info about the time :) | |
made on ipad pro in swift playground ^^ | |
*/ | |
import Foundation | |
let startTime = Date().timeIntervalSinceReferenceDate |
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
-- Shiba (8173) | |
local surface = require 'gamesense/surface' | |
local anti_aim = require 'gamesense/antiaim_funcs' | |
local screen_size = client.screen_size | |
local entity_get_prop = entity.get_prop | |
local entity_get_local_player = entity.get_local_player | |
local ui_get = ui.get | |
local ui_set = ui.set | |
local new_hotkey = ui.new_hotkey |
NewerOlder