diff --git a/pastes/pastes_20231028120604.csv b/pastes/pastes_20231028120604.csv new file mode 100644 index 0000000..6349be0 --- /dev/null +++ b/pastes/pastes_20231028120604.csv @@ -0,0 +1,4498 @@ +id,title,username,language,date,content +H4XtcqXg,06. Closest Numbers,Spocoman,C++,Saturday 28th of October 2023 07:03:19 AM CDT,"#include + +using namespace std; + +int main() { + int length, number, diff = 2147483647; + cin >> length; + + int* arr = new int[length]; + + for (int i = 0; i < length; i++) { + cin >> number; + arr[i] = number; + } + + for (int i = 0; i < length; i++) { + for (int j = i + 1; j < length; j++) { + if (abs(arr[i] - arr[j]) < diff) { + diff = abs(arr[i] - arr[j]); + } + } + } + + cout << (length > 1 ? diff : 0) << endl; + return 0; +}" +KZxuK2QN,miniscript.org,plirof2,HTML,Saturday 28th of October 2023 06:59:34 AM CDT,"https://miniscript.org/ + +https://forums.miniscript.org/ + +https://miniscript.org/tryit/ + +https://miniscript.org/MiniMicro/index.html + +https://joestrout.itch.io/basic-computer-games + +https://coding-horror.github.io/basic-computer-games/ , https://github.com/coding-horror/basic-computer-games + +https://miniscript.org/wiki/How_to_package_a_Mini_Micro_game + + + + + + + + +" +4UK2rWTg,Stock and Give Item (Script),Sungmingamerpro13,CSS,Saturday 28th of October 2023 06:46:22 AM CDT,"local ServerStorage = game:GetService(""ServerStorage"") + +local StockLabel = script.Parent.StockGui.stockLabel +local Stock = 10 +local Cash = 25 + +local function GiveFood(player) + + if Stock >= 1 then + local ClonedFood = ServerStorage.ItemsFolder.WaterBottle:Clone() + ClonedFood.Parent = player.Backpack + Stock -= 1 + elseif Stock <= 0 then + script.Parent.ClickDetector.MaxActivationDistance = 0 + for i = 10,0,-1 do + StockLabel.Text = ""STOCK IN""..i.."" SECONDS"" + wait(1) + end + StockLabel.Text = ""WATERBOTTLES STOCK: ""..Stock --- Change ItemName + Stock += Stock + end +end + +script.Parent.ClickDetector.MouseHoverEnter:Connect(function() + if not script.Parent:FindFirstChild(""SelectionBox"") then + local SelectionBox = Instance.new(""SelectionBox"") + SelectionBox.Adornee = script.Parent + SelectionBox.Parent = script.Parent + SelectionBox.Color3 = Color3.new(1, 1, 1) + SelectionBox.Transparency = 0.8 + end +end) + +script.Parent.ClickDetector.MouseHoverLeave:Connect(function() + if script.Parent:FindFirstChild(""SelectionBox"") then + script.Parent.SelectionBox:Destroy() + end +end) + +script.Parent.ClickDetector.MouseClick:Connect(function(player) + StockLabel.Text = ""WATERBOTTLES STOCK: ""..Stock --- Change ItemName + if player.Coins.Value >= Cash then + player.Coins.Value = player.Coins.Value - Cash + GiveFood(player) + end +end) +" +uY3LiBBG,OpenComputers OPPM Installer,Klebestreifen,Lua,Saturday 28th of October 2023 06:40:25 AM CDT,"local fs = require(""filesystem"") +local shell = require(""shell"") + +local cwd = shell.getWorkingDirectory() + +local function oppmFile(f) + return ""https://raw.githubusercontent.com/OpenPrograms/Vexatos-Programs/47ae6d628c0d44f2e8f86f9f632c177658f9efb0/oppm/"" .. f +end + +local function download(f) + print(""Download "" .. f) + return shell.execute(""wget -f "" .. oppmFile(f)) +end + +fs.makeDirectory(""/tmp/oppm"") +fs.makeDirectory(""/tmp/oppm/lib"") +fs.makeDirectory(""/tmp/oppm/etc"") + +shell.setWorkingDirectory(""/tmp/oppm"") +download(""oppm.lua"") +shell.setWorkingDirectory(""/tmp/oppm/lib"") +download(""lib/oppm.lua"") +shell.setWorkingDirectory(""/tmp/oppm/etc"") +download(""etc/oppm.cfg"") + +shell.setWorkingDirectory(""/tmp/oppm"") +shell.execute(""./oppm.lua install oppm"") + +-- +shell.setWorkingDirectory(cwd) +shell.execute(""oppm register Klebestreifen/OpenComputersPackages"") + +print(""Done"")" +8WKga089,merge templates,salexame,C++,Saturday 28th of October 2023 06:29:58 AM CDT,"#include + +template +void Merge(T1* first_begin, T1* first_end, T2* second_begin, T2* second_end, T3* out) { + T1* it1 = first_begin; + T2* it2 = second_begin; + T3* end = out; + while (it1 != first_end && it2 != second_end) { + if (*it1 < *it2) { + *end = *it1; + ++end; + ++it1; + } else { + *end = *it2; + ++end; + ++it2; + } + } + while (it1 != first_end) { + *end = *it1; + ++end; + ++it1; + } + while (it2 != second_end) { + *end = *it2; + ++end; + ++it2; + } +} + +signed main() { + int arr1[5] = {1, 3, 5, 7, 9}; + long long arr2[5] = {2, 4, 6, 8, 10}; + int16_t arr[10]; + Merge(arr1, arr1 + 5, arr2, arr2 + 5, arr); + for (int i = 0; i < 10; ++i) { + std::cout << arr[i] << ' '; + } +}" +ArikWiQ1,3 вопрос,ForestFox,Python,Saturday 28th of October 2023 06:21:45 AM CDT,"def hits_count(dup_ranks, k): + return sum([(int)(r <= k) for r in dup_ranks]) / len(dup_ranks) + +import math + +def dcg_score(dup_ranks, k): + return sum([1 / math.log2(1 + r) * (r <= k) for r in dup_ranks]) / len(dup_ranks) + +dup_ranks = [2, 1, 47, 10, 5] +diff_scores = [hits_count([r], 47) - dcg_score([r], 1) for r in dup_ranks] + +# Find the maximum value +max_diff_score = max(diff_scores) + +print(""Maximum Hits@47 - DCG@1: "", max_diff_score)" +fnq5jScw,Untitled,35657,C++,Saturday 28th of October 2023 06:16:57 AM CDT,"#include + +using namespace std; + + +int main() { + setlocale(LC_ALL, ""ru""); + + int total, unit; + + cout << ""Введите общее количество ткани: ""; + cin >> total; + + cout << ""Введите количество ткани на единицу: ""; + cin >> unit; + + int count = 0; + + while (total >= unit) { + total -= unit; + count++; + } + + cout << count << endl; +} + +" +HYM46UVn,Untitled,Josif_tepe,C++,Saturday 28th of October 2023 06:09:33 AM CDT,"#include + +using namespace std; +class Point { + int x; + int y; + +public: + Point() {} + Point(int _x, int _y) { + x = _x; + y = _y; + } + void set_x(int _x) { + x = _x; + } + void set_y(int _y) { + y = _y; + } + int get_x() { + return x; + } + int get_y() { + return y; + } + + Point operator + (Point tmp) { + Point result(x + tmp.x, y + tmp.y); + return result; + } + Point operator - (Point tmp) { + Point result(x - tmp.x, y - tmp.y); + return result; + } + Point operator * (Point tmp) { + Point result(x * tmp.x, y * tmp.y); + return result; + } + Point operator / (Point tmp) { + Point result(x / tmp.x, y / tmp.y); + return result; + } + bool operator < (Point tmp) { + if(x < tmp.x and y < tmp.y) { + return true; + } + else { + return false; + } + } + bool operator <= (Point tmp) { + if(x <= tmp.x and y <= tmp.y) { + return true; + } + else { + return false; + } + } + bool operator > (Point tmp) { + if(x > tmp.x and y > tmp.y) { + return true; + } + else { + return false; + } + } + bool operator >= (Point tmp) { + if(x >= tmp.x and y >= tmp.y) { + return true; + } + else { + return false; + } + } + bool operator == (Point tmp) { + if(x == tmp.x and y == tmp.y) { + return true; + } + else { + return false; + } + } + bool operator != (Point tmp) { + if(x != tmp.x or y != tmp.y) { + return true; + } + else { + return false; + } + } + friend ostream & operator << (ostream & stream, Point tmp); +}; +ostream & operator << (ostream & stream, Point tmp) { + stream << tmp.x << "" ""; + stream << tmp.y; + return stream; +} +int main() +{ + Point p1(4, 4); + Point p2(5, 3); + + cout << p1 << endl; + cout << p2 << endl; + return 0; +} +" +gYgg9hu9,04-movies.js,Grossos,JavaScript,Saturday 28th of October 2023 06:04:08 AM CDT,"// Movies +// Write a function that stores information about movies inside an array. The movie's object info must be name, +// director, and date. You can receive several types of input: +// • ""addMovie {movie name}"" – add the movie +// • ""{movie name} directedBy {director}"" – check if the movie exists and then add the director +// • ""{movie name} onDate {date}"" – check if the movie exists and then add the date +// At the end print all the movies that have all the info (if the movie has no director, name, or date, don’t print it) in +// JSON format. + +function manageMovies(arr) { + + let movies = []; + + for (let elem of arr) { + + if (elem.includes('addMovie')) { + let movieName = elem.split('addMovie ')[1]; + let movieObj = { name: movieName } + movies.push(movieObj); + + } else if (elem.includes('directedBy')) { + let [movieName, directorName] = elem.split(' directedBy '); + + let movie = movies.find(anyMovie => anyMovie.name == movieName); // текущия обект за филм ?!?! + + if (movie) { + movie.director = directorName; + + } + + } else if (elem.includes('onDate')) { + let [movieName, date] = elem.split(' onDate '); + + let movie = movies.find(anyMovie => anyMovie.name == movieName); // текущия обект за филм ?!?! + + if (movie) { + movie.date = date; + } + + } + } + + console.log(Object.entries(movies)); + +} + + +manageMovies([ + 'addMovie Fast and Furious', + 'addMovie Godfather', + 'Inception directedBy Christopher Nolan', + 'Godfather directedBy Francis Ford Coppola', + 'Godfather onDate 29.07.2018', + 'Fast and Furious onDate 30.07.2018', + 'Batman onDate 01.08.2018', + 'Fast and Furious directedBy Rob Cohen'])" +UP7U6UUV,Untitled,Josif_tepe,C++,Saturday 28th of October 2023 06:03:00 AM CDT,"#include + +using namespace std; +class Point { + int x; + int y; + +public: + Point() {} + Point(int _x, int _y) { + x = _x; + y = _y; + } + void set_x(int _x) { + x = _x; + } + void set_y(int _y) { + y = _y; + } + int get_x() { + return x; + } + int get_y() { + return y; + } + + Point operator + (Point tmp) { + Point result(x + tmp.x, y + tmp.y); + return result; + } + Point operator - (Point tmp) { + Point result(x - tmp.x, y - tmp.y); + return result; + } + Point operator * (Point tmp) { + Point result(x * tmp.x, y * tmp.y); + return result; + } + Point operator / (Point tmp) { + Point result(x / tmp.x, y / tmp.y); + return result; + } + bool operator < (Point tmp) { + if(x < tmp.x and y < tmp.y) { + return true; + } + else { + return false; + } + } + bool operator <= (Point tmp) { + if(x <= tmp.x and y <= tmp.y) { + return true; + } + else { + return false; + } + } + bool operator > (Point tmp) { + if(x > tmp.x and y > tmp.y) { + return true; + } + else { + return false; + } + } + bool operator >= (Point tmp) { + if(x >= tmp.x and y >= tmp.y) { + return true; + } + else { + return false; + } + } + bool operator == (Point tmp) { + if(x == tmp.x and y == tmp.y) { + return true; + } + else { + return false; + } + } + bool operator != (Point tmp) { + if(x != tmp.x or y != tmp.y) { + return true; + } + else { + return false; + } + } +}; +int main() +{ + Point p1(4, 4); + Point p2(5, 3); + + if(p1 < p2) { + cout << ""Pomalo"" << endl; + } + if(p1 <= p2) { + cout << ""Pomalo ili ednakvo"" << endl; + } + if(p1 > p2) { + cout << ""Pogolemo"" << endl; + } + if(p1 >= p2) { + cout << ""Pogolemo ili ednakvo"" << endl; + } + + if(p1 == p2) { + cout << ""Ednakvi se"" << endl; + } + if(p1 != p2) { + cout << ""Razlicni se"" << endl; + } + return 0; +} +" +7bnwU128,Untitled,35657,C++,Saturday 28th of October 2023 06:02:31 AM CDT,"#include + +using namespace std; + + +int main() { + setlocale(LC_ALL, ""ru""); + + int number; + int fact = 1; + + cout << ""Введите число: ""; + cin >> number; + + int i = 1; + + while (i <= number) { + fact *= i; + i++; + } + cout << fact << endl; +} + +" +dV72j3Di,data735,TestGuy1,JSON,Saturday 28th of October 2023 06:00:05 AM CDT,"{ + status: 'Success', + method: 'server', + maindata: 'a30fd0afa74042b9110d40eed6f4b7b5eb8f8d9ae5662d9d43988141848a1aeec9418174d957b73009ccd1f7c619792e8e204f29c74a05eb5b28975c0ce240df726fe84190b13bd025cff6f8c87967bed80bd07d315539b31bc93ad0a8fd33b6748e46475988c0c74aa90a9031c28ba237d891d4aaf6af55f4f5bd905d202e92', + otherdata: [ + '967cc8b144376dbf948f58781012ce5e', + '50a31793751519bf6e1cde3117309159', + 'f3b8d804f9bb47b07c708e4bbff05315', + '4b476b617aecf1597f2670dcc570d3e6', + 'f40ff190152daf9786c9b5c98462688d', + '654cd848c50aaa5826c3bc89d1c765e7', + 'b300e68d0e82494a0301b36b2c296b33', + '8debbc2d5b2f0b4365be0d3201f173b6' + ] +}" +FB9fMJmN,Untitled,Josif_tepe,C++,Saturday 28th of October 2023 05:53:17 AM CDT,"#include + +using namespace std; +class Point { + int x; + int y; + +public: + Point() {} + Point(int _x, int _y) { + x = _x; + y = _y; + } + void set_x(int _x) { + x = _x; + } + void set_y(int _y) { + y = _y; + } + int get_x() { + return x; + } + int get_y() { + return y; + } + + Point operator + (Point tmp) { + Point result(x + tmp.x, y + tmp.y); + return result; + } + Point operator - (Point tmp) { + Point result(x - tmp.x, y - tmp.y); + return result; + } + Point operator * (Point tmp) { + Point result(x * tmp.x, y * tmp.y); + return result; + } + Point operator / (Point tmp) { + Point result(x / tmp.x, y / tmp.y); + return result; + } + + +}; +int main() +{ + Point p1(1, 2); + Point p2(3, 4); + + Point p3 = p1 + p2; + Point p4 = p1 - p2; + Point p5 = p1 * p2; + Point p6 = p1 / p2; + cout << p3.get_x() << "" "" << p3.get_y() << endl; + cout << p4.get_x() << "" "" << p4.get_y() << endl; + cout << p5.get_x() << "" "" << p5.get_y() << endl; + cout << p6.get_x() << "" "" << p6.get_y() << endl; + return 0; +} +" +QmLMZP83,Untitled,Josif_tepe,C++,Saturday 28th of October 2023 05:39:00 AM CDT,"#include + +using namespace std; +class Student{ +private: + string ime; + string prezime; + int godini; + int n; + int niza_od_poeni[100]; +public: + Student() { + + } + Student(string _ime, string _prezime, int _godini, int _n, int _niza_od_poeni[]){ + ime = _ime; + prezime = _prezime; + godini = _godini; + n = _n; + for(int i = 0; i < n; i++){ + niza_od_poeni[i] = _niza_od_poeni[i]; + } + } + void set_ime(string _ime){ + ime = _ime; + } + void set_prezime(string _prezime){ + prezime = _prezime; + } + void set_godini(int _godini){ + godini = _godini; + } + void set_n(int _n){ + n = _n; + } + void set_niza_od_poeni(int _niza_od_poeni[]){ + for(int i = 0; i < n; i++){ + niza_od_poeni[i] = _niza_od_poeni[i]; + } + } + string get_ime(){ + return ime; + } + string get_prezime(){ + return prezime; + } + int get_godini(){ + return godini; + } + int get_n(){ + return n; + } + double procentualno(){ + double sum = 0; + for(int i = 0; i < n; i++){ + sum += niza_od_poeni[i]; + + } + sum /= 500; + return sum * 100; + } +}; +int main() +{ + int niza[] = {40, 60, 100, 250, 5}; + Student s(""Milosh"", ""Kitanovikj"", 14, 5, niza); + cout << s.procentualno() << endl; + return 0; +} +" +93XVXm6t,Untitled,35657,C++,Saturday 28th of October 2023 05:34:59 AM CDT,"#include + +using namespace std; + + +int main() { + setlocale(LC_ALL, ""ru""); + + int begin, end; + int sum = 0; + + cout << ""Введите начало диапазона: ""; + cin >> begin; + + cout << ""Введите конец диапазона: ""; + cin >> end; + end++; + + int num = begin; + + while (num != end) { + if (num % 2 == 1) { + sum += num; + } + num++; + } + + cout << sum << endl; +}" +S6hjs7Sg,fillAir,LDMCoding,Lua,Saturday 28th of October 2023 05:05:15 AM CDT,"local tArgs = { ... } + +local length = tonumber(tArgs[1]) +local width = tonumber(tArgs[2]) +local height = tonumber(tArgs[3]) + +local currLength = 1 +local currWidth = 1 +local currHeight = 1 + +local function len() + for i = length-1,1,-1 + do + if turtle.getFuelLevel() == 0 then + turtle.refuel(1) + end + turtle.dig() + turtle.forward() + currLength = currLength + 1 + end +end +local function wid() + if turtle.getFuelLevel() == 0 then + turtle.refuel(1) + end + if (currWidth % 2 == 0) then + turtle.turnLeft() + turtle.dig() + turtle.forward() + turtle.turnLeft() + currWidth = currWidth + 1 + currLength = 1 + len() + else + turtle.turnRight() + turtle.dig() + turtle.forward() + turtle.turnRight() + currWidth = currWidth + 1 + currLength = 1 + len() + end +end +local function hei() + if turtle.getFuelLevel() == 0 then + turtle.refuel(1) + end + turtle.turnRight() + turtle.turnRight() + turtle.digUp() + turtle.up() + currHeight = currHeight + 1 + currWidth = 1 +end + +local done = false +len() +repeat + if currLength == length then + wid() + if currWidth == width then + hei() + if currHeight == height then + print(""Finished."") + done = true + return + end + end + end +until(done)" +0mmWGwML,Untitled,dllbridge,C,Saturday 28th of October 2023 05:05:04 AM CDT," + + +#include +#include + + + +/////////////////////////////////////////////////// +void foo(char *p) +{ + + + + printf(""%s\n"", p); +} + + + + + +////////////////////////////////////////////////// sz[7] = 0; +int main() // +{ + + + char sz[19] = ""_Pictures""; + + foo(&sz[1]); +} + + + + + + + + + + + + + + + + + + + + + +/* +#include +#include + +char sz [19] = ""SONY"", + sz2[19] = ""_Pictures""; + + + + +////////////////////////////////////////////////// sz[7] = 0; +int main() // +{ + + + + strcat(sz, sz2); printf(""%s\n"", sz); +// strcpy(sz, sz2); printf(""%s\n"", sz); + + + +} + + + + + + +*/ + + + + + + + + + + + + + + + +/* +#include +//#include + +char sz[19] = ""SONY=-_Pictures""; + + +int _strlen(char *p); + +////////////////////////////////////////////////// sz[7] = 0; +int main() // +{ + + sz[1] = 84; + + + printf(""%s\n"", sz); sz[4] = 32; + printf(""%s\n"", sz); + + + int nLen = _strlen(sz); + + printf(""nLen = %d\n"", nLen); +} + + +/////////////////////////////////////////////////// +int _strlen(char *p) +{ + + int n = 0; + + +L_01: n++; + + if(sz[n] != 0) goto L_01; + + //while(sz[++n] != 0); + + +return n; +} + + + + +*/ + + +/* + + +#include +//#include + +char sz[19] = ""SONY=-_Pictures""; + + +int _strlen(char *p); + +////////////////////////////////////////////////// sz[7] = 0; +int main() // +{ + + sz[1] = 84; + + + printf(""%s\n"", sz); sz[4] = 32; + printf(""%s\n"", sz); + + + int nLen = _strlen(sz); + + printf(""nLen = %d\n"", nLen); +} + + +/////////////////////////////////////////////////// +int _strlen(char *p) +{ + + int n = 0; + + + while(sz[++n] != 0); + + +return n; +} + + + +*/ + + + + +/* +#include +//#include + +char sz[19] = ""SONY=-_Pictures""; + + +int _strlen(char *p); + +////////////////////////////////////////////////// sz[7] = 0; +int main() // +{ + + sz[1] = 84; + + + printf(""%s\n"", sz); sz[4] = 32; + printf(""%s\n"", sz); + + + int nLen = _strlen(sz); + + printf(""nLen = %d\n"", nLen); +} + + +/////////////////////////////////////////////////// +int _strlen(char *p) +{ + + int n = 0; + + + for(;;) + { + + if(sz[n] == 0) break; + + n++; + } + +return n; +} + + + + + +*/ +/* + +#include +#include + +char sz[19] = ""SONY_Pictures""; + + +int _strlen(char *p); + +////////////////////////////////////////////////// sz[7] = 0; +int main() // +{ + + sz[1] = 84; + + + printf(""%s\n"", sz); sz[4] = 32; + printf(""%s\n"", sz); + + + int nLen = _strlen(sz); + + printf(""nLen = %d\n"", nLen); +} + + +/////////////////////////////////////////////////// +int _strlen(char *p) +{ + + int n = 0; + + + for(int i = 0; i < 1000; i++) + { + + if(sz[i] == 0) break; + + n ++; + } + +return n; +} +*/ + + + + + + + + + + + + + + + + + + + + + + + + + +/* +#include +using namespace std; + +////////////////////////////////////////////////// +int main() // +{ + + int a = 1000; // ЦЕНА КНИГ + cout << a << endl; + int b = 55; // БУДЕТ УМЕНЬШАТЬСЯ ЦЕНА + int c = 40; // КОЛВО КНИГ + const int Bmax = 8;// ОДИН КРУГ КНИГ + int v = 0; // ТО ЧТО МЫ УЗНАЕМ + int n=8; // СКОЛЬКО ОН УЖЕ КУПИЛ + int del = c / n; + + int tab[7] = { 1000, 945, 890, 835, 780, 725, 665 }, // kjllkjlkj + sum = 0; // kjhkljhlk + + for(int i = 0; i < 7; i++) + { + sum = sum + tab[i]; + } + + v = sum * del; + cout << v; + + return 0; +} + + + */ + + + + + + + " +UjQZRjpc,Untitled,35657,C++,Saturday 28th of October 2023 04:58:53 AM CDT,"#include + +using namespace std; + + +int main() { + setlocale(LC_ALL, ""ru""); + int count; + char ch; + int type; + int i = 0; + + cout << ""Введите количество: ""; + cin >> count; + cout << ""Введите символ: ""; + cin >> ch; + + do { + cout << ""Для вывода горизонтальной линии введите 1, для вывода вертикальной введите 2: ""; + cin >> type; + } while (type != 1 && type != 2); + + + if (type == 1) { + while (i < count) { + cout << ch; + i++; + } + } + else { + while (i < count) { + cout << ch << endl;; + i++; + } + } + cout << endl; + + + +}" +kVmZxufs,ksp/kos,Graf_Rav,Python,Saturday 28th of October 2023 04:45:45 AM CDT,"//get all modules from a part +set getModules to { parameter part. set modules to list(). for m in part:modules { modules:add(part:getModule(m)). print ""found module ""+m. } return modules.} +//activate module event +set doEvent to { parameter module. parameter index. module:doevent(module:alleventnames[index]). } +//activate module action +set doAction to { parameter module. parameter index. parameter status. module:doaction(module:allactionnames[index], status). } +//get module field +set getField to { + parameter module. + parameter index. + return module:getfield(module:ALLFIELDS[index]). +} +//filter list by name +set filterListByName to { parameter _list. parameter name. + set newList to list(). + for item in _list { + if (item:name:contains(name)){ + newList:add(item). + } + } + return newList. +} +//highlight parts +set highlightParts to { parameter parts. parameter color is ""red"". parameter delaySec is 1. + set i to 0. + until i < parts:length { + print ""PART #""+i+"": ""+parts[i]. + highlight(parts[i], color):enabled on. + wait delaySec. + highlight(parts[i], color):enabled off. + i+=1. + } +} +//list parts in qParts. set rcsTanks to list(). for p in qParts { if(p:name:includes(""RCSFuel"")){ rcsTanks:add(p). } } +//transfer(""monopropellant"",ship:partsdubbedpattern(""SOURCE"")[1],ship:partsdubbedpattern(""DESTINATION"")[0],AMOUNT):active on. +//set i to 0. for a in ship:resources[1]:parts {print ""Tank #"" + i. highlight(a,green):enabled on. wait 1. highlight(a,green):enabled off. wait 1. set i to i+1.}" +SgMxC0Eh,Nigerian scammers [28-10-1/2023],bombaires,AIMMS,Saturday 28th of October 2023 04:39:53 AM CDT,"908618401@qq.com +info@mail-net.asia +companydelivery929@gmail.com +companydelivery929+29557@gmail.com +companydelivery929+19851@gmail.com +companydelivery929+7939@gmail.com +companydelivery929+14928@gmail.com +companydelivery929+11420@gmail.com +companydelivery929+8034@gmail.com +companydelivery929+7917@gmail.com +companydelivery929+6001@gmail.com +companydelivery929+6178@gmail.com +companydelivery929+24637@gmail.com +companydelivery929+13042@gmail.com +companydelivery929+15392@gmail.com +companydelivery929+10280@gmail.com +companydelivery929+28265@gmail.com +companydelivery929+4566@gmail.com +companydelivery929+20413@gmail.com +companydelivery929+17928@gmail.com +companydelivery929+24090@gmail.com +companydelivery929+9952@gmail.com +companydelivery929+8928@gmail.com +companydelivery929+25333@gmail.com +companydelivery929+333@gmail.com +companydelivery929+17100@gmail.com +companydelivery929+18968@gmail.com +companydelivery929+8327@gmail.com +companydelivery929+26129@gmail.com +companydelivery929+28692@gmail.com +companydelivery929+31324@gmail.com +companydelivery929+11403@gmail.com +companydelivery929+30109@gmail.com +companydelivery929+20579@gmail.com +companydelivery929+9000@gmail.com +companydelivery929+6980@gmail.com +companydelivery929+5371@gmail.com +companydelivery929+11852@gmail.com +companydelivery929+17908@gmail.com +companydelivery929+11142@gmail.com +companydelivery929+3750@gmail.com +companydelivery929+21120@gmail.com +companydelivery929+15229@gmail.com +companydelivery929+28895@gmail.com +companydelivery929+18287@gmail.com +companydelivery929+14030@gmail.com +companydelivery929+5024@gmail.com +companydelivery929+8944@gmail.com +companydelivery929+8100@gmail.com +companydelivery929+32579@gmail.com +companydelivery929+13987@gmail.com +companydelivery929+30300@gmail.com +companydelivery929+4038@gmail.com +companydelivery929+15855@gmail.com +companydelivery929+6052@gmail.com +companydelivery929+23750@gmail.com +companydelivery929+14543@gmail.com +companydelivery929+15326@gmail.com +companydelivery929+31764@gmail.com +companydelivery929+25564@gmail.com +companydelivery929+24287@gmail.com +companydelivery929+29690@gmail.com +companydelivery929+25820@gmail.com +companydelivery929+755@gmail.com +companydelivery929+8738@gmail.com +companydelivery929+22030@gmail.com +companydelivery929+11241@gmail.com +companydelivery929+11909@gmail.com +companydelivery929+26852@gmail.com +companydelivery929+26476@gmail.com +companydelivery929+3902@gmail.com +companydelivery929+20824@gmail.com +companydelivery929+7523@gmail.com +companydelivery929+7579@gmail.com +companydelivery929+6801@gmail.com +companydelivery929+1644@gmail.com +companydelivery929+25601@gmail.com +companydelivery929+25694@gmail.com +companydelivery929+8868@gmail.com +companydelivery929+1953@gmail.com +companydelivery929+19189@gmail.com +companydelivery929+28927@gmail.com +companydelivery929+7952@gmail.com +companydelivery929+15557@gmail.com +companydelivery929+19710@gmail.com +companydelivery929+10586@gmail.com +companydelivery929+31338@gmail.com +companydelivery929+4765@gmail.com +companydelivery929+32302@gmail.com +companydelivery929+1520@gmail.com +companydelivery929+2930@gmail.com +companydelivery929+29158@gmail.com +companydelivery929+14191@gmail.com +companydelivery929+26371@gmail.com +companydelivery929+9901@gmail.com +companydelivery929+22908@gmail.com +companydelivery929+29024@gmail.com +companydelivery929+27218@gmail.com +companydelivery929+28164@gmail.com +companydelivery929+30623@gmail.com +companydelivery929+4150@gmail.com +companydelivery929+31219@gmail.com +companydelivery929+18317@gmail.com +westernuniontransfer127@gmail.com +westernuniontransfer127+26813@gmail.com +westernuniontransfer127+10961@gmail.com +westernuniontransfer127+3540@gmail.com +westernuniontransfer127+17393@gmail.com +westernuniontransfer127+21057@gmail.com +westernuniontransfer127+25186@gmail.com +westernuniontransfer127+18976@gmail.com +westernuniontransfer127+21411@gmail.com +westernuniontransfer127+8685@gmail.com +westernuniontransfer127+13952@gmail.com +westernuniontransfer127+23521@gmail.com +westernuniontransfer127+10303@gmail.com +westernuniontransfer127+10831@gmail.com +westernuniontransfer127+21918@gmail.com +westernuniontransfer127+27189@gmail.com +westernuniontransfer127+1194@gmail.com +westernuniontransfer127+5856@gmail.com +westernuniontransfer127+6628@gmail.com +westernuniontransfer127+27719@gmail.com +westernuniontransfer127+13694@gmail.com +westernuniontransfer127+28266@gmail.com +westernuniontransfer127+30107@gmail.com +westernuniontransfer127+4048@gmail.com +westernuniontransfer127+26583@gmail.com +westernuniontransfer127+25879@gmail.com +westernuniontransfer127+30871@gmail.com +westernuniontransfer127+2881@gmail.com +westernuniontransfer127+32570@gmail.com +westernuniontransfer127+30897@gmail.com +westernuniontransfer127+27843@gmail.com +westernuniontransfer127+17419@gmail.com +westernuniontransfer127+23614@gmail.com +westernuniontransfer127+3842@gmail.com +westernuniontransfer127+755@gmail.com +westernuniontransfer127+15213@gmail.com +westernuniontransfer127+27587@gmail.com +westernuniontransfer127+29926@gmail.com +westernuniontransfer127+28452@gmail.com +westernuniontransfer127+23630@gmail.com +westernuniontransfer127+10105@gmail.com +westernuniontransfer127+29547@gmail.com +westernuniontransfer127+19138@gmail.com +westernuniontransfer127+11709@gmail.com +westernuniontransfer127+16085@gmail.com +westernuniontransfer127+4542@gmail.com +westernuniontransfer127+6923@gmail.com +westernuniontransfer127+10057@gmail.com +westernuniontransfer127+4246@gmail.com +westernuniontransfer127+22716@gmail.com +westernuniontransfer127+29368@gmail.com +westernuniontransfer127+11295@gmail.com +westernuniontransfer127+22874@gmail.com +westernuniontransfer127+5784@gmail.com +westernuniontransfer127+6241@gmail.com +westernuniontransfer127+14391@gmail.com +westernuniontransfer127+24301@gmail.com +westernuniontransfer127+31639@gmail.com +westernuniontransfer127+23656@gmail.com +westernuniontransfer127+25321@gmail.com +westernuniontransfer127+12364@gmail.com +westernuniontransfer127+31977@gmail.com +westernuniontransfer127+5924@gmail.com +westernuniontransfer127+30719@gmail.com +westernuniontransfer127+25551@gmail.com +westernuniontransfer127+13921@gmail.com +westernuniontransfer127+850@gmail.com +westernuniontransfer127+13224@gmail.com +westernuniontransfer127+6055@gmail.com +westernuniontransfer127+7995@gmail.com +westernuniontransfer127+23987@gmail.com +westernuniontransfer127+7433@gmail.com +westernuniontransfer127+12609@gmail.com +westernuniontransfer127+18406@gmail.com +westernuniontransfer127+24358@gmail.com +westernuniontransfer127+29557@gmail.com +westernuniontransfer127+20262@gmail.com +westernuniontransfer127+23191@gmail.com +westernuniontransfer127+20823@gmail.com +westernuniontransfer127+30956@gmail.com +westernuniontransfer127+19199@gmail.com +westernuniontransfer127+1160@gmail.com +westernuniontransfer127+21880@gmail.com +westernuniontransfer127+2004@gmail.com +westernuniontransfer127+7621@gmail.com +westernuniontransfer127+27289@gmail.com +westernuniontransfer127+31956@gmail.com +westernuniontransfer127+29437@gmail.com +westernuniontransfer127+13346@gmail.com +westernuniontransfer127+14958@gmail.com +westernuniontransfer127+20706@gmail.com +westernuniontransfer127+16099@gmail.com +westernuniontransfer127+31623@gmail.com +westernuniontransfer127+9917@gmail.com +westernuniontransfer127+12206@gmail.com +westernuniontransfer127+23769@gmail.com +westernuniontransfer127+30966@gmail.com +westernuniontransfer127+4915@gmail.com +westernuniontransfer127+7165@gmail.com +westernuniontransfer127+1278@gmail.com +westernuniontransfer127+10497@gmail.com +fre70042@gmail.com +fre70042+4864@gmail.com +fre70042+23549@gmail.com +fre70042+112@gmail.com +fre70042+3532@gmail.com +fre70042+11011@gmail.com +fre70042+9669@gmail.com +fre70042+7276@gmail.com +fre70042+2167@gmail.com +fre70042+5200@gmail.com +fre70042+24299@gmail.com +fre70042+12156@gmail.com +fre70042+30948@gmail.com +fre70042+18695@gmail.com +fre70042+21575@gmail.com +fre70042+3033@gmail.com +fre70042+26114@gmail.com +fre70042+29700@gmail.com +fre70042+17812@gmail.com +fre70042+21908@gmail.com +fre70042+22276@gmail.com +fre70042+1718@gmail.com +fre70042+16517@gmail.com +fre70042+5804@gmail.com +fre70042+32290@gmail.com +fre70042+30907@gmail.com +fre70042+4143@gmail.com +fre70042+14699@gmail.com +fre70042+30546@gmail.com +fre70042+10369@gmail.com +fre70042+30393@gmail.com +fre70042+9231@gmail.com +fre70042+18926@gmail.com +fre70042+16665@gmail.com +fre70042+6730@gmail.com +fre70042+21918@gmail.com +fre70042+27388@gmail.com +fre70042+23084@gmail.com +fre70042+23076@gmail.com +fre70042+1580@gmail.com +fre70042+22869@gmail.com +fre70042+13651@gmail.com +fre70042+29646@gmail.com +fre70042+21055@gmail.com +fre70042+3121@gmail.com +fre70042+28509@gmail.com +fre70042+11104@gmail.com +fre70042+16458@gmail.com +fre70042+1097@gmail.com +fre70042+18639@gmail.com +fre70042+23503@gmail.com +fre70042+15873@gmail.com +fre70042+31003@gmail.com +fre70042+32146@gmail.com +fre70042+24252@gmail.com +fre70042+14947@gmail.com +fre70042+12101@gmail.com +fre70042+25909@gmail.com +fre70042+7801@gmail.com +fre70042+10493@gmail.com +fre70042+22085@gmail.com +fre70042+27610@gmail.com +fre70042+16490@gmail.com +fre70042+9010@gmail.com +fre70042+7797@gmail.com +fre70042+4364@gmail.com +fre70042+13846@gmail.com +fre70042+26244@gmail.com +fre70042+10280@gmail.com +fre70042+27926@gmail.com +fre70042+2890@gmail.com +fre70042+31800@gmail.com +fre70042+13213@gmail.com +fre70042+7637@gmail.com +fre70042+27405@gmail.com +fre70042+20938@gmail.com +fre70042+2180@gmail.com +fre70042+2531@gmail.com +fre70042+29052@gmail.com +fre70042+12374@gmail.com +fre70042+27130@gmail.com +fre70042+9333@gmail.com +fre70042+20792@gmail.com +fre70042+26015@gmail.com +fre70042+8940@gmail.com +fre70042+2746@gmail.com +fre70042+7880@gmail.com +fre70042+12883@gmail.com +fre70042+24752@gmail.com +fre70042+9644@gmail.com +fre70042+8420@gmail.com +fre70042+24059@gmail.com +fre70042+10639@gmail.com +fre70042+19152@gmail.com +fre70042+12903@gmail.com +fre70042+14938@gmail.com +fre70042+8306@gmail.com +fre70042+26553@gmail.com +fre70042+12025@gmail.com +fre70042+11451@gmail.com +fre70042+28340@gmail.com" +ZR53gihT,snowybot trial,coinwalk,JavaScript,Saturday 28th of October 2023 04:24:32 AM CDT,"var smiley = parseFloat(document.getElementById('pct_balance').value); +var nudie = Number((smiley/320).toFixed(8)); +var burp = nudie; +var taget = (smiley*200000); +var bolux = (nudie*10); +var poopy = (nudie*6.5); +var mole = (nudie*7.5); +var sexual = 0; +var jockey = ((burp*1).toFixed(8)); +var bolance = smiley; +var fart = 1; +var woman = ((Math.floor((parseFloat(bolance))/bolux))*bolux); +var manboobs = ((Math.floor((parseFloat(bolance))/bolux))*bolux); + +function get(){ +console.clear(); +setTimeout(function(){ +bolance = document.getElementById('pct_balance').value; +if ((bolance>(((Math.floor(bolance/bolux))*bolux)+poopy))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+mole))&&(bolance!=sexual)&&(bolance>=manboobs)) { + burp = burp*2; + manboobs = ((Math.floor(bolance/bolux))*bolux); + sexual = parseFloat(bolance); +} +if ((bolance>(((Math.floor(bolance/bolux))*bolux)+poopy))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+mole))&&(bolance!=sexual)&&(bolance=(woman+(bolux*fart)))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+poopy))){ + sexual = 0; + fart = 1; + burp = nudie; + woman = ((Math.floor(bolance/bolux))*bolux); + manboobs = ((Math.floor(bolance/bolux))*bolux); +} + if (bolance >= taget) { + console.log(""winner winner chicken dinner""); + return; + } +jockey = ((burp*1).toFixed(8)); +$('#pct_chance').val(49.5); +$('#pct_bet').val(jockey); +$('#a_lo').click(); +}, 100); +var dog = ((bolance-smiley).toFixed(8)); +console.log(""profit""); +console.log(dog); +setTimeout(() => get(), 200); +} +get();" +2muWihEk,Untitled,Sreekar_0125,C++,Saturday 28th of October 2023 04:21:47 AM CDT,"#include +#include +#include +using namespace std; +using namespace __gnu_pbds; +template +using pbds = + tree, rb_tree_tag, tree_order_statistics_node_update>; +// #define cerr if(false)cerr +#define int long long +#define pb push_back +#define F first +#define S second +#define yes cout << ""Yes\n"" +#define no cout << ""No\n"" +#define yn(x) x ? yes : no +#define f(i, s, e) for (int i = s; i < e; i++) +#define vi vector +#define vb vector +#define pii pair +#define vpi vector +#define umi unordered_map +#define mi map +#define si set +#define sc set +#define maxheap priority_queue +#define minheap priority_queue, greater> +#define all(x) x.begin(), x.end() +#define minele(x) *min_element(all(x)) +#define maxele(x) *max_element(all(x)) +#define endl '\n' + +const int N = 2e5; +const int MOD = 1e9 + 7; + + +#ifndef ONLINE_JUDGE +#define debug(x) \ + cerr << (#x) << "" is ""; \ + _print(x) +#define dbg(x) \ + cerr << (#x) << "" is "" << x << endl; +#else +#define debug(x) +#define dbg(x) +#endif + + +template +void _print(T a) +{ + cerr << a; +} +template +void print(T a) +{ + cout << a << ' '; +} +template +void println(T a) +{ + cout << a << endl; +} +template +istream &operator>>(istream &is, vector &a) +{ + for (auto &x : a) + is >> x; + return is; +} +template +ostream &operator<<(ostream &os, const vector &a) +{ + for (const auto &x : a) + os << x << ' '; + return os; +} + +template +void _print(pair p); +template +void _print(vector v); +template +void _print(set v); +template +void _print(map v); +template +void _print(multiset v); +template +void _print(pair p) +{ + cerr << ""{""; + _print(p.F); + cerr << "",""; + _print(p.S); + cerr << ""} ""; +} +template +void _print(vector v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(set v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(multiset v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(map v) +{ + cerr << ""[ ""; + for (auto i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(unordered_map v) +{ + cerr << ""[ ""; + for (auto i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} + +/////////////Sieve/////////////// +// vb sieve(N + 5, true); +// vi primes; +// void gensieve() +// { +// sieve[0] = sieve[1] = false; +// for (int i = 2; i <= sqrt(N); i++) +// { +// if (sieve[i]) +// { +// for (int j = i * i; j <= N; j += i) +// sieve[j] = false; +// } +// } +// for (int i = 2; i <= N; i++) +// { +// if (sieve[i]) +// primes.pb(i); +// } +// } +//////////////////////////////// + +int binpow(int a, int b) +{ + int ans = 1; + a %= MOD; + while(b) + { + if(b & 1) + ans = ((ans % MOD) * (a % MOD)) % MOD; + + a = ((a % MOD) * (a % MOD)) % MOD; + b >>= 1; + } + return ans; +} + +void fast() +{ + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); +} + +void init_code() +{ +#ifndef ONLINE_JUDGE + freopen(""input.txt"", ""r"", stdin); + freopen(""output.txt"", ""w"", stdout); + freopen(""error.txt"", ""w"", stderr); +#endif // ONLINE_JUDGE +} + +bool valid(string &s1, string &s2, map &seq) +{ + if(seq.count(s1) && seq.count(s2)) + { + if(seq[s1] == seq[s2]) return false; + } + int n = s1.length(); + int m = s2.length(); + int l1 = 0, l2 = 0, r1 = n - 1, r2 = m - 1; + + while(s1[l1] == s2[l2] && (l1 < n) && (l2 < m)) + { + l1++; l2++; + } + while(s2[r2] == s1[r1] && (r1 >= 0) && (r2 >= 0)) + { + r1--; + r2--; + } + + string aux1 = """", aux2 = """"; + for(int i = l1; i <= r1; i++) + { + aux1 += s1[i]; + } + for (int i = l2; i <= r2; i++) + { + aux2 += s2[i]; + } + dbg(aux1); dbg(aux2); + if(seq.count(aux1) == 0 || seq.count(aux2) == 0) return true; + return !(seq[aux1] == seq[aux2]); +} + +void solve() +{ + int n; + cin >> n; + + map seq; + f(i, 0, n) + { + int sz; + cin >> sz; + f(j, 0, sz) + { + string s; + cin >> s; + seq[s] = i + 1; + } + } + debug(seq); + + int q; + cin >> q; + int x = 1; + while(q--) + { + string s1, s2; + cin >> s1 >> s2; + dbg(x); + x++; + (valid(s1, s2, seq)) ? cout << ""OK\n"" : cout << ""REJECT\n""; + } +} + +signed main() +{ + init_code(); + fast(); + int t = 1; + // cin >> t; + while (t--) + { + solve(); + } + return 0; +} +" +AtLz2wi7,Untitled,Sreekar_0125,Python,Saturday 28th of October 2023 04:09:01 AM CDT,"import sys +import math + +sys.stdin = open('input.txt', 'r') +sys.stdout = open('output.txt', 'w') +sys.stderr = open('error.txt', 'w') + + +for _ in range(int(input())): + first = list(map(str, input().split())) + second = list(map(str, input().split())) + scores = {} + ch = '2' + for i in range(2, 10): + scores[ch] = i + ch = chr(ord(ch) + 1) + scores['T'] = 10 + scores['J'] = 11 + scores['Q'] = 12 + scores['K'] = 13 + scores['A'] = 14 + l1 = [] + l2 = [] + for i in first: + l1.append(scores[i]) + for i in second: + l2.append(scores[i]) + p1, p2 = 0, 0 + while ((len(l1) != 0) and (len(l2) != 0)): + if l1[0] > l2[0]: + l1.append(l2[0]) + l1.pop(0) + elif l1[0] < l2[0]: + l2.append(l1[0]) + l2.pop(0) + else: + l1.pop(0) + l2.pop(0) + if (len(l2) != 0): + print('player 2') + elif (len(l1) != 0): + print('player 1') + else: + print('draw') + + + +" +zYuRsprC,snowybot trial,coinwalk,JavaScript,Saturday 28th of October 2023 04:06:03 AM CDT,"var smiley = parseFloat(document.getElementById('pct_balance').value); +var nudie = Number((smiley/320).toFixed(8)); +var burp = nudie; +var taget = (smiley*200000); +var bolux = (nudie*10); +var poopy = (nudie*6.5); +var mole = (nudie*7.5); +var sexual = 0; +var jockey = ((burp*1).toFixed(8)); +var bolance = smiley; +var fart = 1; +var woman = ((Math.floor((parseFloat(bolance))/bolux))*bolux); +var manboobs = ((Math.floor((parseFloat(bolance))/bolux))*bolux); + +function get(){ +console.clear(); +setTimeout(function(){ +bolance = document.getElementById('pct_balance').value; +if ((bolance>(((Math.floor(bolance/bolux))*bolux)+poopy))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+mole))&&(bolance!=sexual)&&(bolance>=manboobs)) { + burp = burp*2; + sexual = parseFloat(bolance); +} +if ((bolance>(((Math.floor(bolance/bolux))*bolux)+poopy))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+mole))&&(bolance!=sexual)&&(bolance=(manboobs+(bolux*fart)))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+poopy))){ + sexual = 0; + fart = 1; + burp = nudie; + woman = ((Math.floor(bolance/bolux))*bolux); + manboobs = ((Math.floor(bolance/bolux))*bolux); +} + if (bolance >= taget) { + console.log(""winner winner chicken dinner""); + return; + } +jockey = ((burp*1).toFixed(8)); +$('#pct_chance').val(49.5); +$('#pct_bet').val(jockey); +$('#a_lo').click(); +}, 100); +var dog = ((bolance-smiley).toFixed(8)); +console.log(""profit""); +console.log(dog); +setTimeout(() => get(), 200); +} +get();" +J3vr9EJ1,snowybot trial,coinwalk,JavaScript,Saturday 28th of October 2023 03:55:30 AM CDT,"var smiley = parseFloat(document.getElementById('pct_balance').value); +var nudie = Number((smiley/144).toFixed(8)); +var burp = nudie; +var taget = (smiley*200000); +var bolux = (nudie*10); +var poopy = (nudie*6.5); +var mole = (nudie*7.5); +var sexual = 0; +var jockey = ((burp*1).toFixed(8)); +var bolance = smiley; +var fart = 1; +var woman = ((Math.floor((parseFloat(bolance))/bolux))*bolux); +var manboobs = ((Math.floor((parseFloat(bolance))/bolux))*bolux); + +function get(){ +console.clear(); +setTimeout(function(){ +bolance = document.getElementById('pct_balance').value; +if ((bolance>(((Math.floor(bolance/bolux))*bolux)+poopy))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+mole))&&(bolance!=sexual)&&(bolance>=manboobs)) { + burp = burp*2; + sexual = parseFloat(bolance); +} +if ((bolance>(((Math.floor(bolance/bolux))*bolux)+poopy))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+mole))&&(bolance!=sexual)&&(bolance=(manboobs+(bolux*fart)))&&(bolance<(((Math.floor(bolance/bolux))*bolux)+poopy))){ + sexual = 0; + fart = 1; + burp = nudie; + woman = ((Math.floor(bolance/bolux))*bolux); + manboobs = ((Math.floor(bolance/bolux))*bolux); +} + if (bolance >= taget) { + console.log(""winner winner chicken dinner""); + return; + } +jockey = ((burp*1).toFixed(8)); +$('#pct_chance').val(49.5); +$('#pct_bet').val(jockey); +$('#a_lo').click(); +}, 100); +var dog = ((bolance-smiley).toFixed(8)); +console.log(""profit""); +console.log(dog); +setTimeout(() => get(), 200); +} +get();" +S09e9uM2,bin src multi,STANAANDREY,C,Saturday 28th of October 2023 03:25:13 AM CDT,"#include +#include +#include + +#define NUM_THREADS 4 // Number of threads to use +#define ARRAY_SIZE 20 // Size of the sorted array + +// Shared data structure to hold thread arguments +struct ThreadArgs { + int* arr; + int target; + int start; + int end; + int result; +}; + +// Function to perform binary search on a sorted array +void* binarySearch(void* arg) { + struct ThreadArgs* threadArgs = (struct ThreadArgs*)arg; + int* arr = threadArgs->arr; + int target = threadArgs->target; + int start = threadArgs->start; + int end = threadArgs->end; + + while (start <= end) { + int mid = start + (end - start) / 2; + + if (arr[mid] == target) { + threadArgs->result = mid; + return NULL; + } else if (arr[mid] < target) { + start = mid + 1; + } else { + end = mid - 1; + } + } + + // If the target is not found, set the result to -1 + threadArgs->result = -1; + return NULL; +} + +int main() { + int arr[ARRAY_SIZE] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39}; + int target = 23; + + // Initialize the threads and their arguments + pthread_t threads[NUM_THREADS]; + struct ThreadArgs threadArgs[NUM_THREADS]; + + int step = ARRAY_SIZE / NUM_THREADS; + int remaining = ARRAY_SIZE % NUM_THREADS; + int start = 0; + + // Create threads and assign the binary search tasks + for (int i = 0; i < NUM_THREADS; i++) { + int end = start + step - 1; + if (i < remaining) { + end++; + } + + threadArgs[i].arr = arr; + threadArgs[i].target = target; + threadArgs[i].start = start; + threadArgs[i].end = end; + + pthread_create(&threads[i], NULL, binarySearch, (void*)&threadArgs[i]); + + start = end + 1; + } + + // Wait for all threads to finish + for (int i = 0; i < NUM_THREADS; i++) { + pthread_join(threads[i], NULL); + } + + // Find the first thread that has found the target + int result = -1; + for (int i = 0; i < NUM_THREADS; i++) { + if (threadArgs[i].result != -1) { + result = threadArgs[i].result; + break; + } + } + + if (result != -1) { + printf(""Target %d found at index %d.\n"", target, result); + } else { + printf(""Target %d not found in the array.\n"", target); + } + + return 0; +} +" +VMQXgArC,MagSolutionsExample2023,wingman007,C#,Saturday 28th of October 2023 03:16:38 AM CDT,"// See https://aka.ms/new-console-template for more information +//Console.WriteLine(""Hello, World!""); +// Zad 1. +//Console.WriteLine(""2011 to BIN {0}."", Convert.ToString(2093, 2)); +//Console.WriteLine(""2011 to OCT {0}."", Convert.ToString(2093, 8)); +//Console.WriteLine(""2011 to HEX {0}."", Convert.ToString(2093, 16)); + + +// Test 1 - 2 I +//double x = 3.4, y = 5.6, z = 7.8; + +//Console.WriteLine( +// ((Math.Pow(x, 7.0) * y * z) - 3.3 * Math.Abs(x + Math.Pow(y, 1/4.0))) / +// Math.Pow(10.0, 7.0) + Math.Sqrt(Math.Log(4.0)) +//); + + +// Zad 36 d +//int x = 2; +//int y = 3; +//int z = 4; + +//Console.WriteLine(x > 0 && y > 0 && z > 0); + +// zad 102. + +//int a1, a2, a3, a4, a5, a6; + +//for (int number = 0; number <= 999999; number++) +//{ +// a1 = (number / 100000); +// a2 = (number / 10000) % 10; +// a3 = ((number / 1000) % 10); +// a4 = ((number / 100) % 10); +// a5 = ((number / 10) % 10); +// a6 = number % 10; + +// if (a1 + a2 + a3 == a4 + a5 + a6) +// { +// Console.WriteLine($""{number} is a lucky number""); +// } +//} + +// zad 164 +//int[] A = {2, 2}; +//int[] B = {3, 4}; +//int[] C = {5, 6}; + +//double a = Math.Sqrt(Math.Pow((B[0] - A[0]), 2) + Math.Pow((B[1] - A[1]), 2)); +//Console.WriteLine(a); +//double b = Math.Sqrt(Math.Pow((C[0] - B[0]), 2) + Math.Pow((C[1] - B[1]), 2)); +//Console.WriteLine(b); +//double c = Math.Sqrt(Math.Pow((C[0] - A[0]), 2) + Math.Pow((C[1] - A[1]), 2)); +//Console.WriteLine(c); + +//if (a + b > c && a + c > b && b + c > a) +//{ +// Console.WriteLine(""This is a triangle""); +// double s = (a + b + c) / 2; +// double area = Math.Sqrt(s * (s - a) * (s - b) * (s - c)); +// Console.WriteLine($""The area is {area}""); +//} +//else +//{ +// Console.WriteLine(""Thi si snot a triangle""); +//} + + +// Zad 405 +int n = 0; +bool isNumber = false; +do +{ + Console.Write(""Please, enter the lenght of the array [2,25] ""); + n = int.Parse(Console.ReadLine()); +} while (n < 2 || n > 25); +// isNumber = int.TryParse(Console.ReadLine(), out n); +//} while (!isNumber || (n < 2 || n > 25)); + +int[] myArray = new int[n]; +for (int i = 0; i < myArray.Length; i++) +{ + Console.Write($""Please enter a value for element myArrey[{i}] = ""); + myArray[i] = int.Parse(Console.ReadLine()); +} + +for (int i = 0; i < myArray.Length; i++) +{ + Console.WriteLine($""myArray[{i}] = {myArray[i]}""); +} + +int k = 0; +Console.Write(""Please, enter k = ""); +k = int.Parse(Console.ReadLine()); +Console.WriteLine(Prod(myArray, k)); + +static int Prod(int[] myArray, int k) +{ + int sum = 0; + for (int i = 0; i < myArray.Length; i++) + { + if (myArray[i] > 0 && myArray[i] < k) + { + sum += myArray[i]; + } + } + return sum; +} + +int counter = 0; +int a1 = 0; +int a2 = 0; +int a3 = 0; +for (int i = 0; i < myArray.Length; i++) +{ + if (myArray[i] >= 100 && myArray[i] <= 666) + { + a1 = myArray[i] / 100; + a2 = (myArray[i] / 10) % 10; + a3 = myArray[i] % 10; + + //string numberString = myArray[i].ToString(); + //a1 = numberString[0]; + //a2 = numberString[1]; + //a3 = numberString[2]; + + if ((a1 + a2 + a3) % 3 == 0) + { + counter++; + } + } +} + +Console.WriteLine(counter); + + +// Zad 363 +//Console.WriteLine(counter); + +//char myChar = 'A'; +//Console.WriteLine((int)myChar); + +//string unicode = ""граа""; +//string result = unicode.Replace(""г"", ""г""); + +//Console.WriteLine(result); + +// ------------------------------------------ +//Console.WriteLine(""2010 to BIN {0}."", Convert.ToString(2010, 2)); +//Console.WriteLine(""2010 to OCT {0}."", Convert.ToString(2010, 8)); +//Console.WriteLine(""2010 to HEX {0}."", Convert.ToString(2010, 16)); + +double H = 2.3; +double R = 5.0; +Console.WriteLine(""Surface s = {0}"", 2 * Math.PI * R * H); +Console.WriteLine(""Full Surface S = {0}"", 2 * Math.PI * R * H + 2 * Math.PI * Math.Pow(R, 2)); + +// Zad 37 - 4 +bool s = false; +bool t = true; + +Console.WriteLine(!(s || t) && s || !t); + +// Zad 99 +double sum = 0; +for (int i = 1; i < 100000; i++) +{ + if (i % 2 == 0) + { + sum -= 1.0/i; + } + else + { + sum += 1.0 / i; + } +} + +Console.WriteLine(sum); + +sum = 0; + +for (int i = 100000; i >= 1; i--) +{ + if (i % 2 == 0) + { + sum -= 1.0 / i; + } + else + { + sum += 1.0 / i; + } +} + +Console.WriteLine(sum); + +double sumPositive = 0; +double sumNegative = 0; + +for (int i = 1; i <= 100000; i++) +{ + if (i % 2 == 0) + { + sumNegative -= 1.0 / i; + } + else + { + sumPositive += 1.0 / i; + } +} + +Console.WriteLine(sumNegative); +Console.WriteLine(sumPositive); + + +sumPositive = 0; +sumNegative = 0; + +for (int i = 100000; i >= 1; i--) +{ + if (i % 2 == 0) + { + sumNegative -= 1.0 / i; + } + else + { + sumPositive += 1.0 / i; + } +} + +Console.WriteLine(sumNegative); +Console.WriteLine(sumPositive); + + + +// Zad 163 zad 90 +int a = 2; +int b = 3; +int c = 4; +int d = 5; +int p = 6; +int q = -7; + +// Console.WriteLine(a * x + b * y + c * z + d = 0); + +for (int x = p; x < q; x++) +{ + for (int y = p; y < q; y++) + { + for (int z = p; z < q; z++) + { + if (a*x + b*y + c*z + d == 0) + { + Console.WriteLine($""x = {x} y = {y} z = {z}""); + Console.ReadKey(true); + } + } + } +} +" +G3FCMDHh,SCRIBD download documents,nicuf,Python,Saturday 28th of October 2023 03:05:30 AM CDT,"from selenium import webdriver +from bs4 import BeautifulSoup +import requests + +def download_scribd_document(document_url, output_path): + # Initialize Selenium WebDriver + driver = webdriver.Chrome(executable_path='C:/path/to/chromedriver.exe') # Update this path + driver.get(document_url) + + # Get page source + html = driver.page_source + + # Parse HTML with BeautifulSoup + soup = BeautifulSoup(html, 'html.parser') + download_link = soup.find('a', {'class': 'download-button'}) + + if download_link: + download_response = requests.get(download_link['href']) + download_data = download_response.content + + with open(output_path, 'wb') as f: + f.write(download_data) + else: + print(""Download link not found"") + + driver.quit() + +# Example usage +document_url = 'https://www.scribd.com/document/your-document-id' +output_path = 'document.pdf' +download_scribd_document(document_url, output_path) +" +kZ56BKhe,mahasiswa_edit.php,humaidi,PHP,Saturday 28th of October 2023 03:01:02 AM CDT," + + + + + + + + + Edit Data Mahasiswa + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + +
+
+ +

