{"id":86,"date":"2022-08-27T13:51:44","date_gmt":"2022-08-27T13:51:44","guid":{"rendered":"https:\/\/themeger.shop\/wordpress\/katen\/personal-alt\/?p=86"},"modified":"2023-02-03T19:55:59","modified_gmt":"2023-02-03T18:55:59","slug":"60-things-to-immediately-do-about-building","status":"publish","type":"post","link":"https:\/\/www.mutlu.ch\/?p=86","title":{"rendered":"Kusto Detective Agency: Chall #2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>he mayor of Digitown, Mrs. Gaia Budskott, has found herself in quite a pickle. The election for the city\u2019s mascot was run online for the first time, and it was a huge success! Or was it??<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Over 5 million people voted. Four candidates made it to the final round:<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>&#8211; Kastor the Elephant \u2013 The darling of Digitown Zoo<\/em><\/li>\n\n\n\n<li><em>&#8211; Gaul the Octopus \u2013 A Digitown celebrity, who was a whiz at predicting who\u2019d win the local soccer games<\/em><\/li>\n\n\n\n<li><em>&#8211; William (Willie) the Tortoise \u2013 Digitown\u2019s oldest living creature (estimated age &#8211; 176.4 years)<\/em><\/li>\n\n\n\n<li><em>&#8211; Poppy the Goldfish \u2013 ex-Mayor Jason Guvid\u2019s childhood pet<\/em>\n<ul class=\"wp-block-list\">\n<li><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>The polls predicted a close battle between Kastor and Gaul, but the actual results showed that the ex-mayor\u2019s fish got a whopping 51.7% of all votes! That sure does sound fishy\u2026<br>The mayor is afraid of a vote-tampering scandal that could affect all elections in Digitown! You\u2019ve helped her out last time, and she\u2019s counting on you to get to the bottom of this mystery.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>If voting fraud happened \u2013 prove it and correct the election numbers: what percentage of the votes did each candidate get?<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>You have access to the elections data: IP, anonymized id, vote, date-time &#8211; and the function used for counting the votes.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Good luck, rookie. We\u2019re counting on you.<\/em><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You need to copy paste the script provided in your Cluster<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>.execute database script &lt;|\r\n\/\/ Ingestion may take ~40sec to complete, total 5M+ records\r\n.create-merge table Votes (Timestamp:datetime, vote:string, via_ip:string, voter_hash_id:string)\r\n.ingest async into table Votes (@'https:\/\/kustodetectiveagency.blob.core.windows.net\/digitown-votes\/votes_1.csv.gz')\r\n.ingest async into table Votes (@'https:\/\/kustodetectiveagency.blob.core.windows.net\/digitown-votes\/votes_2.csv.gz')\r\n.ingest async into table Votes (@'https:\/\/kustodetectiveagency.blob.core.windows.net\/digitown-votes\/votes_3.csv.gz')\r\n\r\n\/\/ Query that counts the votes:\r\nVotes\r\n| summarize Count=count() by vote\r\n| as hint.materialized=true T\r\n| extend Total = toscalar(T | summarize sum(Count))\r\n| project vote, Percentage = round(Count*100.0 \/ Total, 1), Count\r\n| order by Count<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Chall #1 Solution<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Votes\r\n| summarize Count = count() by vote, bin(Timestamp, 1s), via_ip\r\n| where Count &lt; 2\r\n| summarize Count=count() by vote\r\n| as hint.materialized=true T\r\n| extend Total = toscalar(T | summarize sum(Count))\r\n| project vote, Percentage = round(Count*100.0 \/ Total, 1), Count\r\n| order by Count<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"600\" height=\"600\" data-id=\"466\" src=\"https:\/\/www.mutlu.ch\/wp-content\/uploads\/2023\/02\/image-1-1.png\" alt=\"\" class=\"wp-image-466\" srcset=\"https:\/\/www.mutlu.ch\/wp-content\/uploads\/2023\/02\/image-1-1.png 600w, https:\/\/www.mutlu.ch\/wp-content\/uploads\/2023\/02\/image-1-1-300x300.png 300w, https:\/\/www.mutlu.ch\/wp-content\/uploads\/2023\/02\/image-1-1-150x150.png 150w, https:\/\/www.mutlu.ch\/wp-content\/uploads\/2023\/02\/image-1-1-60x60.png 60w, https:\/\/www.mutlu.ch\/wp-content\/uploads\/2023\/02\/image-1-1-360x360.png 360w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Kastor: 50.8% \r\nGaul: \t38.6% \r\nWillie:\t6.6% \r\nPoppy: \t4%<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.credly.com\/org\/microsoft-azure-data-explorer\/badge\/kusto-detective-agency-case-2-badge\">Kusto Detective Agency &#8211; Case #2 Badge &#8211; Credly<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>he mayor of Digitown, Mrs. Gaia Budskott, has found herself in quite a pickle. The election for the city\u2019s mascot was run online for the first time, and it was a huge success! Or was it?? Over 5 million people voted. Four candidates made it to the final round: The polls predicted a close battle [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":460,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"gallery","meta":{"footnotes":""},"categories":[26,25],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-gallery","has-post-thumbnail","hentry","category-kql","category-microsoft","post_format-post-format-gallery"],"_links":{"self":[{"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86"}],"version-history":[{"count":5,"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":469,"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions\/469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=\/wp\/v2\/media\/460"}],"wp:attachment":[{"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mutlu.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}