From 29a87f5bfaf01e7cf66e7b4b10e0b12af7eaa538 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 26 Oct 2023 18:05:41 +0000 Subject: [PATCH] Get recent pastes --- pastes/pastes_20231026180540.csv | 3250 ++++++++++++++++++++++++++++++ 1 file changed, 3250 insertions(+) create mode 100644 pastes/pastes_20231026180540.csv diff --git a/pastes/pastes_20231026180540.csv b/pastes/pastes_20231026180540.csv new file mode 100644 index 0000000..a89c9e5 --- /dev/null +++ b/pastes/pastes_20231026180540.csv @@ -0,0 +1,3250 @@ +id,title,username,language,date,content +SD8az550,FileBrowser,Alandil,Bash,Thursday 26th of October 2023 12:50:15 PM CDT," filebrowser: + image: filebrowser/filebrowser:latest + container_name: filebrowser + # ############### + labels: + # Le label ci-dessous permet à Watchtower de faire les mises à jour automatiquement + # Cela peut être supprimé si Watchtower n'est pas utilisé. + - com.centurylinklabs.watchtower.enable=true + # Le label ci-dessous permet à DeUnhealth de redémarrer automatiquement le conteneur + # Cela peut être supprimé si DeUnhealth n'est pas utilisé. + - deunhealth.restart.on.unhealthy=true + # ############### + networks: + default: + #Définition de l'adresse IP du conteneur à l'intérieur du bridge + ipv4_address: 172.10.0.4 + # ############### + ports: + #Définition des ports externe:interne utilisés par le conteneur + - 8080:80 + # ############### + environment: + - PUID=${PUID} + - PGID=${PGID} + - TZ=${TZ} + # ############### + volumes: + - ${RACINE_DATA_DOWNLOADS}:/srv + - ${RACINE_CONF_CONTENEURS}/filebrowser/database:/database/filebrowser.db + - ${RACINE_CONF_CONTENEURS}/filebrowser/config:/config/settings.json + # ############### + restart: unless-stopped + # ###############" +gFNvxdUf,Grid BFS/DFS,pranavsindura,C++,Thursday 26th of October 2023 12:44:02 PM CDT,"#include +#include +#include +#include +using namespace std; + +const vector dx = {0, 0, 1, -1}; +const vector dy = {1, -1, 0, 0}; +// const vector dx = {0, 0, 1, -1, 1, 1, -1, -1}; +// const vector dy = {1, -1, 0, 0, 1, -1, 1, -1}; + +bool is_in_bounds(int x, int y, int N, int M) { + return x >= 0 && x < N && y >= 0 && y < M; +} + +void dfs(int x, int y, int N, int M, vector> &grid, + vector> &vis) { + if (vis[x][y]) { + return; + } + vis[x][y] = true; + + for (int i = 0; i < 4; i++) { + int nx = x + dx[i], ny = y + dy[i]; + if (is_in_bounds(nx, ny, N, M) && !vis[nx][ny] && grid[nx][ny] == 1) { + dfs(nx, ny, N, M, grid, vis); + } + } +} + +void bfs(int u, int v, int N, int M, vector> &grid, + vector> &vis) { + queue> Q; + + Q.push(make_pair(u, v)); + while(!Q.empty()) { + pair nd = Q.front(); + Q.pop(); + int x = nd.first, y = nd.second; + vis[x][y] = true; + + for (int i = 0; i < 4; i++) { + int nx = x + dx[i], ny = y + dy[i]; + if (is_in_bounds(nx, ny, N, M) && !vis[nx][ny] && grid[nx][ny] == 1) { + vis[nx][ny] = true; // IMPORTANT FOR BFS + Q.push(make_pair(nx, ny)); + } + } + } +} + +int main() { + int N, M; // N x M grid of 0/1 + cin >> N >> M; + vector> grid(N, vector(M, 0)); + vector> vis(N, vector(M, false)); + for (int i = 0; i < N; i++) { + for (int j = 0; j < M; j++) { + cin >> grid[i][j]; + } + } + + int island_count = 0; + for (int i = 0; i < N; i++) { + for (int j = 0; j < M; j++) { + if (!vis[i][j] && grid[i][j] == 1) { + island_count++; + dfs(i, j, N, M, grid, vis); + } + } + } + + cout << ""Island Count: "" << island_count << endl; + + int island_count_bfs = 0; + for (int i = 0; i < N; i++) { + for (int j = 0; j < M; j++) { + if (!vis[i][j] && grid[i][j] == 1) { + island_count_bfs++; + bfs(i, j, N, M, grid, vis); + } + } + } + + cout << ""Island Count BFS: "" << island_count << endl; +} + +/* +4 9 +0 0 1 0 0 1 1 1 0 +0 1 1 1 1 0 1 1 0 +0 0 1 1 0 0 1 0 0 +0 0 0 0 0 0 0 0 0 + * */ +" +3tV8kTdX,Untitled,possebon,PHP,Thursday 26th of October 2023 12:41:23 PM CDT," +server { + listen 80 ; + listen [::]:80; + listen *:443 ssl; + server_name api.marcotextil.com.br; + client_max_body_size 300M; + + access_log /var/log/nginx/api.marcotextil.com.br/access.log main; + error_log /var/log/nginx/api.marcotextil.com.br/error.log; + + ssl on; + ssl_certificate /etc/letsencrypt/live/marcotextil.com.br/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/marcotextil.com.br/privkey.pem; # managed by Certbot + + #proxy_set_header Host $host; + # ssl_dhparam /etc/ssl/certs/dhparams.pem; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_session_timeout 1d; + ssl_session_cache shared:SSL:50m; + ssl_stapling on; + ssl_stapling_verify on; + ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; + + ssl_prefer_server_ciphers on; + + #add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Strict-Transport-Security max-age=15768000; + + + location / { + # set Origin to blank to avoid Chrome problems with CORS + proxy_set_header Origin """" ; + + # pass along some header variables with the public host name/port/and so on + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_read_timeout 5m; + proxy_send_timeout 5m; + client_max_body_size 20M; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection ""upgrade""; + proxy_pass http://10.171.161.101:8091; + + #proxy_redirect off; + + } + +} " +uGy5Pxwq,Untitled,parv28,C++,Thursday 26th of October 2023 12:24:52 PM CDT,"class HitCounter { +public: + queue q; + HitCounter() { + } + + void hit(int timestamp) { + q.push(timestamp); + } + + int getHits(int timestamp) { + int start_timestamp = timestamp - 300; + + // remove the expired hits + while(!q.empty() and q.front() <= start_timestamp) + q.pop(); + + return q.size(); + } +}" +8Zi0Kvmz,Songs,borovaneca,Java,Thursday 26th of October 2023 12:15:06 PM CDT,"package Fundamentals.OOP; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Scanner; + +public class Songs { + + static class Song { + + private String typeList; + private String name; + private String time; + + public Song(String typeList, String name, String time) { + this.typeList = typeList; + this.name = name; + this.time = time; + } + + public String getTypeList() { + return this.typeList; + } + + public String getName() { + return this.name; + } + + public String getTime() { + return this.time; + } + } + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + int n = Integer.parseInt(scanner.nextLine()); + + List listSongs = new ArrayList<>(); + for (int i = 1; i <= n; i++) { + String currentLine = scanner.nextLine(); + String[] inputSongArr = currentLine.split(""_""); + + Song song = new Song(inputSongArr[0], inputSongArr[1], inputSongArr[2]); + + listSongs.add(song); + } + String command = scanner.nextLine(); + if (command.equals(""all"")) { + for (Song item : listSongs) { + System.out.println(item.getName()); + } + } else { + for (Song item : listSongs) { + if (item.getTypeList().equals(command)) { + System.out.println(item.getName()); + } + } + } + } +}" +er2pg3k6,Untitled,parv28,C++,Thursday 26th of October 2023 11:39:24 AM CDT,"class Solution { +public: + string removeKdigits(string num, int k) { + stack st; + + int n = num.size(); + for(int i=0;i0 and !st.empty() and st.top() > curr_digit) { + // remove the top digit + st.pop(); + k--; + } + st.push(curr_digit); + } + + while(k>0 and !st.empty()) { + st.pop(); + k--; + } + + stack reverse_stack; + while(!st.empty()) { + reverse_stack.push(st.top()); + st.pop(); + } + + string ans = """"; + // remove leading zeroes + while(!reverse_stack.empty() and reverse_stack.top() == 0) reverse_stack.pop(); + while(!reverse_stack.empty()) { + ans += (reverse_stack.top() + '0'); + reverse_stack.pop(); + } + + return ans!="""" ? ans : ""0""; + } +}; +" +S8WYYTwF,rank-temp-price control,-Teme-,JSON,Thursday 26th of October 2023 11:38:28 AM CDT,"[ + { + ""id"": ""24fec2df3f2e5521"", + ""type"": ""switch"", + ""z"": ""41157ceb102bfa41"", + ""name"": ""price"", + ""property"": ""price"", + ""propertyType"": ""msg"", + ""rules"": [ + { + ""t"": ""lt"", + ""v"": ""0.05"", + ""vt"": ""num"" + }, + { + ""t"": ""gte"", + ""v"": ""0.05"", + ""vt"": ""num"" + } + ], + ""checkall"": ""true"", + ""repair"": false, + ""outputs"": 2, + ""x"": 490, + ""y"": 1840, + ""wires"": [ + [ + ""228fea079e17db6b"" + ], + [ + ""0a5af0b18b5f4106"" + ] + ] + }, + { + ""id"": ""4e7f024adbd82d95"", + ""type"": ""switch"", + ""z"": ""41157ceb102bfa41"", + ""name"": ""price"", + ""property"": ""price"", + ""propertyType"": ""msg"", + ""rules"": [ + { + ""t"": ""lt"", + ""v"": ""0.05"", + ""vt"": ""num"" + }, + { + ""t"": ""gte"", + ""v"": ""0.05"", + ""vt"": ""num"" + } + ], + ""checkall"": ""true"", + ""repair"": false, + ""outputs"": 2, + ""x"": 480, + ""y"": 1910, + ""wires"": [ + [ + ""228fea079e17db6b"" + ], + [ + ""6076893a651af80e"" + ] + ] + }, + { + ""id"": ""0a5af0b18b5f4106"", + ""type"": ""switch"", + ""z"": ""41157ceb102bfa41"", + ""name"": ""rank ≤5"", + ""property"": ""payload"", + ""propertyType"": ""msg"", + ""rules"": [ + { + ""t"": ""lte"", + ""v"": ""5"", + ""vt"": ""num"" + }, + { + ""t"": ""gt"", + ""v"": ""5"", + ""vt"": ""num"" + } + ], + ""checkall"": ""true"", + ""repair"": false, + ""outputs"": 2, + ""x"": 810, + ""y"": 1850, + ""wires"": [ + [ + ""5e089a5af6c166b0"" + ], + [ + ""536bfc400d70f984"" + ] + ] + }, + { + ""id"": ""8cf3a50ab10da9e5"", + ""type"": ""switch"", + ""z"": ""41157ceb102bfa41"", + ""name"": ""temp ≤6"", + ""property"": ""payload"", + ""propertyType"": ""msg"", + ""rules"": [ + { + ""t"": ""lt"", + ""v"": ""6"", + ""vt"": ""num"" + }, + { + ""t"": ""gte"", + ""v"": ""6"", + ""vt"": ""num"" + } + ], + ""checkall"": ""true"", + ""repair"": false, + ""outputs"": 2, + ""x"": 810, + ""y"": 1910, + ""wires"": [ + [ + ""5e089a5af6c166b0"" + ], + [ + ""536bfc400d70f984"" + ] + ] + }, + { + ""id"": ""aba4264a83cfcdcb"", + ""type"": ""server-state-changed"", + ""z"": ""41157ceb102bfa41"", + ""name"": ""rank"", + ""server"": ""ec62f897660298cb"", + ""version"": 5, + ""outputs"": 1, + ""exposeAsEntityConfig"": """", + ""entityId"": ""sensor.shf_rank_now"", + ""entityIdType"": ""exact"", + ""outputInitially"": false, + ""stateType"": ""num"", + ""ifState"": """", + ""ifStateType"": ""str"", + ""ifStateOperator"": ""is"", + ""outputOnlyOnStateChange"": true, + ""for"": ""0"", + ""forType"": ""num"", + ""forUnits"": ""minutes"", + ""ignorePrevStateNull"": false, + ""ignorePrevStateUnknown"": false, + ""ignorePrevStateUnavailable"": false, + ""ignoreCurrentStateUnknown"": false, + ""ignoreCurrentStateUnavailable"": false, + ""outputProperties"": [ + { + ""property"": ""payload"", + ""propertyType"": ""msg"", + ""value"": """", + ""valueType"": ""entityState"" + }, + { + ""property"": ""price"", + ""propertyType"": ""msg"", + ""value"": ""$number($entities(\""sensor.shf_electricity_price_now\"").state)"", + ""valueType"": ""jsonata"" + } + ], + ""x"": 290, + ""y"": 1840, + ""wires"": [ + [ + ""24fec2df3f2e5521"" + ] + ] + }, + { + ""id"": ""11ab9b4a0b11a25d"", + ""type"": ""server-state-changed"", + ""z"": ""41157ceb102bfa41"", + ""name"": ""Temperature"", + ""server"": ""ec62f897660298cb"", + ""version"": 5, + ""outputs"": 1, + ""exposeAsEntityConfig"": """", + ""entityId"": ""sensor.atc_6111_temperature"", + ""entityIdType"": ""exact"", + ""outputInitially"": false, + ""stateType"": ""num"", + ""ifState"": """", + ""ifStateType"": ""str"", + ""ifStateOperator"": ""is"", + ""outputOnlyOnStateChange"": true, + ""for"": ""0"", + ""forType"": ""num"", + ""forUnits"": ""minutes"", + ""ignorePrevStateNull"": false, + ""ignorePrevStateUnknown"": false, + ""ignorePrevStateUnavailable"": false, + ""ignoreCurrentStateUnknown"": false, + ""ignoreCurrentStateUnavailable"": false, + ""outputProperties"": [ + { + ""property"": ""payload"", + ""propertyType"": ""msg"", + ""value"": """", + ""valueType"": ""entityState"" + }, + { + ""property"": ""price"", + ""propertyType"": ""msg"", + ""value"": ""$number($entities(\""sensor.shf_electricity_price_now\"").state)"", + ""valueType"": ""jsonata"" + } + ], + ""x"": 310, + ""y"": 1910, + ""wires"": [ + [ + ""4e7f024adbd82d95"" + ] + ] + }, + { + ""id"": ""6076893a651af80e"", + ""type"": ""rbe"", + ""z"": ""41157ceb102bfa41"", + ""name"": ""0.5"", + ""func"": ""deadband"", + ""gap"": ""0.5"", + ""start"": """", + ""inout"": ""out"", + ""septopics"": true, + ""property"": ""payload"", + ""topi"": ""topic"", + ""x"": 660, + ""y"": 1910, + ""wires"": [ + [ + ""8cf3a50ab10da9e5"" + ] + ] + }, + { + ""id"": ""228fea079e17db6b"", + ""type"": ""junction"", + ""z"": ""41157ceb102bfa41"", + ""x"": 670, + ""y"": 1820, + ""wires"": [ + [ + ""5e089a5af6c166b0"" + ] + ] + }, + { + ""id"": ""5e089a5af6c166b0"", + ""type"": ""junction"", + ""z"": ""41157ceb102bfa41"", + ""x"": 970, + ""y"": 1820, + ""wires"": [ + [ + ""a45f72cf043b2140"" + ] + ] + }, + { + ""id"": ""536bfc400d70f984"", + ""type"": ""junction"", + ""z"": ""41157ceb102bfa41"", + ""x"": 970, + ""y"": 1910, + ""wires"": [ + [ + ""785e7b1f453bb836"" + ] + ] + }, + { + ""id"": ""ec62f897660298cb"", + ""type"": ""server"", + ""name"": ""Home Assistant"", + ""version"": 5, + ""addon"": false, + ""rejectUnauthorizedCerts"": true, + ""ha_boolean"": ""y|yes|true|on|home|open"", + ""connectionDelay"": true, + ""cacheJson"": true, + ""heartbeat"": false, + ""heartbeatInterval"": ""30"", + ""areaSelector"": ""friendlyName"", + ""deviceSelector"": ""friendlyName"", + ""entitySelector"": ""friendlyName"", + ""statusSeparator"": ""at: "", + ""statusYear"": ""hidden"", + ""statusMonth"": ""short"", + ""statusDay"": ""numeric"", + ""statusHourCycle"": ""h23"", + ""statusTimeFormat"": ""h:m"", + ""enableGlobalContextStore"": true + } +]" +7htF1LM6,Minimize the Heights II,jayati,C++,Thursday 26th of October 2023 11:38:01 AM CDT,"//{ Driver Code Starts +// Initial template for C++ + +#include +using namespace std; + +// } Driver Code Ends +// User function template for C++ + +class Solution { + public: + int getMinDiff(int arr[], int n, int k) { + if(n==1) + { + return 0; + } + sort(arr,arr+n); + int d=arr[n-1]-arr[0]; + int mi,mx; + for(int i=1;i> t; + while (t--) { + int n, k; + cin >> k; + cin >> n; + int arr[n]; + for (int i = 0; i < n; i++) { + cin >> arr[i]; + } + Solution ob; + auto ans = ob.getMinDiff(arr, n, k); + cout << ans << ""\n""; + } + return 0; +} +// } Driver Code Ends" +VxiM1HAY,Cpp,maxim_shlyahtin,C++,Thursday 26th of October 2023 10:56:23 AM CDT,"void Trap::event_trigger(){ + if(this->player.get_finesse() < 15) + this->player.set_health(this->player.get_health() - this->value); + else + std::cout << ""You dodged a trap\n""; +} + +void Teleport::event_trigger(){ + if(this->player.get_intelligence() >= 15) + this->field.set_new_loc(this->new_loc.first, this->new_loc.second); + else + this->field.set_new_loc(this->field.get_start().first, this->field.get_start().second); +} + +Manipulator.cpp +#ifndef Manipulator_cpp +#define Manipualtor_cpp +#include ""Manipulator.h"" +#include +#include + + +Manipulator::Manipulator(Player& player, Field& field): player(player), field(field){} + +void Manipulator::player_movement(MOVEMENT move){ + int new_x = this->coordinates.first; + int new_y = this->coordinates.second; + if(!this->check_coordinates(new_x, new_y)){ + std::cout << ""This cell is out of reach\n""; + return ; + } + switch (move) { + case MOVEMENT::RIGHT: + if(!this->field.get_cell(new_x, new_y).get_wall(RIGHT)) + new_x += 1; + else{ + std::cout << ""There is a wall\n""; + return ; + } + break; + case MOVEMENT::LEFT: + if(!this->field.get_cell(new_x, new_y).get_wall(LEFT)) + new_x -= 1; + else{ + std::cout << ""There is a wall\n""; + return ; + } + break; + case MOVEMENT::UP: + if(!this->field.get_cell(new_x, new_y).get_wall(UP)) + new_y += 1; + else{ + std::cout << ""There is a wall\n""; + return ; + } + break; + case MOVEMENT::DOWN: + if(!this->field.get_cell(new_x, new_y).get_wall(DOWN)) + new_y -= 1; + else{ + std::cout << ""There is a wall\n""; + return ; + } + break; + default: + break; + } + Cell cell = this->field.get_cell(new_x, new_y); + if(cell.get_pass()){ + this->field.get_cell(this->coordinates.first, this->coordinates.second).set_player_presence(false); + this->coordinates.first = new_x; + this->coordinates.second = new_y; + this->field.get_cell(new_x, new_y).set_player_presence(true); + if(this->field.get_cell(new_x, new_y).get_event() != nullptr){ + this->check_for_event(); + std::cout << ""Event was triggered\n""; + } + } else + std::cout << ""Path is blocked\n""; +} + + + +bool Manipulator::check_for_miss(int finesse, int check) { + if(this->player.get_finesse() < check) + return true; + return false; +} + +void Manipulator::take_damage(int damage, bool hit) { + if (hit) + this->player.set_health(this->player.get_health() - damage); +} + +void Manipulator::get_exp(int value) { + this->player.set_exp(this->player.get_exp() + value); +} + +void Manipulator::show_stats() { + std::cout << ""Name: "" << this->player.get_name() << ""\n""; + std::cout << ""Health: "" << this->player.get_health() << ""\n""; + std::cout << ""Strength: "" << this->player.get_strength() << ""\n""; + std::cout << ""Finesse: "" << this->player.get_finesse() << ""\n""; + std::cout << ""Intelligence: "" << this->player.get_intelligence() << ""\n""; + std::cout << ""Exp: "" << this->player.get_exp() << ""\n""; + std::cout << ""Money: "" << this->player.get_money() << ""\n""; + std::cout << ""Armor: "" << this->player.get_armor() << ""\n""; +} + +void Manipulator::show_coords(){ + std::cout << ""Your X coordinate: "" << this->coordinates.first << ""\n""; + std::cout << ""Your Y coordinate: "" << this->coordinates.second << ""\n""; +} + +bool Manipulator::check_coordinates(int x, int y){ + if(x < 0 || x > MAX_W || y < 0 || y > MAX_H) + return false; + else + return true; +} + +void Manipulator::update_coords(){ + int x = this->field.get_new_loc().first; + int y = this->field.get_new_loc().second; + if(x == -1){ return; } + int prev_x = this->coordinates.first; + int prev_y = this->coordinates.second; + this->field.get_cell(prev_x, prev_y).set_event(nullptr); + this->field.get_cell(prev_x, prev_y).set_player_presence(false); + if(this->check_coordinates(x, y)){ + this->coordinates.first = x; + this->coordinates.second = y; + this->field.get_cell(x, y).set_player_presence(true); + } + this->field.set_new_loc(-1, -1); +} + +void Manipulator::check_for_event(){ + int x = this->coordinates.first; + int y = this->coordinates.second; + Cell cell = this->field.get_cell(x, y); + cell.get_event()->event_trigger(); + this->update_coords(); +} + +void Manipulator::start_the_game() { + std::cout << ""It's the start of the game. Choose your name:\n""; + std::string name; + std::cin >> name; + this->player.set_name(name); + std::cout << ""Choose your character:\n""; + std::cout << ""Press 1 to choose Fighter\n""; + std::cout << ""Press 2 to choose Wizard\n""; + std::cout << ""Press 3 to choose Rogue\n""; + int input; + std::cin >> input; + switch (input) { + case(1): + this->player.set_character(SUBCLASS::FIGHTER); + break; + case(2): + this->player.set_character(SUBCLASS::WIZARD); + break; + case(3): + this->player.set_character(SUBCLASS::ROGUE); + break; + default: + std::cout << ""You decided to start as a commoner.\n""; + } + std::cout << ""Character's info: \n""; + this->show_stats(); + std::cout << ""\n""; + IFieldGen* ev = new FieldGenerator(30, 30); + this->field = ev->create_field(this->player); + FieldDisplay field_display(this->field); + this->update_coords(); + this->field.get_cell(1, 0).set_event(new Teleport(std::make_pair(9, 9), this->field, this->player)); + this->show_coords(); + field_display.show_field(); + this->player_movement(RIGHT); + this->show_stats(); + field_display.show_field(); +} + +#endif" +uvTMa3Vv,Untitled,dllbridge,C,Thursday 26th of October 2023 10:52:43 AM CDT," +#include + + +//////////////////////////////////////////////////// +struct TT // +{ + + int n; + + float fWeigt; + +}; + + + +TT d3, d2; + +int n; + +//////////////////////////////////////////////////// unsigned +int main() // +{ + + TT d4; + + + + d2.n = 11; + d2.fWeigt = 37.843; + + printf(""d2.fWeigt = %.3f\n"", d2.fWeigt); + + scanf(""%d"", &d2.n); +} + + + + + + + + + + + + + + + + + +/* +#include + + +//////////////////////////////////////////////////// +struct TT // +{ + + int n; + + float fWeigt; + +}d1, d2, arr[22]; + + + +TT d3; + + +//////////////////////////////////////////////////// unsigned +int main() // +{ + + TT d4; + + + + d2.n = 11; + d2.fWeigt = 37.843; + + printf(""d2.fWeigt = %.3f\n"", d2.fWeigt); + + scanf(""%d"", &d2.n); +} + + + + + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* + +#include + + +int n = 47, // hykjhkjh + *p = &n, // ooljklj + &a = n; + + + +//////////////////////////////////////////////////// unsigned +int main() // +{ + + + printf(""address n = %7d\n"", &n); + printf(""address n = %7d\n"", p); + printf(""address n = %7d\n"", &a); a -= 17; + printf("" n = %7d\n"", n); +} + + + + +*/ + + + + + + + + + + + + + + + +/* + +#include + + +int n = 97; +int *p = &n; +int &a = n; + +//////////////////////////////////////////////////// unsigned +int main() // +{ + + + printf(""address n = %7d\n"", &n); + printf(""address n = %7d\n"", p); + printf(""address n = %7d\n"", &a); a = a - 17; + printf("" n = %7d\n"", n); +} + + + +*/ + + + + + + + + + + + + + + + + + + + + + + + + + + +/* + +#include + + +int n = 55; + +//////////////////////////////////////////////////// unsigned +int main() // +{ + + int nRes = n%7; + + printf(""remainder = %d\n"", nRes); nRes = n/7; + printf(""Group = %d\n"", nRes); +} + + + + + +*/ + + + + + + + +" +d2n1w91F,AOC2016D21.py,bob_f,Python,Thursday 26th of October 2023 10:48:51 AM CDT,"from collections import deque + +def get_puzzle_input(a_file_name) -> list[str]: + with open(a_file_name) as INFILE: + return [line.rstrip() for line in INFILE if not line.startswith('#')] + +def swap_positions(a_encrypted: list[str], a_x:int, a_y:int): + a_encrypted[a_x], a_encrypted[a_y] = a_encrypted[a_y], a_encrypted[a_x] + +def swap_letter(a_encrypted: list[str], a_char_a:str, a_char_b:str): + char_a_pos = a_encrypted.index(a_char_a) + char_b_pos = a_encrypted.index(a_char_b) + swap_positions(a_encrypted, char_a_pos, char_b_pos) + +def rotate_steps(a_encrypted: list[str], a_steps:int, a_direction:str): + d_encrypted = deque(a_encrypted) + d_encrypted.rotate(int(a_steps) if a_direction == 'right' else -int(a_steps)) + a_encrypted.clear() + a_encrypted.extend(list(d_encrypted)) + +def reverse_chunk(a_encrypted: list[str], a_from:int, a_to:int): + reverse_chunk = a_encrypted[a_from:a_to + 1][::-1] + encrypted = a_encrypted[:a_from] + reverse_chunk + a_encrypted[a_to + 1:] + a_encrypted.clear() + a_encrypted.extend(encrypted) + pass + +def rotate_letter(a_encrypted: list[str], a_char:str): + char_index = a_encrypted.index(a_char) + steps_to_rotate = 1 + char_index + steps_to_rotate += 1 if char_index > 3 else 0 + rotate_steps(a_encrypted, steps_to_rotate, 'right') + +def move_char(a_encrypted: list[str], a_char_from:int, a_char_to:int): + copy = a_encrypted.copy() + char_to_move = copy[a_char_from] + del copy[a_char_from] + a_encrypted.clear() + + a = copy[:a_char_to] + b = [char_to_move] + c = copy[a_char_to:] + d = a + b + c + + a_encrypted.extend(copy[:a_char_to] + [char_to_move] + copy[a_char_to:]) + pass + +def solve(a_password: str, a_operations: list[str]) -> str: + encrypted = list(a_password) + + for operation in a_operations: + match operation.split(): + case ['swap', 'position', pos_x, *blah, pos_y]: + swap_positions(encrypted, int(pos_x), int(pos_y)) + case ['swap', 'letter', char_a, *blah, char_b]: + swap_letter(encrypted, char_a, char_b) + case ['rotate', direction, steps, ('steps' | 'step')]: + rotate_steps(encrypted, int(steps), direction) + case ['rotate', 'based', *blah, char]: + rotate_letter(encrypted, char) + case ['reverse', 'positions', rev_from, 'through', rev_to]: + reverse_chunk(encrypted, int(rev_from), int(rev_to)) + case ['move', 'position', pos_from, *blah, pos_to]: + move_char(encrypted, int(pos_from), int(pos_to)) + case _: + assert 1==0, 'Nah' + + return ''.join(encrypted) + +operations = get_puzzle_input('AOC2016\AOC2016D21.txt') +password = 'abcdefgh' + +print(f'{solve(password, operations)=}')" +T6Eza9Tg,Events,maxim_shlyahtin,C++,Thursday 26th of October 2023 10:32:17 AM CDT,"class Event{ +public: + virtual void event_trigger() = 0; + + virtual ~Event() = default; +}; + +class PlayerEvents: public Event{ +public: + PlayerEvents(int value, Player& player):value(value), player(player){} + + virtual void event_trigger() = 0; + + virtual ~PlayerEvents() = default; + +protected: + int value; + Player& player; +}; + +class Trap: public PlayerEvents{ +public: + Trap(int value, Player& player): PlayerEvents(value, player){} + + void event_trigger(); + + ~Trap() = default; +}; + +class FieldEvents: public Event{ +public: + FieldEvents(std::pair new_loc, Field& field, Player& player): new_loc(new_loc), field(field), player(player){} + + virtual void event_trigger() = 0; + + ~FieldEvents() = default; +protected: + std::pair new_loc; + Field& field; + Player& player; +}; + +class Teleport: public FieldEvents{ +public: + Teleport(std::pair new_loc, Field& field, Player& player): FieldEvents(new_loc, field, player){} + + void event_trigger(); + + ~Teleport() = default; +}; + +" +y1MVnJkM,[titon.neocities.org] Postcards,Titondesign,HTML,Thursday 26th of October 2023 10:18:10 AM CDT," +" +5J63X6qm,rpgjhkjhjkh,gruntfutuk,Python,Thursday 26th of October 2023 10:17:32 AM CDT," import random + from dataclasses import dataclass + + + @dataclass + class Response: + # detect player response + playerResponse: str + + + @dataclass + class Player: + # player stats + playerAC: int + playerMaxHealth: int + playerHealth: int + playerStrength: int + playerMagicka: int + playerCrit: int + playerPhysical: int + playerMagic: int + + def __str__(self): + return ( + f""\n##YOUR STATS##\n"" + f""AC: {self.playerAC}\n"" + f""Health: {self.playerHealth}/{myPlayer.playerMaxHealth}\n"" + f""Strength: {self.playerStrength}\n"" + f""magicka: {self.playerMagicka}\n"" + f""Crit Chance: {self.playerCrit}\n"" + f""Physical Resistance: {self.playerPhysical}\n"" + f""Magical Resistance: {self.playerMagic}\n"" + ) + + + @dataclass + class Ramsey: + # Ramsey Stats + ramseyAC: int + ramseyMaxHealth: int + ramseyHealth: int + ramseyStrength: int + ramseyMagicka: int + ramseyCrit: int + ramseyPhysical: int + ramseyMagic: int + ramseyClass: str + ramseyAbility: str + ramseyTick1: bool + ramseyTick2: bool + ramseyTick3: bool + ramseySanguineTreat: bool + + + @dataclass + class Room: + # rooms + room1: bool + room1pt2: bool + room2: bool + room3: bool + room4: bool + room4bite: bool + room4resist: bool + room5: bool + room5eat: bool + room5decline: bool + room6: bool + room7: bool + room8: bool + room9: bool + room10: bool + + + @dataclass + class Interactions: + room4int: int + firstFight: int + + + @dataclass + class Weapons: + punch: int + + + @dataclass + class Mechanics: + playerDamageToDeal: int + playerDamageDone: int + enemyDamageToDeal: int + enemyDamageDone: int + playerCritHit: int + enemyCritHit: int + playerRollToHit: int + enemyRollToHit: int + gameStarted: int + + + def statsDisplay(): + # display stats to player + print(myPlayer) + myResponse.playerResponse = input(""What would you like to do next: "") + print("""") + + + # rooms and interactions + def firstFight(): + print(""Welcome to your first fight in the Vampire Manor!"") + print("""") + print(""##HOW FIGHTS WORK##"") + print(""____________________"") + print(""Fights are one time and are unescapable, meaning once a fight has started, you must survive, so be careful!"") + print(""1. Your enemies stats will be shown so plan out your attack."") + print( + ""2. Enemies have the same stats as you. Class and Special Ability: The class can help determine what type of enemy you are fighting, the special ability gives you a warning on the enemy's strongest move. AC: AC or armour class is the number you have to get to be able to hit the enemy which will be determined by a random D20 roll. Health: Once the enemy's health is reduced to 0, you win! Strength and Magicka: Strength is the stat that determines how much physical damage they do, and vice versa for magicka, certain weapons use different damage stats, so it's adivsed to build your character around one of these stats. Physical Resistance and Magic Resistance: These are the stats that protect the enemy, or you, from certain attacks, typically one resistance will be much lower than the other, so abuse it! Critical Chance: The higher you or your enemy's crit chance is, the more likely they are to deal double damage in one turn."") + print(""3. Each round, you will have a choice of attacks to choose from, pick wisely, some have cooldowns."") + print(""Good Luck!"") + myInteraction.firstFight = True + + + def playRoom1(): + myRoom.room1 = True + print(""__________________________________________"") + print("""") + print( + ""You awake from a coarse slumber, sat wreathed in your own blood. Your face feels cold and lifeless, your skin, a pale blue, and an intense hunger rages deep inside you. You lay inside an enclosed space, the walls are laid with soft pillow that feels quite comfortable, apart from the warm stickiness of your own blood, you’re locked in a coffin. Despite the stark appearance of your body, you feel unparalleled strength, hopefully enough to break yourself out."") + print("""") + print(""Enter: attack"") + print("""") + myResponse.playerResponse = input() + + + def playRoom1pt2(): + myRoom.room1pt2 = True + print(""__________________________________________"") + print("""") + print( + ""As you look around, you see that the coffin you were in is placed in the centre of a small room. The building is cold and has an intricately designed gothic architecture, it’s dark, with small torches illuminating the surrounding area. There is only one exit, to your east."") + print("""") + print(""Exits: E"") + print("""") + print(""Enter 'E' or 'east'"") + print("""") + myResponse.playerResponse = input() + + + def playRoom2(): + myRoom.room2 = True + print(""__________________________________________"") + print("""") + print( + ""You enter into a large intersection, once again dimly lit with torches. To the south is an open archway that leads to another room. To the east is an open door and to the north is a large, locked gateway, adorned with silver and engraved with a symbol you don’t remember but it still feels familiar."") + print("""") + print(""Exits: E, S"") + print("""") + myResponse.playerResponse = input() + + + def playRoom4(): + myRoom.room4 = True + if myInteraction.room4int == False: + print(""__________________________________________"") + print("""") + print( + ""As you enter this room, a strong smell of flesh wafts over you, and as you look down, you see a lifeless human laying in a pool of their own blood. You feel an intense urge to fulfill your hunger, the body does seem fresh, however you know what you want to do is wrong."") + print("""") + print(""Enter: 'bite' or 'resist'"") + print("""") + myInteraction.room4int = True + myResponse.playerResponse = input() + elif myInteraction.room4int == True: + print(""__________________________________________"") + print("""") + print(""You're back in this room, the lifeless body lies here, staring blankly into space"") + print("""") + print(""Exits: E, W, N"") + print("""") + myResponse.playerResponse = input() + + + def playRoom4bite(): + myRoom.room4bite = True + print(""__________________________________________"") + print("""") + print(""You dig your fangs into the corpse, and as you do, you start to feel stronger and happier."") + print("""") + print(""Your corruption increases by 20%, but your health increases by 15"") + print("""") + print(""Exits: E, W, N"") + print("""") + myResponse.playerResponse = input() + + + def playRoom4resist(): + myRoom.room4resist = True + print(""__________________________________________"") + print("""") + print(""You resist the urge, the hunger still rages, but you feel slightly more at ease"") + print("""") + print(""Exits: E, W, N"") + print("""") + myResponse.playerResponse = input() + + + def playRoom5(): + myRoom.room5 = True + print(""__________________________________________"") + print("""") + print( + ""As you enter this room a soft and sweet smell wafts over you. As you look closer, you see a table laid with sanguine cloth and a vase of roses sits in the middle. The table holds an assortment of deserts, some puddings, some cake, some pastries, but all of them seem to have a hint of red."") + print("""") + print(""You see a woman, dressed in chef’s clothes walk towards you."") + print("""") + print( + ""Lady Ramsey: 'Oh hello newborn, looking for a meal?' She peers closer, her eyes giving an uncanny valley feel. 'They're fresh.'"") + print("""") + print(""Enter: 'eat' or 'decline'"") + print("""") + myResponse.playerResponse = input() + + + def playRoom5eat(): + myRoom.room5eat = True + print(""__________________________________________"") + print("""") + print(""Lady Ramsey: 'Isn’t it tasty? Made fresh with human blood.'"") + print("""") + print(""Your corruption increases by 15%, but your max health increases by 10"") + print("""") + print(""Exits: E"") + print("""") + myResponse.playerResponse = input() + + + def playerDamage(): + attack = input(""What attack would you like to do?: "") + if attack == ""punch"": + myMechanics.playerDamageToDeal = myWeapons.punch + + + def ramseyDamage(): + ramseyCritChance = random.randint(1, 100) + if myRamsey.ramseyTick1 == False and myRamsey.ramseyTick2 == False and myRamsey.ramseyTick3 == False: + myRamsey.ramseySanguineTreat = False + myRamsey.ramseyTick1 = True + + myMechanics.enemyDamageToDeal = myRamsey.ramseyMagicka + if ramseyCritChance > myRamsey.ramseyCrit: + myMechanics.enemyDamageToDeal / 2 + + elif myRamsey.ramseyTick1 and myRamsey.ramseyTick2 == False and myRamsey.ramseyTick3 == False: + myRamsey.ramseyTick2 = True + + myMechanics.enemyDamageToDeal = myRamsey.ramseyMagicka + if ramseyCritChance > myRamsey.ramseyCrit: + myMechanics.enemyDamageToDeal / 2 + + elif myRamsey.ramseyTick1 and myRamsey.ramseyTick2 and myRamsey.ramseyTick3 == False: + myRamsey.ramseyTick3 = True + + myMechanics.enemyDamageToDeal = myRamsey.ramseyMagicka + if ramseyCritChance > myRamsey.ramseyCrit: + myMechanics.enemyDamageToDeal / 2 + + elif myRamsey.ramseyTick1 and myRamsey.ramseyTick2 and myRamsey.ramseyTick3: + myRamsey.ramseySanguineTreat = True + myRamsey.ramseyTick1 = False + myRamsey.ramseyTick2 = False + myRamsey.ramseyTick3 = False + + + def ramseyHealthCheck(): + if myRamsey.ramseyHealth > myRamsey.ramseyMaxHealth: + myRamsey.ramseyHealth = myRamsey.ramseyMaxHealth + + + def ramseyFight(): + while myPlayer.playerHealth > 0 and myRamsey.ramseyHealth > 0: + playerDamage() + ramseyDamage() + myMechanics.playerRollToHit = random.randint(1, 20) + if myMechanics.playerRollToHit > myRamsey.ramseyAC: + myRamsey.ramseyHealth = myRamsey.ramseyHealth - myMechanics.playerDamageToDeal + print(""You dealt Ramsey"", myMechanics.playerDamageToDeal, ""damage!"") + elif myMechanics.playerRollToHit == 1: + myPlayer.playerHealth = myPlayer.playerHealth - myMechanics.playerDamageToDeal / 2 + print(""Critical miss! You dealt yourself"", myMechanics.playerDamageToDeal / 2, ""damage!"") + elif myMechanics.playerRollToHit == 20: + myRamsey.ramseyHealth = myRamsey.ramseyHealth - myMechanics.playerDamageToDeal * 1.5 + print(""Critical hit! You dealt Ramsey"", myMechanics.playerDamageToDeal * 1.5) + print("""") + if myRamsey.ramseySanguineTreat == True: + ramseyHeal = myPlayer.playerHealth * 0.2 + myPlayer.playerHealth = myPlayer.playerHealth - myPlayer.playerHealth * 0.2 + myRamsey.ramseyHealth = myRamsey.ramseyHealth + ramseyHeal + ramseyHealthCheck() + elif myRamsey.ramseySanguineTreat == False: + myMechanics.enemyRollToHit = random.randint(1, 20) + if myMechanics.enemyRollToHit > myPlayer.playerAC: + myPlayer.playerHealth = myPlayer.playerHealth - myMechanics.enemyDamageToDeal + print(""Ramsey dealt you"", myMechanics.enemyDamageToDeal, ""damage!"") + elif myMechanics.enemyRollToHit == 1: + myRamsey.ramseyHealth = myRamsey.ramseyHealth - myMechanics.enemyDamageToDeal / 2 + print(""Critical miss! Ramsey dealt herself"", myMechanics.enemyDamageToDeal / 2, ""damage!"") + elif myMechanics.enemyRollToHit == 20: + myPlayer.playerHealth = myPlayer.playerHealth - myMechanics.enemyDamageToDeal * 1.5 + print(""Critical hit! Ramsey dealt you"", myMechanics.enemyDamageToDeal * 1.5, ""damage!"") + print(""Well done! You have defeated Ramsey the Cook!"") + + + def playRoom5decline(): + myRoom.room5decline = True + print(""__________________________________________"") + print("""") + print(""Lady Ramsey: 'Wrong choice'"") + print("""") + if myInteraction.firstFight == False: + firstFight() + ramseyFight() + elif myInteraction.firstFight == True: + print(""Good Luck!"") + ramseyFight() + + + myResponse = Response(playerResponse="""") + myResponse.playerResponse = input( + ""Welcome brave adventurer, to get started enter 'start' but if you wish to familiarize yourself with your character, enter 'stats': "") + myPlayer = Player(playerAC=14, playerMaxHealth=100, playerHealth=100, playerStrength=30, playerMagicka=30, + playerCrit=15, playerPhysical=20, playerMagic=5) + myRamsey = Ramsey(ramseyAC=12, ramseyMaxHealth=90, ramseyHealth=90, ramseyStrength=10, ramseyMagicka=40, ramseyCrit=10, + ramseyPhysical=5, ramseyMagic=15, ramseyClass=""Mage - Cook"", + ramseyAbility=""Special Ability: Sanguine Treat – Lady Ramsey throws one of her special treats at her enemy, it deals damage equal to 10% of the enemy's total health and Lady Ramsey heals that much."", + ramseyTick1=False, ramseyTick2=False, ramseyTick3=False, ramseySanguineTreat=False) + myRoom = Room(room1=False, room1pt2=False, room2=False, room3=False, room4=False, room4bite=False, room4resist=False, + room5=False, room5eat=False, room5decline=False, room6=False, room7=False, room8=False, room9=False, + room10=False) + myInteraction = Interactions(room4int=False, firstFight=False) + myWeapons = Weapons(punch=1) + # weapon calculations + while myPlayer.playerHealth > 0: + myWeapons.punch = myWeapons.punch * myPlayer.playerStrength / 2 + myMechanics = Mechanics(playerDamageToDeal=0, playerDamageDone=False, enemyDamageToDeal=0, enemyDamageDone=False, + playerCritHit=False, enemyCritHit=False, playerRollToHit=0, enemyRollToHit=0, gameStarted=False) + + while myPlayer.playerHealth > 0: + if myResponse.playerResponse == ""stats"": + myResponse.playerResponse = """" + statsDisplay() + elif myResponse.playerResponse == ""start"" and gameStarted == False: + myResponse.playerResponse = """" + gameStarted = True + playRoom1() + elif myResponse.playerResponse == ""attack"" and myRoom.room1 == True: + myResponse.playerResponse = """" + print("""") + myRoom.room1 = False + playRoom1pt2() + elif ((myResponse.playerResponse == ""E"" or myResponse.playerResponse == ""east"") and myRoom.room1pt2 == True) or ( + (myResponse.playerResponse == ""N"" or myResponse.playerResponse == ""north"") and myRoom.room4 == True): + myResponse.playerResponse = """" + print("""") + myRoom.room1pt2 = False + myRoom.room4 = False + playRoom2() + elif ((myResponse.playerResponse == ""S"" or myResponse.playerResponse == ""south"") and myRoom.room2 == True) or (( + myResponse.playerResponse == ""E"" or myResponse.playerResponse == ""east"") and myRoom.room5 == True or myRoom.room5eat == True or myRoom.room5decline == True): + myResponse.playerResponse = """" + print("""") + myRoom.room2 = False + myRoom.room5 = False + playRoom4() + elif myResponse.playerResponse == ""bite"" and myRoom.room4 == True: + myResponse.playerResponse = """" + print("""") + myRoom.room4 = False + playRoom4bite() + elif myResponse.playerResponse == ""resist"" and myRoom.room4 == True: + myResponse.playerResponse = """" + print("""") + myRoom.room4 = False + playRoom4resist() + elif ((myResponse.playerResponse == ""W"" or myResponse.playerResponse == ""west"") and ( + myRoom.room4 == True or myRoom.room4bite == True or myRoom.room4resist == True)): + myResponse.playerResponse = """" + print("""") + myRoom.room4 = False + myRoom.room4bite = False + myRoom.room4resist = False + playRoom5() + elif myResponse.playerResponse == ""eat"" and myRoom.room5 == True: + myResponse.playerResponse = """" + print("""") + myRoom.room5 = False + playRoom5eat() + elif myResponse.playerResponse == ""decline"" and myRoom.room5 == True: + myResponse.playerResponse = """" + print("""") + myRoom.room5 = False + playRoom5decline() +" +knpQSqLb,wine uninstaller --list,iconoclasthero,Bash,Thursday 26th of October 2023 10:10:10 AM CDT,"$ wine uninstaller --list +0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 +0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 +0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 +0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 +0098:fixme:wineusb:query_id Unhandled ID query type 0x5. +0104:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0104:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0108:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0108:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0110:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0110:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0114:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0114:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +011c:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +010c:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +011c:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +010c:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0120:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0120:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0128:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0128:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0118:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0118:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0124:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0124:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +012c:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +012c:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0130:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0130:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0138:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0138:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +013c:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +013c:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0134:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0134:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0140:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0144:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0144:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0140:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0148:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0148:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +014c:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +014c:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0150:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0150:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0154:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0154:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0158:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +0158:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +015c:fixme:ntoskrnl:KeQueryPriorityThread (0000000000000000): stub. +015c:fixme:ntoskrnl:KeSetPriorityThread (0000000000000000 16) +0170:fixme:advapi:RegisterEventSourceW ((null),L""WinArchiver Service""): stub +0170:fixme:advapi:ReportEventW (CAFE4242,0x0004,0x0000,0x00000069,00000000,0x0000,0x00000000,01FDFE98,00000000): stub +0178:fixme:heap:RtlSetHeapInformation handle 0000000001850000, info_class 0, info 000000000021F6B0, size 4 stub! +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F510 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F510 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F510 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F510 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F510 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F510 +0178:fixme:ntdll:EtwRegisterTraceGuidsW register trace class {04c6e16d-b99f-4a3a-9b3e-b8325bbc781e} +0178:fixme:svchost:AddServiceElem library L""C:\\windows\\system32\\WsmSvc.dll"" expects undocumented SvchostPushServiceGlobals function to be called +003c:fixme:service:scmdatabase_autostart_services Auto-start service L""WinRM"" failed to start: 1053 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F740 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F740 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F740 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F740 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F6C0 +0178:fixme:ntdll:EtwLogTraceEvent 0 000000000021F740 +7-Zip|||7-Zip 19.00 (x64) +{2DBE349F-FF05-42FE-81A9-2B3A0EC22BBE}|||Common Desktop Agent +Dell B1160w Mono Laser Printer|||Dell B1160w Mono Laser Printer +{1F232A3A-5C62-42BA-9ADC-A097DF7A85D5}|||Dell OS Recovery Tool +eMule|||eMule +inAudible 1.197|||inAudible +Microsoft .NET Framework 4 Client Profile|||Microsoft .NET Framework 4 Client Profile +{9BE518E6-ECC6-35A9-88E4-87755C07200F}|||Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161 +{FF27E73D-C30A-4F32-B2D7-22069F01DDB9}|||OverDrive for Windows +{05321FDB-BBA2-497D-99C6-C440E184C043}|||PowerShell 7-x64 +WinArchiver|||WinArchiver +KB968930|||Windows Management Framework Core +{92E6986F-9DE7-4D94-A27F-3601B260C881}|||Wine Gecko (32-bit) +{45A1C80C-3E51-432F-AF64-27BA6BFCF4C1}|||Wine Gecko (32-bit) +{83F3DB41-CE50-411F-B218-93FD46CE0AB0}|||Wine Gecko (64-bit) +{8F52B55B-5164-4458-B4F6-B6A6EA67DF65}|||Wine Gecko (64-bit) +" +9aqthxqz,winetricks dotnet20,iconoclasthero,Bash,Thursday 26th of October 2023 10:07:20 AM CDT,"$ cat x.log +$ winetricks dotnet20 +od: wine: No such file or directory +------------------------------------------------------ +warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug. +------------------------------------------------------ +Using winetricks 20230212-next - sha256sum: fe0550e0d843214f87dcb0f4aa591be0046fa93db7b8330217dd926258e628fc with wine-8.0.2 and WINEARCH=win64 +Executing w_do_call dotnet20 +od: wine: No such file or directory +------------------------------------------------------ +warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug. +------------------------------------------------------ +Executing load_dotnet20 +Executing w_do_call remove_mono internal +od: wine: No such file or directory +------------------------------------------------------ +warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug. +------------------------------------------------------ +Executing load_remove_mono internal +reg: Unable to find the specified registry key +reg: Unable to find the specified registry key +Executing rm -f /home/$USER/.wine/dosdevices/c:/windows/system32/mscoree.dll +Executing rm -f /home/$USER/.wine/dosdevices/c:/windows/syswow64/mscoree.dll +Executing w_do_call fontfix +od: wine: No such file or directory +------------------------------------------------------ +warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug. +------------------------------------------------------ +Executing load_fontfix +Executing mkdir -p /home/$USER/.cache/winetricks/dotnet20 +mkdir: cannot create directory ‘/home/$USER/.cache’: File exists +------------------------------------------------------ +warning: Note: command mkdir -p /home/$USER/.cache/winetricks/dotnet20 returned status 1. Aborting. +------------------------------------------------------ +edt 11.06 am pwd: /dev/shm/cache +" +6c8zVfkW,Untitled,ShiinaBR,C#,Thursday 26th of October 2023 10:01:46 AM CDT,"[ +""0001859EA7AF69EF10A6F7921DD4DD9A:3M92MlWo2b1V04mxizc7cHB6TDP/UInspfWR4yT7K3g="" +]" +6keNBi0j,C18SWUARTv0.001,wpyke,C,Thursday 26th of October 2023 09:58:47 AM CDT,"#include <18F4620.h> +#include + +void main(void) +{ + char data; + + OpenUART( USART_TX_INT_OFF & // Transmit interrupt OFF + USART_RX_INT_OFF & // Receive interrupt OFF + USART_ASYNCH_MODE & // Asynchronous Mode + USART_EIGHT_BIT & // 8-bit transmit/receive + USART_CONT_RX & // Continuous reception + USART_BRGH_HIGH, // High baud rate + 25 ); // configure software UART + + while(1) + { + data = ReadUART(); //read a byte + WriteUART( data ); //bounce it back + } +} +" +vXPAPCn7,Untitled,Danielo_17,Java,Thursday 26th of October 2023 09:54:16 AM CDT,"package nauka.zadania; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Scanner; +import java.util.Set; + +public class Wisielec { + private static final ArrayList words = new ArrayList<>(); //lista do przechowywania dostępnych haseł. + + static { + words.add(""MADRYT""); + words.add(""BARCELONA""); + words.add(""MILAN""); + words.add(""RZYM""); + words.add(""PARYŻ""); + + } + + private static final String[] gallows = { + "" _______\n"" + + "" | |\n"" + + "" |\n"" + + "" |\n"" + + "" |\n"" + + "" |\n"" + + ""_|_"", + + "" _______\n"" + + "" | |\n"" + + "" | O\n"" + + "" |\n"" + + "" |\n"" + + "" |\n"" + + ""_|_"", + + "" _______\n"" + + "" | |\n"" + + "" | O\n"" + + "" | |\n"" + + "" |\n"" + + "" |\n"" + + ""_|_"", + + "" _______\n"" + + "" | |\n"" + + "" | O\n"" + + "" | /|\n"" + + "" |\n"" + + "" |\n"" + + ""_|_"", + + "" _______\n"" + + "" | |\n"" + + "" | O\n"" + + "" | /|\\\n"" + + "" |\n"" + + "" |\n"" + + ""_|_"", + + "" _______\n"" + + "" | |\n"" + + "" | O\n"" + + "" | /|\\\n"" + + "" | /\n"" + + "" |\n"" + + ""_|_"", + + "" _______\n"" + + "" | |\n"" + + "" | O\n"" + + "" | /|\\\n"" + + "" | / \\\n"" + + "" |\n"" + + ""_|_"" + }; + + private static final int maxAttempts = 7; // stała określająca maksymalną liczbę prób + + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + Set usedLetters = new HashSet<>(); + + System.out.println(""Czołem! Zapraszam do gry w Wisielca.""); + + System.out.println(""Wybierz liczbę od 1 do "" + words.size() + "", aby wylosować hasło do odgadnięcia: ""); + + int choose = scanner.nextInt(); // odczytanie liczby wpisanej przez użytkownika. + + while (choose < 1 || choose > words.size()) { //sprawdzenie czy wybrana liczba mieści się w zdefiniowanym zakresie. + System.out.println(""Nieprawidłowy wybór, prosiłem CIe o wybranie liczby z zakresu 1 - "" + words.size() + + ""! Wybierz ponownie liczbę: ""); + + choose = scanner.nextInt(); // ponowne odczytanie liczby. + } + + String password = words.get(choose - 1); + + StringBuilder hiddenPassword = new StringBuilder(); + for (int i = 0; i < password.length(); i++) { + hiddenPassword.append(""_""); //Zastąpienie litery znakami ""_"". + } + + int faults = 0; //inicjacja licznika błędów. + + while (faults < maxAttempts && hiddenPassword.indexOf(""_"") != -1) { + System.out.println(""Aktualny stan: "" + hiddenPassword); + + System.out.println(""Podaj literę: ""); + + char letter; + try { + letter = scanner.next().toUpperCase().charAt(0); + if (!Character.isLetter(letter)) { + System.out.println(""Wprowadzono znak zamiast liter! Spróbój ponownie.""); + continue; + } + } catch (Exception e) { + System.out.println(""Nieprawdiłowe dane! Wprowadź literę.""); + continue; + } + + if (usedLetters.contains(letter)) { + System.out.println(""Ta litera została już użyta!""); + continue; + } + usedLetters.add(letter); + if (password.indexOf(letter) == -1) { + + faults++; + + printGallows(faults); + + } else { + for (int i = 0; i < password.length(); i++) { + if (password.charAt(i) == letter) { + hiddenPassword.setCharAt(i, letter); + } + + } + } + + } + if (faults == maxAttempts) { + System.out.println(""Przegrałeś, wykorzystałeś wszystkie próby. Prawidłowe hasło to: "" + password); + } else { + System.out.println(""Brawo! Odgadłeś hasło: "" + password); + } + } + + private static void printGallows(int faults) { + System.out.println(gallows[faults - 1]); + + } +} + + + +" +ra3ZENhU,Turtle Quarry,hiphopcanine,Lua,Thursday 26th of October 2023 09:52:27 AM CDT,"--[[ Turtle Quarry Program ]]-- + +--[[ Smart name compare: +Compare the name of 2 items including name variations +for ores, cobbled versions, etc... +]]-- +function smartNameCompare(name, cur_name) + bits_to_delete = {""cobbled_"", ""cobble"", ""raw_"", ""_ore""} + -- delete all the extra bits from them name + for i, del_name in ipairs(bits_to_delete) do + name = string.gsub(name, del_name, """") + cur_name = string.gsub(cur_name, del_name, """") + end + if name == cur_name then + return true + else + return false + end +end + +function smart_mine() + -- get the data of the block being looked at + success, data = turtle.inspect() + if success then + -- loop through the inventory and check if the current item exists in there + for i = 1,16,1 + -- dig if the current inventory slot is empty + if not turtle.getItemDetail(i) == nil then + turtle.dig() + else + -- check for + cur_name = turtle.getItemDetail(i)[""name""] + if ((turtle.getItemCount(i) < 64) and smartNameCompare(data.name, cur_name) then + turtle.dig() + end + end + end + end +end" +auZbF4Gc,Project 220,KKK_Smart,Python,Thursday 26th of October 2023 09:19:30 AM CDT,"import glob +import os +import sys +import time +import random +import math +import carla + +try: + sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % ( + sys.version_info.major, + sys.version_info.minor, + 'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0]) +except IndexError: + pass + +import carla + +actor_list = [] + + +def generate_lidar_blueprint(blueprint_library): + lidar_blueprint = blueprint_library.find('sensor.lidar.ray_cast_semantic') + lidar_blueprint.set_attribute('channels', str(64)) + lidar_blueprint.set_attribute('points_per_second', str(56000)) + lidar_blueprint.set_attribute('rotation_frequency', str(40)) + lidar_blueprint.set_attribute('range', str(100)) + return lidar_blueprint + + +object_id = {""None"": 0, + ""Buildings"": 1, + ""Fences"": 2, + ""Other"": 3, + ""Pedestrians"": 4, + ""Poles"": 5, + ""RoadLines"": 6, + ""Roads"": 7, + ""Sidewalks"": 8, + ""Vegetation"": 9, + ""Vehicles"": 10, + ""Wall"": 11, + ""TrafficsSigns"": 12, + ""Sky"": 13, + ""Ground"": 14, + ""Bridge"": 15, + ""RailTrack"": 16, + ""GuardRail"": 17, + ""TrafficLight"": 18, + ""Static"": 19, + ""Dynamic"": 20, + ""Water"": 21, + ""Terrain"": 22 + } +key_list = list(object_id.keys()) +val_list = list(object_id.values()) + + +def semantic_lidar_data1(point_cloud_data): + distance_name_data = {} + for detection in point_cloud_data: + position = val_list.index(detection.object_tag) + distance = math.sqrt((detection.point.x ** 2) + (detection.point.y ** 2) + (detection.point.z ** 2)) + distance_name_data[""distance""] = distance + distance_name_data[""name""] = key_list[position] + if distance_name_data[""name""] == 'Pedestrians' and distance_name_data[""distance""] > 1 and distance_name_data[""distance""] < 8: + dropped_vehicle.apply_control(carla.VehicleControl(hand_brake=True)) + dropped_vehicle.set_light_state(carla.VehicleLightState(carla.VehicleLightState.Brake | + carla.VehicleLightState.LeftBlinker | carla.VehicleLightState.LowBeam)) + + dropped_vehicle.apply_control(carla.VehicleControl(throttle=0.3, steer=0.2)) + time.sleep(1) + dropped_vehicle.apply_control(carla.VehicleControl(throttle=0.3, steer=-0.2)) + time.sleep(1) + car_control() + else: + continue + + + +def car_control(): + dropped_vehicle.apply_control(carla.VehicleControl(throttle=0.51)) + + time.sleep(20) + +police_car_blueprint = get_blueprint_of_world.filter('dodge_charger.police')[0] +police_car_spawn_point = map.get_spawn_points()[15] + +try: + client = carla.Client('127.0.0.1', 2000) + client.set_timeout(10.0) + world = client.get_world() + map = world.get_map() + get_blueprint_of_world = world.get_blueprint_library() + car_model = get_blueprint_of_world.filter('model3')[0] + spawn_point = (world.get_map().get_spawn_points()[20]) + dropped_vehicle = world.spawn_actor(car_model, spawn_point) + + police_car_blueprint = get_blueprint_of_world.filter('dodge_charger.police')[0] + police_car_spawn_point = map.get_spawn_points()[15] + actor_list.append(police_car) + police_car.apply_control(carla.VehicleControl(throttle=0.5) +if distance_name_data[""name""] == ""Vehicles"" and 3 < distance_name_data['distance'] < 8: + police_car.apply_control(carla.VehicleControl(throttle=0.5, steer=0.2)) + + + simulator_camera_location_rotation = carla.Transform(police_car_spawn_point.location, police_car_spawn_point.rotation) + simulator_camera_location_rotation.location += spawn_point.get_forward_vector() * 30 + simulator_camera_location_rotation.rotation.yaw += 180 + simulator_camera_view = world.get_spectator() + simulator_camera_view.set_transform(simulator_camera_location_rotation) + actor_list.append(dropped_vehicle) + actor_list.append(police_car) + + + lidar_sensor = generate_lidar_blueprint(get_blueprint_of_world) + sensor_lidar_spawn_point = carla.Transform(carla.Location(x=0, y=0, z=2.0), + carla.Rotation(pitch=0.000000, yaw=90.0, roll=0.000000)) + sensor = world.spawn_actor(lidar_sensor, sensor_lidar_spawn_point, attach_to=dropped_vehicle) + + sensor.listen(lambda data2: semantic_lidar_data1(data2)) + car_control() + actor_list.append(sensor) + + time.sleep(1000) + +except Exception as e: + print(f""An error occurred: {str(e)}"") + +finally: + print('destroying actors') + for actor in actor_list: + actor.destroy() + print('done.')" +nF0nw0a3,ExU Screen Ctrl,osmarks,Lua,Thursday 26th of October 2023 08:11:47 AM CDT,"local ax, bx = -45, -43 +local ay, by = 66, 67 +local az, bz = -96, -96 + +local function seturl(url) + for x = ax, bx do + for y = ay, by do + for z = az, bz do + commands.blockdata(x, y, z, textutils.serialiseJSON({ image_id = url }, true)) + end + end + end +end + +local function memesearch(query) + local res = http.post(""https://mse.osmarks.net/backend"", textutils.serialiseJSON({text={{query, 1}}})) + return textutils.unserialiseJSON(res.readAll()) +end + +while true do + local _, _, user, message = os.pullEvent ""chat_message"" + local file + for _, result in ipairs(memesearch(message)) do + local f = result.file:lower() + if f:match "".jpe?g$"" or f:match "".png$"" then + file = result.file + break + end + end + seturl(""https://i2.osmarks.net/memes-or-something/"" .. file) +end" +FvLnizYh,Untitled,wclovers,PHP,Thursday 26th of October 2023 08:00:57 AM CDT,"add_filter( 'wcfm_is_allow_cancel_membership', function($allow, $vendor_id, $wcfm_membership_id ) { + if ( '979436' == $wcfm_membership_id ) { + $allow = false; + } + return $allow; +},10, 3);" +TsLm7KAA,Untitled,tuomasvaltanen,Python,Thursday 26th of October 2023 07:49:53 AM CDT,"# johdatus ohjelmointiin, 26.10.2023, koodipaja +print(""Tervetuloa!"")" +FrA2yj1A,Untitled,kolbka_,Java,Thursday 26th of October 2023 07:46:50 AM CDT,"package linkedlists.lockbased; + +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import contention.abstractions.AbstractCompositionalIntSet; + +public class HandOverHand extends AbstractCompositionalIntSet { + + // sentinel nodes + private Node head; + private Node tail; + + public HandOverHand(){ + head = new Node(Integer.MIN_VALUE); + tail = new Node(Integer.MAX_VALUE); + head.next = tail; + } + + private class Nodes{ + public Node curr; + public Node pred; + Nodes(Node curr, Node pred){ + this.curr = curr; + this.pred = pred; + } + } + private Nodes traverse(int item, Node curr, Node pred){ + while(curr.key < item){ + pred.unlock(); + pred = curr; + curr = pred.next; + curr.lock(); + } + return new Nodes(curr, pred); + } + + @Override + public boolean addInt(int item){ + head.lock(); + Node pred = head; + Node curr = pred.next; + try{ + curr.lock(); + try{ + Nodes nn = traverse(item, curr, pred); + curr = nn.curr; pred = nn.pred; + if (curr.key == item){ + return false; + } + Node node = new Node(item); + node.next = curr; + pred.next = node; + return true; + } + finally { + curr.unlock(); + } + } + finally { + pred.unlock(); + } + } + + @Override + public boolean removeInt(int item){ + head.lock(); + Node pred = head; + Node curr = pred.next; + try{ + curr.lock(); + try{ + Nodes nn = traverse(item, curr, pred); + curr = nn.curr; pred = nn.pred; + if (curr.key == item){ + pred.next = curr.next; + return true; + } + return false; + } + finally { + curr.unlock(); + } + } + finally { + pred.unlock(); + } + } + + @Override + public boolean containsInt(int item){ + head.lock(); + Node pred = head; + Node curr = pred.next; + try{ + curr.lock(); + try { + Nodes nn = traverse(item, curr, pred); + curr = nn.curr; pred = nn.pred; + return curr.key == item; + } + finally { + curr.unlock(); + } + } + finally { + pred.unlock(); + } + } + + private class Node { + Node(int item) { + key = item; + next = null; + } + + public void lock(){ + l.lock(); + } + public void unlock(){ + l.unlock(); + } + public int key; + public Node next; + private Lock l = new ReentrantLock(); + } + + @Override + public void clear() { + head = new Node(Integer.MIN_VALUE); + head.next = new Node(Integer.MAX_VALUE); + } + + /** + * Non atomic and thread-unsafe + */ + @Override + public int size() { + int count = 0; + + Node curr = head.next; + while (curr.key != Integer.MAX_VALUE) { + curr = curr.next; + count++; + } + return count; + } +} +" +SPXXCg9f,Untitled,wclovers,PHP,Thursday 26th of October 2023 07:44:43 AM CDT,"add_filter('wcfm_product_manage_fields_general', function($fields) { + if (isset($fields['pro_title'])) { + $fields['pro_title']['placeholder'] = __('Change the word here', 'wc-frontend-manager'); + } + return $fields; +});" +AaiTX8kU,duplicate-posts-and-pages,Guenni007,PHP,Thursday 26th of October 2023 07:25:38 AM CDT," ""rd_duplicate_post_as_draft"", + ""post"" => $post->ID, + ], + ""admin.php"" + ), + basename(__FILE__), + ""duplicate_nonce"" + ); + /**** + Modification at https://oxygenados.com to avoid link creation in snippets Advanced Scripts, Scripts Organizer..... + **/ + $myCat = get_the_category($post->ID); + $Posttype = get_post_type($post->ID); + if ($Posttype == ""page"" || $myCat[0]->name != """") { + /** Changes by https://oxygenados.com **/ + $actions[""duplicate""] = + /** Changes by Guenni007 - to be translatable **/ + '' . \esc_html__( 'Duplicate', 'avia_framework' ) . ''; + } + return $actions; +} + + +/* + * Function creates post duplicate as a draft and redirects then to the edit post screen + */ +add_action( + ""admin_action_rd_duplicate_post_as_draft"", + ""rd_duplicate_post_as_draft"" +); + +function rd_duplicate_post_as_draft() +{ + // check if post ID has been provided and action + if (empty($_GET[""post""])) { + wp_die(""No post to duplicate has been provided!""); + } + + // Nonce verification + if ( + !isset($_GET[""duplicate_nonce""]) || + !wp_verify_nonce($_GET[""duplicate_nonce""], basename(__FILE__)) + ) { + return; + } + + // Get the original post id + $post_id = absint($_GET[""post""]); + + // And all the original post data then + $post = get_post($post_id); + + /* + * if you don't want current user to be the new post author, + * then change next couple of lines to this: $new_post_author = $post->post_author; + */ + $current_user = wp_get_current_user(); + $new_post_author = $current_user->ID; + + // if post data exists (I am sure it is, but just in a case), create the post duplicate + if ($post) { + // new post data array + $args = [ + ""comment_status"" => $post->comment_status, + ""ping_status"" => $post->ping_status, + ""post_author"" => $new_post_author, + ""post_content"" => $post->post_content, + ""post_excerpt"" => $post->post_excerpt, + ""post_name"" => $post->post_name, + ""post_parent"" => $post->post_parent, + ""post_password"" => $post->post_password, + ""post_status"" => ""draft"", + ""post_title"" => $post->post_title, + ""post_type"" => $post->post_type, + ""to_ping"" => $post->to_ping, + ""menu_order"" => $post->menu_order, + ]; + + // insert the post by wp_insert_post() function + $new_post_id = wp_insert_post($args); + + /* + * get all current post terms ad set them to the new post draft + */ + $taxonomies = get_object_taxonomies(get_post_type($post)); // returns array of taxonomy names for post type, ex array(""category"", ""post_tag""); + if ($taxonomies) { + foreach ($taxonomies as $taxonomy) { + $post_terms = wp_get_object_terms($post_id, $taxonomy, [ + ""fields"" => ""slugs"", + ]); + wp_set_object_terms( + $new_post_id, + $post_terms, + $taxonomy, + false + ); + } + } + + // duplicate all post meta + $post_meta = get_post_meta($post_id); + if ($post_meta) { + foreach ($post_meta as $meta_key => $meta_values) { + if (""_wp_old_slug"" == $meta_key) { + // do nothing for this meta key + continue; + } + + foreach ($meta_values as $meta_value) { + add_post_meta($new_post_id, $meta_key, $meta_value); + } + } + } + + // finally, redirect to the edit post screen for the new draft + // wp_safe_redirect( + // add_query_arg( + // array( + // 'action' => 'edit', + // 'post' => $new_post_id + // ), + // admin_url( 'post.php' ) + // ) + // ); + // exit; + // or we can redirect to all posts with a message + wp_safe_redirect( + add_query_arg( + [ + ""post_type"" => + ""post"" !== get_post_type($post) + ? get_post_type($post) + : false, + ""saved"" => ""post_duplication_created"", // just a custom slug here + ], + admin_url(""edit.php"") + ) + ); + exit(); + } else { + wp_die(""Copy creation has failed :(( ""); + } +} + +/* + * In case we decided to add admin notices + */ +add_action(""admin_notices"", ""rudr_duplication_admin_notice""); + +function rudr_duplication_admin_notice() +{ + // Get the current screen + $screen = get_current_screen(); + + if (""edit"" !== $screen->base) { + return; + } + + //Checks if settings updated + if (isset($_GET[""saved""]) && ""post_duplication_created"" == $_GET[""saved""]) { + echo '

The copy has been created.

'; + } +} +" +TJtrBc4P,Combine Fields Into Hidden - CF7,CodeDropz,PHP,Thursday 26th of October 2023 07:20:40 AM CDT,"add_action('wp_head', function(){ + ?> + + permutations = GeneratePermutations(bands); + + int permutationCount = 1; + + foreach (var permutation in permutations) + { + Console.WriteLine($""Вариант {permutationCount++}:""); + foreach (var band in permutation) + { + Console.WriteLine(band); + } + Console.WriteLine(); + } + } + + static List GeneratePermutations(string[] items) + { + List permutations = new List(); + Permute(items, 0, items.Length - 1, permutations); + return permutations; + } + + static void Permute(string[] items, int left, int right, List permutations) + { + if (left == right) + { + permutations.Add(items.ToArray()); + } + else + { + for (int i = left; i <= right; i++) + { + Swap(ref items[left], ref items[i]); + Permute(items, left + 1, right, permutations); + Swap(ref items[left], ref items[i]); // Restore the original order + } + } + } + + static void Swap(ref string a, ref string b) + { + string temp = a; + a = b; + b = temp; + } +}" +NZg0A0bH,Zadacha_1,Alethiashy,C#,Thursday 26th of October 2023 07:05:39 AM CDT,"using System; +using System.Collections.Generic; +using System.Linq; + +class Program +{ + static void Main() + { + int[] digits = { 1, 2, 3, 4, 5, 6, 7 }; + int[] permutation = new int[digits.Length]; + bool[] used = new bool[digits.Length]; + List permutationsList = new List(); + + GeneratePermutations(digits, permutation, used, 0, permutationsList); + + int count = permutationsList.Count; + + Console.WriteLine(""Възможни начини за съставяне на шифър на касата:""); + foreach (var p in permutationsList) + { + Console.WriteLine(string.Join("" "", p)); + } + + Console.WriteLine($""Общ брой възможни комбинации: {count}""); + } + + static void GeneratePermutations(int[] digits, int[] permutation, bool[] used, int currentIndex, List result) + { + if (currentIndex == digits.Length) + { + result.Add(permutation.ToArray()); + return; + } + + for (int i = 0; i < digits.Length; i++) + { + if (!used[i]) + { + permutation[currentIndex] = digits[i]; + used[i] = true; + GeneratePermutations(digits, permutation, used, currentIndex + 1, result); + used[i] = false; + } + } + } +} +" +qc37DYsY,03. Factorial Division,Spocoman,C++,Thursday 26th of October 2023 07:02:59 AM CDT,"#include + +using namespace std; + +double factorial(int n) { + if (n == 0) { + return 1; + } + else { + return (n * factorial(n - 1)); + } +} + +int main() { + int n1, n2; + cin >> n1 >> n2; + + printf(""%.2f\n"", factorial(n1) / factorial(n2)); + + return 0; +}" +46nSVg4w,02. Operations,Spocoman,C++,Thursday 26th of October 2023 06:59:32 AM CDT,"#include + +using namespace std; + +void addition(int a, int b) { + cout << a + b << endl; +} +void subtraction(int a, int b) { + cout << a - b << endl; +} +void multiplication(int a, int b) { + cout << a * b << endl; +} +void division(int a, int b) { + if (b != 0) { + cout << (double)a / b << endl; + } + else { + cout << ""Can't divide by zero."" << endl; + } +} + +int main() { + double n1, n2; + cin >> n1 >> n2; + + char operation; + cin >> operation; + + if (operation == '+') { + addition(n1, n2); + } + else if (operation == '-') { + subtraction(n1, n2); + } + else if(operation == '*') { + multiplication(n1, n2); + } + else { + division(n1, n2); + } + + return 0; +}" +ejMJ6DYZ,Largest number possible,jayati,C++,Thursday 26th of October 2023 06:50:37 AM CDT,"//{ Driver Code Starts +// Initial Template for C++ + +#include +using namespace std; + +// } Driver Code Ends +// User function Template for C++ + +class Solution{ +public: + string findLargest(int N, int S){ + // code here + string s=""""; + int sum=0; + + + if(S==0 && N>1) + { + return ""-1""; + } + for(int i=0;i=9) + { + s+='9'; + S-=9; + } + else + { + s+=char(S+48); + S=0; + } + } + if(S>0) + { + return ""-1""; + } + return s; + + + } +}; + +//{ Driver Code Starts. + +int main(){ + int t; + cin>>t; + while(t--){ + int N, S; + cin>>N>>S; + + Solution ob; + cout< + +using namespace std; + +void closestToTheCenter(double x1, double x2, double y1, double y2) { + if (abs(x1 * x1 + y1 * y1) < abs(x2 * x2 + y2 * y2)) { + cout << ""("" << x1 << "", "" << y1 << "")\n""; + } + else { + cout << ""("" << x2 << "", "" << y2 << "")\n""; + } +} + +int main() { + double x1, y1, x2, y2; + cin >> x1 >> y1 >> x2 >> y2; + + closestToTheCenter(x1, x2, y1, y2); + + return 0; +}" +sTZr5T5Y,06. Math Power,Spocoman,C++,Thursday 26th of October 2023 06:44:34 AM CDT,"#include + +using namespace std; + +int mathPower(int b, int e) { + int result = 1; + + for (int i = 0; i < e; i++) { + result *= b; + } + + return result; +} + +int main() { + int base, exponent; + cin >> base >> exponent; + + cout << mathPower(base, exponent) << endl; + + return 0; +}" +3rgBUTjz,[de]serialize object | unity3d,halleman19,C#,Thursday 26th of October 2023 06:43:40 AM CDT,"using System; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +namespace xmlapp +{ + class Program + { + static void Main(string[] args) + { + Player pl0 = new Player(27, ""Sam"", ""Halleman""); + Player pl1 = new Player(24, ""Dairysh"", ""none""); + + BinaryFormatter formatter = new BinaryFormatter(); + + byte[] data; + MemoryStream stream = new MemoryStream(); + + formatter.Serialize(stream, pl0); + formatter.Serialize(stream, pl1); + + data = stream.ToArray(); + + MemoryStream ms = new MemoryStream(data); + + Player pl0ds = (Player)formatter.Deserialize(ms); + Player pl1ds = (Player)formatter.Deserialize(ms); + } + } + + [Serializable] + public class Player + { + private int age; + private string name; + [NonSerialized] + private string surname; + + public int Age + { + get { return this.age; } + } + + public string Name + { + get { return this.name; } + } + + public string SurName + { + get { return this.surname; } + } + + public Player(int age, string name, string surname) + { + this.age = age; + this.name = name; + this.surname = surname; + } + } +} +" +GnaSMDZB,05. Calculate Rectangle Area,Spocoman,C++,Thursday 26th of October 2023 06:41:09 AM CDT,"#include + +using namespace std; + +int calculateRectangeArea(int a, int b) { + return a * b; +} + +int main() { + int sideA, sideB; + cin >> sideA >> sideB; + + cout << calculateRectangeArea(sideA, sideB) << endl; + + return 0; +}" +5BJYxe2Q,04. Printing Triangle,Spocoman,C++,Thursday 26th of October 2023 06:38:54 AM CDT,"#include +#include + +using namespace std; + +void printTiangle(int n) { + string result = """"; + + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= i; j++) { + result += to_string(j) + "" ""; + } + result += ""\n""; + } + for (int i = n; i > 0; i--) { + for (int j = 1; j < i; j++) { + result += to_string(j) + "" ""; + } + result += ""\n""; + } + cout << result; +} + +int main() { + int n; + cin >> n; + + printTiangle(n); + + return 0; +}" +BycSnMun,03. Smallest of Three Numbers,Spocoman,C++,Thursday 26th of October 2023 06:33:35 AM CDT,"#include + +using namespace std; + +void smallestNumber(int a, int b, int c) { + int result = + a < b && a < c ? a : + b < a && b < c ? b : c; + + cout << result << endl; +} + +int main() { + int n1, n2, n3; + cin >> n1 >> n2 >> n3; + + smallestNumber(n1, n2, n3); + + return 0; +}" +pCFrdXL6,02. Grades,Spocoman,C++,Thursday 26th of October 2023 06:26:50 AM CDT,"#include + +using namespace std; + +void print(double n) { + string result = + n < 3.00 ? ""Fail"" : + n < 4.00 ? ""Poor"" : + n < 4.50 ? ""Good"" : + n < 5.50 ? ""Very good"" : + n <= 6.00 ? ""Excellent"" : """"; + + cout << result << endl; +} + +int main() { + double grade; + cin >> grade; + + print(grade); + + return 0; +}" +W96bXumx,Untitled,Princelion33,Lua,Thursday 26th of October 2023 06:18:34 AM CDT,"_G.UI_Size = 200 +loadstring(game:HttpGet(""https://raw.githubusercontent.com/3345-c-a-t-s-u-s/-beta-/main/AutoParry.lua""))() + +loadstring(game:HttpGet(""https://raw.githubusercontent.com/1f0yt/community/main/autoparrybest""))() +-- Click 'X' to toggle spam mode, 'Z' for autoblock, and 'C' for the circle + +loadstring(game:HttpGet(""https://raw.githubusercontent.com/1f0yt/community/main/infernofixed""))() + +loadstring(game:HttpGet(('https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source'),true))()" +L8hjt0te,01. Sign of Integer Numbers,Spocoman,C++,Thursday 26th of October 2023 06:17:35 AM CDT,"#include + +using namespace std; + +void print(int n) { + cout << ""The number "" << n << "" is "" << (n > 0 ? ""positive"" : n < 0 ? ""negative"" : ""zero"") << "".\n""; +} + +int main() { + int n; + cin >> n; + + print(n); + + return 0; +}" +9Ra0qm74,Untitled,onilink_,C++,Thursday 26th of October 2023 06:15:07 AM CDT," validate(0x0B, 0x8000, 0x000A); + validate(0x0B, 0x0001, 0x000D); + validate(0x0B, 0x0000, 0x000D); + validate(0x0B, 0x0015, 0x0001); + validate(0x0B, 0x0021, 0x0002); + validate(0x0B, 0x0000, 0x0020); + validate(0x0B, 0x8040, 0x001E); + validate(0x0B, 0x0030, 0x004E); + validate(0x0B, 0x0000, 0x0049); + validate(0x0B, 0x0014, 0x0001); + validate(0x0B, 0x0020, 0x0002); + validate(0x0B, 0x05FF, 0x0003); + validate(0x0B, 0x07F9, 0x0004); + validate(0x0B, 0x0000, 0x0022); + validate(0x0B, 0x0000, 0x0023); + validate(0x0B, 0x8000, 0x000A); + validate(0x0B, 0x008E, 0x0005); + validate(0x0B, 0x0019, 0x0006); + validate(0x0B, 0x06E3, 0x0009); + validate(0x0B, 0x06E3, 0x0009); + validate(0x0B, 0x06E3, 0x0009); + validate(0x0B, 0x010F, 0x002B); + validate(0x0B, 0x010F, 0x002C); + validate(0x0B, 0x010F, 0x002D); + validate(0x0B, 0x010F, 0x002E);" +9bcrURhP,Signal CPU,Fusion1227,Lua,Thursday 26th of October 2023 06:10:02 AM CDT,"-- this is the startup script for signal computers + + +----| config |---------------------------- + + +local MODEM_SIDE = ""top"" +local SIGNAL_SIDE = ""back"" -- the side connected to the signal +local CENTRAL_CPU_ID = 125 -- the id of the computer at spawn + + + +----| setup |---------------------------- + + +local actionEnum = { + GET_SIGNAL_STATE = ""GET_SIGNAL_STATE"", + SENSOR_CHANGE = ""SENSOR_CHANGE"", +} + + +----| functions |---------------------------- + + +function receiveSignal() -- waits for commands from central cpu + while true do + print(""Waiting for a command..."") + local id, state = rednet.receive() + if id == CENTRAL_CPU_ID then + if state == true then -- activate signal + print(""Activating signal..."") + redstone.setOutput(SIGNAL_SIDE, true) + elseif state == false then -- deactivate signal + redstone.setOutput(SIGNAL_SIDE, false) + print(""Deactivating signal..."") + end + end + end +end + + +----| main |---------------------------- + + +rednet.open(MODEM_SIDE) +print(""Rednet opened."") + + +-- get the immediate signal state +print(""Getting the immediate state..."") +rednet.send(CENTRAL_CPU_ID, actionEnum.GET_SIGNAL_STATE) +local id, immediateState = rednet.receive() +redstone.setOutput(SIGNAL_SIDE, immediateState) +print(""The signal state is currently set to "" .. tostring(immediateState)) + + +-- listen for signal state changes +receiveSignal()" +DeVV9Uyr,Central CPU,Fusion1227,Lua,Thursday 26th of October 2023 06:09:37 AM CDT,"-- this is the startup script for the central cpu at spawn + + +----| config |---------------------------- + + +local MODEM_SIDE = ""top"" + + +----| setup |---------------------------- + + +os.loadAPI(""TrainSignalSystem"") + +local actionEnum = { + GET_SIGNAL_STATE = ""GET_SIGNAL_STATE"", + SENSOR_CHANGE = ""SENSOR_CHANGE"", +} + + +----| functions |---------------------------- + + +function onGetSignalState(id) + local trainSignalSystem = TrainSignalSystem.findFromComputerId(id) + if trainSignalSystem then + local isOn = trainSignalSystem.isOn + rednet.send(trainSignalSystem.signalId, isOn) + end +end + + +function onSensorChange(id) + local trainSignalSystem = TrainSignalSystem.findFromComputerId(id) + if trainSignalSystem then + if id == trainSignalSystem.onSensorId and trainSignalSystem.isOn == false then -- activate the signal + print(""Activating signal..."") + trainSignalSystem.isOn = true + rednet.send(trainSignalSystem.signalId, true) -- send a message to the computer that handles the signal light + elseif id == trainSignalSystem.offSensorId and trainSignalSystem.isOn == true then -- deactivate the signal + print(""Deactivating signal..."") + trainSignalSystem.isOn = false + rednet.send(trainSignalSystem.signalId, false) -- send a message to the computer that handles the signal light + end + end +end + + +function receiveSignal() -- waits for commands from central cpu + while true do + print(""Waiting for a message..."") + local id, message = rednet.receive() + print(""Received message from computer "" .. id) + + -- proceed based on the action given in the message + if message == actionEnum.SENSOR_CHANGE then + onSensorChange(id) + elseif message == actionEnum.GET_SIGNAL_STATE then + onGetSignalState(id) + end + end +end + + +----| main |---------------------------- + + +rednet.open(MODEM_SIDE) +print(""Rednet opened."") + + +receiveSignal()" +fRzr3v4M,Sensor CPU,Fusion1227,Lua,Thursday 26th of October 2023 06:08:51 AM CDT,"-- this is the startup script for sensor computers + + +----| config |---------------------------- + + +local MODEM_SIDE = ""top"" +local SENSOR_SIDE = ""back"" -- the side connected to the sensor +local CENTRAL_CPU_ID = 125 -- the id of the computer at spawn + + +----| setup |---------------------------- + + +local lastState = false + +local actionEnum = { + GET_SIGNAL_STATE = ""GET_SIGNAL_STATE"", + SENSOR_CHANGE = ""SENSOR_CHANGE"", +} + + +----| functions |---------------------------- + + +function getSensorState() + local isOn = redstone.getInput(SENSOR_SIDE) + return isOn +end + + +----| main |---------------------------- + + +rednet.open(MODEM_SIDE) +print(""Rednet opened."") + + +while true do + local state = getSensorState() + if state ~= lastState then -- if the state changed + if state == true then -- if the sensor is activated + print(""Sensor activated. Sending message to central computer..."") + rednet.send(CENTRAL_CPU_ID, actionEnum.SENSOR_CHANGE) + lastState = state + end + lastState = state -- record the state change + end + sleep(1) +end" +nNJhHQSN,06. Greatest Common Divisor,Spocoman,C++,Thursday 26th of October 2023 05:50:35 AM CDT,"#include + +using namespace std; + +int main() { + int firstNumber, secondNumber; + cin >> firstNumber >> secondNumber; + + for (int i = 10; i > 0; i--) { + if (firstNumber % i == 0 && secondNumber % i == 0) { + cout << i << endl; + return 0; + } + } +}" +aNQk9Ejs,05. Min and Max,Spocoman,C++,Thursday 26th of October 2023 05:47:18 AM CDT,"#include + +using namespace std; + +int main() { + int n, number, minNumber = 2147483647, maxNumber = (-2147483647 - 1); + cin >> n; + + for (int i = 0; i < n; i++) { + cin >> number; + if (number < minNumber) { + minNumber = number; + } + if (number > maxNumber) { + maxNumber = number; + } + } + + cout << minNumber << ' ' << maxNumber << endl; + return 0; +}" +UhaexDii,04. 1 to N,Spocoman,C++,Thursday 26th of October 2023 05:45:19 AM CDT,"#include + +using namespace std; + +int main() { + int n; + cin >> n; + + for (int i = 1; i <= n; i++) { + cout << i << ' '; + } + + return 0; +}"