Edit Data Mahasiswa

+
+ +
+
+ +
+ + ""> +
+ +
+ + ""> +
+ +
+ + +
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ Copyright 2022 By Humaidi Zakaria +
+
+ + + + + + + + + + + +" +PUf55zq2,settings archive,TIMAS_Bro,Lua,Saturday 28th of October 2023 02:51:50 AM CDT,"{ + [ ""testwp.lua"" ] = ""os.loadAPI('tos/tos')\ +print(tos.getPersistentVariable('wpc'))"", + upline = ""os.loadAPI('/uap')\ +os.loadAPI('lg/lg')\ +lg.setup('term')\ +lg.fillScreen(colors.white)\ +lg.fill(1,26,2,2,colors.lightGray)\ +lg.drawText(2,4,colors.white,colors.gray,' Enter upline color: ')\ +lg.drawInput(' ',2,25,6,6,20)\ +\ +lg.drawBT('heart',2,2,12,12,colors.black,colors.white,'\\3')\ +lg.drawBT('note',4,4,12,12,colors.black,colors.white,'\\15')\ +lg.drawBT('dot',6,6,12,12,colors.black,colors.white,'\\7')\ +lg.drawBT('smileface',8,8,12,12,colors.black,colors.white,'\\2')\ +lg.drawBT('blank',10,10,12,12,colors.white,colors.black,'\ ')\ +lg.drawBT('save',2,6,17,17,colors.white,colors.green,' save ')\ +local upl_col = \""gray\""\ +local upl_sym = \""\\15\""\ +if not lg.isColor(upl_col) then\ + upl_col = \""gray\""\ +end\ +os.sleep(0.5)\ +while true do\ + local event, button, x, y = os.pullEvent( \""mouse_click\"" )\ + if (lg.isInput(x,y) == \"" \"") then\ + upl_col = lg.getInput(x,y)\ + if not lg.isColor(upl_col) then upl_col = \""gray\"" end\ + tos.writePersistentVariable(\""upl_col\"",upl_col)\ + elseif (lg.isButton(x,y) == 'heart') then\ + upl_sym = '\\3'\ + elseif (lg.isButton(x,y) == 'note') then\ + upl_sym = '\\15'\ + elseif (lg.isButton(x,y) == 'dot') then\ + upl_sym = '\\7'\ + elseif (lg.isButton(x,y) == 'smileface') then\ + upl_sym = '\\2'\ + elseif (lg.isButton(x,y) == 'blank') then\ + upl_sym = '\ '\ + elseif (lg.isButton(x,y) == 'save') then\ + tos.writePersistentVariable('upl_sym', upl_sym)\ + os.sleep(0.5)\ + os.reboot()\ + end\ + if lg.isButton(x,y) or lg.isInput(x,y) then\ + lg.drawText(2,14,colors.white,lg.getColor(upl_col)\ + ,upl_sym)\ + end \ + end\ + \ +lg.exit()"", + settings = ""os.loadAPI('lg/lg')\ +os.loadAPI('tos/tos')\ +os.loadAPI(\""uap\"")\ +lg.setup('term')\ +lg.fillScreen(colors.white)\ +lg.fill(1,26,2,2,colors.lightGray)\ +\ +lg.drawBT('wp',2,25,4,4,colors.black,colors.lightGray,' Wallpaper color')\ +lg.drawBT('upl',2,25,6,6,colors.black,colors.lightGray,' Upper line settings')\ +lg.drawBT('dwnl',2,25,8,8,colors.black,colors.lightGray,' Down line color')\ +uap.upd()\ +while true do\ + local event, button, x, y = os.pullEvent( \""mouse_click\"" )\ + if (lg.isButton(x,y) == \""wp\"") then\ + tos.openFile('/settings/wallpaper')\ + sleep(0.1)\ + elseif (lg.isButton(x,y) == 'upl') then\ + tos.openFile('/settings/upline')\ + elseif (lg.isButton(x,y) == 'dwnl') then\ + tos.openFile('/settings/dwnline')\ + end\ +end\ +\ +lg.exit()"", + wallpaper = ""os.loadAPI('/uap')\ +os.loadAPI('lg/lg')\ +lg.setup('term')\ +local wpcolor = \""gray\""\ +if not lg.isColor(wpcolor) then\ + wpcolor = \""gray\""\ +end\ +lg.fillScreen(colors.white)\ +lg.fill(1,26,2,2,colors.lightGray)\ +lg.drawText(2,4,colors.white,colors.gray,' Enter wallpaper color: ')\ +lg.drawInput(' ',2,25,6,6,20)\ +os.sleep(0.5)\ +while true do\ + local event, button, x, y = os.pullEvent( \""mouse_click\"" )\ + if (lg.isInput(x,y) == \"" \"") then\ + local wpcolor = lg.getInput(x,y)\ + tos.writePersistentVariable('color',wpcolor)\ + end\ + end\ +\ +lg.exit()"", + dwnline = ""os.loadAPI('/uap')\ +os.loadAPI('lg/lg')\ +lg.setup('term')\ +lg.fillScreen(colors.white)\ +lg.fill(1,26,2,2,colors.lightGray)\ +lg.drawText(2,4,colors.white,colors.gray,' Enter downline color: ')\ +lg.drawInput(' ',2,25,6,6,20)\ +local dwl_col = \""gray\""\ +if not lg.isColor(dwl_col) then\ + dwl_col = \""gray\""\ +end\ +os.sleep(0.5)\ +while true do\ + local event, button, x, y = os.pullEvent( \""mouse_click\"" )\ + if (lg.isInput(x,y) == \"" \"") then\ + local dwl_col = lg.getInput(x,y)\ + tos.writePersistentVariable('dwl_col',dwl_col)\ + end\ + end\ +\ +lg.exit()"", +}" +cvdK6zyR,Make A Dictionary,Pijomir,JavaScript,Saturday 28th of October 2023 02:43:06 AM CDT,"function makeDictionary(input) { + let dictionary = {}; + for (let line of input) { + let currentWordAndDefinition = JSON.parse(line); + let currentWord = Object.keys(currentWordAndDefinition); + let currentDefinition = Object.values(currentWordAndDefinition); + // let [currentWord, currentDefinition] = Object.entries(currentWordAndDefinition); + dictionary[currentWord] = currentDefinition; + } + + let sortedDictionary = Object.entries(dictionary).sort((a, b) => a[0].localeCompare(b[0])); + sortedDictionary.forEach(a => console.log(`Term: ${a[0]} => Definition: ${a[1]}`)); +}" +AbDJS9DA,modifikasi halaman mahasiswa.php,humaidi,PHP,Saturday 28th of October 2023 02:41:04 AM CDT," + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +" +wNFFRufA,Bodyguard Example,Ji9sw,C++,Saturday 28th of October 2023 02:38:31 AM CDT," if (GUI::Option(""Spawn Bodyguard"", """")) + { + int clone[1000]; + int gcount = 1; + Ped SelectedPlayer = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(Features::SelectedPlayer); // The player to spawn it for + if (!ENTITY::DOES_ENTITY_EXIST(SelectedPlayer)) return; // Making sure the player exists + Hash railgun = MISC::GET_HASH_KEY(""WEAPON_RAILGUN""); // The bodyguards weapon + Vector3 pos = ENTITY::GET_ENTITY_COORDS(SelectedPlayer, false); // Players position to spawn it on + Hash pedm = MISC::GET_HASH_KEY(""u_m_m_jesus_01""); // The bodyguards ped + STREAMING::REQUEST_MODEL(pedm); // Request the ped + while (!STREAMING::HAS_MODEL_LOADED(pedm)) { fibermain::pause(); } // Wait for the ped to load + int my_group = PLAYER::GET_PLAYER_GROUP(SelectedPlayer); // Create a group for the bodyguards + clone[gcount] = PED::CREATE_PED(26, pedm, pos.x + rand() % 1, pos.y + rand() % 1, pos.z + 1, 0, 1, 1); // Create the ped + PED::SET_PED_AS_GROUP_LEADER(SelectedPlayer, my_group); // Set ped as group leader + PED::SET_PED_AS_GROUP_MEMBER(clone[gcount], my_group); // Add it as a member + PED::SET_PED_NEVER_LEAVES_GROUP(clone[gcount], my_group); // Make it so it cant leave + ENTITY::SET_ENTITY_INVINCIBLE(clone[gcount], false); // Godmode? + PED::SET_PED_COMBAT_ABILITY(clone[gcount], 100); // How good are they at shooting? + WEAPON::GIVE_WEAPON_TO_PED(clone[gcount], railgun, railgun, 9999, 9999); // Give them the gun you selected + PED::SET_PED_CAN_SWITCH_WEAPON(clone[gcount], true); // Can they switch to a sidearm? + PED::SET_GROUP_FORMATION(my_group, 3); // Set the entire groups formation, you can change this anytime if you save my_group as a variable elsewhere + PED::SET_PED_MAX_HEALTH(clone[gcount], 5000); // Set peds health (Not sure why, if its godmode, unless you disable godmode) + gcount++; + }" +pMaSwv0p,Untitled,Sreekar_0125,C++,Saturday 28th of October 2023 02:30:14 AM CDT,"#include +#include +#include +using namespace std; +using namespace __gnu_pbds; +template +using pbds = + tree, rb_tree_tag, tree_order_statistics_node_update>; +// #define cerr if(false)cerr +#define int long long +#define pb push_back +#define F first +#define S second +#define yes cout << ""Yes\n"" +#define no cout << ""No\n"" +#define yn(x) x ? yes : no +#define f(i, s, e) for (int i = s; i < e; i++) +#define vi vector +#define vb vector +#define pii pair +#define vpi vector +#define umi unordered_map +#define mi map +#define si set +#define sc set +#define maxheap priority_queue +#define minheap priority_queue, greater> +#define all(x) x.begin(), x.end() +#define minele(x) *min_element(all(x)) +#define maxele(x) *max_element(all(x)) +#define endl '\n' + +const int N = 2e5; +const int MOD = 1e9 + 7; + + +#ifndef ONLINE_JUDGE +#define debug(x) \ + cerr << (#x) << "" is ""; \ + _print(x) +#define dbg(x) \ + cerr << (#x) << "" is "" << x << endl; +#else +#define debug(x) +#define dbg(x) +#endif + + +template +void _print(T a) +{ + cerr << a; +} +template +void print(T a) +{ + cout << a << ' '; +} +template +void println(T a) +{ + cout << a << endl; +} +template +istream &operator>>(istream &is, vector &a) +{ + for (auto &x : a) + is >> x; + return is; +} +template +ostream &operator<<(ostream &os, const vector &a) +{ + for (const auto &x : a) + os << x << ' '; + return os; +} + +template +void _print(pair p); +template +void _print(vector v); +template +void _print(set v); +template +void _print(map v); +template +void _print(multiset v); +template +void _print(pair p) +{ + cerr << ""{""; + _print(p.F); + cerr << "",""; + _print(p.S); + cerr << ""} ""; +} +template +void _print(vector v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(set v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(multiset v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(map v) +{ + cerr << ""[ ""; + for (auto i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(unordered_map v) +{ + cerr << ""[ ""; + for (auto i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} + +/////////////Sieve/////////////// +// vb sieve(N + 5, true); +// vi primes; +// void gensieve() +// { +// sieve[0] = sieve[1] = false; +// for (int i = 2; i <= sqrt(N); i++) +// { +// if (sieve[i]) +// { +// for (int j = i * i; j <= N; j += i) +// sieve[j] = false; +// } +// } +// for (int i = 2; i <= N; i++) +// { +// if (sieve[i]) +// primes.pb(i); +// } +// } +//////////////////////////////// + +int binpow(int a, int b) +{ + int ans = 1; + a %= MOD; + while(b) + { + if(b & 1) + ans = ((ans % MOD) * (a % MOD)) % MOD; + + a = ((a % MOD) * (a % MOD)) % MOD; + b >>= 1; + } + return ans; +} + +void fast() +{ + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); +} + +void init_code() +{ +#ifndef ONLINE_JUDGE + freopen(""input.txt"", ""r"", stdin); + freopen(""output.txt"", ""w"", stdout); + freopen(""error.txt"", ""w"", stderr); +#endif // ONLINE_JUDGE +} + +class Trie +{ +public: + Trie *children[26]; + int cnt; + Trie() + { + f(i, 0, 26) children[i] = nullptr; + cnt = 0; + } + void insert(string s) + { + Trie *node = this; + for (int i = 0; i < s.length(); i++) + { + int mask = s[i] - 'a'; + if (node->children[mask] == nullptr) + { + node->children[mask] = new Trie(); + // this->cnt = 1; + } + node->children[mask]->cnt++; + node = node->children[mask]; + // this->cnt += 1; + } + } + string prefix_answer(string s) + { + Trie *node = this; + string prefix = """"; + int n = s.length(); + bool found = false; + for (int i = 0; i < n; i++) + { + bool mask = s[i] - 'a'; + + if (node->children[mask] != nullptr) + { + prefix += s[i]; + node = node->children[mask]; + // dbg(node->children[mask]->cnt); + } + else + { + if(cnt == 1) + { + while(1) + { + bool end = true; + f(i, 0, 26) + { + if (node->children[i] != nullptr) + { + prefix += char(i + 'a'); + node = node->children[i]; + end = false; + } + } + if(end) break; + } + found = true; + } + else + { + return ""#""; + } + } + dbg(node->children[mask]->cnt); + } + return prefix; + } + + string suffix_answer(string s) + { + reverse(all(s)); + Trie *node = this; + string suffix = """"; + int n = s.length(); + bool found = false; + for (int i = 0; i < n; i++) + { + bool mask = s[i] - 'a'; + if (node->children[mask] != nullptr) + { + suffix += s[i]; + node = node->children[mask]; + } + else + { + if (cnt == 1) + { + while (1) + { + bool end = true; + f(i, 0, 26) + { + if (node->children[i] != nullptr) + { + suffix += char(i + 'a'); + node = node->children[i]; + end = false; + } + } + if (end) + break; + } + found = true; + } + else + { + return ""#""; + } + } + } + reverse(all(suffix)); + return suffix; + } +}; + +void solve() +{ + int n, m; + cin >> n >> m; + + vector v(n); + Trie pf, sf; + f(i, 0, n) + { + string s; + cin >> s; + pf.insert(s); + reverse(all(s)); + sf.insert(s); + } + + string ss = ""spoof""; + print(pf.children[18]->cnt); + string sss = pf.prefix_answer(ss); + dbg(sss); + + while(m--) + { + string s; + cin >> s; + + // string ans_pf = pf.prefix_answer(s); + // string ans_sf = sf.suffix_answer(s); + // dbg(ans_pf); + // dbg(ans_sf); + // if(ans_pf == ""#"" || ans_sf == ""#"") + // { + // cout << ""ambiguous\n""; + // } + // else if(ans_pf.size() < 3 || ans_sf.size() < 3) + // { + // cout << ""none\n""; + // } + // else + // { + // cout << ans_pf << ' ' << ans_sf << endl; + // } + } +} + +signed main() +{ + init_code(); + fast(); + int t = 1; + // cin >> t; + while (t--) + { + solve(); + } + return 0; +} +" +4VXscgiG,proses_crud_mahasiswa.php,humaidi,PHP,Saturday 28th of October 2023 02:22:54 AM CDT," +#include +#include +#include + +class FileToArray { +private: + std::vector> array; + +public: + FileToArray(const std::string& filePath) { + std::ifstream inputFile(filePath); + + if (!inputFile.is_open()) { + std::cerr << ""Error: Could not open file"" << std::endl; + return; + } + + array.resize(20, std::vector(10)); + + std::string line; + std::getline(inputFile, line); + + std::istringstream lineStream(line); + int value; + for (int i = 0; i < 20; i++) { + for (int j = 0; j < 10; j++) { + if (lineStream >> value) { + array[i][j] = value; + } else { + std::cerr << ""Error: Not enough data in the file."" << std::endl; + inputFile.close(); + return; + } + } + } + + inputFile.close(); + } + + void compareAndPrintMismatches(int selectedNumber) { + for (int row = 0; row < 20; row++) { + for (int col = 0; col < 10; col++) { + int number = array[row][col]; + if (number != selectedNumber) { + std::cout << ""Mismatch: Row "" << (row + 1) << "", Column "" << (col + 1) << "" - Value: "" << number << std::endl; + } + } + } + } + + int countElements() { + return 20 * 10; + } + + void exportToFile(const std::string& outputPath, const std::string& delimiter) { + std::ofstream outputFile(outputPath); + + if (!outputFile.is_open()) { + std::cerr << ""Error: Could not open output file"" << std::endl; + return; + } + + for (int row = 0; row < 20; row++) { + for (int col = 0; col < 10; col++) { + outputFile << array[row][col]; + if (col < 9) { + outputFile << delimiter; + } + } + outputFile << ""\n""; + } + + outputFile.close(); + } +}; + +// recv Hh21re + +int main() { + std::string inputFilePath = ""numbers.txt""; // Change this to the path of your input file + FileToArray fileToArray(inputFilePath); + + int selectedNumber = 85; // Change this to the number you want to compare + + fileToArray.compareAndPrintMismatches(selectedNumber); + + int elementCount = fileToArray.countElements(); + std::cout << ""Total number of elements in the array: "" << elementCount << std::endl; + + std::string outputFilePath = ""output.txt""; // Change this to the desired output file path + std::string delimiter = ""\t""; // Change this to the desired delimiter + fileToArray.exportToFile(outputFilePath, delimiter); + + return 0; +} + " +k9hhDSgh,Untitled,tuomasvaltanen,Python,Saturday 28th of October 2023 01:49:06 AM CDT,"# Johdatus ohjelmointiin, 28.10.2023 +print(""Tervetuloa!"") + +# UUSI TIEDOSTO +# muista asentaa ensin colorama, ks. ohjeet +from colorama import Fore, Back, Style + +print(Fore.CYAN + 'Eri väristä tekstiä!') +print(Back.LIGHTWHITE_EX + 'Eri taustavärikin!') +print(""Edelleen teksti on turkoosia, ja taustaväri on valkoinen!"") + +# palautetaan kaikki normaaliksi +print(Style.RESET_ALL) +print('Nyt ollaan taas normaalissa tilassa!') + +# UUSI TIEDOSTO + +from colorama import Fore, Back, Style + +print(Fore.CYAN + 'Eri väristä tekstiä!') +print(""Lisää tekstiä, vieläkin sama väri!"") +print(Fore.RED + Back.LIGHTCYAN_EX + ""Vaihdetaan tausta ja tekstin väri samalla kertaa!"") +print(""Vieläkin on punainen teksti ja sininen taustaväri."") + +# palautetaan kaikki normaaliksi +print(Style.RESET_ALL + 'Nyt ollaan taas normaalissa tilassa!') + +# UUSI TIEDOSTO + +from colorama import Fore, Back, Style + +# kysytään käyttäjältä luku +number = input(""Anna jokin numero:\n"") +number = int(number) + +# reagoidaan eri värillä riippuen siitä onko numero positiivinen vai negatiivinen +if number >= 0: + print(Fore.BLACK + Back.LIGHTGREEN_EX + ""Positiivinen luku!"") +else: + print(Fore.BLACK + Back.LIGHTRED_EX + ""Negatiivinen luku..."") + +# UUSI TIEDOSTO + +# muista asentaa ensin Pillow-moduuli! + +from PIL import Image, ImageDraw + +# luodaan uusi kuva => koko 100 x 30 (sivuttain x pystysuunnassa) +img = Image.new('RGB', (500, 300), color=(73, 109, 137)) + +# alustetaan piirto-objekti +d = ImageDraw.Draw(img) + +# piirretään tekstiä +# koordinaatit alkaa aina vasemmasta yläkulmasta +# eli koordinaatti 100, 200 => 100 pikseliä oikealle, ja 200 pikseliä alas +d.text((50, 100), ""Hello World"", fill=(255, 255, 0)) + +# piirretään ympyrä (käyttämällä ellipsityökalua) +# xy = aloituspiste on kohdassa 100,100 => oikea alanurkka on kohdassa 200,200 +# tarkoittaa että ellipsin koko on 100 x 100 (eli 200 - 100, 200 - 100) +d.ellipse((150, 150, 250, 250), fill=(192, 102, 217), outline=(0, 0, 0)) + +# tallennetaan lopputulos tiedostoon +img.save('pil_text.png')" +qkDZDRdc,mahasiswa_tambah.php,humaidi,PHP,Saturday 28th of October 2023 01:25:04 AM CDT," + + + + + + Tambah Data Mahasiswa + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + +
+
+ +

Tambah Data Mahasiswa

+
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ Copyright 2022 By Humaidi Zakaria +
+
+ + + + + + + + + + + +" +Maa45P5s,Employees,Pijomir,JavaScript,Saturday 28th of October 2023 12:22:17 AM CDT,"function createListOfEmployees(input) { + let list = {}; + for(let employee of input) { + list[employee] = employee.length; + } + + for (let [employeeName, employeeNum] of Object.entries(list)) { + console.log(` Name: ${employeeName} -- Personal Number: ${employeeNum}`); + } +}" +gdu9gxBT,LeetCode 155 - Min Stack - 2023.10.28 solution,nathanwailes,Python,Saturday 28th of October 2023 12:13:05 AM CDT,"StackItem = namedtuple(""StackItem"", ""val minimum"") +class MinStack: + + def __init__(self): + self.stack = [] + + def push(self, val: int) -> None: + if len(self.stack) == 0: + minimum = val + else: + minimum = min(val, self.stack[-1].minimum) + self.stack.append(StackItem(val=val, minimum=minimum)) + + def pop(self) -> None: + return self.stack.pop().val + + def top(self) -> int: + return self.stack[-1].val + + def getMin(self) -> int: + return self.stack[-1].minimum + + +# Your MinStack object will be instantiated and called as such: +# obj = MinStack() +# obj.push(val) +# obj.pop() +# param_3 = obj.top() +# param_4 = obj.getMin()" +i6sCLQJX,prodi.php,humaidi,PHP,Friday 27th of October 2023 11:57:53 PM CDT," + + + + + + Daftar Prodi + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + +

DAFTAR PRODI FAKULTAS TEKNIK DAN ILMU KOMPUTER UMPP

+ +
+
+ + + + + + + + + + + + + + + + +
NoNama ProdiAKSI
1.S1 Informatika + Edit + Hapus +
+
+
+ +
+
+ +
+
+ Copyright 2022 By Humaidi Zakaria +
+
+ + + + + + + + + + + + + + + + + +" +ReGKS0Rp,mahasiswa.php,humaidi,PHP,Friday 27th of October 2023 11:53:30 PM CDT," + + + + + + Daftar Mahasiswa + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + +

DAFTAR MAHASISWA FAKULTAS TEKNIK DAN ILMU KOMPUTER UMPP

+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
NoNamaNIMPRODIAKSI
1.Humaidi Zakaria201903010008D3 Manajemen Informatika + Edit + Hapus +
+
+
+ +
+
+ +
+
+ Copyright 2022 By Humaidi Zakaria +
+
+ + + + + + + + + + + + + + + + + +" +JLQjpFVX,dashboard.php,humaidi,PHP,Friday 27th of October 2023 11:43:35 PM CDT," + + + + + + + Dashboard + + + + + + + + + + +
+ + +
+ + +
+
+ + +
+

SELAMAT DATANG

+

Ini adalah website pertama saya

+ +
+ + +
+
+ +
+
+ Copyright 2022 By Humaidi Zakaria +
+
+ + + + + + + +" +P1b6CsHa,CSS to make Discord usable,IncandescenceSy,CSS,Friday 27th of October 2023 11:06:18 PM CDT,"/* Message bar buttons */ +button[aria-label=""Send a gift""], +button[aria-label=""Open sticker picker""], /* Use Ctrl+S */ +button[aria-label=""Open GIF picker""], /* Use Ctrl+G */ +button[aria-label=""Boost this server""], +.attachButton_b1db83.attachButton_eba568.button_afdfd9.lookBlank__7ca0a.colorBrand_b2253e.grow__4c8a4, +.expression-picker-chat-input-button.buttonContainer__8b164, + +/* Channels & Roles / Browse Channels button */ +#channels li[role=""button""], +.sectionDivider__68d2a, + +/* Super reaction buttons */ +[aria-label=""Add Super Reaction""], +#super-reaction-picker-tab, +#message-add-reaction-1 , + +/* Nitro ads in profile edit */ +.premiumFeatureBorder__9bbb3.featureBorder_a44f20.customizationSectionBorder__17861, +.customizationSection__16fec.showBorder__9e03d, +.container_d6bff4, +.bannerNitroUpsell__492d6, +.premiumFeatureBorder__9bbb3.featureBorder_a44f20.tryItOutSection__0f9fb, +.premiumTab__57bdc.item__48dda.themed_b957e8, +.upsellOverlayContainer__08979, + +/* Shop and store */ +a[href=""/store""], a[href=""/shop""], + +/* Mark unread button */ +div[role=""button""][aria-label=""Mark Unread""], +#message-mark-unread, + +/* Speak message button */ +#message-tts, + +/* Annoying emoji images and submenu on rightclick and hover */ +.customItem__7173b, +.caret_ce50ce, +.submenuPaddingContainer__12a9d, +.wrapper__2e846, + +/* Top toolbar buttons */ +.toolbar__88c63 a, /* Help button */ +[aria-label=""Show User Profile (Unavailable)""], +[aria-label=""Show User Profile""], /* Use Ctrl+U */ +[aria-label=""Show Member List""], /* Use Ctrl+U */ +[aria-label=""Add Friends to DM""], /* Use + button at top of DMs */ +[aria-label=""Start Video Call""], +[aria-label=""Inbox""], +[aria-label=""Notification Settings""], /* Just right click channel */ + +/* ""Find or start a conversation"" bar */ +.searchBar_e4ea2a, + +/* Boost goal */ +[aria-label=""Buy Boosts to help unlock Level 1 perks!""], +[aria-label=""Buy Boosts to help unlock Level 2 perks!""], +[aria-label=""Buy Boosts to help unlock Level 3 perks!""], + +/* Events */ +#channels li[data-list-item-id^=channels___upcoming-events], +#channels li[data-list-item-id^=channels___ongoing-events], + +/* Create invite button */ +.actionIcon_d679b5, /* Use server dropdown menu or right click channel */ + +/* Commonly used divider to create whitespace around elements this deletes */ +div[style=""height: 12px;""] + +{ + display: none; +}" +1rLrXFUU,Untitled,Sreekar_0125,C++,Friday 27th of October 2023 10:50:39 PM CDT,"#include +#include +#include +using namespace std; +using namespace __gnu_pbds; +template +using pbds = + tree, rb_tree_tag, tree_order_statistics_node_update>; +// #define cerr if(false)cerr +#define int long long +#define pb push_back +#define F first +#define S second +#define yes cout << ""Yes\n"" +#define no cout << ""No\n"" +#define yn(x) x ? yes : no +#define f(i, s, e) for (int i = s; i < e; i++) +#define vi vector +#define vb vector +#define pii pair +#define vpi vector +#define umi unordered_map +#define mi map +#define si set +#define sc set +#define maxheap priority_queue +#define minheap priority_queue, greater> +#define all(x) x.begin(), x.end() +#define minele(x) *min_element(all(x)) +#define maxele(x) *max_element(all(x)) +#define endl '\n' + +const int N = 1300; +const int MOD = 1e9 + 7; + + +#ifndef ONLINE_JUDGE +#define debug(x) \ + cerr << (#x) << "" is ""; \ + _print(x) +#define dbg(x) \ + cerr << (#x) << "" is "" << x << endl; +#else +#define debug(x) +#define dbg(x) +#endif + + +template +void _print(T a) +{ + cerr << a; +} +template +void print(T a) +{ + cout << a << ' '; +} +template +void println(T a) +{ + cout << a << endl; +} +template +istream &operator>>(istream &is, vector &a) +{ + for (auto &x : a) + is >> x; + return is; +} +template +ostream &operator<<(ostream &os, const vector &a) +{ + for (const auto &x : a) + os << x << ' '; + return os; +} + +template +void _print(pair p); +template +void _print(vector v); +template +void _print(set v); +template +void _print(map v); +template +void _print(multiset v); +template +void _print(pair p) +{ + cerr << ""{""; + _print(p.F); + cerr << "",""; + _print(p.S); + cerr << ""} ""; +} +template +void _print(vector v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(set v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(multiset v) +{ + cerr << ""[ ""; + for (T i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(map v) +{ + cerr << ""[ ""; + for (auto i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} +template +void _print(unordered_map v) +{ + cerr << ""[ ""; + for (auto i : v) + { + _print(i); + cerr << "" ""; + } + cerr << ""]""; + cerr << endl; +} + +/////////////Sieve/////////////// +// vb sieve(N + 5, true); +// vi primes; +// void gensieve() +// { +// sieve[0] = sieve[1] = false; +// for (int i = 2; i <= sqrt(N); i++) +// { +// if (sieve[i]) +// { +// for (int j = i * i; j <= N; j += i) +// sieve[j] = false; +// } +// } +// for (int i = 2; i <= N; i++) +// { +// if (sieve[i]) +// primes.pb(i); +// } +// } +//////////////////////////////// + +int binpow(int a, int b) +{ + int ans = 1; + a %= MOD; + while(b) + { + if(b & 1) + ans = ((ans % MOD) * (a % MOD)) % MOD; + + a = ((a % MOD) * (a % MOD)) % MOD; + b >>= 1; + } + return ans; +} + +void fast() +{ + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); +} + +void init_code() +{ +#ifndef ONLINE_JUDGE + freopen(""input.txt"", ""r"", stdin); + freopen(""output.txt"", ""w"", stdout); + freopen(""error.txt"", ""w"", stderr); +#endif // ONLINE_JUDGE +} + +vb valid(2000, false); + +int len(int n) +{ + int ans = 0; + while (n) + { + ans++; + n /= 10; + } + return ans; +} +int sum(int n) +{ + int ans = 0; + while (n) + { + ans += (n % 10) * (n % 10); + n /= 10; + } + return ans; +} + +void precmp() +{ + valid[1] = true; + valid[7] = true; + valid[10] = true; + for (int i = 11; i <= 1296; i++) + { + int x = i; + while (len(x) != 1) + { + x = sum(x); + if (i == 13) + dbg(x); + } + valid[i] = (x == 1); + } +} + +int cntNum(string X, int i, int sum, int tight, vector> &dp) +{ + if(dp[sum][i][tight] != -1) + { + return dp[sum][i][tight]; + } + + if (i >= X.length() || sum < 0) + { + if (sum == 0) + { + return dp[sum][i][tight] = 1; + } + return dp[sum][i][tight] = 0; + } + + + int res = 0; + + int end = tight != 0 ? X[i] - '0' : 9; + + for (int j = 0; j <= end; j++) + { + res += cntNum(X, i + 1, (sum - (j * j)), + (tight > 0 & (j == end)) == + true + ? 1 + : 0, dp); + } + return dp[sum][i][tight] = res; +} + +static int UtilCntNumRange(int L, int R, int Y, vector> &dp) +{ + + if (R == 0 && Y == 0) + { + return 1; + } + + string str = to_string(R); + + int cntR = cntNum(str, 0, Y, + 1, dp); + + + str = to_string(L - 1); + + int cntL = cntNum(str, 0, Y, + 1, dp); + + return (cntR - cntL); +} + +void solve() +{ + int a, b; + cin >> a >> b; + int ans = 0; + vector> dp(N, vector(N, vi(3, -1))); + for(int i = 1; i <= 1296; i++) + { + if(valid[i]) + { + ans += (UtilCntNumRange(a, b, i, dp)); + } + } + println(ans); +} + +signed main() +{ + init_code(); + fast(); + int t = 1; + precmp(); + // cin >> t; + while (t--) + { + solve(); + } + return 0; +} +" +TQyvmT3a,Half Network,Fusion1227,Lua,Friday 27th of October 2023 08:55:20 PM CDT,"--[[ + A complete train signal system has two on sensors (one per side), two off sensors (one per side), + and two signal lights. Given a signal light A and a signal light B, this script handles + the on sensor for B and the off sensor for A. Since these two sensors are close to A, + it is efficient to link them and A to a single computer, and to link the rest of the components + on the other side to another computer. + + Each train signal network should have two computers, and each computer should use this script + and name it ""startup"". +]] + + +----| config |---------------------------- + + +local MODEM_SIDE = ""top"" +local LEFT_SENSOR_SIDE = ""left"" +local RIGHT_SENSOR_SIDE = ""right"" +local SIGNAL_SIDE = ""back"" +local CENTRAL_CPU_ID = 125 -- the id of the computer at spawn + + +----| setup |---------------------------- + + +local protocolEnum = { + GET_SIGNAL_STATE = ""GET_SIGNAL_STATE"", + SENSOR_CHANGE = ""SENSOR_CHANGE"", +} + +local sensorStateEnum = { -- compatible with bitwise operations + off = 0, + leftOn = 1, + rightOn = 2, + bothOn = 3, +} + +local lastSensorStates = sensorStateEnum.off + + +----| functions |---------------------------- + + +function getSensorStates() + local leftValue = redstone.getInput(LEFT_SENSOR_SIDE) and sensorStateEnum.leftOn or sensorStateEnum.off -- 1 if on, 0 if off + local rightValue = redstone.getInput(RIGHT_SENSOR_SIDE) and sensorStateEnum.rightOn or sensorStateEnum.off -- 2 if on, 0 if off + return leftValue + rightValue -- corresponds to one of the sensorStateEnum values +end + + +function sendSensorStates() + local states = getSensorStates() + if states ~= lastSensorStates and states ~= sensorStateEnum.off and states ~= sensorStateEnum.bothOn then -- if the state changed and just one of the sensors is on + rednet.send(CENTRAL_CPU_ID, states, protocolEnum.SENSOR_CHANGE) + end + lastSensorStates = states -- record the state change +end + + +function setSignalState() + rednet.send(CENTRAL_CPU_ID, nil, protocolEnum.GET_SIGNAL_STATE) + local id, signalState = rednet.receive(protocolEnum.GET_SIGNAL_STATE) + print(""Received message from computer "" .. id .. ""\n\t> Message: "" .. tostring(signalState)) + if id ~= CENTRAL_CPU_ID then return end + + if signalState == true then -- activate signal + print(""Activating signal..."") + redstone.setOutput(SIGNAL_SIDE, true) + elseif signalState == false then -- deactivate signal + redstone.setOutput(SIGNAL_SIDE, false) + print(""Deactivating signal..."") + end +end + + +----| main |---------------------------- + + +rednet.open(MODEM_SIDE) +print(""Rednet opened."") + + +while true do + sendSensorStates() + setSignalState() + sleep(1) +end" +kXaWLEb6,Nasvectica's Data,azimuths,JSON,Friday 27th of October 2023 08:51:37 PM CDT,"{""Stats"":{""MissionEXP"":{""ObjectName"":""MissionEXP"",""ObjectClass"":""IntValue"",""ObjectValue"":""908""},""PrimaryCN"":{""ObjectName"":""PrimaryCN"",""ObjectClass"":""IntValue"",""ObjectValue"":""4""},""mapmove1"":{""ObjectName"":""mapmove1"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""LeftEye"":{""ObjectName"":""LeftEye"",""ObjectClass"":""StringValue"",""ObjectValue"":""Omnigan"",""ObjectAttributes"":{""Progress"":""Stage 2""}},""Key12"":{""ObjectName"":""Key12"",""ObjectClass"":""StringValue"",""ObjectValue"":""b""},""Blind"":{""ObjectName"":""Blind"",""ObjectClass"":""NumberValue"",""ObjectValue"":""0""},""Slot2"":{""ObjectName"":""Slot2"",""ObjectClass"":""StringValue"",""ObjectValue"":""Flame Bullet""},""TailedBeastLevel"":{""ObjectName"":""TailedBeastLevel"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""CombatEXP"":{""ObjectName"":""CombatEXP"",""ObjectClass"":""IntValue"",""ObjectValue"":""45""},""Personality"":{""ObjectName"":""Personality"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""GripCount"":{""ObjectName"":""GripCount"",""ObjectClass"":""IntValue"",""ObjectValue"":""4""},""Marking"":{""ObjectName"":""Marking"",""ObjectClass"":""IntValue"",""ObjectValue"":""69""},""SkinColor"":{""ObjectName"":""SkinColor"",""ObjectClass"":""IntValue"",""ObjectValue"":""8""},""RP"":{""ObjectName"":""RP"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Slot="":{""ObjectName"":""Slot="",""ObjectClass"":""StringValue"",""ObjectValue"":""""},""Slot11"":{""ObjectName"":""Slot11"",""ObjectClass"":""StringValue"",""ObjectValue"":""Wind Blade""},""MSAbility1"":{""ObjectName"":""MSAbility1"",""ObjectClass"":""StringValue"",""ObjectValue"":""0""},""Key8"":{""ObjectName"":""Key8"",""ObjectClass"":""StringValue"",""ObjectValue"":""8""},""LINDAMINISTARTUP"":{""ObjectName"":""LINDAMINISTARTUP"",""ObjectClass"":""IntValue"",""ObjectValue"":""5""},""Slot4"":{""ObjectName"":""Slot4"",""ObjectClass"":""StringValue"",""ObjectValue"":""Paralysis""},""Slot9"":{""ObjectName"":""Slot9"",""ObjectClass"":""StringValue"",""ObjectValue"":""Fireball""},""Version"":{""ObjectName"":""Version"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""HairColorR"":{""ObjectName"":""HairColorR"",""ObjectClass"":""IntValue"",""ObjectValue"":""55""},""Key4"":{""ObjectName"":""Key4"",""ObjectClass"":""StringValue"",""ObjectValue"":""v""},""CurseMarkLevel"":{""ObjectName"":""CurseMarkLevel"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Key2"":{""ObjectName"":""Key2"",""ObjectClass"":""StringValue"",""ObjectValue"":""2""},""Genjutsu"":{""ObjectName"":""Genjutsu"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""SwordSave"":{""ObjectName"":""SwordSave"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""BijuuXP"":{""ObjectName"":""BijuuXP"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Key3"":{""ObjectName"":""Key3"",""ObjectClass"":""StringValue"",""ObjectValue"":""3""},""BonusSkillPoints"":{""ObjectName"":""BonusSkillPoints"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""CColorB"":{""ObjectName"":""CColorB"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""PosY"":{""ObjectName"":""PosY"",""ObjectClass"":""IntValue"",""ObjectValue"":""368""},""SPR"":{""ObjectName"":""SPR"",""ObjectClass"":""IntValue"",""ObjectValue"":""12""},""BijuuConvo"":{""ObjectName"":""BijuuConvo"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""jincooldown"":{""ObjectName"":""jincooldown"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Ken"":{""ObjectName"":""Ken"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Scar"":{""ObjectName"":""Scar"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Slot12"":{""ObjectName"":""Slot12"",""ObjectClass"":""StringValue"",""ObjectValue"":""Divine Wind""},""RecentTrainings"":{""ObjectName"":""RecentTrainings"",""ObjectClass"":""StringValue"",""ObjectValue"":""[\""Pushup Training\"",\""Kunai Training\"",\""Block Training\""]""},""EyeColorR"":{""ObjectName"":""EyeColorR"",""ObjectClass"":""IntValue"",""ObjectValue"":""180""},""HairColorG"":{""ObjectName"":""HairColorG"",""ObjectClass"":""IntValue"",""ObjectValue"":""49""},""RaidCD"":{""ObjectName"":""RaidCD"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Slot6"":{""ObjectName"":""Slot6"",""ObjectClass"":""StringValue"",""ObjectValue"":""Multi Wind Shuriken""},""HairColorB"":{""ObjectName"":""HairColorB"",""ObjectClass"":""IntValue"",""ObjectValue"":""49""},""Gender"":{""ObjectName"":""Gender"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""MSAbility2"":{""ObjectName"":""MSAbility2"",""ObjectClass"":""StringValue"",""ObjectValue"":""0""},""Kids"":{""ObjectName"":""Kids"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""SecondaryWep"":{""ObjectName"":""SecondaryWep"",""ObjectClass"":""StringValue"",""ObjectValue"":""Kunai""},""PosZ"":{""ObjectName"":""PosZ"",""ObjectClass"":""IntValue"",""ObjectValue"":""1409""},""UnlockedCloak"":{""ObjectName"":""UnlockedCloak"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""CloakTime"":{""ObjectName"":""CloakTime"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""BijuuRelation"":{""ObjectName"":""BijuuRelation"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Prestige"":{""ObjectName"":""Prestige"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""MaxAge"":{""ObjectName"":""MaxAge"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""TailedBeastMastered"":{""ObjectName"":""TailedBeastMastered"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Mangekyo"":{""ObjectName"":""Mangekyo"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""LastGripped"":{""ObjectName"":""LastGripped"",""ObjectClass"":""IntValue"",""ObjectValue"":""537037415""},""LastAge"":{""ObjectName"":""LastAge"",""ObjectClass"":""IntValue"",""ObjectValue"":""1698457280""},""Key11"":{""ObjectName"":""Key11"",""ObjectClass"":""StringValue"",""ObjectValue"":""-""},""AwakenCD"":{""ObjectName"":""AwakenCD"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""AgeLimit"":{""ObjectName"":""AgeLimit"",""ObjectClass"":""IntValue"",""ObjectValue"":""2400""},""SecondaryAmmo"":{""ObjectName"":""SecondaryAmmo"",""ObjectClass"":""IntValue"",""ObjectValue"":""15""},""Mastered"":{""ObjectName"":""Mastered"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""WeaveSpeed"":{""ObjectName"":""WeaveSpeed"",""ObjectClass"":""IntValue"",""ObjectValue"":""20""},""WipeLog"":{""ObjectName"":""WipeLog"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Slot10"":{""ObjectName"":""Slot10"",""ObjectClass"":""StringValue"",""ObjectValue"":""Leaf Whirlwind""},""Key9"":{""ObjectName"":""Key9"",""ObjectClass"":""StringValue"",""ObjectValue"":""9""},""Slot5"":{""ObjectName"":""Slot5"",""ObjectClass"":""StringValue"",""ObjectValue"":""Great Breakthrough""},""Slot7"":{""ObjectName"":""Slot7"",""ObjectClass"":""StringValue"",""ObjectValue"":""Wind Slash""},""RESTORE"":{""ObjectName"":""RESTORE"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""TailedBeast"":{""ObjectName"":""TailedBeast"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""GrandParentID"":{""ObjectName"":""GrandParentID"",""ObjectClass"":""StringValue"",""ObjectValue"":""""},""TimesRerolled"":{""ObjectName"":""TimesRerolled"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""CurseMarkEXP"":{""ObjectName"":""CurseMarkEXP"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""HBChoice"":{""ObjectName"":""HBChoice"",""ObjectClass"":""IntValue"",""ObjectValue"":""2""},""WeaponSave"":{""ObjectName"":""WeaponSave"",""ObjectClass"":""StringValue"",""ObjectValue"":""Tanto""},""PrimaryWep"":{""ObjectName"":""PrimaryWep"",""ObjectClass"":""StringValue"",""ObjectValue"":""Kunai""},""OriginalVillage"":{""ObjectName"":""OriginalVillage"",""ObjectClass"":""IntValue"",""ObjectValue"":""5""},""BijuuSealed"":{""ObjectName"":""BijuuSealed"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Name"":{""ObjectName"":""Name"",""ObjectClass"":""StringValue"",""ObjectValue"":""Vee""},""Key10"":{""ObjectName"":""Key10"",""ObjectClass"":""StringValue"",""ObjectValue"":""t""},""LastChakra"":{""ObjectName"":""LastChakra"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""EyeColorG"":{""ObjectName"":""EyeColorG"",""ObjectClass"":""IntValue"",""ObjectValue"":""40""},""DateRecord"":{""ObjectName"":""DateRecord"",""ObjectClass"":""IntValue"",""ObjectValue"":""2062""},""RU"":{""ObjectName"":""RU"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""KPos"":{""ObjectName"":""KPos"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""logcheck"":{""ObjectName"":""logcheck"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Slot-"":{""ObjectName"":""Slot-"",""ObjectClass"":""StringValue"",""ObjectValue"":""""},""PrimaryAmmo"":{""ObjectName"":""PrimaryAmmo"",""ObjectClass"":""IntValue"",""ObjectValue"":""15""},""FamilyID"":{""ObjectName"":""FamilyID"",""ObjectClass"":""StringValue"",""ObjectValue"":""Vee(10)2668871""},""ToggleAccessories"":{""ObjectName"":""ToggleAccessories"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""HideName"":{""ObjectName"":""HideName"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Slot3"":{""ObjectName"":""Slot3"",""ObjectClass"":""StringValue"",""ObjectValue"":""Vacuum Blast""},""HandsignTraining"":{""ObjectName"":""HandsignTraining"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""Blindness"":{""ObjectName"":""Blindness"",""ObjectClass"":""NumberValue"",""ObjectValue"":""0""},""Trauma"":{""ObjectName"":""Trauma"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""ChakraArmorRGB"":{""ObjectName"":""ChakraArmorRGB"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""BerserkTimes"":{""ObjectName"":""BerserkTimes"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""SpentSkillPoints"":{""ObjectName"":""SpentSkillPoints"",""ObjectClass"":""IntValue"",""ObjectValue"":""-17""},""PDLog"":{""ObjectName"":""PDLog"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Key6"":{""ObjectName"":""Key6"",""ObjectClass"":""StringValue"",""ObjectValue"":""6""},""Deaths"":{""ObjectName"":""Deaths"",""ObjectClass"":""IntValue"",""ObjectValue"":""7""},""EyeColorB"":{""ObjectName"":""EyeColorB"",""ObjectClass"":""IntValue"",""ObjectValue"":""105""},""Slot1"":{""ObjectName"":""Slot1"",""ObjectClass"":""StringValue"",""ObjectValue"":""Vacuum Bullets""},""LastStomach"":{""ObjectName"":""LastStomach"",""ObjectClass"":""IntValue"",""ObjectValue"":""88""},""Parentq"":{""ObjectName"":""Parentq"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""BDAYS"":{""ObjectName"":""BDAYS"",""ObjectClass"":""StringValue"",""ObjectValue"":""0""},""ItemSave"":{""ObjectName"":""ItemSave"",""ObjectClass"":""StringValue"",""ObjectValue"":""Flak""},""CanRank"":{""ObjectName"":""CanRank"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""Slot8"":{""ObjectName"":""Slot8"",""ObjectClass"":""StringValue"",""ObjectValue"":""Sheisty""},""Slot0"":{""ObjectName"":""Slot0"",""ObjectClass"":""StringValue"",""ObjectValue"":""""},""TrainingEXP"":{""ObjectName"":""TrainingEXP"",""ObjectClass"":""IntValue"",""ObjectValue"":""68""},""DefaultMouth"":{""ObjectName"":""DefaultMouth"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""ResetPos"":{""ObjectName"":""ResetPos"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""SkillPoints"":{""ObjectName"":""SkillPoints"",""ObjectClass"":""IntValue"",""ObjectValue"":""17""},""startnewlife"":{""ObjectName"":""startnewlife"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""MaxRank"":{""ObjectName"":""MaxRank"",""ObjectClass"":""IntValue"",""ObjectValue"":""24""},""LastKilledUser"":{""ObjectName"":""LastKilledUser"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""AnbuLog"":{""ObjectName"":""AnbuLog"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""MissionSuccess"":{""ObjectName"":""MissionSuccess"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""CurrentWep"":{""ObjectName"":""CurrentWep"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""SeenDeaths"":{""ObjectName"":""SeenDeaths"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Key5"":{""ObjectName"":""Key5"",""ObjectClass"":""StringValue"",""ObjectValue"":""5""},""IsExiled"":{""ObjectName"":""IsExiled"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""RyoRES"":{""ObjectName"":""RyoRES"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""LastHealth"":{""ObjectName"":""LastHealth"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""Ryo"":{""ObjectName"":""Ryo"",""ObjectClass"":""IntValue"",""ObjectValue"":""4012""},""CColorR"":{""ObjectName"":""CColorR"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Key7"":{""ObjectName"":""Key7"",""ObjectClass"":""StringValue"",""ObjectValue"":""7""},""Elo"":{""ObjectName"":""Elo"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""RightEye"":{""ObjectName"":""RightEye"",""ObjectClass"":""StringValue"",""ObjectValue"":""Omnigan"",""ObjectAttributes"":{""Progress"":""Stage 2""}},""Bank"":{""ObjectName"":""Bank"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Rank"":{""ObjectName"":""Rank"",""ObjectClass"":""IntValue"",""ObjectValue"":""16""},""PosX"":{""ObjectName"":""PosX"",""ObjectClass"":""IntValue"",""ObjectValue"":""2123""},""ParentID"":{""ObjectName"":""ParentID"",""ObjectClass"":""StringValue"",""ObjectValue"":""""},""TailedBeastEXP"":{""ObjectName"":""TailedBeastEXP"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""CColorG"":{""ObjectName"":""CColorG"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""MaxTails"":{""ObjectName"":""MaxTails"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Age"":{""ObjectName"":""Age"",""ObjectClass"":""IntValue"",""ObjectValue"":""9""},""berserkcheck"":{""ObjectName"":""berserkcheck"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Village"":{""ObjectName"":""Village"",""ObjectClass"":""IntValue"",""ObjectValue"":""5""},""bald"":{""ObjectName"":""bald"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""SecondaryCN"":{""ObjectName"":""SecondaryCN"",""ObjectClass"":""IntValue"",""ObjectValue"":""1""},""KillStreak"":{""ObjectName"":""KillStreak"",""ObjectClass"":""IntValue"",""ObjectValue"":""2""},""Key1"":{""ObjectName"":""Key1"",""ObjectClass"":""StringValue"",""ObjectValue"":""1""},""kek"":{""ObjectName"":""kek"",""ObjectClass"":""IntValue"",""ObjectValue"":""10""},""Influence"":{""ObjectName"":""Influence"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Title"":{""ObjectName"":""Title"",""ObjectClass"":""StringValue"",""ObjectValue"":""Genin""}},""Skilltree"":{""Fireball"":{""ObjectName"":""Fireball"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Pouch Upgrade 3"":{""ObjectName"":""Pouch Upgrade 3"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Flame Bullet"":{""ObjectName"":""Flame Bullet"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Breakthrough"":{""ObjectName"":""Breakthrough"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Omnigan"":{""ObjectName"":""Omnigan"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Multi Wind Shuriken"":{""ObjectName"":""Multi Wind Shuriken"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Great Breakthrough"":{""ObjectName"":""Great Breakthrough"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Dynamic Entry"":{""ObjectName"":""Dynamic Entry"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Divine Wind"":{""ObjectName"":""Divine Wind"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Substitution"":{""ObjectName"":""Substitution"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""1000 Years of Death"":{""ObjectName"":""1000 Years of Death"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Wind Slash"":{""ObjectName"":""Wind Slash"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Wind Blade"":{""ObjectName"":""Wind Blade"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Vacuum Blast"":{""ObjectName"":""Vacuum Blast"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Stage 1"":{""ObjectName"":""Stage 1"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Vacuum Bullets"":{""ObjectName"":""Vacuum Bullets"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Stage 2"":{""ObjectName"":""Stage 2"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Paralysis"":{""ObjectName"":""Paralysis"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Earth Pillar"":{""ObjectName"":""Earth Pillar"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""},""Leaf Whirlwind"":{""ObjectName"":""Leaf Whirlwind"",""ObjectClass"":""IntValue"",""ObjectValue"":""0""}},""Copy"":[]}" +syT6SGxE,C++ Solution to find non matched numbers,Mark2020H,C++,Friday 27th of October 2023 08:32:31 PM CDT,"/* Does same as java solution but in c++ + +Test file for you + +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 35 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 86 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 +85 85 85 85 85 85 85 85 85 85 + +*/ + + +#include +#include +#include +#include + +class FileToArray { +private: + std::vector> array; + +public: + FileToArray(const std::string& filePath) { + std::ifstream inputFile(filePath); + + if (!inputFile.is_open()) { + std::cerr << ""Error: Could not open file"" << std::endl; + return; + } + + array.resize(20, std::vector(10)); + + std::string line; + std::getline(inputFile, line); + + std::istringstream lineStream(line); + int value; + for (int i = 0; i < 20; i++) { + for (int j = 0; j < 10; j++) { + if (lineStream >> value) { + array[i][j] = value; + } else { + std::cerr << ""Error: Not enough data in the file."" << std::endl; + inputFile.close(); + return; + } + } + } + + inputFile.close(); + } + + void compareAndPrintMismatches(int selectedNumber) { + for (int row = 0; row < 20; row++) { + for (int col = 0; col < 10; col++) { + int number = array[row][col]; + if (number != selectedNumber) { + std::cout << ""Mismatch: Row "" << (row + 1) << "", Column "" << (col + 1) << "" - Value: "" << number << std::endl; + } + } + } + } + + int countElements() { + return 20 * 10; + } + + void exportToFile(const std::string& outputPath, const std::string& delimiter) { + std::ofstream outputFile(outputPath); + + if (!outputFile.is_open()) { + std::cerr << ""Error: Could not open output file"" << std::endl; + return; + } + + for (int row = 0; row < 20; row++) { + for (int col = 0; col < 10; col++) { + outputFile << array[row][col]; + if (col < 9) { + outputFile << delimiter; + } + } + outputFile << ""\n""; + } + + outputFile.close(); + } +}; + +int main() { + std::string inputFilePath = ""numbers.txt""; // Change this to the path of your input file + FileToArray fileToArray(inputFilePath); + + int selectedNumber = 85; // Change this to the number you want to compare + + fileToArray.compareAndPrintMismatches(selectedNumber); + + int elementCount = fileToArray.countElements(); + std::cout << ""Total number of elements in the array: "" << elementCount << std::endl; + + std::string outputFilePath = ""output.txt""; // Change this to the desired output file path + std::string delimiter = ""\t""; // Change this to the desired delimiter + fileToArray.exportToFile(outputFilePath, delimiter); + + return 0; +} +" +AZVjUukw,[SINGLEPLAYER] TrainSignalNetwork API,Fusion1227,Lua,Friday 27th of October 2023 08:25:57 PM CDT,"----/ TrainSignalNetwork class /--------------------------------------------- + + +local instances = {} + + +--/ constructors /-- + + +function new(id1, id2) + local self = {} + self.subNetwork1 = { + id = id1, + signalState = false, + } + self.subNetwork2 = { + id = id2, + signalState = false, + } + return self +end + + +--/ functions /-- + + +function findFromComputerId(id) + for _, tsn in pairs(instances) do + if tsn.subNetwork1.id == id then + return tsn, tsn.subNetwork1, tsn.subNetwork2 -- the entire system, the relevant sub-system, and the other sub-system + elseif tsn.subNetwork2.id == id then + return tsn, tsn.subNetwork2, tsn.subNetwork1 -- the entire system, the relevant sub-system, and the other sub-system + end + end +end + + +----/ linked computer ids /--------------------------------------------- + + +--[[ + Each array represents a train signal network, and the numbers are computer ids +]] + +local linkedIds = { + -- {120, 114}, + {3, 5}, + {8, 9}, +} + + +----/ make systems from linked ids /--------------------------------------------- + + +for _, list in pairs(linkedIds) do + local trainSignalNetwork = new(unpack(list)) + table.insert(instances, trainSignalNetwork) +end"