Skip to content

Instantly share code, notes, and snippets.

View DoctorGester's full-sized avatar

Kirill Artemov DoctorGester

View GitHub Profile
private static void parse() {
try {
String basePath = "C:\\Workspace\\crumbling-islands-arena\\game\\panorama\\localization\\";
List<String> lines = Files.readAllLines(Paths.get(basePath + "addon_russian.txt"));
Pattern linePattern = Pattern.compile(".*HeroTips_npc_dota_hero_([^\"]*).*");
Pattern abilityPattern = Pattern.compile("([QWER])</font>:([^<\"]*)(<br/>|\")??");
List<String> result = new ArrayList<>();
#include "menu_common.as"
IMGUI imGUI;
void Init(string p_level_name) {
}
void DrawGUI() {
imGUI.render();
}
public class Graph extends Canvas{
Timer mainTimer;
Thread mainThread;
BufferStrategy bufferStrategy;
BufferedImage bufferImage = Game.graphConf.createCompatibleImage(Game.screenWidth, Game.screenHeight);
static RenderingHints renderingHints;
float alpha = 0.8f;
int loadLen = 0;
variables (
Bool "Is in a race" False
Bool "Just finished racing" False
Bool "Already tried racing" False
Number "Race start time" 0
Number "Race result time" 0
)
trigger "Race start" (
description ""
const naive_search_index = [];
for (let folder of folders) {
naive_search_index.push({
name: folder.title.toLowerCase(),
id: string_id_to_number(folder.id)
});
}
static u32 color_name_to_color_argb(String &color_name) {
char c = *color_name.start;
switch (color_name.length) {
// Red
case 3: return 0xFFE91E63;
case 4: {
if (c == 'B'/*lue*/) return 0xFF2196F3; else
if (c == 'G'/*ray*/) return 0xFF9E9E9E;
Folder_Color* string_to_folder_color(String string) {
static Folder_Color None(0, 0xff555555, 0);
static Folder_Color Purple1(0xFFE1BEE7, 0xff8e24aa, 0xffeecbf4);
static Folder_Color Purple2(0xFFCE93D8, 0xff8e24aa, 0xffe4a8ee);
static Folder_Color Purple3(0xFFBA68C8, 0xfff3e5f5, 0xffcb75da);
static Folder_Color Purple4(0xFF8E24AA, 0xfff3e5f5, 0xffa637c5);
static Folder_Color Indigo1(0xFFD1C4E9, 0xff5e35b1, 0xffddd0f5);
static Folder_Color Indigo2(0xFFB39DDB, 0xff5e35b1, 0xffc7b0ef);
static Folder_Color Indigo3(0xFF9575CD, 0xffede7f6, 0xffa281dd);
static Folder_Color Indigo4(0xFF5E35B1, 0xffede7f6, 0xff7146ca);
#include <chrono>
struct Object {
int property_to_sort_by;
int property_to_group_by;
};
int compare_objects(const void* a, const void* b) {
Object* left = (Object*) a;
Object* right = (Object*) b;
#include <chrono>
const int total_objects = 10000;
int group_identifiers[] = {
123,
20,
3,
41,
5893,
bool mat4_invert(mat4& m, mat4& inv) {
double det;
inv.m11 = m.m22 * m.m33 * m.m44 -
m.m22 * m.m34 * m.m43 -
m.m32 * m.m23 * m.m44 +
m.m32 * m.m24 * m.m43 +
m.m42 * m.m23 * m.m34 -
m.m42 * m.m24 * m.m33;