From 6e9615e9d8514e46736846c11831550ad24ab5de Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 9 Nov 2023 12:06:47 +0000 Subject: [PATCH] Get recent pastes --- pastes/pastes_20231109120646.csv | 5715 ++++++++++++++++++++++++++++++ 1 file changed, 5715 insertions(+) create mode 100644 pastes/pastes_20231109120646.csv diff --git a/pastes/pastes_20231109120646.csv b/pastes/pastes_20231109120646.csv new file mode 100644 index 0000000..d50f23e --- /dev/null +++ b/pastes/pastes_20231109120646.csv @@ -0,0 +1,5715 @@ +id,title,username,language,date,content +tdhjfZpi,data747,TestGuy1,JSON,Thursday 9th of November 2023 06:00:08 AM CDT,"{ + status: 'Success', + method: 'server', + maindata: '09d164efd05f4af07a63179d473c11e0b88851b2b267c0d58abe1ec6685fedadd16c99e26e9cf2f3d203595f174a1facd1af6e794a2edf97a73378d19f8e9bed5d2304dd180014b49e4caef69d29a69773de67fcf02c77ef2238ff6a36b5426ab6022483f00264ea0d4989460782e3c812449b253a881a163ccdba00f348bb0c', + otherdata: [ + '380ba6b0f6cae5c4b77e583668d6e5f4', + '0ea532ba796c7a06a27f03763f110c80', + '0b0797cfe117dd4c6906b4fbb4812673', + 'f37dc9dc6665d43c686c7e02678fc879', + '88ff1e42ed7a3a5ab8fae530a72439dc', + '5d0849a519b57e354cc64041c526fe29', + 'd97466b52e71f72879a4f2556c2715a1', + 'c1743157c146b3f4d03e15f33dd3ddeb' + ] +}" +F8p619hC,SQL Logging Configuration,horozov86,Python,Thursday 9th of November 2023 05:57:32 AM CDT,"# Добавя се в края на settings.py + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'console': { + 'class': 'logging.StreamHandler'} + + }, + 'root': { + 'handlers': ['console'], + 'level': 'DEBUG', + }, + 'loggers': { + 'django.db.backends': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + } + + } + +}" +h5etXWXL,BTC Wallet Credentials have been reset,castlclass_20,GetText,Thursday 9th of November 2023 05:56:31 AM CDT,"Dear User +We have received a request to reset the login information for your Bitcoin wallet. If you did not make this request, please disregard this message. +Your new login credentials will be +Cocumazzo5i:kudXwV on 212.224.93.130 +You can connect via SSH. +Regards" +qGZLPrW1,BTC Wallet Credentials have been reset,VQ-Moe,GetText,Thursday 9th of November 2023 05:52:26 AM CDT,"Dear User +We have received a request to reset the login information for your Bitcoin wallet. If you did not make this request, please contact us immediately. + +Your new login credentials will be: +josli45:KoE3dG1 on 159.223.212.34 +You can connect via SSH. + +Regards +BT171481" +3ntbtuFc,BrowserLegado,FreedTV,JSON,Thursday 9th of November 2023 04:51:26 AM CDT,"{ + ""versionCode"": 1000, + ""versionName"": ""1.0.0"", + ""title"": ""标题"", + ""desc"": ""优化"", + ""cancel"": ""取消"", + ""confirm"": ""确定"", + ""canCancel"": true, + ""app"": false, + ""url"": ""https://www.baidu.com"" +}" +ZmbQxJpR,malloc_array_in_function_and_then_access_array_from_outside.c,dmilicev,C,Thursday 9th of November 2023 04:37:26 AM CDT,"/* + + malloc_array_in_function_and_then_access_array_from_outside.c + +https://stackoverflow.com/questions/8437791/c-malloc-array-in-function-and-then-access-array-from-outside + + + You can find all my C programs at Dragan Milicev's pastebin: + + https://pastebin.com/u/dmilicev + +*/ + +#include +#include + +// creates a memory location for array arr[n] of n integers +// and fills it with ordinal numbers +void create_array(int **arr, int arr_size) { + *arr = malloc(sizeof(int) * arr_size); + + if (arr == NULL) { // Check if the memory has been successfully allocated by malloc + printf(""\n Memory not allocated. \n""); + return; + } + + // optionally, we can fill the array of integers with ordinal numbers + for(int i=0; i + + ), + conditions: { + isAnon: true, + }, + }, + { + component: ( + + ), + conditions: { + isAnon: true, + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount0""], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount1""], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount2""], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount3""], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [ + ""depositcount0"", + ""depositcount1"", + ""depositcount2"", + ""depositcount3"", + ""depositcount4"", + ], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount4""], + weekDays: [1], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount4""], + weekDays: [4], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount4""], + weekDays: [3], + }, + }, + + { + component: ( + + ), + conditions: { + groupIds: [""depositcount4""], + weekDays: [5], + }, + }, + { + component: ( + + ), + conditions: { + groupIds: [""depositcount4""], + weekDays: [6], + }, + }, + + { + component: ( + + ), + }, + + { + component: ( + + ), + }, + + { + component: ( + + ), + }, + + { + component: ( + + ), + }, + { + component: ( + + ), + }, + { + component: ( + + ), + }, + ]} + /> +" +ZaaDWRRF,JSON insert,Savelyev_Vyacheslav,JavaScript,Thursday 9th of November 2023 03:48:34 AM CDT," + +const dataJSON_IN = `{ + ""sys_security_acl"": [ + { + ""active"": true, + ""admin_overrides"": true, + ""any_fields"": false, + ""any_tables"": false, + ""application_id"": 155931135900000002, + ""column_id"": null, + ""condition"": ""(stateIN-5@-2@0@2)"", + ""description"": """", + ""name"": ""[Delete].itsm_request_task"", + ""operation"": ""delete"", + ""policy"": ""Open"", + ""role_ids"": ""169951757498590336"", + ""script"": """", + ""sys_created_at"": ""2022-04-15 07:36:22"", + ""sys_created_by"": 163913798097018628, + ""sys_id"": 165000818294108986, + ""sys_updated_at"": ""2022-04-15 07:36:22"", + ""sys_updated_by"": 163913798097018628, + ""table_id"": 156950581217511178 + }, + { + ""active"": true, + ""admin_overrides"": false, + ""any_fields"": false, + ""any_tables"": false, + ""application_id"": 156950344216170038, + ""column_id"": 155931135900001086, + ""condition"": ""(stateNOT IN12@10@7)"", + ""description"": """", + ""name"": ""[Write].itsm_request_task.state"", + ""operation"": ""write"", + ""policy"": ""Changed"", + ""role_ids"": ""169951757498590336"", + ""script"": """", + ""sys_created_at"": ""2022-04-04 14:25:19"", + ""sys_created_by"": 163913798097018628, + ""sys_id"": 164908231991033578, + ""sys_updated_at"": ""2022-04-12 09:36:55"", + ""sys_updated_by"": 163913798097018628, + ""table_id"": 156950581217511178 + }, + { + ""active"": true, + ""admin_overrides"": true, + ""any_fields"": false, + ""any_tables"": false, + ""application_id"": 156950344216170038, + ""column_id"": null, + ""condition"": ""(stateNOT IN12@7@10)"", + ""description"": """", + ""name"": ""[Write].itsm_request_task"", + ""operation"": ""write"", + ""policy"": ""Open"", + ""role_ids"": ""156951063014647724,169951757498590336"", + ""script"": """", + ""sys_created_at"": ""2022-04-04 14:24:38"", + ""sys_created_by"": 163913798097018628, + ""sys_id"": 164908227890279436, + ""sys_updated_at"": ""2022-04-04 14:24:38"", + ""sys_updated_by"": 163913798097018628, + ""table_id"": 156950581217511178 + }, + { + ""active"": true, + ""admin_overrides"": true, + ""any_fields"": false, + ""any_tables"": false, + ""application_id"": 156950344216170038, + ""column_id"": null, + ""condition"": ""(stateNOT IN7@12)"", + ""description"": """", + ""name"": ""[Write].itsm_incident_task"", + ""operation"": ""write"", + ""policy"": ""Open"", + ""role_ids"": ""156951063014647724,169951757498590336"", + ""script"": """", + ""sys_created_at"": ""2022-04-04 14:13:00"", + ""sys_created_by"": 163913798097018628, + ""sys_id"": 164908158094836457, + ""sys_updated_at"": ""2022-04-04 14:13:00"", + ""sys_updated_by"": 163913798097018628, + ""table_id"": 156950588012506154 + }, + { + ""active"": true, + ""admin_overrides"": true, + ""any_fields"": false, + ""any_tables"": false, + ""application_id"": 156950344216170038, + ""column_id"": null, + ""condition"": ""(stateIN-5@-2@0@2)"", + ""description"": """", + ""name"": ""[Delete].itsm_incident_task"", + ""operation"": ""delete"", + ""policy"": ""Changed"", + ""role_ids"": ""169951757498590336"", + ""script"": """", + ""sys_created_at"": ""2022-04-04 13:40:00"", + ""sys_created_by"": 163913798097018628, + ""sys_id"": 164907960095466582, + ""sys_updated_at"": ""2022-05-27 17:20:17"", + ""sys_updated_by"": 164726140438057134, + ""table_id"": 156950588012506154 + }, + { + ""active"": true, + ""admin_overrides"": true, + ""any_fields"": false, + ""any_tables"": false, + ""application_id"": 156950344216170038, + ""column_id"": 155931135900001086, + ""condition"": ""(stateNOT IN12@7)"", + ""description"": """", + ""name"": ""[Write].itsm_incident_task.state"", + ""operation"": ""write"", + ""policy"": ""Changed"", + ""role_ids"": ""169951757498590336"", + ""script"": """", + ""sys_created_at"": ""2022-04-04 13:33:29"", + ""sys_created_by"": 163913798097018628, + ""sys_id"": 164907920997296708, + ""sys_updated_at"": ""2022-04-04 14:11:48"", + ""sys_updated_by"": 163913798097018628, + ""table_id"": 156950588012506154 + } + ] +}` + + +function modifyAndCleanData(dataJSON_IN, keysToRemove) { + // Модифицируем строку JSON, добавляя кавычки вокруг числовых значений + let modifiedJSON = dataJSON_IN.replace(/""(\w+)"": (\d{15,})/g, '""$1"": ""$2""'); + + // Парсим модифицированную строку JSON обратно в объект JavaScript + let data = JSON.parse(modifiedJSON); + + // Удаляем указанные ключи из каждого элемента в массиве sys_security_acl + data.sys_security_acl.forEach(acl => { + keysToRemove.forEach(key => { + delete acl[key]; + }); + }); + + return data; + } + + // Пример использования функции + const keysToRemove = [ + ""description"", + ""name"", + ""sys_created_at"", + ""sys_created_by"", + ""sys_id"", + ""sys_updated_at"", + ""sys_updated_by"", + 'application_id' + ]; + + const modifiedData = modifyAndCleanData(dataJSON_IN, keysToRemove); + + // print(JSON.stringify(modifiedData, null, 2)); + print( createSimpleRecordCode(JSON.stringify(modifiedData, null, 2)) ) + +function createSimpleRecordCode(dataJSON) { + let modifiedJSON = dataJSON.replace(/""(\w+)"": (\d{15,})/g, '""$1"": ""$2""'); + const data = JSON.parse(modifiedJSON); + + if (!data || !data.sys_security_acl || !Array.isArray(data.sys_security_acl)) { + console.error('Invalid input data'); + return ''; + } + + let code = ''; + + data.sys_security_acl.forEach((item, index) => { + const currentVarName = `current${index}`; // Создаем уникальное имя переменной для каждой итерации + code += `const ${currentVarName} = new SimpleRecord('sys_security_acl');\n`; + Object.keys(item).forEach(key => { + let value = item[key]; + + if (['description', 'name', 'sys_created_at', 'sys_created_by', 'sys_id', 'sys_updated_at', 'sys_updated_by'].includes(key)) { + return; + } + + value = JSON.stringify(value); // JSON.stringify обрабатывает все типы значений корректно + code += ` ${currentVarName}.setValue('${key}', ${value});\n`; // Используем уникальное имя переменной + }); + code += ` ${currentVarName}.insert();\n\n`; // Завершаем блок кода для текущей итерации + }); + + return code; +} + +" +wCHseL7k,every_array_element_is_multiplication_of_previous_and_next_103.c,dmilicev,C,Thursday 9th of November 2023 03:42:12 AM CDT,"/* + + every_array_element_is_multiplication_of_previous_and_next_103.c + +https://www.w3resource.com/c-programming-exercises/array/c-array-exercise-103.php + +103. Write a program in C to update every array element +with multiplication of previous and next numbers in array. +Expected Output: +The given array is: +1 2 3 4 5 6 +The new array is: +2 3 8 15 24 30 + + + You can find all my C programs at Dragan Milicev's pastebin: + + https://pastebin.com/u/dmilicev + +*/ + +#include +#include + +// Displays the array arr[n] of n integers with text before and after the array +void print_array(char *text_before, int arr[], int n, char *text_after){ + printf(""%s"", text_before); + for(int i=0;i= 15 || in_array( date( 'N' ), [ 6, 7 ] ) ) ) ) { + // ...se desactiva la tarifa de envío. + unset( $rates[$shipping_rate_id] ); + } + } + + return $rates; +}" +vdGfwdVg,01. Guinea Pig,Spocoman,C++,Thursday 9th of November 2023 03:15:48 AM CDT,"#include +#include + +using namespace std; + +int main() { + double food, hay,cover, weight; + cin >> food >> hay >> cover >> weight; + + for (int i = 1; i <= 30; i++) { + food -= 0.3; + if (i % 2 == 0) { + hay -= food * 0.05; + } + if (i % 3 == 0) { + cover -= weight / 3; + } + } + + if (food < 0 || hay < 0 || cover < 0) { + cout << ""Merry must go to the pet store!"" << endl; + } + else { + printf(""Everything is fine! Puppy is happy! Food: %.2f, Hay: %.2f, Cover: %.2f."", food, hay, cover); + } + return 0; +}" +T87Azewz,01. Guinea Pig,Spocoman,C#,Thursday 9th of November 2023 03:08:30 AM CDT,"using System; + +namespace GuineaPig +{ + class Program + { + static void Main(string[] args) + { + double food = double.Parse(Console.ReadLine()); + double hay = double.Parse(Console.ReadLine()); + double cover = double.Parse(Console.ReadLine()); + double weight = double.Parse(Console.ReadLine()); + + for (int i = 1; i <= 30; i++) + { + food -= 0.3; + if (i % 2 == 0) + { + hay -= food * 0.05; + } + if (i % 3 == 0) + { + cover -= weight / 3; + } + } + + if (food < 0 || hay < 0 || cover < 0) + { + Console.Write(""Merry must go to the pet store!""); + } + else + { + Console.WriteLine($""Everything is fine! Puppy is happy! Food: {food:f2}, Hay: {hay:f2}, Cover: {cover:f2}.""); + } + } + } +}" +biDuCvAR,slope erosion,Kaelygon,C++,Thursday 9th of November 2023 02:47:11 AM CDT,"#include +#include +#include +#include + +const int FRAME_TIME_TARGET = 16.667; +const int SCREEN_WIDTH = 1024; +const int SCREEN_HEIGHT = 1024; + +const int SCREEN_OFFSET_X = 3400; +const int SCREEN_OFFSET_Y = 600; + +const int GRID_SIZE = 16; // Size of each grid cell +const int GRID_ROWS = SCREEN_HEIGHT / GRID_SIZE; +const int GRID_COLS = SCREEN_WIDTH / GRID_SIZE; + +float gridCell[GRID_ROWS][GRID_COLS]; + +float MAX_SLOPE=0.05; +float PROPAGATE_AMPLITUDE=0.025; +bool DISPLAY_NORMAL=false; + +void renderWholeGrid(SDL_Renderer* renderer) { + // Clear the renderer + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + + // Set a different color for each cell + for (int i = 0; i < GRID_ROWS; ++i) { + for (int j = 0; j < GRID_COLS; ++j) { + int red,green,blue; + + if (DISPLAY_NORMAL == 1) { + float sumSlope_x = 0.0f; + float sumSlope_y = 0.0f; + + int maskRadius = 1; // Adjust the mask radius as needed + + for (int s = -maskRadius; s <= maskRadius; ++s) { + for (int t = -maskRadius; t <= maskRadius; ++t) { + + // Calculate indices of the neighboring cell + int in = i + s; + int jn = j + t; + + // Make sure array index isn't out of bounds + in = std::min(GRID_ROWS - 1, std::max(0, in)); + jn = std::min(GRID_COLS - 1, std::max(0, jn)); + + // Calculate slope with the neighboring cell + float slope = gridCell[i][j] - gridCell[in][jn]; + sumSlope_x += slope * s; + sumSlope_y += slope * t; + + } + } + + // Normalize the normal vector + float length = sqrt(sumSlope_x * sumSlope_x + sumSlope_y * sumSlope_y); + if (length > 0) { + sumSlope_x /= length; + sumSlope_y /= length; + } + + // Map the normalized components to color values (assuming positive values) + red = static_cast((sumSlope_x + 1.0f) * 0.5f * 255); + green = static_cast((sumSlope_y + 1.0f) * 0.5f * 255); + blue = 127; // Set blue to a constant value for simplicity + } else { + red = gridCell[i][j] * 255; + green = gridCell[i][j] * 255; + blue = gridCell[i][j] * 255; + } + + SDL_SetRenderDrawColor(renderer, red, green, blue, 255); + + SDL_Rect cell = {j * GRID_SIZE, i * GRID_SIZE, GRID_SIZE, GRID_SIZE}; + SDL_RenderFillRect(renderer, &cell); + } + } + + // Present the renderer + SDL_RenderPresent(renderer); +} + +//Spills to neighbouring cells if slope is too high +void updateHeight(SDL_Renderer* renderer) { + for (int i = 0; i < GRID_ROWS; i++) { + for (int j = 0; j < GRID_COLS; j++) { + + //loop through masked neighbors + int maskRadius=2; + for(int s=-maskRadius;s<=maskRadius;s++){ + for(int t=-maskRadius;t<=maskRadius;t++){ + + //offset to neighbor + int in = i+s; + int jn = j+t; + + // Make sure array index isn't out of bounds + in = std::min(GRID_ROWS - 1, std::max(0, in)); + jn = std::min(GRID_COLS - 1, std::max(0, jn)); + + //spill to neighbor + float slope = gridCell[i][j]-gridCell[in][jn]; + bool tooHigh = abs(slope)>MAX_SLOPE; + float centerDistance = sqrt(s*s+t*t)/sqrt(2*maskRadius*maskRadius); + gridCell[i][j] -= tooHigh*PROPAGATE_AMPLITUDE*(slope/2)*(1-centerDistance); + gridCell[in][jn]+= tooHigh*PROPAGATE_AMPLITUDE*(slope/2)*(1-centerDistance); + } + } + + } + } +} + +// Variables for key press cooldown +const Uint32 COOLDOWN_TIME = 50; +Uint32 lastKeyPressTime = 0; + +// Variables to track mouse drag +bool isMouseDragging = false; +int dragStartX, dragStartY; + +bool quit = false; +SDL_Event e; + +void detectKeys(){ + while (SDL_PollEvent(&e) != 0) { + + if (e.type == SDL_QUIT) { + quit = true; + break; + + } + + if (e.type == SDL_KEYDOWN) { + if (e.key.keysym.sym == SDLK_ESCAPE) { + quit = true; + continue; + } + if (e.key.keysym.sym == SDLK_n) { + DISPLAY_NORMAL = !DISPLAY_NORMAL; // Toggle DISPLAY_NORMAL + std::cout << ""DISPLAY_NORMAL: "" << DISPLAY_NORMAL << std::endl; // Print to console + continue; + } + if (e.key.keysym.sym == SDLK_r) { + for (int i = 0; i < GRID_ROWS; ++i) { + for (int j = 0; j < GRID_COLS; ++j) { + int squareSize = 9; + gridCell[i][j] = ( i/squareSize + j/squareSize )%2; //checker board + gridCell[i][j]*= rand()/(float)RAND_MAX; //noise on white squares + } + } + continue; + } + continue; + } + + if (e.type == SDL_MOUSEBUTTONDOWN) { + if (e.button.button == SDL_BUTTON_LEFT || e.button.button == SDL_BUTTON_RIGHT) { + isMouseDragging = true; + SDL_GetMouseState(&dragStartX, &dragStartY); + } + continue; + } + + if (e.type == SDL_MOUSEBUTTONUP) { + if (e.button.button == SDL_BUTTON_LEFT || e.button.button == SDL_BUTTON_RIGHT) { + isMouseDragging = false; + } + continue; + } + + + if (e.type == SDL_MOUSEMOTION) { + if (isMouseDragging) { + int mouseX, mouseY; + SDL_GetMouseState(&mouseX, &mouseY); + + // Calculate the grid position based on the mouse coordinates + int gridX = mouseX / GRID_SIZE; + int gridY = mouseY / GRID_SIZE; + + // Determine the value based on the mouse button + float valueToSet = (e.button.button == SDL_BUTTON_LEFT) ? 1.0f : 0.0f; + + // Update the grid cells based on the value + int maskRadius = 2; + for (int s = -maskRadius; s <= maskRadius; s++) { + for (int t = -maskRadius; t <= maskRadius; t++) { + gridCell[gridY + s][gridX + t] = valueToSet; + } + } + } + continue; + } + + + } +} + +int main() { + srand(time(NULL)); + + //Generate initial height map + for (int i = 0; i < GRID_ROWS; ++i) { + for (int j = 0; j < GRID_COLS; ++j) { + int squareSize = 9; + gridCell[i][j] = ( i/squareSize + j/squareSize )%2; //checker board + gridCell[i][j]*= rand()/(float)RAND_MAX; //noise on white squares + } + } + + // Initialize SDL + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + std::cerr << ""SDL could not initialize! SDL_Error: "" << SDL_GetError() << std::endl; + return 1; + } + + // Create a window + SDL_Window* window = SDL_CreateWindow(""Grid Renderer"", SCREEN_OFFSET_X, SCREEN_OFFSET_Y, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN); + if (window == nullptr) { + std::cerr << ""Window could not be created! SDL_Error: "" << SDL_GetError() << std::endl; + return 2; + } + + // Create a renderer for the window + SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + if (renderer == nullptr) { + std::cerr << ""Renderer could not be created! SDL_Error: "" << SDL_GetError() << std::endl; + return 3; + } + + Uint32 frameStartTime = SDL_GetTicks(); + frameStartTime+=FRAME_TIME_TARGET; + renderWholeGrid(renderer); + + //Render loop + while (!quit) { + + // Calculate the time to render a frame + Uint32 currentFrameTime = SDL_GetTicks() - frameStartTime; + + // Wait till FRAME_TIME_TARGET is reached + if (currentFrameTime < FRAME_TIME_TARGET) { + SDL_Delay(FRAME_TIME_TARGET - currentFrameTime); + detectKeys(); + } + + updateHeight(renderer); + + + renderWholeGrid(renderer); + frameStartTime = SDL_GetTicks(); + } + + // Clean up and exit + SDL_DestroyRenderer(renderer); + SDL_DestroyWindow(window); + SDL_Quit(); + + return 0; +} +" +92W6iY1D,Curs pointeri,visoft,C,Thursday 9th of November 2023 01:59:31 AM CDT,"#include +#include + +typedef struct{ + char nume[100]; + char prenume[100]; + int note[10]; +} Student; + +int main() +{ + Student student; + Student *tabel_studenti; + tabel_studenti = + (Student*)malloc(sizeof(Student) * 20); + if (tabel_studenti == NULL) + return -1; + + for (int i = 0; i< 3; i++){ + //scanf(""%d"", &student.note[i]); // note + i + scanf(""%d"", &tabel_studenti[0].note[i]); + } + +// scanf(""%s"", student.nume); +// scanf(""%s"", student.prenume); +// printf(""%s | %s"", student.nume, + // student.prenume); + return 0; +} +" +uTDdv5bF,Xlog translator,kosander,Python,Thursday 9th of November 2023 01:55:47 AM CDT,"''' +* xlog.dat interpreter +* By: Mikko Koskenkorva +* +* Description +* Takes the xlog.dat file, interprets the used commands and results, and verboses them at the end of each log line. +* New logfile is output as a result. +* +* Todo: General tasks +* ============= +* Todo: Move dictionaries in another module +* Todo: Create executable +* Todo: Errors may break the command-result sequence: +* 1660 Time: 2023-06-05 14:59:30 ms:144 Level: LOG INFO Message: [AF,R,0] - Read averaging filter mode +* 1661 Time: 2023-06-05 14:59:50 ms:165 Level: LOG ERROR Message: XCmdEngine socket receive timeout +* 1662 Time: 2023-06-05 14:59:50 ms:165 Level: LOG INFO Message: [9]- Error - Could not translate this line. +* 1663 Time: 2023-06-05 14:59:50 ms:165 Level: LOG INFO Message: [SU,R,0] - Read summing filter mode +* 1664 Time: 2023-06-05 15:00:10 ms:178 Level: LOG ERROR Message: XCmdEngine socket receive timeout +* +* +''' + +''' +Dictionary: commands_dict_predef + +Dictionary for commands with pre-defined results, i.e. gain setting, where the user can choose from pre-defined + +First key is the ASCII version of the command. +Second key: + First sub key is the verbose of the actual command. + The following sub keys are the possible results of the command. + +''' +commands_predef_dict = { + ""AF"": { + ""verbose"": ""averaging filter mode"", + ""00"": ""None"", + ""01"": ""2 lines"", + ""02"": ""4 lines"", + ""03"": ""8 lines"", + ""04"": ""16 lines"", + ""05"": ""32 lines"", + ""06"": ""64 lines"", + ""07"": ""128 lines"", + ""08"": ""256 lines"", + }, + ""BR"": { + ""verbose"": ""serial port communication baud rate"", + ""00"": ""115200"", + ""01"": ""9600"" + }, + ""CF"": { + ""verbose"": ""camera link data format in dual energy mode"", + ""00"": ""Normal mode (low energy preceding the high energy)"", + ""01"": ""Interweave mode (low energy interveawed with the high energy)"" + }, + ""CT"": { + ""verbose"": ""card type"", + ""00"": ""Card type 1"", + ""01"": ""Card type 2"", + ""02"": ""Card type 3"", + ""03"": ""Card type 4"", + ""04"": ""Card type 5"", + ""05"": ""Card type 6"", + ""06"": ""Card type 7"", + ""07"": ""Card type 8"", + + }, + ""DA"": { + ""verbose"": ""pixel binning mode"", + ""00"": ""No binning"", + ""01"": ""Averaging every 2 pixels"", + ""02"": ""Summing every 2 pixels"", + ""03"": ""Averaging every 4 pixels"", + ""04"": ""Summing every 4 pixels"", + }, + ""DC"": { + ""verbose"": ""energy mode (HI/LO) in single energy mode"", + ""00"": ""Low-energy gain"", + ""01"": ""High-energy gain"" + }, + ""EB"": { + ""verbose"": ""baseline correction"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""ED"": { + ""verbose"": ""test pattern mode"", + ""00"": ""Disabled"", + ""01"": ""Normal test pattern"", + ""02"": ""Slope test pattern"" + }, + ""EG"": { + ""verbose"": ""gain correction"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""EL"": { + ""verbose"": ""external line trigger"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""EM"": { + ""verbose"": ""energy mode"", + ""00"": ""Single energy"", + ""01"": ""Dual energy"" + }, + ""EO"": { + ""verbose"": ""offset correction"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""EP"": { + ""verbose"": ""PDC correction"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""ES"": { + ""verbose"": ""output scaling mode"", + ""00"": ""Enabled"", + ""01"": ""Disabled"" + }, + ""EV"": { + ""verbose"": ""encoder voltage mode"", + ""00"": ""422"", + ""01"": ""TTL"" + }, + ""FM"": { + ""verbose"": ""external frame trigger mode"", + ""00"": ""Rising edge"", + ""01"": ""Falling edge"" + }, + ""GT"": { + ""verbose"": ""X-GCU type"", + ""00"": ""Gb Ethernet"", + }, + ""LC"": { + ""verbose"": ""LED state"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""LE"": { + ""verbose"": ""Hi/Lo line trigger with hi/lo edge level detection."", + ""00"": ""Rising edge"", + ""01"": ""Falling edge"" + }, + ""LM"": { + ""verbose"": ""external line trigger mode"", + ""00"": ""Rising edge"", + ""01"": ""Falling edge"", + ""02"": ""Sync trigger stamp mode"", + ""03"": ""Async trigger stamp mode"" + }, + ""LS"": { + ""verbose"": ""line stamp / encoder mode"", + ""00"" :""Line stamp"", + ""01"": ""Encoder"" + }, + ""OA"": { + ""verbose"": ""offset averaging filter"", + ""00"": ""One line"", + ""01"": ""Two lines"", + ""02"": ""Four lines"", + ""03"": ""Eight lines"" + }, + ""OE"": { + ""verbose"": ""offset delay status"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""OM"": { + ""verbose"": ""operating mode"", + ""00"": ""Continuous mode"", + ""01"": ""Non-continuous mode"", + ""02"": ""Constant integration mode"", + ""03"": ""Non-continuous with Hi/Lo trigger"" + }, + ""PO"": { + ""verbose"": ""pixel order mode for all pixels"", + ""00"": ""Low from first, high from first"", + ""01"": ""Low from last, high from first"", + ""02"": ""Low from first, high from first"", + ""03"": ""Low from last, high from last"" + }, + ""RL"": { + ""verbose"": ""Ethernet LED state"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""SF"": { + ""verbose"": ""start / stop scanning"", + ""00"": ""************* Stop scanning *************"", + ""01"": ""************* Start scanning *************"" + }, + + ""SU"": { + ""verbose"": ""summing filter mode"", + ""00"": ""None"", + ""01"": ""2 lines"", + ""02"": ""4 lines"", + ""03"": ""8 lines"", + ""04"": ""16 lines"", + ""05"": ""32 lines"", + ""06"": ""64 lines"", + ""07"": ""128 lines"", + ""08"": ""256 lines"", + }, + ""SW"": { + ""verbose"": ""swap mode of low and high part"", + ""00"": ""Normal"", + ""01"": ""Swapped"" + }, + + ""TC"": { + ""verbose"": ""trigger stamp parity check mode"", + ""00"": ""Disabled"", + ""01"": ""Odd parity check"", + ""02"": ""Even parity check"" + }, + ""TE"": { + ""verbose"": ""set drop external trigger when first power on"", + ""00"": ""Enable drop trigger"", + ""01"": ""Disable drop trigger"" + }, + ""TR"": { + ""verbose"": ""X-GCU frame and line trigger RS485 bus terminator resistor, used only in multi-X-GCU applications"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + } + +} + +''' +Dictionary: commands_dict_dynamic + +Dictionary for commands with dynamic results, i.e. integration time, where the user can set the values freely. +Contains only the key : value pair (""ASCII command : verbose""). Result translation from hex is handled in the calling function + +''' +commands_dynamic_dict = { + + ""BS"": ""base line value"", + ""CP"": ""correction pixel position"", + ""DN"": ""number of cards per X-DFE"", + ""DP"": ""the number of pixels per DM"", + ""CN"": ""the number of DM modules in X-GCUs each channel. The first channel number is the "" + ""highest byte"", + ""EF"": ""external frame trigger mode, 0 = disabled, framesize = n * 32"", + ""FD"": ""frame trigger delay (n * 32 lines)"", + ""GF"": ""X-GCU firmware version"", + ""GI"": ""X-GCU voltage, temperature and humidity"", # Todo: tarkista missä muodossa datat tulee + ""GS"": ""X-GCU serial number"", + ""HG"": ""reserved X-GCU firmware version"", # Todo: Mikä tää on? + ""IR"": ""Integration time range"", # Results need configuring. Sets integration time range. + # Max and min integration time, 8-byte unsigned value. + # The high four bytes are the max value, the low four bytes are the min value. + ""MT"": ""MTU size"", + ""NT"": ""non-integration time (us) in Non-continuous and constant modes"", + ""OD"": ""offset delay value (us)"", + ""PD"": ""pixel depth"", + ""PN"": ""the total number of pixels in the system"", + ""PS"": ""pixel size"", # Todo: Pixel size unit? + ""PT"": ""system working time counter (1 step = 2 hours)"", # Todo: laskuri tuloksille + ""RD"": ""line trigger raw delay"", + ""SB"": ""output scale"", + ""SP"": ""Hi/Lo line trigger sampling position (1us)"", + ""ST"": ""integration time (us)"", + ""TD"": ""line trigger fine delay (multiple of 0,125us)"", + ""TH"": ""constant mode threshold value"", + ""TI"": ""gain table ID"", + ""TP"": ""heartbeat period"", + ""WT"": ""X-GCU uptime after powerup"", #Todo: Yksiköt? + ""ZG"": ""Z gap (one step = 0,1mm"" + +} + + + +''' +Output for starting and stopping scanning, made to stand out more easily from the logs +''' +commands_scanning_dict = { + + ""0"": ""************************ STOP SCANNING ************************"", + ""1"": ""************************ START SCANNING ************************"" +} + +''' +Dictionary: commands_dmid_dynamic_dict + +Commands that have dmid and data as arguments. Data is dynamically set by the user +''' +# Todo: List commands that have dmid and data (data is dynamic) as arguments +commands_dmid_dynamic_dict = { + ""AR"": ""Write AD register"", + ""BC"": ""Bad pixel correction mode"", + ""BM"": ""Load bad pixels map from flash to FPGA"", + ""DF"": ""DM firmware version"", + ""DI"": ""DM voltage, temperature and humidity"", # Todo: Tarkista missä muodossa datat tulee + ""DS"": ""DM serial number"", + ""DT"": ""DM test mode"", + ""HD"": ""reserved X-Card firmware version"", + ""RA"": ""Reset AD"", + ""RC"": ""Recofigure AD"", + ""SG"": ""DM Gain value per module (HE + LE), first channel is the highest byte"", + ""TM"": ""TDI correction mode"" + +} + +''' +Dictionary: commands_dmid_predef_dict + +Commands that have dmid, data is selected from pre-defined values +''' +# Todo: List commands that have dmid and data (data is predefined) as arguments +commands_dmid_predef_dict = { + ""AS"": { + ""verbose"": ""AD speed mode"", + ""00"": ""Low speed"", + ""01"": ""High speed"" + }, + ""AV"": { + ""verbose"": ""AD Vref"", + ""00"": ""Disable"", + ""01"": ""Enable"" + }, + ""BC"": { + ""verbose"" : ""Bad pixel correction mode"", + ""00"" : ""Disable"", + ""01"" : ""Enable"" + }, + ""PC"": { + ""verbose"": ""PD connection"", + ""00"": ""Disabled"", + ""01"": ""Enabled"" + }, + ""TM"": { + ""verbose"" : ""TDI correction mode"", + ""00"" : ""No TDI + Forward"", + ""10"" : ""No TDI + Reverse"", + ""01"" : ""TDI + Forward"", + ""02"" : ""TDI + Reverse"" + } +} + +''' +Dictionary: commands_exec_dict + +List of commands that are executed +''' +commands_exec_dict = { + ""AC"" : ""Perform AD calibration"", + ""RA"" : ""Reset AD"", + ""RC"" : ""Reconfigure X-GCU / X-DFE firmware"", + ""RG"" : ""Reset channel gain to 1.0"", + ""RO"" : ""Reset channel offset to 0"", + ""SE"" : ""Send a simulated external frame trigger"" + +} +''' +Dictionary: commands_flash_dict + +Dictionary for saving or loading settings to/from flash. +Contains different verboses for save and load functions. +Doesn't take additional arguments + +''' +commands_flash_dict = { + ""IN"": { + ""S"" : ""- Save current settings to the user flash"", # [IN,S,0] + ""L"" : ""- Load settings from the user flash."" # [IN,L,0] + }, + ""IN1"": { + ""S"" : ""- Save current settings to the main / backup flash flash"", # [IN1,S,0] + ""L"" : ""- Load settings from the main / backup flash flash."" # [IN1,L,0] + }, + ""OC"": { + ""L"": "" - Load channel offset from flash to FPGA"" + }, + ""PC"":{ + ""L"": ""- Load PDC coeffieicnt data"" + }, + ""PP"" : { + ""L"" : ""- Load PDC position data"" + } +} + +''' +Dictionary: commands_flash_predef_dict + +Dictionary for saving or loading settings to/from flash. +Contains different verboses for save and load functions. +Doesn't take additional arguments + +''' + +commands_flash_predef_dict = { + ""GC"": { + ""S"": ""- Save channel gain from group "", + ""L"": ""- Load channel gain from group "" + } + + +} + +errors_dict = { + ""0"": ""Error 0"", + ""1"": ""Error 1"", + ""2"": ""Error 2"", + ""3"": ""Error 3"", + ""4"": ""Error 4"", + ""5"": ""Error 5"", + ""6"": ""Error 6"", + ""7"": ""Error 7"", + ""8"": ""Error 8"", + ""9"": ""Error 9"", + ""10"": ""Error 10"" +} + + +def hextodecimal(result): + return str(int(result, 16)) # Converts hex to decimal by specifying base = 16 and returns the result a string + +def commandlookup(command, opmode, dmid=""0"", data=""0""): + # Todo: Functions for each command type?? + decimal_data = hextodecimal(data) + + if command in commands_flash_dict: # Flash command without additional data + verbose_command_str = commands_flash_dict[command][opmode] + + return verbose_command_str + ""\n"" + + elif command in commands_flash_predef_dict: # Flash command with additional data + verbose_command_str = commands_flash_predef_dict[command][opmode] + + return verbose_command_str + data +""\n"" # Return the command verbose + data + + elif command == ""SF"": + return commands_scanning_dict[data] + ""\n"" + + elif command in commands_predef_dict: + verbose_command_str = commands_predef_dict[command][""verbose""] + + if opmode == ""W"": + if command == ""OM"": + return "" - Set "" + verbose_command_str + "" to: "" + commands_predef_dict[command][""0""+data] + ""\n"" + else: + return "" - Set "" + verbose_command_str + "" to: "" + decimal_data + ""\n"" + elif opmode == ""R"": + return "" - Read "" + verbose_command_str + ""\n"" + + elif command in commands_dynamic_dict: + verbose_command_str = commands_dynamic_dict[command] + if opmode == ""W"": + return "" - Set "" + verbose_command_str + "" to: "" + decimal_data + ""\n"" + elif opmode == ""R"": + return "" - Read "" + verbose_command_str + ""\n"" + + elif command in commands_dmid_dynamic_dict: + verbose_command_str = commands_dmid_dynamic_dict[command] + if dmid == ""0xFF"": + dmid = ""ALL MODULES"" + + + if opmode == ""W"": + return "" - Set "" + verbose_command_str + "" for module id "" + dmid + "" to: "" + decimal_data + ""\n"" + elif opmode == ""R"": + return "" - Read "" + verbose_command_str + "" for module id "" + dmid + ""\n"" + + elif command in commands_dmid_predef_dict: + verbose_command = commands_dmid_predef_dict[command][""verbose""] + if dmid == ""0xFF"": + dmid = ""ALL MODULES"" + + + if opmode == ""W"": + return "" - Set "" + verbose_command + "" for module id "" + dmid + "" to: "" + decimal_data + ""\n"" + elif opmode == ""R"": + return "" - Read "" + verbose_command + "" for module id "" + dmid + ""\n"" + + + else: + return ""Command not found in commands lists, please see the X-Lib Programmers manual for more details!\n"" + +def resultLookup(command, result=""00""): + + #if command in commands_list_predef and result in commands_list_predef[command]: + if command in commands_predef_dict: + return commands_predef_dict[command][result] + ""\n\n"" + + elif command in commands_dynamic_dict: + if command == ""CN"" or command == ""GF"" or command == ""HG"": + return result + ""\n\n"" # Value is not converted to decimal + + elif command == ""IR"": + max_int = hextodecimal(result[8:]) + min_int = hextodecimal(result[:8]) + return ""Integration time range is "" + min_int + "" - "" + max_int + "" us\n\n"" + + elif command == ""FD"": + converted = hextodecimal(result) + return converted +"" * 32 lines = "" + str(int(converted)*32) + "" lines \n\n"" + + else: + converted = hextodecimal(result) + return converted + ""\n\n"" + + elif command in commands_flash_dict: + return commands_flash_dict[command] + ""\n\n"" + + elif command in commands_dmid_dynamic_dict or command in commands_dmid_predef_dict: + return result + ""\n\n"" + + # TODO: Check command/result not found logics + + elif command not in commands_predef_dict: + + return ""Command not found in commands list, please see the X-Lib Programmers manual for more details!\n\n"" + + elif result not in commands_predef_dict[command]: + + return ""Result not found in commands list, please see the X-Lib Programmers manual for more details!\n\n"" + + +def errorLookup(err): + error = errors_dict[err] + return error + ""\n"" + +# Todo: def checkfirstline # Määrittää onko ensimmäinen rivi r/w/l/s/e-komento (pitäisi olla) +# Todo: def cannottranslate, Add customized error messages per reason why can't translate, or include in error handling +''' +Initializations for global parameters +''' + +linetype = 'C' # initialize line type. Can be 'C' command, 'RR' result or 'WR' write result, + # 'S' for flash save, 'L' for flash load, 'E' for command execution + # Default 'C' +command = '' # initialize command string. Used to store command from each command line +opmode = '' # initialize operation mode string. Used to store operation mode from each command line +num_command_reads = 0 # Counter for read commands +num_command_writes = 0 # Counter for written commands +num_value_reads = 0 # Counter for read values +num_errors = 0 # Counter for error lines +num_warnings = 0 # Counter for warning lines + +# Todo: Add file handling exception checking +# Todo: GUI for opening & saving file +def open_originalfile(): + with open(""xlog.dat"", ""r"") as f: + content = f.read().splitlines() # Split the logfile into lines + + return content + # Prompt for file path (absolute) # Create separate directory for lookup? + # Open file as read + + +def open_verbosefile(): + f = (open(""xlog_verbose.dat"", ""w"")) # The verbose version of the log file + return f + # get path and filename of original file, add _verbose to the filename before extension + # create new file with new_filename + + +def close_verbosefile(f): + f.close() + + return 0 + + + +logfile = open_originalfile() # Open and read the contents of xlog.dat located in the same directory of this script + +verbose_logfile = open_verbosefile() # Open the new log file with verbosed results in write mode + +for index, line in enumerate(logfile, 1): # Iterate through all lines in the log file, include index + + log_entry = line.replace("" "", "" "") # Replace multiple spaces with single space + log_entry_lst = log_entry.split() # Split into list using space as separator + + if log_entry_lst[6] == ""INFO"": # If line contains read or write info + message = log_entry_lst[8].replace(""["", """").replace(""]"", """").split( + "","") # Take message and remove [ and ] surrounding the message + # and split message into list with , as separator + + if linetype == 'C': # Line contains a command (read/write/execute/load/save) + try: + if message[1] == 'R': # Read command + linetype = 'RR' # next line contains read value + command = message[0] + verbCommand = commandlookup(command, message[1], message[2]) # Look up message verbose for command + + verbose_logline = str(index) + "" "" + line + verbCommand # concat original line + command + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + num_command_reads += 1 # Increment command read counter + + elif message[1] == 'W': # Write command + linetype = 'WR' # Next line: Write result - contains OK or error code + command = message[0] + opmode = message[1] + dmid = message[2] + data = message[3] + + verbCommand = commandlookup(command, opmode, dmid, data) + + verbose_logline = str(index) + "" "" + line + verbCommand # concat original line + command + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + + # look up value from the message string. + num_command_writes += 1 # Increment command write counter + + elif message[1] == 'S': # Save settings to flash + linetype = 'SF' # Next line contains OK or error code + command = message[0] + opmode = message[1] + + if len(message) == 3: + + verbCommand = commandlookup(command, opmode) # Look up message verbose for command + + elif len(message) == 4: + + verbCommand = commandlookup(command, opmode, data=message[3]) # Look up message verbose for command + + verbose_logline = str( + index) + "" "" + line + "" "" + verbCommand # concat original line + command - Save settings to FLASH + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + num_command_writes += 1 # Increment command write counter + + elif message[1] == 'L': # Load settings from flash + linetype = 'LF' # Next line contains OK or error code + command = message[0] + opmode = message[1] + + if len(message) == 3: + + verbCommand = commandlookup(command, opmode) # Look up message verbose for command + + elif len(message) == 4: + + verbCommand = commandlookup(command, opmode, data=message[3]) # Look up message verbose for command + + verbose_logline = str( + index) + "" "" + line + "" "" + verbCommand # concat original line + command - Save settings to FLASH + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + num_command_writes += 1 # Increment command write counter + + # Todo: elif message[1] == 'E': # Execute command + # Todo: Is else: needed? + + except: + verbose_logline = str(index) + "" "" + line + ""- Error - Could not translate this line.\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + elif linetype == 'RR': # This line contains result from value read + try: + if message[0] == '0': # Value read successfully + verbResult = resultLookup(command, message[1]) # Look up result + verbose_logline = str(index) + "" "" + line + "" - "" + str(verbResult) # concat original line + result + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + linetype = 'C' # Set line type to 'C', next line is command (or error) + num_value_reads += 1 # Increment value read counter + else: + linetype = 'C' # Set line type to 'C', next line is command (or error) + verbose_logline = str( + index) + "" "" + line + "" - "" + "" - Error when reading the value!\n"" # concat original line + result + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + except: + linetype = 'C' # Set line type to 'C', next line is command (or error) + verbose_logline = str(index) + "" "" + line + ""- Error - Could not translate this line.\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + + elif linetype == 'WR': # Line contains the result of the written command + try: + if message[0] == '0': # Command written successfully + verbose_logline = str( + index) + "" "" + line + "" - Command completed succesfully!\n\n"" # concat original line + command + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + + linetype = 'C' # Set line type to 'C', next line is command (or error) + else: + verbose_logline = str( + index) + "" "" + line + "" - "" + "" - Error when writing the value!\n\n"" # concat original line + result + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + linetype = 'C' # Set line type to 'C', next line is command (or error) + except: + verbose_logline = str(index) + "" "" + line + ""- Error - Could not translate this line.\n\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + linetype = 'C' # Set line type to 'C', next line is command (or error) + + elif linetype == ""SF"": # Line contains flash save confirmation + if message[0] == ""0"": + verbose_logline = str(index) + "" "" + line + ""- Settings saved successfully\n\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + linetype = 'C' # Set line type to 'C', next line is command (or error) + else: + verbose_logline = str(index) + "" "" + line + ""- Error occurred when saving to flash\n\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + linetype = 'C' # Set line type to 'C', next line is command (or error) + elif linetype == ""LF"": # Line contains flash load confirmation + if message[0] == ""0"": + verbose_logline = str(index) + "" "" + line + ""- Settings loaded successfully\n\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + linetype = 'C' # Set line type to 'C', next line is command (or error) + else: + verbose_logline = str(index) + "" "" + line + ""- Error occurred when loading from flash\n\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + linetype = 'C' # Set line type to 'C', next line is command (or error) + + else: # If cannot determine the line type + verbose_logline = str(index) + "" "" + line + ""- Error - Could not translate this line.\n\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + ''' + elif linetype == ""E"": + verbose_logline = str(index) + "" "" + line + errorLookup(message[0]) +""\n"" + verbose_logfile.write(str(verbose_logline)) # append result in to the new file + errorLookup(message[0]) + linetype = 'C'. + ''' + + elif log_entry_lst[6] == ""ERROR"": + num_errors += 1 + linetype = 'C' # Set line type to 'C', next line is command (or error) + verbose_logfile.write( + str(index) + "" "" + line + "" \n\n"") # append the original error in to the new file, no further info added + + elif log_entry_lst[6] == ""WARNING"": + num_warnings += 1 + linetype = 'C' # Set line type to 'C', next line is command (or error) + verbose_logfile.write( + str(index) + "" "" + line + "" \n\n"") # append the original warning in to the new file, no further info added + +verbose_logfile.write(f""\n\t\t{num_errors} errors found"") +verbose_logfile.write(f""\n\t\t{num_warnings} warnings found"") +verbose_logfile.write(f""\n\t\t{num_command_writes} commands issued"") +verbose_logfile.write(f""\n\t\t{num_command_reads} commands read"") +verbose_logfile.write(f""\n\nTotal\t{len(logfile)} lines written"") + +close_verbosefile(verbose_logfile) # Close the new log file" +mvXwYuBv,snowybot the best bot ever made.,coinwalk,JavaScript,Thursday 9th of November 2023 01:48:53 AM CDT,"var originalbal = parseFloat(document.getElementById('pct_balance').value); +var divide = 300; +var changer = (divide/7); +var base = Number((originalbal/divide).toFixed(8)); +var floatingbase = base; +var taget = (originalbal*7); +var groupedten = (base*10); +var groupedseven = (base*6.5); +var tobetnext = ((floatingbase*1).toFixed(8)); +var bolance = originalbal; +var over = 6.9; +var under = 2.9; +var fart = 2; +var freak = false; +var oldbolance = ((Math.floor(originalbal/groupedten))*groupedten); +var oldbolancetree = ((Math.floor(originalbal/groupedten))*groupedten); +var oldbolancetwo = ((Math.floor(originalbal/groupedten))*groupedten); + + function getR(minz, maxz) { + minz = Math.ceil(minz); + maxz = Math.floor(maxz); + return Math.floor(Math.random() * (maxz - minz + 1)) + minz; +} + + +function get(){ +console.clear(); +setTimeout(function(){ +bolance = document.getElementById('pct_balance').value; +if ((bolance>(oldbolance+(floatingbase*over)))&&(bolance>oldbolancetwo)) { + floatingbase = floatingbase*2; + over = 4.9; + under = 4.9; + freak = true; + oldbolance = parseFloat(bolance); +} +if ((bolance>(oldbolance+(floatingbase*over)))&&(bolance=(oldbolancetree+(groupedten*fart)))&&(bolance<(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base; + fart = 2; + over = 6.9; + under = 2.9; + freak = false; + oldbolance = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetree = ((Math.floor(bolance/groupedten))*groupedten); +} +if ((floatingbase>=(bolance/changer))&&(bolancebase)&&(bolance<(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base; + fart = 0; + over = 6.9; + under = 2.9; + oldbolance = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); +} +if ((floatingbase>=(bolance/changer))&&(bolancebase)&&(bolance>(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base*2; + fart = 0; + over = 4.9; + under = 4.9; + oldbolance = parseFloat(bolance); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); +} + if (bolance >= taget) { + console.log(""winner winner chicken dinner""); + return; + } +tobetnext = ((floatingbase*1).toFixed(8)); +$('#pct_chance').val(49.5); +$('#pct_bet').val(tobetnext); +$('#a_lo').click(); +}, (getR(100,200))); +var good = ((bolance-originalbal).toFixed(8)); +console.log(""profit""); +console.log(good); +setTimeout(() => get(), (getR(200,300))); +} +get();" +aNGWiUBZ,Untitled,Kaban4ik,Java,Thursday 9th of November 2023 01:44:24 AM CDT,"class Robot implements Cloneable { + int a; + public Robot(int a) { + this.a = a; + } + + public void a() { + this.a++; + } + + @Override + public Object clone(){ + return super.clone(); + } +} + + +Robot r1 = new Robot(10); +Robot r2 = r1; +Robot r3 = r1.clone(); +Robot r4 = r2.clone(); + +r1.a(); +r1.a - ? , r2.a - ? , r3.a - ? , r4.a - ? + +r2.a(); +r1.a - ? , r2.a - ? , r3.a - ? , r4.a - ? + +r3.a(); +r1.a - ? , r2.a - ? , r3.a - ? , r4.a - ? + +r4.a(); +r1.a - ? , r2.a - ? , r3.a - ? , r4.a - ? " +E2VpNSGn,Untitled,Kaban4ik,Java,Thursday 9th of November 2023 01:34:12 AM CDT,"class Base { + String name; + + Base() { + System.out.println(""No-args base""); + } + + Base(String name) { + this.name = name; + System.out.println(""parameterized base""); + } +} + +class Child extends Base { + Child() { + System.out.println(""No-args child""); + } + + Child(String name) { + super(name); + System.out.println(""parameterized child""); + } + + public static void main(String args[]) { + Child obj = new Child(); + print('*******'); + Base obj2 = new Child(); + } +}" +De3hdZ70,cool bitmap font thing header (font.hpp),Kitomas,C++,Thursday 9th of November 2023 01:25:19 AM CDT,"#ifndef _UTILS_FONT_HPP +#define _UTILS_FONT_HPP +//todo: make function to swap renderers + +#include + +#include + + +extern const Uint8 font8x8_default[1024]; + + +class font8x8 { + SDL_bool _valid = SDL_FALSE; //used for method call checks + + SDL_Renderer* _renderer = nullptr; + SDL_Surface* _fontSurface = nullptr; + SDL_Texture* _fontTexture = nullptr; + + SDL_Color _palette[2] = {{0},{0}}; //bg and text palette colors respectively + SDL_Point _scale = {8,8}; //1x scale by default + + + void _freeSurfaceSafely(){ + if(_fontSurface != nullptr){ + SDL_FreeSurface(_fontSurface); + _fontSurface = nullptr; + } + } + + void _freeTextureSafely(){ + if(_fontTexture != nullptr){ + SDL_DestroyTexture(_fontTexture); + _fontTexture = nullptr; + } + } + + +public: + SDL_bool isValid(){ return _valid; } + + font8x8(SDL_Renderer* renderer, const Uint8* table = font8x8_default); + + ~font8x8(){ + _freeSurfaceSafely(); + _freeTextureSafely(); + } + + + SDL_Color getBackgroundColor(){ return _palette[0]; } + SDL_Color getTextColor(){ return _palette[1]; } + void setPalette(SDL_Color background, SDL_Color text); + + float getScaleX(){ return (float)_scale.x/8; } + float getScaleY(){ return (float)_scale.y/8; } + void setScale(SDL_FPoint scale){ + _scale.x = scale.x*8 + 0.5f; + _scale.y = scale.y*8 + 0.5f; + } + + + void putCharRaw(char chr, int x, int y); + void putChar(char chr, int column, int row){ //align char position to scale + putCharRaw(chr, column*_scale.x, row*_scale.y); + } + + void printRaw(const std::string& txt, int x, int y); + void print(const std::string& txt, int column, int row){ + printRaw(txt, column*_scale.x, row*_scale.y); //basically same thing as putChar + } +}; + + +#endif /* _UTILS_FONT_HPP */ +" +K5whMWN1,cool bitmap font thing,Kitomas,C++,Thursday 9th of November 2023 01:24:36 AM CDT,"#include + + +//a modified version of https://github.com/dhepper/font8x8/blob/master/font8x8_basic.h + //here, i changed its formatting, and made 16 gradient chars between $10-$20 + //(space included, which itself is a gradient value of 0) +/* +for an example of how chars are encoded, +this is what the bits for char '3' look like in big endian: + 0b00011110 (0x1E) + 0b00110011 (0x33) + 0b00110000 (0x30) + 0b00011100 (0x1C) + 0b00110000 (0x30) + 0b00110011 (0x33) + 0b00011110 (0x1E) + 0b00000000 (0x00) +*/ +const Uint8 font8x8_default[1024] = { //128 chars of 8 bytes each = 1024 bytes + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$00 (null) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$01 (start of heading) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$02 (start of text) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$03 (end of text) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$04 (end of transmission) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$05 (enquiry) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$06 (acknowledge) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$07 '\a' (bell) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$08 '\b' (backspace) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$09 '\t' (horizontal tab) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$0A '\n' (new line) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$0B '\v' (vertical tab) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$0C '\f' (new page) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$0D '\r' (carriage return) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$0E (shift out) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$0F (shift in) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, //$10 (gradient value 16) + 0xFF, 0xFF, 0xEE, 0xFF, 0xFF, 0xFF, 0xEE, 0xFF, //$11 (gradient value 15) + 0xBB, 0xFF, 0xEE, 0xFF, 0xBB, 0xFF, 0xEE, 0xFF, //$12 (gradient value 14) + 0xAA, 0xFF, 0xEE, 0xFF, 0xAA, 0xFF, 0xEE, 0xFF, //$13 (gradient value 13) + 0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF, //$14 (gradient value 12) + 0xAA, 0xDD, 0xAA, 0xDD, 0xAA, 0xDD, 0xAA, 0xDD, //$15 (gradient value 11) + 0xAA, 0xDD, 0xAA, 0x77, 0xAA, 0xDD, 0xAA, 0x77, //$16 (gradient value 10) + 0xAA, 0xDD, 0xAA, 0x55, 0xAA, 0xDD, 0xAA, 0x55, //$17 (gradient value 9) + 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, //$18 (gradient value 8) + 0xAA, 0x44, 0xAA, 0x55, 0xAA, 0x44, 0xAA, 0x55, //$19 (gradient value 7) + 0xAA, 0x44, 0xAA, 0x11, 0xAA, 0x44, 0xAA, 0x11, //$1A (gradient value 6) + 0xAA, 0x44, 0xAA, 0x00, 0xAA, 0x44, 0xAA, 0x00, //$1B (gradient value 5) + 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00, //$1C (gradient value 4) + 0xAA, 0x00, 0x88, 0x00, 0xAA, 0x00, 0x88, 0x00, //$1D (gradient value 3) + 0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, //$1E (gradient value 2) + 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x88, 0x00, //$1F (gradient value 1) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$20 ' ' (gradient value 0) + 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00, //$21 '!' + 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$22 '""' (use \"" if inside string) + 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00, //$23 '#' + 0x0C, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x0C, 0x00, //$24 '$' + 0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00, //$25 '%' + 0x1C, 0x36, 0x1C, 0x6E, 0x3B, 0x33, 0x6E, 0x00, //$26 '&' + 0x06, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, //$27 '\'' (use ' if outside char literal) + 0x18, 0x0C, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x00, //$28 '(' + 0x06, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x06, 0x00, //$29 ')' + 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, //$2A '*' + 0x00, 0x0C, 0x0C, 0x3F, 0x0C, 0x0C, 0x00, 0x00, //$2B '+' + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x06, //$2C ',' + 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, //$2D '-' + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, //$2E '.' + 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00, //$2F '/' + 0x3E, 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x3E, 0x00, //$30 '0' + 0x0C, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x3F, 0x00, //$31 '1' + 0x1E, 0x33, 0x30, 0x1C, 0x06, 0x33, 0x3F, 0x00, //$32 '2' + 0x1E, 0x33, 0x30, 0x1C, 0x30, 0x33, 0x1E, 0x00, //$33 '3' + 0x38, 0x3C, 0x36, 0x33, 0x7F, 0x30, 0x78, 0x00, //$34 '4' + 0x3F, 0x03, 0x1F, 0x30, 0x30, 0x33, 0x1E, 0x00, //$35 '5' + 0x1C, 0x06, 0x03, 0x1F, 0x33, 0x33, 0x1E, 0x00, //$36 '6' + 0x3F, 0x33, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00, //$37 '7' + 0x1E, 0x33, 0x33, 0x1E, 0x33, 0x33, 0x1E, 0x00, //$38 '8' + 0x1E, 0x33, 0x33, 0x3E, 0x30, 0x18, 0x0E, 0x00, //$39 '9' + 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00, //$3A ':' + 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x06, //$3B ';' + 0x18, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x18, 0x00, //$3C '<' + 0x00, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x00, 0x00, //$3D '=' + 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00, //$3E '>' + 0x1E, 0x33, 0x30, 0x18, 0x0C, 0x00, 0x0C, 0x00, //$3F '?' (or \? to avoid trigraphs) + 0x3E, 0x63, 0x7B, 0x7B, 0x7B, 0x03, 0x1E, 0x00, //$40 '@' + 0x0C, 0x1E, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x00, //$41 'A' + 0x3F, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3F, 0x00, //$42 'B' + 0x3C, 0x66, 0x03, 0x03, 0x03, 0x66, 0x3C, 0x00, //$43 'C' + 0x1F, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1F, 0x00, //$44 'D' + 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x46, 0x7F, 0x00, //$45 'E' + 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x06, 0x0F, 0x00, //$46 'F' + 0x3C, 0x66, 0x03, 0x03, 0x73, 0x66, 0x7C, 0x00, //$47 'G' + 0x33, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x33, 0x00, //$48 'H' + 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, //$49 'I' + 0x78, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, 0x00, //$4A 'J' + 0x67, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x67, 0x00, //$4B 'K' + 0x0F, 0x06, 0x06, 0x06, 0x46, 0x66, 0x7F, 0x00, //$4C 'L' + 0x63, 0x77, 0x7F, 0x7F, 0x6B, 0x63, 0x63, 0x00, //$4D 'M' + 0x63, 0x67, 0x6F, 0x7B, 0x73, 0x63, 0x63, 0x00, //$4E 'N' + 0x1C, 0x36, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00, //$4F 'O' + 0x3F, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x0F, 0x00, //$50 'P' + 0x1E, 0x33, 0x33, 0x33, 0x3B, 0x1E, 0x38, 0x00, //$51 'Q' + 0x3F, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x67, 0x00, //$52 'R' + 0x1E, 0x33, 0x07, 0x0E, 0x38, 0x33, 0x1E, 0x00, //$53 'S' + 0x3F, 0x2D, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, //$54 'T' + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x00, //$55 'U' + 0x33, 0x33, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00, //$56 'V' + 0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00, //$57 'W' + 0x63, 0x63, 0x36, 0x1C, 0x1C, 0x36, 0x63, 0x00, //$58 'X' + 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x0C, 0x1E, 0x00, //$59 'Y' + 0x7F, 0x63, 0x31, 0x18, 0x4C, 0x66, 0x7F, 0x00, //$5A 'Z' + 0x1E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x1E, 0x00, //$5B '[' + 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00, //$5C '\\' + 0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x00, //$5D ']' + 0x08, 0x1C, 0x36, 0x63, 0x00, 0x00, 0x00, 0x00, //$5E '^' + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, //$5F '_' + 0x0C, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, //$60 '`' + 0x00, 0x00, 0x1E, 0x30, 0x3E, 0x33, 0x6E, 0x00, //$61 'a' + 0x07, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00, //$62 'b' + 0x00, 0x00, 0x1E, 0x33, 0x03, 0x33, 0x1E, 0x00, //$63 'c' + 0x38, 0x30, 0x30, 0x3e, 0x33, 0x33, 0x6E, 0x00, //$64 'd' + 0x00, 0x00, 0x1E, 0x33, 0x3f, 0x03, 0x1E, 0x00, //$65 'e' + 0x1C, 0x36, 0x06, 0x0f, 0x06, 0x06, 0x0F, 0x00, //$66 'f' + 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x1F, //$67 'g' + 0x07, 0x06, 0x36, 0x6E, 0x66, 0x66, 0x67, 0x00, //$68 'h' + 0x0C, 0x00, 0x0E, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, //$69 'i' + 0x30, 0x00, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, //$6A 'j' + 0x07, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x67, 0x00, //$6B 'k' + 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, //$6C 'l' + 0x00, 0x00, 0x33, 0x7F, 0x7F, 0x6B, 0x63, 0x00, //$6D 'm' + 0x00, 0x00, 0x1F, 0x33, 0x33, 0x33, 0x33, 0x00, //$6E 'n' + 0x00, 0x00, 0x1E, 0x33, 0x33, 0x33, 0x1E, 0x00, //$6F 'o' + 0x00, 0x00, 0x3B, 0x66, 0x66, 0x3E, 0x06, 0x0F, //$70 'p' + 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x78, //$71 'q' + 0x00, 0x00, 0x3B, 0x6E, 0x66, 0x06, 0x0F, 0x00, //$72 'r' + 0x00, 0x00, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x00, //$73 's' + 0x08, 0x0C, 0x3E, 0x0C, 0x0C, 0x2C, 0x18, 0x00, //$74 't' + 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x6E, 0x00, //$75 'u' + 0x00, 0x00, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00, //$76 'v' + 0x00, 0x00, 0x63, 0x6B, 0x7F, 0x7F, 0x36, 0x00, //$77 'w' + 0x00, 0x00, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x00, //$78 'x' + 0x00, 0x00, 0x33, 0x33, 0x33, 0x3E, 0x30, 0x1F, //$79 'y' + 0x00, 0x00, 0x3F, 0x19, 0x0C, 0x26, 0x3F, 0x00, //$7A 'z' + 0x38, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, 0x38, 0x00, //$7B '{' + 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, //$7C '|' + 0x07, 0x0C, 0x0C, 0x38, 0x0C, 0x0C, 0x07, 0x00, //$7D '}' + 0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //$7E '~' + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 //$7F (indicates transparency) +}; + + + + +font8x8::font8x8(SDL_Renderer* renderer, const Uint8* table){ + if(renderer == nullptr) throw ""renderer == nullptr""; + if(table == nullptr) throw ""table == nullptr""; + _renderer = renderer; + + //8-bit indexed, though only the first 2 palette colors are used + //(also, for 128 8x8 chars, a surface size of 128x64 is used) + _fontSurface = SDL_CreateRGBSurfaceWithFormat(0,128,64,8,SDL_PIXELFORMAT_INDEX8); + if(_fontSurface == nullptr){ + _valid = SDL_FALSE; + throw SDL_GetError(); + } + + + //generate pixel data from font data + if(SDL_LockSurface(_fontSurface)){ //make sure i have safe access to pixel data + _freeSurfaceSafely(); + _valid = SDL_FALSE; + throw SDL_GetError(); + } + Uint8* table_copy = (Uint8*) table; //otherwise i can't increment the pointer + Uint8* pixels = (Uint8*) _fontSurface->pixels; + + for(int yi=0; yi<64; yi+=8){ //for each char vertically + for(int xi=0; xi<128; xi+=8){ //for each char horizontally + int charPos = xi + yi*128; + for(int ri=0; ri<8; ++ri){ //for each row in current char + Uint8 row = *(table_copy++); + int rowPos = charPos + ri*128; + pixels[rowPos++] = (row>>0)&1; //each byte is a char's row (8 pixels) + pixels[rowPos++] = (row>>1)&1; + pixels[rowPos++] = (row>>2)&1; + pixels[rowPos++] = (row>>3)&1; + pixels[rowPos++] = (row>>4)&1; + pixels[rowPos++] = (row>>5)&1; + pixels[rowPos++] = (row>>6)&1; + pixels[rowPos++] = (row>>7)&1; + } + } + } + + SDL_UnlockSurface(_fontSurface); //can't error + + + //initialize palette to black and white, and create font texture + _valid = SDL_TRUE; //_valid will be set back to false if setPalette fails + setPalette( {0x00,0x00,0x00,0xFF}, {0xFF,0xFF,0xFF,0xFF} ); +} + + + + +void font8x8::setPalette(SDL_Color background, SDL_Color text){ + if(!_valid) throw ""invalid font""; + //the texture has be remade once the palette colors are modified + _freeTextureSafely(); + + //out of the 256 possible palette colors for 8-bit indexed, i'm only using 2 + _palette[0] = background; + _palette[1] = text; + + + if(SDL_LockSurface(_fontSurface)){ + _freeSurfaceSafely(); + _valid = SDL_FALSE; + throw SDL_GetError(); + } + + //'replace 2 palette colors, starting at index 0' + if(SDL_SetPaletteColors(_fontSurface->format->palette, _palette, 0, 2)){ + _freeSurfaceSafely(); + _valid = SDL_FALSE; + throw SDL_GetError(); + } + + SDL_UnlockSurface(_fontSurface); //can't error + + + _fontTexture = SDL_CreateTextureFromSurface(_renderer, _fontSurface); + if(_fontTexture == nullptr){ + _valid = SDL_FALSE; + throw SDL_GetError(); + } +} + + + + +void font8x8::putCharRaw(char chr, int x, int y){ + if(!_valid) throw ""invalid font""; + //char 127 is treated as 'transparent', so don't draw anything + if((chr&=127) == 127) return; + + SDL_Rect sourceRect, destinationRect; + + //position inside the font sprite sheet thing + sourceRect.x = (chr&15)*8; //for a total of 16 columns, scaled by 8 pixels + sourceRect.y = (chr>>4)*8; //for a total of 8 rows, scaled by 8 pixels + sourceRect.w = 8; //source texture area should always be 8x8 + sourceRect.h = 8; + + //position with regard to the render target (usually the window itself) + destinationRect.x = x; + destinationRect.y = y; + destinationRect.w = _scale.x; + destinationRect.h = _scale.y; + + SDL_RenderCopy(_renderer, _fontTexture, &sourceRect, &destinationRect); +} + + + + +void font8x8::printRaw(const std::string& txt, int x, int y){ + int startX = x; + size_t length = txt.length(); + + for(size_t i=0; i key : value +# tanda kurung { } +# object + +student = {""name"": ""Jaka"", ""address"": ""Jakarta Barat""} + +car = { + ""model"": ""truck"", + ""brand"": ""ford"", + ""year"": 2010, + ""color1"": [""red"", ""blue"", ""black""], + +} + +# display dict keys +print(car.keys()) + +# access item +print(car[""brand""]) + +# add new item +car[""owner""] = ""Jaka"" +print(car) + +# modify item +car[""year""] = 2011 +print(car) + +# modify item +car[""color""] = [""red"", ""black""] +print(car) + +# remove item +car.pop(""color"") +print(car) + +# remove the last item +car.popitem() +print(car) +" +1S17Utu9,green monkey snowybot,coinwalk,JavaScript,Thursday 9th of November 2023 12:51:31 AM CDT,"var originalbal = parseFloat(document.getElementById('pct_balance').value); +var divide = 300; +var changer = (originalbal/7); +var base = Number((originalbal/divide).toFixed(8)); +var floatingbase = base; +var taget = (originalbal*7); +var groupedten = (base*10); +var groupedseven = (base*6.5); +var tobetnext = ((floatingbase*1).toFixed(8)); +var bolance = originalbal; +var over = 6.9; +var under = 2.9; +var fart = 2; +var freak = false; +var oldbolance = ((Math.floor(originalbal/groupedten))*groupedten); +var oldbolancetree = ((Math.floor(originalbal/groupedten))*groupedten); +var oldbolancetwo = ((Math.floor(originalbal/groupedten))*groupedten); + + function getR(minz, maxz) { + minz = Math.ceil(minz); + maxz = Math.floor(maxz); + return Math.floor(Math.random() * (maxz - minz + 1)) + minz; +} + + +function get(){ +console.clear(); +setTimeout(function(){ +bolance = document.getElementById('pct_balance').value; +if ((bolance>(oldbolance+(floatingbase*over)))&&(bolance>oldbolancetwo)) { + floatingbase = floatingbase*2; + over = 4.9; + under = 4.9; + freak = true; + oldbolance = parseFloat(bolance); +} +if ((bolance>(oldbolance+(floatingbase*over)))&&(bolance=(oldbolancetree+(groupedten*fart)))&&(bolance<(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base; + fart = 2; + over = 6.9; + under = 2.9; + freak = false; + oldbolance = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetree = ((Math.floor(bolance/groupedten))*groupedten); +} +if ((floatingbase>=(bolance/changer))&&(bolancebase)&&(bolance<(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base; + fart = 0; + over = 6.9; + under = 2.9; + oldbolance = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); +} +if ((floatingbase>=(bolance/changer))&&(bolancebase)&&(bolance>(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base*2; + fart = 0; + over = 4.9; + under = 4.9; + oldbolance = parseFloat(bolance); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); +} + if (bolance >= taget) { + console.log(""winner winner chicken dinner""); + return; + } +tobetnext = ((floatingbase*1).toFixed(8)); +$('#pct_chance').val(49.5); +$('#pct_bet').val(tobetnext); +$('#a_lo').click(); +}, (getR(100,200))); +var good = ((bolance-originalbal).toFixed(8)); +console.log(""profit""); +console.log(good); +setTimeout(() => get(), (getR(200,300))); +} +get();" +3VLhELWb,filter,rvdraws,JSON,Wednesday 8th of November 2023 11:41:15 PM CDT,"[{ + c: ""name"", + v: [2,3] + st: 1, +}, +{ + c: ""refId"", + v: [4,5,6] + st: 1, +} +] +t: ""table1"" +p: [1,10] +o: 1" +tvXNURGv,53. Maximum Subarray,micahbales,JavaScript,Wednesday 8th of November 2023 10:46:45 PM CDT,"/** +* Problem statement: +* +* File this one under: ""Easy if you already know the answer."" +* +* https://en.wikipedia.org/wiki/Maximum_subarray_problem +*/ + +/* Kadane's algorithm */ + +/** + * @param {number[]} nums + * @return {number} + */ +var maxSubArray = function(nums) { + let bestSum = -Infinity + let currentSum = 0 + for (const num of nums) { + currentSum = Math.max(num, currentSum + num) + bestSum = Math.max(bestSum, currentSum) + } + return bestSum +};" +mGau1Zyi,Untitled,NAHID_GTC,C,Wednesday 8th of November 2023 10:35:14 PM CDT,"#include + +// Function to convert a decimal number to binary +long long DecimalToBinaryConversion(int decimalNum) { + long long binaryNum = 0; + int remainder, position = 1; + + while (decimalNum > 0) { + remainder = decimalNum % 2; + binaryNum += remainder * position; + decimalNum /= 2; + position *= 10; + } + + return binaryNum; +} + +int main() { + int decimalNum; + + printf(""Enter a decimal number: ""); + scanf(""%d"", &decimalNum); + + if (decimalNum < 0) { + printf(""Invalid input. Please enter a non-negative decimal number.\n""); + return 1; + } + + long long binaryNum = DecimalToBinaryConversion(decimalNum); + + printf(""Binary equivalent: %lld\n"", binaryNum); + + return 0; +} +" +AEVL4Y28,Untitled,NAHID_GTC,C,Wednesday 8th of November 2023 10:34:47 PM CDT,"#include + +int main() { + int arr[100] = {0}; + int size = 0; + + printf(""Enter the number of elements you want to insert: ""); + scanf(""%d"", &size); + + if (size < 1 || size > 100) { + printf(""Invalid array size. Size should be between 1 and 100.\n""); + return 1; + } + + printf(""Enter %d elements:\n"", size); + for (int i = 0; i < size; i++) { + scanf(""%d"", &arr[i]); + } + + printf(""Array before insertion: ""); + for (int i = 0; i < size; i++) { + printf(""%d "", arr[i]); + } + printf(""\n""); + + int element, index; + printf(""Enter the element you want to insert: ""); + scanf(""%d"", &element); + printf(""Enter the index at which you want to insert the element: ""); + scanf(""%d"", &index); + + if (index < 0 || index >= size) { + printf(""Invalid index. Index should be between 0 and %d.\n"", size - 1); + return 1; + } + + // Shift elements to the right to make space for the new element + for (int i = size; i > index; i--) { + arr[i] = arr[i - 1]; + } + + // Insert the element at the proper position + arr[index] = element; + size++; + + printf(""Array after insertion: ""); + for (int i = 0; i < size; i++) { + printf(""%d "", arr[i]); + } + printf(""\n""); + + return 0; +} +" +3RMm1aSK,snowybot the best bot ever made.,coinwalk,JavaScript,Wednesday 8th of November 2023 09:09:07 PM CDT,"var originalbal = parseFloat(document.getElementById('pct_balance').value); +var divide = 80000; +var changer = (originalbal/20); +var base = Number((originalbal/divide).toFixed(8)); +var floatingbase = base; +var taget = (originalbal*7); +var groupedten = (base*10); +var groupedseven = (base*6.5); +var tobetnext = ((floatingbase*1).toFixed(8)); +var bolance = originalbal; +var over = 6.9; +var under = 2.9; +var fart = 2; +var freak = false; +var oldbolance = ((Math.floor(originalbal/groupedten))*groupedten); +var oldbolancetree = ((Math.floor(originalbal/groupedten))*groupedten); +var oldbolancetwo = ((Math.floor(originalbal/groupedten))*groupedten); + + function getR(minz, maxz) { + minz = Math.ceil(minz); + maxz = Math.floor(maxz); + return Math.floor(Math.random() * (maxz - minz + 1)) + minz; +} + + +function get(){ +console.clear(); +setTimeout(function(){ +bolance = document.getElementById('pct_balance').value; +if ((bolance>(oldbolance+(floatingbase*over)))&&(bolance>oldbolancetwo)) { + floatingbase = floatingbase*2; + over = 4.9; + under = 4.9; + freak = true; + oldbolance = parseFloat(bolance); +} +if ((bolance>(oldbolance+(floatingbase*over)))&&(bolance=(oldbolancetree+(groupedten*fart)))&&(bolance<(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base; + fart = 2; + over = 6.9; + under = 2.9; + freak = false; + oldbolance = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetree = ((Math.floor(bolance/groupedten))*groupedten); +} +if ((floatingbase>=(bolance/changer))&&(bolancebase)&&(bolance<(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base; + fart = 0; + over = 6.9; + under = 2.9; + oldbolance = ((Math.floor(bolance/groupedten))*groupedten); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); +} +if ((floatingbase>=(bolance/changer))&&(bolancebase)&&(bolance>(((Math.floor(bolance/groupedten))*groupedten)+groupedseven))){ + floatingbase = base*2; + fart = 0; + over = 4.9; + under = 4.9; + oldbolance = parseFloat(bolance); + oldbolancetwo = ((Math.floor(bolance/groupedten))*groupedten); +} + if (bolance >= taget) { + console.log(""winner winner chicken dinner""); + return; + } +tobetnext = ((floatingbase*1).toFixed(8)); +$('#pct_chance').val(49.5); +$('#pct_bet').val(tobetnext); +$('#a_lo').click(); +}, (getR(100,200))); +var good = ((bolance-originalbal).toFixed(8)); +console.log(""profit""); +console.log(good); +setTimeout(() => get(), (getR(200,300))); +} +get();" +tzBg0TkT,Sic Bo,excellent940707,C,Wednesday 8th of November 2023 08:26:21 PM CDT,"#include +#include +#include +using namespace std; +bool game(int a, int b, int c, int wager){ + if(wager==1){ + if(a==3&&b==3&&c==3)return false; + else if(a==5&&b==5&&c==5)return false; + else if((a+b+c)==3)return false; + else if((a+b+c)%2==1)return true; + else return false; + } + else{ + if(a==2&&b==2&&c==2)return false; + else if(a==4&&b==4&&c==4)return false; + else if((a+b+c)==18)return false; + else if((a+b+c)%2==0)return true; + else return false; + } +} +int main(){ + srand(time(NULL)); + int t=1000; + double win=0, lose=0; + while(t--){ + bool result=game(rand()%6+1, rand()%6+1, rand()%6+1, rand()%2); + if(result)win++; + else lose++; + } + printf(""%.5f\n"",win/(win+lose)); + return 0; +}" +qSEFX2DF,Summary Stats,UF6,Python,Wednesday 8th of November 2023 07:47:06 PM CDT,"import pandas as pd +import numpy as np +import matplotlib.pyplot as plt +from scipy.stats import norm + +# Replace 'B5 segmentSummary (1).csv' with the actual CSV file path +file_path = 'B5 segmentSummary (1).csv' + +# Define the range of column positions you want to analyze (columns 6 through 10) +start_column_position = 6 # Corresponds to column 6 +end_column_position = 9 # Corresponds to column 10 + +# Read the CSV file into a Pandas DataFrame +df = pd.read_csv(file_path) + +# Select columns 6 through 10 for analysis +selected_columns = df.iloc[:, start_column_position:end_column_position + 1] + +# Calculate summary statistics for the selected columns +summary_statistics = selected_columns.describe() + +# Transpose the summary statistics for plotting +summary_statistics = summary_statistics.T + +# Create a grouped bar plot for the selected statistics +plt.figure(figsize=(12, 6)) +x = range(len(summary_statistics.index)) +bar_width = 0.15 + +# Define the statistics to plot +statistics_to_plot = ['mean', 'std', 'min', '25%', '50%', '75%', 'max'] + +for i, statistic in enumerate(statistics_to_plot): + plt.bar( + [pos + i * bar_width for pos in x], + summary_statistics[statistic], + width=bar_width, + label=statistic + ) + +plt.xlabel('Columns') +plt.ylabel('Values') +plt.title('Summary Statistics for Selected Columns') +plt.xticks([pos + 3 * bar_width for pos in x], summary_statistics.index, rotation=45) +plt.legend() + +# Adjust layout +plt.tight_layout() + +# Create a figure with subplots for each Gaussian distribution +plt.figure(figsize=(12, 6)) + +# Define the x-axis range for the plots +x_range = np.linspace(selected_columns.min().min(), selected_columns.max().max(), 1000) + +# Iterate through the selected columns and analyze them +for i, col in enumerate(selected_columns.columns): + plt.subplot(2, 2, i + 1) # Create subplots in a 2x2 grid + target_column = selected_columns[col] + mean = target_column.mean() + std_dev = target_column.std() + + # Fit a Gaussian distribution + fitted_data = norm.pdf(x_range, mean, std_dev) + + # Plot the Gaussian distribution + plt.plot(x_range, fitted_data, 'b-', linewidth=2, label='Fitted Gaussian') + + # Plot the original data as a histogram + plt.hist(target_column, bins=30, density=True, alpha=0.7, color='gray', label='Data Histogram') + + # Add labels and title with the target column name + plt.xlabel('Values') + plt.ylabel('Frequency') + plt.title(f'Gaussian Fit for {col}') + + # Show the mean shift + plt.axvline(mean, color='red', linestyle='dashed', linewidth=2, label='Mean Shift') + + # Add a legend + plt.legend() + +# Adjust layout +plt.tight_layout() + +# Show the plots +plt.show() +" +MTjgdAgw,Team Member Repeat Elementor Widgets,salmancreation,PHP,Wednesday 8th of November 2023 07:20:43 PM CDT,"start_controls_section( + '_section_title', + [ + 'label' => __('Title & Description', 'bdevselement'), + 'tab' => Controls_Manager::TAB_CONTENT, + 'condition' => [ + 'design_style' => ['style_10'] + ], + ] + ); + + $this->add_control( + 'title', + [ + 'label' => __('Title', 'bdevselement'), + 'label_block' => true, + 'type' => Controls_Manager::TEXTAREA, + 'rows' => 4, + 'default' => 'Heading Title', + 'placeholder' => __('Heading Text', 'bdevselement'), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + + $this->end_controls_section(); + + + // member list + $this->start_controls_section( + '_section_slides', + [ + 'label' => __( 'Members List', 'bdevselement' ), + 'tab' => Controls_Manager::TAB_CONTENT, + ] + ); + + $repeater = new Repeater(); + + $repeater->start_controls_tabs( + '_tab_style_member_box_slider' + ); + + $repeater->start_controls_tab( + '_tab_member_info', + [ + 'label' => __( 'Information', 'bdevselement' ), + ] + ); + + $repeater->add_control( + 'image', + [ + 'type' => Controls_Manager::MEDIA, + 'label' => __( 'Image', 'bdevselement' ), + 'default' => [ + 'url' => Utils::get_placeholder_image_src(), + ], + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => true, + 'label' => __( 'Title', 'bdevselement' ), + 'default' => __( 'BDevs Member Title', 'bdevselement' ), + 'placeholder' => __( 'Type title here', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'designation', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => true, + 'show_label' => true, + 'label' => __( 'Job Title', 'bdevselement' ), + 'default' => __( 'BDevs Officer', 'bdevselement' ), + 'placeholder' => __( 'Type designation here', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'slide_url', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => true, + 'show_label' => false, + 'placeholder' => __( 'Type link here', 'bdevselement' ), + 'default' => __( '#', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->end_controls_tab(); + + $repeater->start_controls_tab( + '_tab_member_links', + [ + 'label' => __( 'Links', 'bdevselement' ), + ] + ); + + $repeater->add_control( + 'show_social', + [ + 'label' => __( 'Show Options?', 'bdevselement' ), + 'type' => Controls_Manager::SWITCHER, + 'label_on' => __( 'Yes', 'bdevselement' ), + 'label_off' => __( 'No', 'bdevselement' ), + 'return_value' => 'yes', + 'style_transfer' => true, + ] + ); + + $repeater->add_control( + 'web_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Website Address', 'bdevselement' ), + 'placeholder' => __( 'Add your profile link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'email_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Email', 'bdevselement' ), + 'placeholder' => __( 'Add your email link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'phone_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Phone', 'bdevselement' ), + 'placeholder' => __( 'Add your phone link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'facebook_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Facebook', 'bdevselement' ), + 'default' => __( '#', 'bdevselement' ), + 'placeholder' => __( 'Add your facebook link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'twitter_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Twitter', 'bdevselement' ), + 'default' => __( '#', 'bdevselement' ), + 'placeholder' => __( 'Add your twitter link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'instagram_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Instagram', 'bdevselement' ), + 'default' => __( '#', 'bdevselement' ), + 'placeholder' => __( 'Add your instagram link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'linkedin_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'LinkedIn', 'bdevselement' ), + 'default' => __( '#', 'bdevselement' ), + 'placeholder' => __( 'Add your linkedin link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'youtube_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Youtube', 'bdevselement' ), + 'placeholder' => __( 'Add your youtube link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'googleplus_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Google Plus', 'bdevselement' ), + 'placeholder' => __( 'Add your Google Plus link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'flickr_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Flickr', 'bdevselement' ), + 'placeholder' => __( 'Add your flickr link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'vimeo_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Vimeo', 'bdevselement' ), + 'placeholder' => __( 'Add your vimeo link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'behance_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Behance', 'bdevselement' ), + 'placeholder' => __( 'Add your hehance link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'dribble_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Dribbble', 'bdevselement' ), + 'placeholder' => __( 'Add your dribbble link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'pinterest_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Pinterest', 'bdevselement' ), + 'placeholder' => __( 'Add your pinterest link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->add_control( + 'gitub_title', + [ + 'type' => Controls_Manager::TEXT, + 'label_block' => false, + 'label' => __( 'Github', 'bdevselement' ), + 'placeholder' => __( 'Add your github link', 'bdevselement' ), + 'dynamic' => [ + 'active' => true, + ] + ] + ); + + $repeater->end_controls_tab(); + $repeater->end_controls_tabs(); + + // REPEATER + $this->add_control( + 'slides', + [ + 'show_label' => false, + 'type' => Controls_Manager::REPEATER, + 'fields' => $repeater->get_controls(), + 'title_field' => '<# print(title || ""Carousel Item""); #>', + 'default' => [ + [ + 'image' => [ + 'url' => Utils::get_placeholder_image_src(), + ], + ], + [ + 'image' => [ + 'url' => Utils::get_placeholder_image_src(), + ], + ], + [ + 'image' => [ + 'url' => Utils::get_placeholder_image_src(), + ], + ], + [ + 'image' => [ + 'url' => Utils::get_placeholder_image_src(), + ], + ], + [ + 'image' => [ + 'url' => Utils::get_placeholder_image_src(), + ], + ] + ] + ] + ); + + $this->add_group_control( + Group_Control_Image_Size::get_type(), + [ + 'name' => 'thumbnail', + 'default' => 'medium_large', + 'separator' => 'before', + 'exclude' => [ + 'custom' + ] + ] + ); + + $this->add_control( + 'title_tag', + [ + 'label' => __( 'Title HTML Tag', 'bdevselement' ), + 'type' => Controls_Manager::CHOOSE, + 'options' => [ + 'h1' => [ + 'title' => __( 'H1', 'bdevselement' ), + 'icon' => 'eicon-editor-h1' + ], + 'h2' => [ + 'title' => __( 'H2', 'bdevselement' ), + 'icon' => 'eicon-editor-h2' + ], + 'h3' => [ + 'title' => __( 'H3', 'bdevselement' ), + 'icon' => 'eicon-editor-h3' + ], + 'h4' => [ + 'title' => __( 'H4', 'bdevselement' ), + 'icon' => 'eicon-editor-h4' + ], + 'h5' => [ + 'title' => __( 'H5', 'bdevselement' ), + 'icon' => 'eicon-editor-h5' + ], + 'h6' => [ + 'title' => __( 'H6', 'bdevselement' ), + 'icon' => 'eicon-editor-h6' + ] + ], + 'default' => 'h3', + 'toggle' => false, + ] + ); + + $this->add_responsive_control( + 'align', + [ + 'label' => __( 'Alignment', 'bdevselement' ), + 'type' => Controls_Manager::CHOOSE, + 'options' => [ + 'left' => [ + 'title' => __( 'Left', 'bdevselement' ), + 'icon' => 'fa fa-align-left', + ], + 'center' => [ + 'title' => __( 'Center', 'bdevselement' ), + 'icon' => 'fa fa-align-center', + ], + 'right' => [ + 'title' => __( 'Right', 'bdevselement' ), + 'icon' => 'fa fa-align-right', + ], + ], + 'toggle' => true, + 'selectors' => [ + '{{WRAPPER}} .single-carousel-item' => 'text-align: {{VALUE}};' + ] + ] + ); + + $this->end_controls_section(); + + $this->start_controls_section( + '_section_settings', + [ + 'label' => __( 'Design Style', 'bdevselement' ), + 'tab' => Controls_Manager::TAB_CONTENT, + ] + ); + + $this->add_control( + 'design_style', + [ + 'label' => __( 'Design Style', 'bdevselement' ), + 'type' => Controls_Manager::SELECT, + 'options' => [ + 'style_1' => __( 'Style 1', 'bdevselement' ), + 'style_2' => __( 'Style 2', 'bdevselement' ), + ], + 'default' => 'style_1', + 'frontend_available' => true, + 'style_transfer' => true, + ] + ); + $this->add_control( + 'slider_active', + [ + 'label' => __( 'Slider active on/off', 'bdevselement' ), + 'type' => Controls_Manager::SWITCHER, + 'default' =>true, + 'condition' => [ + 'design_style' => ['style_10'] + ], + ] + ); + $this->add_control( + 'animation_speed', + [ + 'label' => __( 'Animation Speed', 'bdevselement' ), + 'type' => Controls_Manager::NUMBER, + 'min' => 100, + 'step' => 10, + 'max' => 10000, + 'default' => 300, + 'description' => __( 'Slide speed in milliseconds', 'bdevselement' ), + 'frontend_available' => true, + 'condition' => [ + 'design_style' => ['style_10'] + ], + ] + ); + + $this->add_control( + 'autoplay', + [ + 'label' => __( 'Autoplay?', 'bdevselement' ), + 'type' => Controls_Manager::SWITCHER, + 'label_on' => __( 'Yes', 'bdevselement' ), + 'label_off' => __( 'No', 'bdevselement' ), + 'return_value' => 'yes', + 'default' => 'yes', + 'frontend_available' => true, + 'condition' => [ + 'design_style' => ['style_10'] + ], + ] + ); + + $this->add_control( + 'autoplay_speed', + [ + 'label' => __( 'Autoplay Speed', 'bdevselement' ), + 'type' => Controls_Manager::NUMBER, + 'min' => 100, + 'step' => 100, + 'max' => 10000, + 'default' => 3000, + 'description' => __( 'Autoplay speed in milliseconds', 'bdevselement' ), + 'condition' => [ + 'autoplay' => 'yes', + 'design_style' => ['style_10'] + ], + 'frontend_available' => true, + ] + ); + + $this->add_control( + 'loop', + [ + 'label' => __( 'Infinite Loop?', 'bdevselement' ), + 'type' => Controls_Manager::SWITCHER, + 'label_on' => __( 'Yes', 'bdevselement' ), + 'label_off' => __( 'No', 'bdevselement' ), + 'return_value' => 'yes', + 'default' => 'yes', + 'frontend_available' => true, + 'condition' => [ + 'design_style' => ['style_10'] + ], + ] + ); + + $this->add_control( + 'vertical', + [ + 'label' => __( 'Vertical Mode?', 'bdevselement' ), + 'type' => Controls_Manager::SWITCHER, + 'label_on' => __( 'Yes', 'bdevselement' ), + 'label_off' => __( 'No', 'bdevselement' ), + 'return_value' => 'yes', + 'frontend_available' => true, + 'style_transfer' => true, + 'condition' => [ + 'design_style' => ['style_10'] + ], + ] + ); + + $this->add_control( + 'navigation', + [ + 'label' => __( 'Navigation', 'bdevselement' ), + 'type' => Controls_Manager::SELECT, + 'options' => [ + 'none' => __( 'None', 'bdevselement' ), + 'arrow' => __( 'Arrow', 'bdevselement' ), + 'dots' => __( 'Dots', 'bdevselement' ), + 'both' => __( 'Arrow & Dots', 'bdevselement' ), + ], + 'default' => 'arrow', + 'frontend_available' => true, + 'style_transfer' => true, + 'condition' => [ + 'design_style' => ['style_10'] + ], + ] + ); + + $this->end_controls_section(); + + + } + + protected function register_style_controls() { + $this->start_controls_section( + '_section_style_content', + [ + 'label' => __( 'Title / Content', 'bdevselement' ), + 'tab' => Controls_Manager::TAB_STYLE, + ] + ); + + $this->add_responsive_control( + 'content_padding', + [ + 'label' => __( 'Content Padding', 'bdevselement' ), + 'type' => Controls_Manager::DIMENSIONS, + 'size_units' => [ 'px', 'em', '%' ], + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', + ], + ] + ); + + $this->add_group_control( + Group_Control_Background::get_type(), + [ + 'name' => 'content_background', + 'selector' => '{{WRAPPER}} .bdevs-el-content', + 'exclude' => [ + 'image' + ] + ] + ); + + // Title + $this->add_control( + '_heading_title', + [ + 'type' => Controls_Manager::HEADING, + 'label' => __( 'Title', 'bdevselement' ), + 'separator' => 'before' + ] + ); + + $this->add_responsive_control( + 'title_spacing', + [ + 'label' => __( 'Bottom Spacing', 'bdevselement' ), + 'type' => Controls_Manager::SLIDER, + 'size_units' => ['px'], + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', + ], + ] + ); + + $this->add_control( + 'title_color', + [ + 'label' => __( 'Text Color', 'bdevselement' ), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-title' => 'color: {{VALUE}}', + ], + ] + ); + + $this->add_group_control( + Group_Control_Typography::get_type(), + [ + 'name' => 'title', + 'selector' => '{{WRAPPER}} .bdevs-el-title', + 'scheme' => Typography::TYPOGRAPHY_2, + ] + ); + + // Subtitle + $this->add_control( + '_heading_subtitle', + [ + 'type' => Controls_Manager::HEADING, + 'label' => __( 'Subtitle', 'bdevselement' ), + 'separator' => 'before' + ] + ); + + $this->add_responsive_control( + 'subtitle_spacing', + [ + 'label' => __( 'Bottom Spacing', 'bdevselement' ), + 'type' => Controls_Manager::SLIDER, + 'size_units' => ['px'], + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}};', + ], + ] + ); + + $this->add_control( + 'subtitle_color', + [ + 'label' => __( 'Text Color', 'bdevselement' ), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-subtitle' => 'color: {{VALUE}}', + ], + ] + ); + + $this->add_group_control( + Group_Control_Typography::get_type(), + [ + 'name' => 'subtitle', + 'selector' => '{{WRAPPER}} .bdevs-el-subtitle', + 'scheme' => Typography::TYPOGRAPHY_3, + ] + ); + + // description + $this->add_control( + '_content_description', + [ + 'type' => Controls_Manager::HEADING, + 'label' => __( 'Description', 'bdevselement' ), + 'separator' => 'before' + ] + ); + + $this->add_responsive_control( + 'description_spacing', + [ + 'label' => __( 'Bottom Spacing', 'bdevselement' ), + 'type' => Controls_Manager::SLIDER, + 'size_units' => ['px'], + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-desc' => 'margin-bottom: {{SIZE}}{{UNIT}};', + ], + ] + ); + + $this->add_control( + 'description_color', + [ + 'label' => __( 'Text Color', 'bdevselement' ), + 'type' => Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-desc' => 'color: {{VALUE}}', + ], + ] + ); + + $this->add_group_control( + Group_Control_Typography::get_type(), + [ + 'name' => 'description', + 'selector' => '{{WRAPPER}} .bdevs-el-desc', + 'scheme' => Typography::TYPOGRAPHY_4, + ] + ); + + $this->end_controls_section(); + + // feature icon + $this->start_controls_section( + '_section_style_icon', + [ + 'label' => __('Icon', 'bdevselement'), + 'tab' => \Elementor\Controls_Manager::TAB_STYLE, + ] + ); + + $this->add_control( + 'feature_icon_width', + [ + 'label' => esc_html__('Size', 'bdevselement'), + 'type' => \Elementor\Controls_Manager::SLIDER, + 'size_units' => ['px', '%'], + 'range' => [ + 'px' => [ + 'min' => 0, + 'max' => 1000, + 'step' => 5, + ], + '%' => [ + 'min' => 0, + 'max' => 100, + ], + ], + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-icon a' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}', + ], + ] + ); + + $this->add_group_control( + \Elementor\Group_Control_Typography::get_type(), + [ + 'name' => 'feature-icon', + 'selector' => '{{WRAPPER}} .bdevs-el-icon a', + ] + ); + + $this->add_control( + 'feature_icon_color', + [ + 'label' => __('Color', 'bdevselement'), + 'type' => \Elementor\Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-icon a' => 'color: {{VALUE}}', + ], + ] + ); + + $this->add_control( + 'feature_icon_bg_color', + [ + 'label' => __('BG Color', 'bdevselement'), + 'type' => \Elementor\Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-icon a' => 'background-color: {{VALUE}}', + ], + ] + ); + + $this->add_control( + 'feature_icon_h_color', + [ + 'label' => __('Hover Color', 'bdevselement'), + 'type' => \Elementor\Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-icon:hover a' => 'color: {{VALUE}}', + ], + ] + ); + + $this->add_control( + 'feature_icon_bg_h_color', + [ + 'label' => __('BG Hover Color', 'bdevselement'), + 'type' => \Elementor\Controls_Manager::COLOR, + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-icon:hover a' => 'background-color: {{VALUE}}', + ], + ] + ); + + $this->add_group_control( + \Elementor\Group_Control_Border::get_type(), + [ + 'name' => 'feature_icon_border', + 'selector' => '{{WRAPPER}} .bdevs-el-icon a', + ] + ); + + $this->add_control( + 'feature_icon_border_radius', + [ + 'label' => __('Border Radius', 'bdevselement'), + 'type' => \Elementor\Controls_Manager::DIMENSIONS, + 'size_units' => ['px', '%'], + 'selectors' => [ + '{{WRAPPER}} .bdevs-el-icon a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', + ], + ] + ); + + $this->end_controls_section(); + + + } + + protected function render() { + $settings = $this->get_settings_for_display(); + + $this->add_inline_editing_attributes( 'title', 'basic' ); + $this->add_render_attribute( 'title', 'class', 'b_hover bdevs-el-title' ); + $this->add_render_attribute( 'name', 'class', 'name' ); + + $this->add_inline_editing_attributes( 'description', 'intermediate' ); + $this->add_render_attribute( 'description', 'class', 'bdevs-card-text' ); + + if (!empty($title)) { + $title = bdevs_element_kses_basic( $settings['title' ] ); + } + + if ( empty( $settings['slides'] ) ) { + return; + } + ?> + + add_inline_editing_attributes( 'title', 'basic' ); + $this->add_render_attribute( 'title', 'class', 'team__text-title bdevs-el-title' ); + + // bg_image + if (!empty($settings['bg_shape_image']['id'])) { + $bg_shape_image = wp_get_attachment_image_url( $settings['bg_shape_image']['id'], $settings['shape_size'] ); + if ( ! $bg_shape_image ) { + $bg_shape_image = $settings['bg_shape_image']['url']; + } + } + + $slider_active = !empty($settings['slider_active']) ? 'team1__carousel owl-carousel' : ''; + ?> + +
+
+
+ +
+
+
+ + "" alt=""""> + +
+ +
+ + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + +
+ +
+
+
+ %3$s', + tag_escape( $settings['title_tag'] ), + $this->get_render_attribute_string( 'title' ), + $title, + $slide_url + ); ?> + + + + +
+
+
+ +
+
+
+ + + + + +
+
+
+ +
+
+ +
+ "" alt=""img""> +
+ + +
+ + + + %3$s', + tag_escape( $settings['title_tag'] ), + $this->get_render_attribute_string( 'title' ), + $title, + $slide_url + ); ?> +
+
+ +
+
+
+ +
+
+
+ + + +
+
+
+ +
+
+ +
+ +
+ + "" alt=""""> + + + + + "" alt=""""> + + +
+
+ %3$s', + tag_escape( $settings['title_tag'] ), + $this->get_render_attribute_string( 'title' ), + $title, + $slide_url + ); ?> + +

+
+ + +
+ + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + + + + ""> + +
+ +
+
+ +
+
+
+ + + add_responsive_control( + 'align_slide', + [ + 'label' => __( 'Alignment', 'bdevselement' ), + 'type' => Controls_Manager::CHOOSE, + 'options' => [ + 'left' => [ + 'title' => __( 'Left', 'bdevselement' ), + 'icon' => 'fa fa-align-left', + ], + 'center' => [ + 'title' => __( 'Center', 'bdevselement' ), + 'icon' => 'fa fa-align-center', + ], + 'right' => [ + 'title' => __( 'Right', 'bdevselement' ), + 'icon' => 'fa fa-align-right', + ], + ], + 'toggle' => true, + 'default' => 'left', + 'selectors' => [ + '{{WRAPPER}}' => 'text-align: {{VALUE}};' + ] + ] + );" +qNHh3Hpu,Rolex Corner Vanilla JS 2023 Cookiebot Script,nicolaslagios,JavaScript,Wednesday 8th of November 2023 06:33:42 PM CDT,"/* ---- Rolex Corner Cookiebot Concent Script 2023 ---- +#### Rocket Path P.C. #### */ +function CookiebotOnAcceptListenerFunction(e) { + // Έλεγχος αν το cookie ""rlx-once"" είναι ""true"" + if (getCookie(""rlx-once"") === ""true"") { + return; //αν ναι τότε σταμάτα την διαδικασία της function + } + + // Αλλιώς έλεγχος αν το iframe με id ""rlx-corner"" υπάρχει + var rlxCorner = document.getElementById(""rlx-corner""); + if (rlxCorner) { + if (Cookiebot.consent.marketing) { + // Αν έχει γίνει αποδοχή των cookies του marketing τότε: + postMessageToIframe(rlxCorner, ""consentTrue""); + postMessageToIframe(rlxCorner, ""consentValidation""); + setCookie(""rlx-consent"", true); + setCookie(""rlx-once"", true); + } else { + // Διαφορετικά: + postMessageToIframe(rlxCorner, ""consentFalse""); + setCookie(""rlx-consent"", false); + setCookie(""rlx-once"", false); + } + } +} +window.addEventListener(""CookiebotOnAccept"", CookiebotOnAcceptListenerFunction); //και το listener για άμεσο έλεγχο + +function CookiebotOnDeclineListenerFunction(e) { + // έλεγχος αν το iframe με id ""rlx-corner"" υπάρχει + var rlxCorner = document.getElementById(""rlx-corner""); + if (rlxCorner) { + postMessageToIframe(rlxCorner, ""consentFalse""); + setCookie(""rlx-consent"", false); + setCookie(""rlx-once"", false); + } +} +window.addEventListener(""CookiebotOnDecline"", CookiebotOnDeclineListenerFunction); + +// Ελεγχος αν jQuery και ""rlx-corner"" υπάρχουν +if (typeof jQuery !== ""undefined"" && jQuery(""#rlx-corner"").length > 0) { + setCookie(""rlx-consent"", false); + + // Έλεγχος αν το ""CookieConsent"" υπάρχει + if (getCookie(""CookieConsent"")) { + var cookieStr = getCookie(""CookieConsent""); //παίρνει το περιεχόμενο + cookieStr = cookieStr.slice(1, -1); //αφαίρεί το brackets {} + var cookieArr = cookieStr.split("",""); //μετατροπή σε array είτε υπάρχει split comma είτε όχι + var cookieObj = {}; + + // Δημιουργία υποarrays - objects για κάθε array item + cookieArr.forEach(function (item) { + var parts = item.split("":""); + cookieObj[parts[0]] = parts[1]; + }); + + // Έλεγχος αν το marketing consent είναι true, και κάνει τα cookies true αντίστοιχα + if (cookieObj.marketing === 'true') { + setCookie(""rlx-consent"", true); + setCookie(""rlx-once"", true); + } + } else { + // Αν δεν υπάρχει το ""CookieConsent"" cookie τότε τα κάνει false + setCookie(""rlx-consent"", false); + setCookie(""rlx-once"", false); + } +} + +// Υπόλοιπη διαδικασία χωρίς comments +if (document.getElementById(""rlx-corner"") && getCookie(""rlx-consent"") === ""true"") { + var rlxCorner = document.getElementById(""rlx-corner""); + if (rlxCorner) { + postMessageToIframe(rlxCorner, ""consentTrue""); + postMessageToIframe(rlxCorner, ""consentValidation""); + } +} + +function getCookie(name) { + var value = ""; "" + document.cookie; + var parts = value.split(""; "" + name + ""=""); + if (parts.length === 2) return parts.pop().split("";"").shift(); +} + +function setCookie(name, value) { + document.cookie = name + ""="" + value + ""; path=/""; +} + +function postMessageToIframe(iframe, message) { + if (iframe && iframe.contentWindow) { + iframe.contentWindow.postMessage(message, ""https://corners.rolex.com""); + } +}" +3ff2naY4,2023-11-08_stats.json,rdp_snitch,JSON,Wednesday 8th of November 2023 06:18:22 PM CDT,"{ + ""ip"": { + ""103.232.53.123"": 51, + ""185.209.82.234"": 3, + ""111.61.253.55"": 6, + ""85.209.11.106"": 3, + ""198.235.24.43"": 9, + ""87.251.75.145"": 6, + ""185.170.144.3"": 6, + ""87.251.75.120"": 3, + ""198.235.24.56"": 9, + ""106.116.169.71"": 3, + ""36.91.222.100"": 6, + ""147.78.47.51"": 12, + ""141.98.11.128"": 6, + ""191.101.41.72"": 3, + ""62.204.41.146"": 15, + ""77.90.185.132"": 3, + ""81.19.135.47"": 9, + ""179.60.147.5"": 3, + ""152.32.243.98"": 3, + ""98.255.115.52"": 3, + ""84.247.59.181"": 3, + ""193.29.13.175"": 3, + ""107.175.137.135"": 6, + ""198.235.24.166"": 9, + ""62.122.184.165"": 12, + ""152.89.198.133"": 12, + ""13.94.102.91"": 72, + ""87.251.75.64"": 3, + ""20.127.65.148"": 6, + ""205.210.31.37"": 9, + ""45.140.17.16"": 3 + }, + ""asn"": { + ""AS63737"": 51, + ""AS212374"": 3, + ""AS24547"": 6, + ""AS57523"": 27, + ""AS396982"": 36, + ""AS208091"": 12, + ""AS197414"": 6, + ""AS4134"": 3, + ""AS7713"": 6, + ""AS209588"": 24, + ""AS209605"": 6, + ""AS206092"": 3, + ""AS59425"": 15, + ""AS198465"": 3, + ""AS135377"": 3, + ""AS33667"": 3, + ""AS62240"": 3, + ""AS42397"": 3, + ""AS36352"": 6, + ""AS8075"": 78, + ""AS198953"": 3 + }, + ""isp"": { + ""VIETSERVER"": 51, + ""Virtuozzo International GmbH"": 3, + ""China Mobile communications corporation"": 6, + ""Chang Way Technologies Co. Limited"": 27, + ""Google LLC"": 36, + ""Xhost Internet Solutions LP"": 18, + ""Chinanet"": 3, + ""PT Telekomunikasi Indonesia"": 6, + ""Flyservers S.A."": 24, + ""UAB Host Baltic"": 6, + ""Ipxo Limited"": 3, + ""Horizon LLC"": 15, + ""BtHoster LTD"": 3, + ""UCLOUD INFORMATION TECHNOLOGY (HK) LIMITED"": 3, + ""Comcast Cable Communications, LLC"": 3, + ""Clouvider Limited"": 3, + ""Bunea TELECOM SRL"": 3, + ""ColoCrossing"": 6, + ""Microsoft Corporation"": 78, + ""Proton66 OOO"": 3 + }, + ""org"": { + ""VietServer Services technology company limited"": 51, + ""Virtuozzo International GmbH"": 3, + ""China Mobile"": 6, + ""Chang Way Technologies Co. Limited"": 15, + ""Palo Alto Networks, Inc"": 36, + ""Xhost Internet Solutions"": 12, + ""Xhostis"": 6, + ""Chinanet HE"": 3, + ""Telekomunikasi Indonesia"": 6, + ""Flyservers S.A"": 12, + ""Unknown"": 6, + ""Ipxo"": 3, + ""Horizon LLC"": 15, + ""BtHoster LTD"": 3, + ""Alviva Holding Limited"": 9, + ""Cloud Solutions S.A"": 3, + ""Ucloud Information Technology (hk) Limited"": 3, + ""Comcast Cable Communications, Inc."": 3, + ""Noop, LLC"": 3, + ""Bunea TELECOM SRL"": 3, + ""New Wave NetConnect, LLC"": 6, + ""Starcrecium Limited"": 12, + ""Microsoft Azure Cloud (northeurope)"": 72, + ""Microsoft Azure Cloud (eastus)"": 6, + ""Proton66 LLC"": 3 + }, + ""regionName"": { + ""Hanoi"": 51, + ""Schaffhausen"": 3, + ""Hebei"": 9, + ""Moscow"": 45, + ""California"": 45, + ""North Holland"": 30, + ""Jakarta"": 6, + ""Kaunas"": 6, + ""New York"": 3, + ""Bavaria"": 3, + ""Sverdlovsk Oblast"": 9, + ""Distrito Federal"": 3, + ""Seoul"": 3, + ""Hesse"": 3, + ""Timis"": 3, + ""Leinster"": 72, + ""Virginia"": 6 + }, + ""country"": { + ""Vietnam"": 51, + ""Switzerland"": 3, + ""China"": 9, + ""Russia"": 54, + ""United States"": 54, + ""Netherlands"": 30, + ""Indonesia"": 6, + ""Lithuania"": 6, + ""Germany"": 6, + ""Venezuela"": 3, + ""South Korea"": 3, + ""Romania"": 3, + ""Ireland"": 72 + }, + ""account"": { + ""hello"": 138, + ""(empty)"": 18, + ""Administr"": 42, + ""zHizRuoKb"": 3, + ""MquwEF"": 3, + ""YwtVpF"": 3, + ""GGpTQepkf"": 3, + ""TmJTXV"": 3, + ""FYxqRg"": 3, + ""Test"": 15, + ""Domain"": 45, + ""Administrator"": 3, + ""a"": 3, + ""FMHfuXWIW"": 3, + ""HvzHlK"": 3, + ""LWjtvB"": 3, + ""HhZUOcGfq"": 3, + ""ZRLONL"": 3, + ""KKQVDr"": 3 + }, + ""keyboard"": { + ""Unknown"": 300 + }, + ""client_build"": { + ""Unknown"": 300 + }, + ""client_name"": { + ""Unknown"": 300 + }, + ""ip_type"": { + ""Unknown"": 150, + ""mobile"": 6, + ""hosting"": 123, + ""proxy"": 18, + ""mobile & hosting & proxy"": 3 + } +}" +iqiwtrys,2023-11-08_stats.json,rdp_snitch,JSON,Wednesday 8th of November 2023 06:16:08 PM CDT,"{ + ""ip"": { + ""103.232.53.123"": 34, + ""185.209.82.234"": 2, + ""111.61.253.55"": 4, + ""85.209.11.106"": 2, + ""198.235.24.43"": 6, + ""87.251.75.145"": 4, + ""185.170.144.3"": 4, + ""87.251.75.120"": 2, + ""198.235.24.56"": 6, + ""106.116.169.71"": 2, + ""36.91.222.100"": 4, + ""147.78.47.51"": 8, + ""141.98.11.128"": 4, + ""191.101.41.72"": 2, + ""62.204.41.146"": 10, + ""77.90.185.132"": 2, + ""81.19.135.47"": 6, + ""179.60.147.5"": 2, + ""152.32.243.98"": 2, + ""98.255.115.52"": 2, + ""84.247.59.181"": 2, + ""193.29.13.175"": 2, + ""107.175.137.135"": 4, + ""198.235.24.166"": 6, + ""62.122.184.165"": 8, + ""152.89.198.133"": 8, + ""13.94.102.91"": 48, + ""87.251.75.64"": 2, + ""20.127.65.148"": 4, + ""205.210.31.37"": 6, + ""45.140.17.16"": 2 + }, + ""asn"": { + ""AS63737"": 34, + ""AS212374"": 2, + ""AS24547"": 4, + ""AS57523"": 18, + ""AS396982"": 24, + ""AS208091"": 8, + ""AS197414"": 4, + ""AS4134"": 2, + ""AS7713"": 4, + ""AS209588"": 16, + ""AS209605"": 4, + ""AS206092"": 2, + ""AS59425"": 10, + ""AS198465"": 2, + ""AS135377"": 2, + ""AS33667"": 2, + ""AS62240"": 2, + ""AS42397"": 2, + ""AS36352"": 4, + ""AS8075"": 52, + ""AS198953"": 2 + }, + ""isp"": { + ""VIETSERVER"": 34, + ""Virtuozzo International GmbH"": 2, + ""China Mobile communications corporation"": 4, + ""Chang Way Technologies Co. Limited"": 18, + ""Google LLC"": 24, + ""Xhost Internet Solutions LP"": 12, + ""Chinanet"": 2, + ""PT Telekomunikasi Indonesia"": 4, + ""Flyservers S.A."": 16, + ""UAB Host Baltic"": 4, + ""Ipxo Limited"": 2, + ""Horizon LLC"": 10, + ""BtHoster LTD"": 2, + ""UCLOUD INFORMATION TECHNOLOGY (HK) LIMITED"": 2, + ""Comcast Cable Communications, LLC"": 2, + ""Clouvider Limited"": 2, + ""Bunea TELECOM SRL"": 2, + ""ColoCrossing"": 4, + ""Microsoft Corporation"": 52, + ""Proton66 OOO"": 2 + }, + ""org"": { + ""VietServer Services technology company limited"": 34, + ""Virtuozzo International GmbH"": 2, + ""China Mobile"": 4, + ""Chang Way Technologies Co. Limited"": 10, + ""Palo Alto Networks, Inc"": 24, + ""Xhost Internet Solutions"": 8, + ""Xhostis"": 4, + ""Chinanet HE"": 2, + ""Telekomunikasi Indonesia"": 4, + ""Flyservers S.A"": 8, + ""Unknown"": 4, + ""Ipxo"": 2, + ""Horizon LLC"": 10, + ""BtHoster LTD"": 2, + ""Alviva Holding Limited"": 6, + ""Cloud Solutions S.A"": 2, + ""Ucloud Information Technology (hk) Limited"": 2, + ""Comcast Cable Communications, Inc."": 2, + ""Noop, LLC"": 2, + ""Bunea TELECOM SRL"": 2, + ""New Wave NetConnect, LLC"": 4, + ""Starcrecium Limited"": 8, + ""Microsoft Azure Cloud (northeurope)"": 48, + ""Microsoft Azure Cloud (eastus)"": 4, + ""Proton66 LLC"": 2 + }, + ""regionName"": { + ""Hanoi"": 34, + ""Schaffhausen"": 2, + ""Hebei"": 6, + ""Moscow"": 30, + ""California"": 30, + ""North Holland"": 20, + ""Jakarta"": 4, + ""Kaunas"": 4, + ""New York"": 2, + ""Bavaria"": 2, + ""Sverdlovsk Oblast"": 6, + ""Distrito Federal"": 2, + ""Seoul"": 2, + ""Hesse"": 2, + ""Timis"": 2, + ""Leinster"": 48, + ""Virginia"": 4 + }, + ""country"": { + ""Vietnam"": 34, + ""Switzerland"": 2, + ""China"": 6, + ""Russia"": 36, + ""United States"": 36, + ""Netherlands"": 20, + ""Indonesia"": 4, + ""Lithuania"": 4, + ""Germany"": 4, + ""Venezuela"": 2, + ""South Korea"": 2, + ""Romania"": 2, + ""Ireland"": 48 + }, + ""account"": { + ""hello"": 92, + ""(empty)"": 12, + ""Administr"": 28, + ""zHizRuoKb"": 2, + ""MquwEF"": 2, + ""YwtVpF"": 2, + ""GGpTQepkf"": 2, + ""TmJTXV"": 2, + ""FYxqRg"": 2, + ""Test"": 10, + ""Domain"": 30, + ""Administrator"": 2, + ""a"": 2, + ""FMHfuXWIW"": 2, + ""HvzHlK"": 2, + ""LWjtvB"": 2, + ""HhZUOcGfq"": 2, + ""ZRLONL"": 2, + ""KKQVDr"": 2 + }, + ""keyboard"": { + ""Unknown"": 200 + }, + ""client_build"": { + ""Unknown"": 200 + }, + ""client_name"": { + ""Unknown"": 200 + }, + ""ip_type"": { + ""Unknown"": 100, + ""mobile"": 4, + ""hosting"": 82, + ""proxy"": 12, + ""mobile & hosting & proxy"": 2 + } +}" +J3ri9GRj,2023-11-08_stats.json,rdp_snitch,JSON,Wednesday 8th of November 2023 06:15:10 PM CDT,"{ + ""ip"": { + ""103.232.53.123"": 17, + ""185.209.82.234"": 1, + ""111.61.253.55"": 2, + ""85.209.11.106"": 1, + ""198.235.24.43"": 3, + ""87.251.75.145"": 2, + ""185.170.144.3"": 2, + ""87.251.75.120"": 1, + ""198.235.24.56"": 3, + ""106.116.169.71"": 1, + ""36.91.222.100"": 2, + ""147.78.47.51"": 4, + ""141.98.11.128"": 2, + ""191.101.41.72"": 1, + ""62.204.41.146"": 5, + ""77.90.185.132"": 1, + ""81.19.135.47"": 3, + ""179.60.147.5"": 1, + ""152.32.243.98"": 1, + ""98.255.115.52"": 1, + ""84.247.59.181"": 1, + ""193.29.13.175"": 1, + ""107.175.137.135"": 2, + ""198.235.24.166"": 3, + ""62.122.184.165"": 4, + ""152.89.198.133"": 4, + ""13.94.102.91"": 24, + ""87.251.75.64"": 1, + ""20.127.65.148"": 2, + ""205.210.31.37"": 3, + ""45.140.17.16"": 1 + }, + ""asn"": { + ""AS63737"": 17, + ""AS212374"": 1, + ""AS24547"": 2, + ""AS57523"": 9, + ""AS396982"": 12, + ""AS208091"": 4, + ""AS197414"": 2, + ""AS4134"": 1, + ""AS7713"": 2, + ""AS209588"": 8, + ""AS209605"": 2, + ""AS206092"": 1, + ""AS59425"": 5, + ""AS198465"": 1, + ""AS135377"": 1, + ""AS33667"": 1, + ""AS62240"": 1, + ""AS42397"": 1, + ""AS36352"": 2, + ""AS8075"": 26, + ""AS198953"": 1 + }, + ""isp"": { + ""VIETSERVER"": 17, + ""Virtuozzo International GmbH"": 1, + ""China Mobile communications corporation"": 2, + ""Chang Way Technologies Co. Limited"": 9, + ""Google LLC"": 12, + ""Xhost Internet Solutions LP"": 6, + ""Chinanet"": 1, + ""PT Telekomunikasi Indonesia"": 2, + ""Flyservers S.A."": 8, + ""UAB Host Baltic"": 2, + ""Ipxo Limited"": 1, + ""Horizon LLC"": 5, + ""BtHoster LTD"": 1, + ""UCLOUD INFORMATION TECHNOLOGY (HK) LIMITED"": 1, + ""Comcast Cable Communications, LLC"": 1, + ""Clouvider Limited"": 1, + ""Bunea TELECOM SRL"": 1, + ""ColoCrossing"": 2, + ""Microsoft Corporation"": 26, + ""Proton66 OOO"": 1 + }, + ""org"": { + ""VietServer Services technology company limited"": 17, + ""Virtuozzo International GmbH"": 1, + ""China Mobile"": 2, + ""Chang Way Technologies Co. Limited"": 5, + ""Palo Alto Networks, Inc"": 12, + ""Xhost Internet Solutions"": 4, + ""Xhostis"": 2, + ""Chinanet HE"": 1, + ""Telekomunikasi Indonesia"": 2, + ""Flyservers S.A"": 4, + ""Unknown"": 2, + ""Ipxo"": 1, + ""Horizon LLC"": 5, + ""BtHoster LTD"": 1, + ""Alviva Holding Limited"": 3, + ""Cloud Solutions S.A"": 1, + ""Ucloud Information Technology (hk) Limited"": 1, + ""Comcast Cable Communications, Inc."": 1, + ""Noop, LLC"": 1, + ""Bunea TELECOM SRL"": 1, + ""New Wave NetConnect, LLC"": 2, + ""Starcrecium Limited"": 4, + ""Microsoft Azure Cloud (northeurope)"": 24, + ""Microsoft Azure Cloud (eastus)"": 2, + ""Proton66 LLC"": 1 + }, + ""regionName"": { + ""Hanoi"": 17, + ""Schaffhausen"": 1, + ""Hebei"": 3, + ""Moscow"": 15, + ""California"": 15, + ""North Holland"": 10, + ""Jakarta"": 2, + ""Kaunas"": 2, + ""New York"": 1, + ""Bavaria"": 1, + ""Sverdlovsk Oblast"": 3, + ""Distrito Federal"": 1, + ""Seoul"": 1, + ""Hesse"": 1, + ""Timis"": 1, + ""Leinster"": 24, + ""Virginia"": 2 + }, + ""country"": { + ""Vietnam"": 17, + ""Switzerland"": 1, + ""China"": 3, + ""Russia"": 18, + ""United States"": 18, + ""Netherlands"": 10, + ""Indonesia"": 2, + ""Lithuania"": 2, + ""Germany"": 2, + ""Venezuela"": 1, + ""South Korea"": 1, + ""Romania"": 1, + ""Ireland"": 24 + }, + ""account"": { + ""hello"": 46, + ""(empty)"": 6, + ""Administr"": 14, + ""zHizRuoKb"": 1, + ""MquwEF"": 1, + ""YwtVpF"": 1, + ""GGpTQepkf"": 1, + ""TmJTXV"": 1, + ""FYxqRg"": 1, + ""Test"": 5, + ""Domain"": 15, + ""Administrator"": 1, + ""a"": 1, + ""FMHfuXWIW"": 1, + ""HvzHlK"": 1, + ""LWjtvB"": 1, + ""HhZUOcGfq"": 1, + ""ZRLONL"": 1, + ""KKQVDr"": 1 + }, + ""keyboard"": { + ""Unknown"": 100 + }, + ""client_build"": { + ""Unknown"": 100 + }, + ""client_name"": { + ""Unknown"": 100 + }, + ""ip_type"": { + ""Unknown"": 50, + ""mobile"": 2, + ""hosting"": 41, + ""proxy"": 6, + ""mobile & hosting & proxy"": 1 + } +}" +EUADvvEZ,977. Squares of a Sorted Array,micahbales,JavaScript,Wednesday 8th of November 2023 05:25:47 PM CDT,"/** +* Problem Statement: https://leetcode.com/problems/squares-of-a-sorted-array/ +*/ + +/* Trivial brute force strategy */ + +/** + * @param {number[]} nums + * @return {number[]} + */ +var sortedSquares = function(nums) { + return nums.map(num => num * num).sort((a,b) => a - b) +}; + +/* Fancy two-pointer strategy */ + +/** + * @param {number[]} nums + * @return {number[]} + */ +var sortedSquares = function(nums) { + const result = new Array(nums.length) + let left = 0, + right = nums.length - 1 + + for (let i = nums.length - 1; i >= 0; i--) { + if (Math.abs(nums[left]) < Math.abs(nums[right])) { + result[i] = nums[right] ** 2 + right-- + } else { + result[i] = nums[left] ** 2 + left++ + } + } + return result +};" +w9JDJgT7,Untitled,bombaires,AIMMS,Wednesday 8th of November 2023 05:19:22 PM CDT,"ellalora14@gmail.com +ellalo.ra14@gmail.com +el.l.a.l.or.a1.4@gmail.com +el.lal.o.r.a.14@gmail.com +ella.lo.ra.14@gmail.com +e.ll.alo.ra.14@gmail.com +e.ll.a.lor.a1.4@gmail.com +el.la.l.ora1.4@gmail.com +el.lalora.1.4@gmail.com +e.l.l.a.lo.ra.14@gmail.com +e.l.la.lo.ra.1.4@gmail.com +e.l.l.alo.r.a.14@gmail.com +el.l.a.l.or.a14@gmail.com +ell.a.l.ora14@gmail.com +e.ll.a.lora.14@gmail.com +e.l.lalor.a.1.4@gmail.com +ella.lo.r.a.1.4@gmail.com +e.l.la.lo.ra1.4@gmail.com +e.ll.a.lora14@gmail.com +el.l.a.lora.14@gmail.com +e.l.la.l.ora.1.4@gmail.com +e.l.l.al.ora.14@gmail.com +e.l.la.l.ora1.4@gmail.com +el.lal.o.ra.14@gmail.com +e.l.l.a.l.o.ra14@gmail.com +e.ll.alo.r.a.14@gmail.com +e.lla.lor.a14@gmail.com +e.ll.alo.r.a.1.4@gmail.com +ell.a.l.ora1.4@gmail.com +e.l.la.l.or.a1.4@gmail.com +e.llalor.a.1.4@gmail.com +el.lalor.a.1.4@gmail.com +el.l.a.lora.1.4@gmail.com +e.l.l.a.l.or.a.1.4@gmail.com +e.l.la.lo.r.a14@gmail.com +ell.alora.14@gmail.com +ellalora1.4@gmail.com +ella.l.ora14@gmail.com +el.l.alor.a.14@gmail.com +el.l.al.o.r.a.14@gmail.com +e.ll.a.l.o.ra1.4@gmail.com +ellalo.ra1.4@gmail.com +e.ll.alora.14@gmail.com +e.l.l.alo.ra.14@gmail.com +ella.lora.1.4@gmail.com +e.l.l.al.or.a14@gmail.com +e.l.la.l.ora.14@gmail.com +el.l.alora.14@gmail.com +el.la.l.ora.14@gmail.com +e.ll.al.o.ra.1.4@gmail.com +e.l.l.a.l.o.ra.14@gmail.com +e.ll.al.or.a.1.4@gmail.com +e.l.la.lora14@gmail.com +el.la.lor.a14@gmail.com +el.l.a.lo.ra.14@gmail.com +e.l.l.a.lo.r.a.14@gmail.com +e.l.la.lor.a1.4@gmail.com +e.llal.ora1.4@gmail.com +el.l.al.ora.14@gmail.com +ellalor.a.14@gmail.com +ell.alor.a.14@gmail.com +el.la.l.o.r.a.1.4@gmail.com +el.lal.ora14@gmail.com +e.l.l.al.or.a.1.4@gmail.com +ella.l.or.a14@gmail.com +e.llal.ora.14@gmail.com +el.lalor.a1.4@gmail.com +e.ll.al.or.a14@gmail.com +ella.l.ora1.4@gmail.com +ell.a.l.o.ra14@gmail.com +e.l.lal.ora.14@gmail.com +e.llal.o.r.a1.4@gmail.com +e.l.l.a.l.ora.1.4@gmail.com +e.ll.a.lo.r.a.14@gmail.com +e.lla.l.o.r.a.14@gmail.com +e.ll.al.ora.14@gmail.com +e.l.l.a.l.or.a1.4@gmail.com +e.l.lalora.14@gmail.com +ellal.o.r.a14@gmail.com +el.l.a.l.o.ra14@gmail.com +el.la.l.o.ra1.4@gmail.com +e.l.l.al.ora14@gmail.com +e.l.la.l.o.r.a.1.4@gmail.com +e.ll.a.lo.r.a14@gmail.com +el.l.al.o.ra.1.4@gmail.com +el.la.lo.r.a.14@gmail.com +el.l.al.o.r.a14@gmail.com +ellalor.a14@gmail.com +ella.l.o.ra.1.4@gmail.com +e.l.l.a.lo.ra.1.4@gmail.com +e.ll.alor.a14@gmail.com +ell.a.l.o.r.a14@gmail.com +el.lal.o.r.a14@gmail.com +el.l.alor.a.1.4@gmail.com +e.l.l.a.lora.1.4@gmail.com +ell.al.o.r.a.1.4@gmail.com +el.l.a.l.or.a.14@gmail.com +e.lla.l.o.r.a14@gmail.com +e.l.l.alor.a.14@gmail.com +el.la.lo.r.a.1.4@gmail.com +e.llalo.ra1.4@gmail.com +ell.alo.ra1.4@gmail.com +e.lla.lo.r.a14@gmail.com +e.lla.lo.ra.1.4@gmail.com +e.l.la.lo.r.a.1.4@gmail.com +el.la.lo.ra.14@gmail.com +e.l.l.a.l.o.r.a.1.4@gmail.com +ell.alo.ra.1.4@gmail.com +el.l.a.lor.a.14@gmail.com +e.ll.a.l.o.r.a.1.4@gmail.com +e.l.la.lor.a.14@gmail.com +ella.lo.ra14@gmail.com +e.l.l.al.or.a.14@gmail.com +el.lal.ora.14@gmail.com +e.ll.a.l.or.a.14@gmail.com +e.l.lal.o.ra.14@gmail.com +e.l.l.a.l.ora.14@gmail.com +el.l.a.l.o.r.a.14@gmail.com +ellal.o.ra14@gmail.com +el.la.lora.1.4@gmail.com +e.l.l.a.l.o.r.a.14@gmail.com +ell.al.ora1.4@gmail.com +ellal.or.a.1.4@gmail.com +e.llal.o.ra1.4@gmail.com +e.llal.o.r.a.14@gmail.com +ella.lor.a.1.4@gmail.com +e.ll.a.l.ora.1.4@gmail.com +e.llal.o.ra14@gmail.com +el.l.al.o.r.a.1.4@gmail.com +e.l.l.alora1.4@gmail.com +e.ll.alo.ra14@gmail.com +ell.al.or.a.1.4@gmail.com +e.l.l.alora.1.4@gmail.com +e.l.lal.ora.1.4@gmail.com +e.l.la.l.o.r.a.14@gmail.com +el.la.lo.r.a14@gmail.com +e.l.l.a.lora.14@gmail.com +ell.a.l.o.ra1.4@gmail.com +ell.alora1.4@gmail.com +ellalo.ra.1.4@gmail.com +e.lla.lor.a.14@gmail.com +el.lal.ora1.4@gmail.com +ella.l.or.a1.4@gmail.com +ella.lo.r.a14@gmail.com +e.l.l.alora14@gmail.com +e.ll.al.o.r.a14@gmail.com +ell.a.l.or.a.14@gmail.com +el.l.a.l.o.ra.1.4@gmail.com +e.l.lal.o.r.a.14@gmail.com +e.l.la.lor.a14@gmail.com +el.lal.o.r.a1.4@gmail.com +e.llalo.r.a1.4@gmail.com +ell.a.lor.a.1.4@gmail.com +e.l.la.lo.r.a1.4@gmail.com +ella.l.o.ra.14@gmail.com +el.l.al.ora1.4@gmail.com +ella.l.o.r.a.1.4@gmail.com +ellal.o.ra.1.4@gmail.com +e.l.l.al.o.ra1.4@gmail.com +ell.a.l.o.r.a.1.4@gmail.com +e.l.lalor.a1.4@gmail.com +e.ll.alor.a.14@gmail.com +ella.l.ora.1.4@gmail.com +el.la.lo.ra.1.4@gmail.com +ella.l.o.ra14@gmail.com +el.lal.or.a.1.4@gmail.com +ellal.o.r.a.1.4@gmail.com +ell.a.lora1.4@gmail.com +e.ll.a.l.o.ra14@gmail.com +el.l.a.lo.r.a.1.4@gmail.com +e.llalora1.4@gmail.com +e.l.l.a.l.o.ra1.4@gmail.com +el.l.a.lo.ra14@gmail.com +el.la.lora1.4@gmail.com +ell.a.l.or.a1.4@gmail.com +el.l.a.l.or.a.1.4@gmail.com +ellalo.ra.14@gmail.com +e.ll.a.lora1.4@gmail.com +ella.lor.a14@gmail.com +e.lla.lora.14@gmail.com +e.ll.a.lo.r.a.1.4@gmail.com +el.la.lo.r.a1.4@gmail.com +e.ll.a.lora.1.4@gmail.com +el.l.a.l.o.ra1.4@gmail.com +el.l.a.l.ora1.4@gmail.com +ell.alo.r.a.1.4@gmail.com +e.l.lalo.r.a14@gmail.com +el.l.a.lor.a.1.4@gmail.com +el.l.a.lo.ra1.4@gmail.com +el.l.a.l.ora.14@gmail.com +ellal.o.ra1.4@gmail.com +el.l.a.lor.a1.4@gmail.com +el.la.lora14@gmail.com +e.llal.or.a14@gmail.com +e.lla.l.o.r.a.1.4@gmail.com +e.ll.alor.a1.4@gmail.com +el.la.l.or.a.1.4@gmail.com +el.l.a.l.o.r.a14@gmail.com +e.l.la.l.o.r.a14@gmail.com +el.l.alo.ra.1.4@gmail.com +e.l.lalo.ra.1.4@gmail.com +billtee126@gmail.com +bill.te.e12.6@gmail.com +bill.tee.1.26@gmail.com +b.ill.te.e12.6@gmail.com +bil.l.tee.126@gmail.com +b.il.l.te.e12.6@gmail.com +b.i.l.l.t.e.e1.2.6@gmail.com +b.i.llt.e.e.1.2.6@gmail.com +bi.l.ltee126@gmail.com +b.il.lt.e.e12.6@gmail.com +bil.l.t.ee.1.2.6@gmail.com +bi.l.l.t.ee1.2.6@gmail.com +b.ill.tee126@gmail.com +b.i.ll.tee126@gmail.com +b.i.l.l.t.ee.12.6@gmail.com +b.i.lltee1.26@gmail.com +bi.llte.e.1.26@gmail.com +billt.e.e.1.2.6@gmail.com +b.il.l.t.e.e.126@gmail.com +bi.l.l.t.ee.126@gmail.com +bi.l.lt.ee.1.2.6@gmail.com +b.i.l.l.t.ee12.6@gmail.com +billt.ee.12.6@gmail.com +b.ill.tee.1.26@gmail.com +b.il.l.te.e1.2.6@gmail.com +b.i.llte.e.126@gmail.com +bi.llte.e.126@gmail.com +b.i.l.ltee.1.2.6@gmail.com +b.i.ll.tee.126@gmail.com +billt.ee.1.2.6@gmail.com +b.i.l.l.tee.12.6@gmail.com +bi.l.l.t.ee.1.2.6@gmail.com +bi.llt.e.e.12.6@gmail.com +b.illte.e1.2.6@gmail.com +bil.l.tee.1.26@gmail.com +b.illt.e.e.1.2.6@gmail.com +bi.ll.tee126@gmail.com +bi.l.l.t.ee126@gmail.com +b.i.l.ltee.1.26@gmail.com +b.i.llte.e.1.2.6@gmail.com +b.ill.t.e.e1.2.6@gmail.com +bil.l.t.ee126@gmail.com +b.ill.t.ee.12.6@gmail.com +billtee126@gmail.com +bi.l.lt.e.e.12.6@gmail.com +bi.ll.t.e.e126@gmail.com +b.ill.te.e1.26@gmail.com +bil.l.t.e.e1.26@gmail.com +b.ill.tee1.26@gmail.com +b.i.ll.te.e.1.26@gmail.com +bil.l.t.ee12.6@gmail.com +bi.l.l.tee126@gmail.com +bi.l.l.t.ee.12.6@gmail.com +bil.ltee.12.6@gmail.com +b.ill.tee.1.2.6@gmail.com +b.i.l.ltee1.2.6@gmail.com +b.il.l.t.e.e1.2.6@gmail.com +b.il.lt.ee.1.26@gmail.com +billte.e.1.26@gmail.com +b.i.l.l.t.e.e126@gmail.com +b.i.l.l.t.e.e1.26@gmail.com +b.i.l.l.t.e.e.1.26@gmail.com +b.il.l.tee1.26@gmail.com +bi.llte.e.1.2.6@gmail.com +b.illte.e126@gmail.com +b.i.l.lt.e.e126@gmail.com +bil.l.t.e.e.1.2.6@gmail.com +bil.lte.e.1.2.6@gmail.com +bil.ltee.126@gmail.com +b.i.l.lte.e.126@gmail.com +bi.l.l.tee1.26@gmail.com +b.i.ll.te.e12.6@gmail.com +b.i.l.lt.ee.12.6@gmail.com +billt.e.e126@gmail.com +bi.ll.t.ee1.26@gmail.com +bill.te.e1.2.6@gmail.com +b.illt.ee12.6@gmail.com +b.il.l.te.e.126@gmail.com +b.il.l.tee.1.26@gmail.com +bi.l.lte.e126@gmail.com +b.i.llte.e.12.6@gmail.com +bi.l.lt.e.e1.2.6@gmail.com +bi.ll.tee1.2.6@gmail.com +bill.t.e.e.1.26@gmail.com +bill.te.e.12.6@gmail.com +b.i.llt.ee.1.2.6@gmail.com +b.i.ll.t.ee12.6@gmail.com +bi.l.lte.e.126@gmail.com +b.i.llte.e1.26@gmail.com +b.i.ll.t.ee126@gmail.com +b.il.ltee.126@gmail.com +billt.ee126@gmail.com +b.il.l.t.ee.1.2.6@gmail.com +b.ill.t.ee12.6@gmail.com +b.il.l.t.ee1.26@gmail.com +b.i.l.l.te.e.1.26@gmail.com +b.i.l.lt.e.e1.26@gmail.com +b.illt.e.e1.2.6@gmail.com +b.illt.e.e.12.6@gmail.com +billt.e.e12.6@gmail.com +b.i.lltee.12.6@gmail.com +bil.l.t.e.e.12.6@gmail.com +b.illt.ee.1.2.6@gmail.com +bi.ll.te.e.126@gmail.com +b.il.l.te.e.12.6@gmail.com +bi.l.ltee.1.26@gmail.com +b.i.llt.e.e.126@gmail.com +bill.te.e.1.2.6@gmail.com +b.illtee126@gmail.com +bi.llt.ee126@gmail.com +bil.lt.ee126@gmail.com +b.il.l.tee.12.6@gmail.com +bi.l.l.tee.1.2.6@gmail.com +bi.llte.e.12.6@gmail.com +billtee.12.6@gmail.com +b.i.ll.t.ee.1.2.6@gmail.com +bil.lt.ee.1.2.6@gmail.com +bill.tee1.2.6@gmail.com +bil.lte.e.12.6@gmail.com +bi.llt.e.e.1.26@gmail.com +b.i.ll.tee12.6@gmail.com +bill.tee.126@gmail.com +b.il.l.tee.126@gmail.com +b.i.l.lt.e.e.126@gmail.com +bil.l.tee126@gmail.com +bi.ll.tee.1.26@gmail.com +billt.ee.126@gmail.com +bi.ll.t.e.e1.26@gmail.com +bi.llt.e.e.126@gmail.com +b.il.l.t.ee.12.6@gmail.com +b.illt.ee126@gmail.com +b.i.ll.tee.1.26@gmail.com +b.il.l.te.e126@gmail.com +bi.l.lt.ee1.26@gmail.com +b.i.l.l.te.e12.6@gmail.com +b.i.l.l.t.e.e.126@gmail.com +b.illte.e.1.2.6@gmail.com +bill.te.e1.26@gmail.com +b.i.l.l.tee.126@gmail.com +b.illt.e.e126@gmail.com +billte.e1.26@gmail.com +bil.ltee12.6@gmail.com +b.i.l.l.tee1.26@gmail.com +bi.l.l.te.e12.6@gmail.com +bi.l.l.tee.126@gmail.com +b.i.l.lt.e.e.12.6@gmail.com +b.il.lte.e1.2.6@gmail.com +b.i.l.lt.ee.126@gmail.com +b.i.l.l.t.ee.1.2.6@gmail.com +b.i.ll.tee.1.2.6@gmail.com +b.i.l.lte.e1.2.6@gmail.com +bil.ltee126@gmail.com +bil.l.te.e.1.2.6@gmail.com +b.illtee.1.2.6@gmail.com +b.i.l.l.tee.1.2.6@gmail.com +bi.ll.t.ee.126@gmail.com +b.illte.e.12.6@gmail.com +billte.e.1.2.6@gmail.com +bill.tee12.6@gmail.com +bill.t.e.e1.2.6@gmail.com +bi.ll.t.ee.1.26@gmail.com +bill.t.ee.12.6@gmail.com +b.i.ll.te.e.12.6@gmail.com +bil.l.te.e.1.26@gmail.com +bil.lt.ee12.6@gmail.com +bil.ltee.1.2.6@gmail.com +b.i.l.lte.e12.6@gmail.com +b.illt.e.e.1.26@gmail.com +b.i.l.l.t.ee.126@gmail.com +b.ill.t.ee.126@gmail.com +b.il.lt.ee.126@gmail.com +b.i.l.lt.ee1.26@gmail.com +b.i.lltee126@gmail.com +bil.lte.e.1.26@gmail.com +b.il.ltee12.6@gmail.com +bi.l.lt.ee.1.26@gmail.com +b.ill.te.e.1.26@gmail.com +bill.t.e.e.12.6@gmail.com +bi.l.l.te.e.1.26@gmail.com +bi.ll.t.e.e1.2.6@gmail.com +bi.l.lt.e.e.126@gmail.com +b.i.l.l.tee126@gmail.com +bil.l.t.e.e.126@gmail.com +b.il.lte.e126@gmail.com +bil.lt.e.e.1.2.6@gmail.com +b.il.l.tee126@gmail.com +bil.l.te.e.12.6@gmail.com +bil.ltee.1.26@gmail.com +bil.lt.e.e.12.6@gmail.com +b.i.l.lt.ee.1.2.6@gmail.com +b.il.lt.ee12.6@gmail.com +b.i.ll.tee1.26@gmail.com +b.illtee12.6@gmail.com +b.illt.e.e1.26@gmail.com +b.il.lt.e.e.1.2.6@gmail.com +b.illt.ee1.2.6@gmail.com +bi.llt.e.e1.2.6@gmail.com +b.i.ll.t.e.e.126@gmail.com +bi.ll.t.e.e.126@gmail.com +bi.l.l.te.e1.26@gmail.com +bi.l.l.te.e.12.6@gmail.com" +UE2YEZ6u,572. Subtree of Another Tree,micahbales,JavaScript,Wednesday 8th of November 2023 05:00:21 PM CDT,"/* Problem statement: https://leetcode.com/problems/subtree-of-another-tree/ + +# Intuition +We'll need to search the root for any place where a node has the same value as the subRoot. If a node has the same value as subRoot, we can check to see if they are both the same tree. + +# Approach +The isSubTree function recursively searches through the main tree, looking for a node with the same value as the subRoot. Finding that, it returns true if that node is the same tree as the subtree. If isSubTree traverses the entirety of 'root' and finds no tree matching subRoot, it returns false. + +# Complexity +- Time complexity: +O(n) - n being the number of nodes + +- Space complexity: +O(h) - h being the height of the tree +*/ + +/** + * Definition for a binary tree node. + * function TreeNode(val, left, right) { + * this.val = (val===undefined ? 0 : val) + * this.left = (left===undefined ? null : left) + * this.right = (right===undefined ? null : right) + * } + */ + +function isSameTree(root, subRoot) { + if (root === null && subRoot === null) return true + if (root?.val !== subRoot?.val) return false + return isSameTree(root.left, subRoot.left) && isSameTree(root.right, subRoot.right) +} + +/** + * @param {TreeNode} root + * @param {TreeNode} subRoot + * @return {boolean} + */ +var isSubtree = function(root, subRoot) { + if (!root || !subRoot) return false + + if (root.val === subRoot.val && + isSameTree(root, subRoot)) return true + + return isSubtree(root.left, subRoot) || isSubtree(root.right, subRoot) +};" +7uiPL4Vy,01. Counter-Strike,Spocoman,C#,Wednesday 8th of November 2023 04:41:00 PM CDT,"using System; + +namespace CounterStrike +{ + class Program + { + static void Main(string[] args) + { + int energy = int.Parse(Console.ReadLine()); + int count = 0, battleIndex; + + string command; + + while ((command = Console.ReadLine()) != ""End of battle"") + { + battleIndex = int.Parse(command); + if (energy < battleIndex) + { + break; + } + count++; + if (count % 3 == 0) + { + energy += count; + } + energy -= battleIndex; + } + + if (command == ""End of battle"") + { + Console.WriteLine($""Won battles: {count}. Energy left: {energy}""); + } + else + { + Console.WriteLine($""Not enough energy! Game ends with {count} won battles and {energy} energy""); + } + } + } +}" +PijsRqkd,01. Counter-Strike,Spocoman,C++,Wednesday 8th of November 2023 04:30:58 PM CDT,"#include +#include + +using namespace std; + +int main() { + int energy, count = 0, battleIndex; + cin >> energy; + cin.ignore(); + + string command; + getline(cin, command); + + while (command != ""End of battle"") { + battleIndex = stoi(command); + if (energy < battleIndex) { + break; + } + count++; + if (count % 3 == 0) { + energy += count; + } + energy -= battleIndex; + getline(cin, command); + } + + if (command == ""End of battle"") { + cout << ""Won battles: "" << count << "". Energy left: "" << energy << endl; + } + else { + cout << ""Not enough energy! Game ends with "" << count << "" won battles and "" << energy << "" energy\n""; + } + return 0; +}" +U6j8SDd6,01. Counter-Strike,Spocoman,JavaScript,Wednesday 8th of November 2023 04:00:17 PM CDT,"function conterStrike(input) { + let command, + battleIndex, + count = 0, + index = 0, + energy = Number(input[index++]); + + while ((command = input[index++]) != ""End of battle"") { + battleIndex = command; + if (energy < battleIndex) { + break; + } + count++; + if (count % 3 == 0) { + energy += count; + } + energy -= battleIndex; + } + + if (command == ""End of battle"") { + console.log(`Won battles: ${count}. Energy left: ${energy}`); + } else { + console.log(`Not enough energy! Game ends with ${count} won battles and ${energy} energy`); + } + + return; +}" +Jv28wwXP,Throttle Semaphore,blackcatdev,Python,Wednesday 8th of November 2023 03:57:42 PM CDT,"from __future__ import annotations + +import asyncio + +from contextlib import AbstractAsyncContextManager + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from pydantic import PositiveFloat, PositiveInt + +class ThrottleSemaphore(AbstractAsyncContextManager): + + __slots__ = ( + 'max_rate', + 'time_period', + ) + + def __init__( + self: ThrottleSemaphore, + max_rate: PositiveInt, time_period: PositiveInt | PositiveFloat, + ): + # TODO: Refactor.. + if isinstance(max_rate, float): + msg = 'Rate value must be int' + raise TypeError(msg) + + if max_rate <= 0: + msg = 'Rate value must be positive' + raise ValueError(msg) + if time_period <= 0: + msg = 'Time value must be positive' + raise ValueError(msg) + + self._delay_time: PositiveFloat = time_period / max_rate + self._max_rate: PositiveInt = max_rate + self._sem: Semaphore = asyncio.Semaphore(max_rate) + + self._loop = loop or asyncio.get_event_loop() + self._loop.create_task(self._leak_sem()) + + + def locked(self: ThrottleSemaphore): + return self._sem.locked() + + + async def _leak_sem(self: ThrottleSemaphore) -> None: + """"""Background task that leaks semaphore releases by rate of tasks per time_period."""""" + while True: + await asyncio.sleep(self._delay_time) + if self._sem._value < self._max_rate: # noqa: SLF001 + # Increase rate value + self._sem.release() + + + async def __aenter__(self: ThrottleSemaphore) -> None: + await self._sem.acquire() + + + async def __aexit__( + self: ThrottleSemaphore, + exc_type: type[BaseException] | None, + exc: BaseException | None, + tb: TracebackType | None, + ) -> None: + return None + + +"