qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
74,280,955
<p>How to repeat rows based on column value in snowflake using sql.</p> <p>I tried a few methods but not working such as dual and connect by.</p> <p>I have two columns: Id and Quantity.</p> <p>For each ID, there are different values of Quantity.</p>
[ { "answer_id": 74281052, "author": "Simeon Pilgrim", "author_id": 43992, "author_profile": "https://Stackoverflow.com/users/43992", "pm_score": 1, "selected": false, "text": "with ten_rows as (\n select row_number() over (order by null) as rn\n from table(generator(ROWCOUNT=>10))\n...
2022/11/01
[ "https://Stackoverflow.com/questions/74280955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19730002/" ]
74,280,961
<p>I am adding an event listener which needs the event properties as well as other parameters</p> <pre><code> document.body.addEventListener(&quot;click&quot;, (e) =&gt; listenForMembersOpen(e, buttonReplacement, openEditModal) ); </code></pre> <p>I need to remove this event listener when my component unmounts but running:</p> <pre><code> document.body.removeEventListener(&quot;click&quot;, (e) =&gt; listenForMembersOpen(e, buttonReplacement, openEditModal) ); </code></pre> <p>doesn't seem to get the job done. I'm thinking it is because the function declaration within the event listener. Any advice on how I can remove the event lister shown?</p> <pre><code>export function addListenersForButtonReplacement(buttonReplacement, openEditModal) { document.body.addEventListener(&quot;click&quot;, (e) =&gt; listenForMembersOpen(e, buttonReplacement, openEditModal) ); document.body.addEventListener(&quot;keydown&quot;, (e) =&gt; listenForMembersOpen(e, buttonReplacement, openEditModal) ); } </code></pre>
[ { "answer_id": 74281052, "author": "Simeon Pilgrim", "author_id": 43992, "author_profile": "https://Stackoverflow.com/users/43992", "pm_score": 1, "selected": false, "text": "with ten_rows as (\n select row_number() over (order by null) as rn\n from table(generator(ROWCOUNT=>10))\n...
2022/11/01
[ "https://Stackoverflow.com/questions/74280961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17498878/" ]
74,280,972
<pre><code>def sum_divisors(n): sum = 0 # Return the sum of all divisors of n, not including n return sum print(sum_divisors(0)) # 0 print(sum_divisors(3)) # Should sum of 1 # 1 print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18 # 55 print(sum_divisors(102)) # Should be sum of 2+3+6+17+34+51 # 114 </code></pre> <p>I attempted to find the range of the numbers with this that I found on another question asked on here but I'm honestly just completely stumped with this question that I'm being asked even with the help that's alread given within the question.</p> <pre><code> for i in xrange(1,n/2+1): if n%i == 0: </code></pre> <p>I'm not sure how to properly input it so it ended up looking like this</p> <pre><code>def sum_divisors(n): for i in xrange(1,n/2+1): if n%i == 0: sum = 0 return sum # Return the sum of all divisors of n, not including n print(sum_divisors(0)) # 0 print(sum_divisors(3)) # Should sum of 1 # 1 print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18 # 55 print(sum_divisors(102)) # Should be sum of 2+3+6+17+34+51 # 114 </code></pre>
[ { "answer_id": 74281052, "author": "Simeon Pilgrim", "author_id": 43992, "author_profile": "https://Stackoverflow.com/users/43992", "pm_score": 1, "selected": false, "text": "with ten_rows as (\n select row_number() over (order by null) as rn\n from table(generator(ROWCOUNT=>10))\n...
2022/11/01
[ "https://Stackoverflow.com/questions/74280972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20310137/" ]
74,280,974
<p>Whenever I run this code, the program only takes the first input from me and then sends a garbage value in the 2nd input itself and then prints a totally random garbage value.</p> <pre><code>.model small .stack 100h .data .code main proc mov ah , 1 ;input 1 int 21h mov bl,al mov al , 1 ;input 2 int 21h add bl , al sub bl , 48 mov dl , bl mov ah , 2 int 21h mov ah , 4ch int 21h main endp end main </code></pre> <p>I've tried changing the <code>mov al , 1</code> to <code>mov ah , 1</code> to take the input but that doesn't work either.</p>
[ { "answer_id": 74281664, "author": "vitsoft", "author_id": 2581418, "author_profile": "https://Stackoverflow.com/users/2581418", "pm_score": 1, "selected": false, "text": ";input 2" }, { "answer_id": 74294745, "author": "Sep Roland", "author_id": 3144770, "author_prof...
2022/11/01
[ "https://Stackoverflow.com/questions/74280974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20291141/" ]
74,280,978
<p>is there any way to achieve a better approach for the <strong>MVC, Model-View-Pattern</strong> architecture pattern, without using the <code>Getx</code> flutter package?</p> <p>since the Getx package is just a lot, and I don(t want to use it's other features but the state management</p> <p>is there any packages or some ways that help manage my app state with <strong>MVC</strong></p> <p>any information are welcome</p>
[ { "answer_id": 74281664, "author": "vitsoft", "author_id": 2581418, "author_profile": "https://Stackoverflow.com/users/2581418", "pm_score": 1, "selected": false, "text": ";input 2" }, { "answer_id": 74294745, "author": "Sep Roland", "author_id": 3144770, "author_prof...
2022/11/01
[ "https://Stackoverflow.com/questions/74280978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18670641/" ]
74,280,983
<p>I have a tuple containing coordinates for a list of nodes. The process I am attempting to complete needs a tuple with only 2-tuple or 3-tuples. I am trying to filter out any 1-tuples.</p> <pre><code>G=nx.read_shp(r'C:\TestData\tl_2019_36013_roads.shp') pos = {k: v for k,v in enumerate(G.nodes())} X=nx.Graph() #Empty graph X.add_nodes_from(pos.keys()) #Add nodes preserving coordinates edg=[tuple(k for k,v in pos.items() if v in sl) for sl in l] print(edg) </code></pre> <p>A portion of this output is:</p> <pre><code>[(38, 9848), (40, 41), (40,), (10, 42)] </code></pre> <p>So in this case, I am attempting to filter out the entry: (40,) as it is only a 1-tuple.</p>
[ { "answer_id": 74281020, "author": "Anton Chernyshov", "author_id": 20127679, "author_profile": "https://Stackoverflow.com/users/20127679", "pm_score": -1, "selected": false, "text": "tuplelist = (40,), (40,21), (532, 234)\nnewlist = []\nfor i in tuplelist:\n if len(i) != 1:\n ...
2022/11/01
[ "https://Stackoverflow.com/questions/74280983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12383945/" ]
74,280,995
<p>My end user is going to enter query like this:</p> <pre><code>INSERT INTO course( id, column_1, column_2, column_3, column_4, column_5) VALUES ('f34-gr5-t46','ABC', '2022-10-18 07:19:29', 2, 'false', now()) ON CONFLICT (id) DO UPDATE SET (column_1, column_2, column_3, column_4, column_5) = (EXCLUDED.column_1, EXCLUDED.column_2, EXCLUDED.column_3, EXCLUDED.column_4, EXCLUDED.column_5); </code></pre> <p>User is going to either create new record or update using this same query. Whenever there is an update I need to store only updated column's name, old value, new value and changed time in my audit table.</p> <p>I have created a function and a trigger like this:</p> <pre><code>CREATE OR REPLACE FUNCTION log_changes() RETURNS TRIGGER LANGUAGE PLPGSQL AS $$ BEGIN IF NEW.column_1 != OLD.column_1 THEN INSERT INTO course_history(id, course_id, field_name, action_type, old_value, new_value, changed_time) VALUES(uuid_generate_v4(), OLD.id, 'column_1', 'UPDATE', OLD.column_1, NEW.column_1, new.changed_time); ELSEIF NEW.column_2 != OLD.column_2 THEN INSERT INTO course_history(id, course_id, field_name, action_type, old_value, new_value, changed_time) VALUES(uuid_generate_v4(), OLD.id, 'column_2', 'UPDATE', OLD.column_2, NEW.column_2, new.changed_time); // and so on for all columns that could be changed in course table END IF; RETURN NEW; END; $$ CREATE TRIGGER course_changes BEFORE UPDATE ON course FOR EACH ROW EXECUTE PROCEDURE log_changes(); </code></pre> <p>This function creates new rows for each updated fields in single update. I am trying to reduce repeating code of if condition for each column. How can I achieve that?</p> <p>Is there a way to combine updates of multiple fields into single row? so that if user updated only two columns in single query, I will have single row showing those updates in history table.</p>
[ { "answer_id": 74281378, "author": "Edouard", "author_id": 8060017, "author_profile": "https://Stackoverflow.com/users/8060017", "pm_score": 1, "selected": false, "text": "course_history" }, { "answer_id": 74284770, "author": "Laurenz Albe", "author_id": 6464308, "aut...
2022/11/01
[ "https://Stackoverflow.com/questions/74280995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13144533/" ]
74,281,029
<p>I have a task to create tableview on a GUI screen dynamically. The control must be created dynamically fo different table types, because we need to maintain different tables. I mean I need SM30 looking table maintainance screen.</p> <p>Is it possible in ABAP to create tableview dynamically? Or is it possible within ALV grids only?</p>
[ { "answer_id": 74281378, "author": "Edouard", "author_id": 8060017, "author_profile": "https://Stackoverflow.com/users/8060017", "pm_score": 1, "selected": false, "text": "course_history" }, { "answer_id": 74284770, "author": "Laurenz Albe", "author_id": 6464308, "aut...
2022/11/01
[ "https://Stackoverflow.com/questions/74281029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8054473/" ]
74,281,039
<p>Sometimes, after wrapping a list of widgets inside a <code>Column</code> or a <code>ListView</code>, the widget takes the whole width or height of this column. However, I simply wish it took the height or width of its contents, but so far I've only been able to find either very complicated ways of doing this or ways of giving, for example, buttons and texts fixed width or height.</p> <p>In CSS, there's <code>min-content</code> and <code>max-content</code> for doing this sort of stuff. Is there an equivalent in Flutter?</p>
[ { "answer_id": 74281040, "author": "Philippe Fanaro", "author_id": 4756173, "author_profile": "https://Stackoverflow.com/users/4756173", "pm_score": 0, "selected": false, "text": "Row" }, { "answer_id": 74281873, "author": "TarHalda", "author_id": 15170120, "author_pr...
2022/11/01
[ "https://Stackoverflow.com/questions/74281039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4756173/" ]
74,281,051
<p>Basically I have a JSON file and whenever I take it to my js application and print it to the console it never print a new line I have no Idea why</p> <p>my JSON file:</p> <pre><code>[ { &quot;id&quot;: &quot;71046&quot;, &quot;question&quot;: &quot;What is a cpu?&quot;, &quot;answer&quot;: &quot;Brain of the computer, it has all the circuity needed to proccess input, store data and output results.&quot;, &quot;options&quot;: [&quot;&quot;] }, { &quot;id&quot;: &quot;63888&quot;, &quot;question&quot;: &quot;What can the proccessor perform?&quot;, &quot;answer&quot;: &quot;1) Basic arithmetic 2) Logic Control 3) Input/Output&quot;, &quot;options&quot;: [] }, { &quot;id&quot;: &quot;5418&quot;, &quot;question&quot;: &quot;CPU principle components:&quot;, &quot;answer&quot;: &quot;1) ALU (Arithmetic Logic Unit)\n 2) Processor Register\\n 3) Control Unit&quot;, &quot;options&quot;: [] } ] </code></pre> <p>I tried many solution to parse print and others and didn't work which is weird</p> <p>I went through this link in stackoverflow and didn't find solution: <a href="https://stackoverflow.com/questions/42068/how-do-i-handle-newlines-in-json">How do I handle newlines in JSON?</a></p> <p>Here what happens when I stringify (the \n or \n doesn't take it to another line): <a href="https://i.stack.imgur.com/6MgLv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6MgLv.png" alt="enter image description here" /></a></p>
[ { "answer_id": 74281040, "author": "Philippe Fanaro", "author_id": 4756173, "author_profile": "https://Stackoverflow.com/users/4756173", "pm_score": 0, "selected": false, "text": "Row" }, { "answer_id": 74281873, "author": "TarHalda", "author_id": 15170120, "author_pr...
2022/11/01
[ "https://Stackoverflow.com/questions/74281051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14792881/" ]
74,281,068
<p>I have a large data frame of station-to-station bike trips and it is my goal to identify the most common combinations of start and end stations. My df looks like this:</p> <pre><code>df &lt;- data.frame(start_station = c('Apple', 'Bungalow', 'Carrot', 'Apple', 'Apple', 'Bungalow'), end_station = c('Bungalow', 'Apple', 'Carrot', 'Bungalow', 'Bungalow', 'Apple'), start_lat = c(12.3456, 23.4567, 34.5678, 12.3456, 12.3456, 23.4567), start_lng = c(09.8765, 98.7654, 87.6543, 09.8765, 09.8765, 98.7654) ) </code></pre> <p>Ideally, I want an output that creates a ranked list of station combinations in descending order of frequency and a new column, 'ride_count' that reflects the number of exact combinations.</p> <p>In the above example, I want the output to be a new dataframe I can further manipulate/visualize</p> <pre><code>start_station end_station ride_count start_lat start_lng Apple Bungalow 3 12.3456 09.8765 Bungalow Apple 2 23.4567 98.7654 Carrot Carrot 1 34.5678 87.6543 </code></pre> <p>Per a previous recommendation, the 'count()' command does perform the correct calculation, however I lose the other data associated with each station, like start_lat and start_lng.</p> <p>Is there a way to preserve these columns?</p> <p>A sincere thanks to anyone for their assistance. I've been plowing through this project efficiently, but I'm really struggling with this final geographic element.</p>
[ { "answer_id": 74281102, "author": "r2evans - GO NAVY BEAT ARMY", "author_id": 3358272, "author_profile": "https://Stackoverflow.com/users/3358272", "pm_score": 1, "selected": false, "text": "library(dplyr)\ndf %>%\n group_by(start_station, end_station) %>%\n summarize(n = n(), across(...
2022/11/01
[ "https://Stackoverflow.com/questions/74281068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391078/" ]
74,281,083
<p>trying to overload the extraction operator in this class</p> <pre><code>class Mystring { private: char* cstring; size_t size; public: friend std::istream &amp;operator&gt;&gt;(std::istream &amp;is, Mystring &amp;str); </code></pre> <p>the function:</p> <pre><code>#include &lt;iostream&gt; #include &quot;mystring.h&quot; std::istream &amp;operator&gt;&gt;(std::istream &amp;is, Mystring &amp;obj) { char *buff = new char[1000]; is &gt;&gt; buff; /* Invalid operands to binary expression ('std::istream' (aka 'basic_istream&lt;char&gt;') and 'char *') */ obj = Mystring{buff}; delete [] buff; return is; } </code></pre> <p>the error I get is: <strong>Invalid operands to binary expression ('std::istream' (aka 'basic_istream&lt;char&gt;') and 'char *')</strong></p> <p>when I tried to do something like this: <code>is &gt;&gt; *buff;</code></p> <p>It reads only the first char</p> <pre><code>Mystring name; std::cout &lt;&lt; &quot;name: &quot; &lt;&lt; std::endl; std::cin &gt;&gt; name; std::cout &lt;&lt; &quot;Your name is &quot; &lt;&lt; name; </code></pre> <pre><code>name: harry Your name is h </code></pre>
[ { "answer_id": 74281132, "author": "Quimby", "author_id": 7691729, "author_profile": "https://Stackoverflow.com/users/7691729", "pm_score": -1, "selected": false, "text": "istream" }, { "answer_id": 74281350, "author": "Ted Lyngmo", "author_id": 7582247, "author_profi...
2022/11/01
[ "https://Stackoverflow.com/questions/74281083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19381959/" ]
74,281,093
<p>I have a number of text items contained in span tags that i need to extract. I am able to do this in a list comp in the class table-main__odds as shown. I need to get the same info fronm the table-main__odds coloured tag. The logic below does not return any values. any help is appreciated?</p> <pre><code>import requests from bs4 import BeautifulSoup import pandas as pd url = 'https://www.betexplorer.com/soccer/england/premier-league/results/' soup = BeautifulSoup(requests.get(url).content) odds_raw = soup.find_all(&quot;td&quot;, class_=&quot;table-main__odds&quot;) fav_odds_raw = soup.find_all(&quot;td&quot;,class_=&quot;table-main__odds colored&quot;) odds = [o.get('data-odd') for o in odds_raw] </code></pre> <p><a href="https://i.stack.imgur.com/OWgYm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OWgYm.png" alt="enter image description here" /></a></p> <p>the desired result is a list with the values contained here in data-odd</p> <p><a href="https://i.stack.imgur.com/5JpkF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5JpkF.png" alt="enter image description here" /></a></p>
[ { "answer_id": 74281266, "author": "Andrej Kesely", "author_id": 10035985, "author_profile": "https://Stackoverflow.com/users/10035985", "pm_score": 3, "selected": true, "text": "import requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\n\n\nurl = \"https://www.betexplorer.com/...
2022/11/01
[ "https://Stackoverflow.com/questions/74281093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18776287/" ]
74,281,110
<p>I have an issue where the Flutter TextField doesn't fill its set height. The blue Container shows the size that the TextField should be.</p> <p><a href="https://i.stack.imgur.com/FChMm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FChMm.png" alt="enter image description here" /></a></p> <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart'; void main() =&gt; runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, ), home: Scaffold( body: Container( color: Colors.blue, height: 56, child: TextField( decoration: InputDecoration( // Sizes contentPadding: EdgeInsets.zero, constraints: const BoxConstraints(minHeight: 56), // Fill color fillColor: Colors.grey, filled: true, // Hint text hintText: &quot;Password&quot;, // Borders border: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: const BorderSide(width: 0, color: Colors.transparent), ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: const BorderSide(width: 0, color: Colors.transparent), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: const BorderSide( width: 2, color: Colors.blue, ), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: const BorderSide( width: 2, color: Colors.blue, ), ), ), ), ), ), ); } } </code></pre> <p>Copying this code into <a href="https://dartpad.dev" rel="nofollow noreferrer">dartpad.dev</a> reveals the issue.</p> <h3>Edit</h3> <p>After removing the height of the container (<code>// height: 56,</code>) there is still a blue gap underneath the TextField. This means that the TextField is taking up the correct height but the InputDecoration is not.</p>
[ { "answer_id": 74281266, "author": "Andrej Kesely", "author_id": 10035985, "author_profile": "https://Stackoverflow.com/users/10035985", "pm_score": 3, "selected": true, "text": "import requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\n\n\nurl = \"https://www.betexplorer.com/...
2022/11/01
[ "https://Stackoverflow.com/questions/74281110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11979688/" ]
74,281,124
<p>I have this .AppImage that, when it updates itself, changes its name to match its version. I also have a python script to update a .desktop shortcut with the new file name. Is there any way to detect the AppImages' name change, then run the python script?</p> <p>I've tried to find a bash command that detects a file's name change, but have only come up with results on how to change a file's name.</p>
[ { "answer_id": 74281266, "author": "Andrej Kesely", "author_id": 10035985, "author_profile": "https://Stackoverflow.com/users/10035985", "pm_score": 3, "selected": true, "text": "import requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\n\n\nurl = \"https://www.betexplorer.com/...
2022/11/01
[ "https://Stackoverflow.com/questions/74281124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391391/" ]
74,281,142
<pre><code>char ch; int nr=0; printf(&quot;\n: &quot;); ch = getchar(); while(ch != 'q' &amp;&amp; ch != 'Q'){ ch = tolower(ch); if(ch == 'a' || ch == 'e' || ch == 'o' || ch == 'i' || ch == 'u') nr++; printf(&quot;something&quot;); ch = getchar(); } printf(&quot;vocale: %d&quot;, nr); </code></pre> <p>its supposed to count the number of vowels until the user presses q or Q. it's such a silly program and yet i cant get past it.</p>
[ { "answer_id": 74281188, "author": "Vlad from Moscow", "author_id": 2877241, "author_profile": "https://Stackoverflow.com/users/2877241", "pm_score": 1, "selected": false, "text": "getchar" }, { "answer_id": 74281233, "author": "Tenobaal", "author_id": 18861247, "auth...
2022/11/01
[ "https://Stackoverflow.com/questions/74281142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391489/" ]
74,281,145
<p>I was making my first website ever.</p> <p>The first button adds one to the number at the bottom, the second button multiplies the amount that's added by 2, and the third one should multiply the multiplier, but for some reason it doesn't work. If someone could point out the error in my code that would be great! also I am sorry for the Very unprofessional website, I just wanted to make it me.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>let numy = 0 increment = 1 multy = 2 multym = 2 function changeColor() { window.alert("downloading virus"); } function adNum() { numy += increment document.getElementById("num").innerHTML = numy; } function multiply() { increment *= multy document.getElementById("earn").innerHTML = "press for earn " + increment; } function multy() { multy *= multym document.getElementById("multiplym").innerHTML = "multiply asmdfmasdfams by " + multym; }</code></pre> <pre class="snippet-code-css lang-css prettyprint-override"><code>body { background-color: powderblue; } body { background-image: url("bigboiwater.jpg"); } h1, h2, h3, h4, h5 { color: red; } img { max-width: 100%; max-height: 100%; } .water { height: 20px; cursor: pointer; margin: 0 auto; } #earn {} #mulity {} #multym } {} .ih { left: 1px; width: 100px } .button { margin: 0 auto; } #num { font-size: 50; color: pink; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;title&gt;you should drink water&lt;/title&gt; &lt;link rel="icon" href="troll.png" /&gt; &lt;div class="ih" style="cursor:progress" ;&gt; &lt;h1 style="cursor:wait;"&gt;Water!&lt;/h1&gt; &lt;h2 style="cursor:crosshair" ;&gt;Water!&lt;/h2&gt; &lt;h3 style="cursor:alias" ;&gt;Water&lt;/h3&gt; &lt;h4 style="cursor:not-allowed" ;&gt;Water&lt;/h4&gt; &lt;h5 style="cursor:zoom-in" ;&gt;Water&lt;/h5&gt; &lt;img src="troll.png"&gt; &lt;div class="water" ;&gt;&lt;button onclick="changeColor()" ;&gt;&lt;img src="Click-Here-PNG-Images.png"&gt;&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;button onclick="adNum()" class="button"&gt; &lt;p id="earn"&gt;press for earn 1&lt;/p&gt; &lt;/button&gt; &lt;button onclick="multiply()" class="button"&gt; &lt;p id="multiply"&gt;multiply earn by 2&lt;/p&gt; &lt;/button&gt; &lt;button onclick="multy()" class="button"&gt; &lt;p id="multiplym"&gt;multiply multiply by 2&lt;/p&gt; &lt;/button&gt; &lt;/div&gt; &lt;p id="num"&gt;hi&lt;/p&gt; &lt;div style="background-color:pink"&gt;&lt;label for="Name"&gt;Whats your problem:&lt;/label&gt;&lt;input type="text" id="Name" name="Name" placeholder="I am kinda stupid"&gt;&lt;/div&gt;</code></pre> </div> </div> </p>
[ { "answer_id": 74281188, "author": "Vlad from Moscow", "author_id": 2877241, "author_profile": "https://Stackoverflow.com/users/2877241", "pm_score": 1, "selected": false, "text": "getchar" }, { "answer_id": 74281233, "author": "Tenobaal", "author_id": 18861247, "auth...
2022/11/01
[ "https://Stackoverflow.com/questions/74281145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16807441/" ]
74,281,185
<p>In TCL the way to make a parameter optional is to give it a default value. I don't know if there are any other ways too. e.g</p> <pre><code>proc my_func {a b c {d 10} {e 11} {f 12}} { ... } </code></pre> <p>Now in the above example the parameters a, b and c are compulsory. The parameters d, e and f are optional. Is there another way to create optional parameters?</p> <p>I am in a situation where I need to create a parameter that can be called from a TCL terminal (in Xilinx Vivado) which has some optional parameters. The user decide to pass a few or all of the optional parameters or none at all. The problem is that, when using positional argument passing, it is impossible to tell TCL which optional parameter we are passing to it. What is the solution to this? e.g</p> <pre><code>my_func 1 2 3 4 5 6 </code></pre> <p>shall call the my_func with values a=1, b=2, c=3, d=4, e=5 and f=6. Also,</p> <pre><code>my_func 1 2 3 4 </code></pre> <p>shall call my_func with values a=1, b=2, c=3 and d=4 and the e, f left at their default values. However, I might need to do something like this</p> <pre><code>my_func 1 2 3 100 </code></pre> <p>where I am passing 100 to f and leave c and d at default value. But the above stament will set d to 100 instead and leave e and f at their default values.</p> <p>What is the solution since I can clearly not use the positional argument technique here.</p>
[ { "answer_id": 74281375, "author": "Chris Heithoff", "author_id": 16350882, "author_profile": "https://Stackoverflow.com/users/16350882", "pm_score": 1, "selected": false, "text": "args" }, { "answer_id": 74282183, "author": "glenn jackman", "author_id": 7552, "author...
2022/11/01
[ "https://Stackoverflow.com/questions/74281185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/854183/" ]
74,281,186
<p>hi I'm pretty new at coding and I was trying to create a program in python that reads and save in another file the data inside a json file (not everything, just what I want). I googled how to parse data but there's something I don't understand.</p> <p>that's a part of the json file:</p> <p>`</p> <pre><code>{ &quot;profileRevision&quot;: 548789, &quot;profileId&quot;: &quot;campaign&quot;, &quot;profileChangesBaseRevision&quot;: 548789, &quot;profileChanges&quot;: [ { &quot;changeType&quot;: &quot;fullProfileUpdate&quot;, &quot;profile&quot;: { &quot;_id&quot;: &quot;2da4f079f8984cc48e84fc99dace495d&quot;, &quot;created&quot;: &quot;2018-03-29T11:02:15.190Z&quot;, &quot;updated&quot;: &quot;2022-10-31T17:34:43.284Z&quot;, &quot;rvn&quot;: 548789, &quot;wipeNumber&quot;: 9, &quot;accountId&quot;: &quot;63881e614ef543b2932c70fed1196f34&quot;, &quot;profileId&quot;: &quot;campaign&quot;, &quot;version&quot;: &quot;refund_teddy_perks_september_2022&quot;, &quot;items&quot;: { &quot;8ec8f13f-6bf6-4933-a7db-43767a055e66&quot;: { &quot;templateId&quot;: &quot;Quest:heroquest_loadout_constructor_2&quot;, &quot;attributes&quot;: { &quot;quest_state&quot;: &quot;Claimed&quot;, &quot;creation_time&quot;: &quot;min&quot;, &quot;last_state_change_time&quot;: &quot;2019-05-18T16:09:12.750Z&quot;, &quot;completion_complete_pve03_diff26_loadout_constructor&quot;: 300, &quot;level&quot;: -1, &quot;item_seen&quot;: true, &quot;sent_new_notification&quot;: true, &quot;quest_rarity&quot;: &quot;uncommon&quot;, &quot;xp_reward_scalar&quot;: 1 }, &quot;quantity&quot;: 1 }, &quot;6940c71b-c74b-4581-9f1e-c0a87e246884&quot;: { &quot;templateId&quot;: &quot;Worker:workerbasic_sr_t01&quot;, &quot;attributes&quot;: { &quot;gender&quot;: &quot;2&quot;, &quot;personality&quot;: &quot;Homebase.Worker.Personality.IsDreamer&quot;, &quot;level&quot;: 1, &quot;item_seen&quot;: true, &quot;squad_slot_idx&quot;: -1, &quot;portrait&quot;: &quot;WorkerPortrait:IconDef-WorkerPortrait-Dreamer-F02&quot;, &quot;building_slot_used&quot;: -1, &quot;set_bonus&quot;: &quot;Homebase.Worker.SetBonus.IsMeleeDamageLow&quot; } } } ] } </code></pre> <p>`</p> <p>I can access profileChanges. I wrote this to create another json file with only the profileChanges things:</p> <p>`</p> <pre><code>myjsonfile= open(&quot;file.json&quot;,'r') jsondata=myjsonfile.read() obj=json.loads(jsondata) ciso=obj['profileChanges'] for i in ciso: print(i) with open(&quot;file2&quot;, &quot;w&quot;) as outfile: json.dump( ciso, outfile, indent=1) </code></pre> <p>the issue I have is that I can't access &quot;profile&quot; (inside profileChanges) in the same way by parsing the new file and I have no idea on how to do it</p> <pre><code></code></pre>
[ { "answer_id": 74281375, "author": "Chris Heithoff", "author_id": 16350882, "author_profile": "https://Stackoverflow.com/users/16350882", "pm_score": 1, "selected": false, "text": "args" }, { "answer_id": 74282183, "author": "glenn jackman", "author_id": 7552, "author...
2022/11/01
[ "https://Stackoverflow.com/questions/74281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391419/" ]
74,281,193
<p>I have a list displayed as inline-block that changes layout when the window is resized smaller, and I have the list inside of an outer section. However, when the list layout changes height, the div does not, and the content in the section below the list suddenly overlaps the list above.</p> <p>tldr; How can I set the height of an outer div to the same height as the inline-block list?</p> <p>My code is essentially as follows:</p> <p>HTML</p> <pre><code>&lt;section&gt; &lt;ul&gt; &lt;li&gt;&lt;div class=&quot;imageHere&quot;&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div class=&quot;imageHere&quot;&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div class=&quot;imageHere&quot;&gt;&lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div class=&quot;imageHere&quot;&gt;&lt;/div&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/section&gt; &lt;section&gt; &lt;p&gt;When the above list is 1row x 4col, this text is placed perfectly. But when the above list is 2row x 2col, this text will overlap the above list.&lt;/p&gt; &lt;/section&gt; </code></pre> <p>CSS</p> <pre><code>section { min-height:100vh; // No matter what, the minimum height should be the height of the window } ul { list-style-type: none; margin: 0; padding: 0; width: 100%; height: 25vw; } li { display: inline-block; vertical-align: top; margin: 15px; } .imageHere { width: 10vw; height: 25vw; } </code></pre> <p>What I have tried:</p> <ul> <li>Not that I know exactly what it does, but I tried using &quot;height: auto;&quot; for the section, but it did nothing.</li> <li>Changing the height of the section manually does change the height of the section.</li> <li>I'm honestly not sure how to go about this without using @media screen, and I REALLY don't want to have to resort to manually adjusting the height of the section each time.</li> </ul> <p>Hopefully there is a solution to this. Thank you so much in advance!</p>
[ { "answer_id": 74281375, "author": "Chris Heithoff", "author_id": 16350882, "author_profile": "https://Stackoverflow.com/users/16350882", "pm_score": 1, "selected": false, "text": "args" }, { "answer_id": 74282183, "author": "glenn jackman", "author_id": 7552, "author...
2022/11/01
[ "https://Stackoverflow.com/questions/74281193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9671862/" ]
74,281,205
<p>This code I have to write should display the subtotal, number of items, sales tax, and total cost</p> <p>When I run it, the program calculates the prices entered wrong, and only prompts me 2 times for a price, when it should prompt me until I tell it to stop.</p> <p>This program uses a while loop and sentinel to proccess the total of item costs purchased online. There is also a tax rate of 6.25% in the calculation.</p> <pre><code>SENTINEL = 0 TAXRATE = 0.0625 numItems = 0 subTotal = 0 print(&quot;&quot;&quot;/ This program will prompt you for the items you purchased online until you enter the sentinel value of 0 to stop the process. The program will create a running total of the items.\n\n\n&quot;&quot;&quot;) itemCost = float(input(&quot;Enter the price of the item(0 to stop):&quot;)) while itemCost != SENTINEL: if itemCost &lt; 0: print(f'this price is illegal!') else: numItems+=1 subTotal+=itemCost itemCost = float(input(&quot;Enter the price of the item(0 to stop):&quot;)) if numItems &gt; 0: salesTax = subTotal * TAXRATE totalCost = subTotal + salesTax print(f'The number of items purchased is {numItems}') print(f'The sub total is {subTotal:.2f}') print(f'The sales tax is {salesTax:.2f}') print(f'The total cost is {totalCost:.2f}') else: print(f'You need to purchase items!') </code></pre> <p>I expected this program to prompt infinitley until you put in the sentinel number, but it only prompts twice. It also thinks that numItems always equals 1, when it shouldnt. it also calculates everything wrong.</p>
[ { "answer_id": 74281375, "author": "Chris Heithoff", "author_id": 16350882, "author_profile": "https://Stackoverflow.com/users/16350882", "pm_score": 1, "selected": false, "text": "args" }, { "answer_id": 74282183, "author": "glenn jackman", "author_id": 7552, "author...
2022/11/01
[ "https://Stackoverflow.com/questions/74281205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391565/" ]
74,281,221
<p>I'm trying to replace the [0] for the index value obtained in the code above. The data[0] is coming from a Json file, and the index value is coming from the month selection. So my goal is to update the data coming from JSON file after the user select a month from the drop down menu.</p> <p>//Getting the index after selecting a month:</p> <pre><code>months.forEach((el, index) =&gt; { el.onclick = function () { const indexValue = Number(index); const monthSelected = (monthText.textContent = this.innerHTML); console.log(monthSelected); console.log(indexValue); return indexValue; }; }); </code></pre> <p><a href="https://i.stack.imgur.com/ICPfe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ICPfe.png" alt="enter image description here" /></a></p> <p>//Here's is where I need to change that hard coded 0 for something:</p> <pre><code>// Step2 const jsonData = fetch(&quot;data.json&quot;) .then(function (resp) { return resp.json(); }) .then(function (data) { const generalData = data[0]; </code></pre> <p>Trying to re-use the index inside the []</p>
[ { "answer_id": 74281312, "author": "Amikot40", "author_id": 10756331, "author_profile": "https://Stackoverflow.com/users/10756331", "pm_score": -1, "selected": false, "text": "months.forEach((el, index) => {\n el.onclick = function () {\n var indexValue = Number(index);\n const mo...
2022/11/01
[ "https://Stackoverflow.com/questions/74281221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20389479/" ]
74,281,222
<p>I have a google sheet with several named ranges. I would like to import every single named range in the sheet and save them as individual objects named after the named range. Furthermore, there are 4 similar blocks of data. Therefore the names of the ranges are structured like &quot;block1_name1&quot; &quot;block1_name2&quot; &quot;block2_name1&quot; &quot;block2_name2&quot; etc.</p> <p>With the following code I can enter every range manually, but there are too many to enter them all manually:</p> <pre><code> const API_KEY = &quot;###&quot;; // Please set your API key. const ID = &quot;###&quot;; // Please set your Spreadsheet ID. const RANGE = [&quot;Range1&quot;, &quot;Range2&quot;]; // Named ranges const ranges = RANGE.map(e =&gt; `ranges=${encodeURIComponent(e)}`).join(&quot;&amp;&quot;); const response = await fetch(`https://sheets.googleapis.com/v4/spreadsheets/${ID}/values:batchGet?key=${API_KEY}&amp;${ranges}`); const { valueRanges } = await response.json(); const obj = valueRanges.reduce((o, { values }, i) =&gt; (o[RANGE[i]] = values, o), {}); console.log(obj); </code></pre> <p>How can I import every named range automatically?</p> <p>How can I save them as a different objects for each datablock like block1.name1 etc?</p>
[ { "answer_id": 74281918, "author": "Giselle Valladares", "author_id": 17390145, "author_profile": "https://Stackoverflow.com/users/17390145", "pm_score": 1, "selected": false, "text": "Method: spreadsheets.get" }, { "answer_id": 74282904, "author": "Tanaike", "author_id":...
2022/11/01
[ "https://Stackoverflow.com/questions/74281222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20375109/" ]
74,281,243
<p>I work on node.js and EJS. I got:</p> <blockquote> <p>TypeError: Cannot read properties of undefined (reading 'push')&quot; error.</p> </blockquote> <p>Here's my code: <a href="https://i.stack.imgur.com/mBeed.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mBeed.png" alt="enter image description here" /></a> <a href="https://i.stack.imgur.com/T1s6u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T1s6u.png" alt="Schema" /></a> <a href="https://i.stack.imgur.com/zFhPJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zFhPJ.png" alt="error" /></a></p> <p>I can write <code>id</code> log but I can't push to my array field.. some needs help</p>
[ { "answer_id": 74281918, "author": "Giselle Valladares", "author_id": 17390145, "author_profile": "https://Stackoverflow.com/users/17390145", "pm_score": 1, "selected": false, "text": "Method: spreadsheets.get" }, { "answer_id": 74282904, "author": "Tanaike", "author_id":...
2022/11/01
[ "https://Stackoverflow.com/questions/74281243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19682853/" ]
74,281,251
<p>HI my Json file is as follows:</p> <pre><code>{ &quot;num_sensor&quot; : 1, &quot;J2&quot; : {&quot;B&quot; : &quot;sensor0&quot;, &quot;A&quot; : &quot;sensor1&quot;, &quot;D&quot; : &quot;sensor2&quot; , &quot;C&quot; : &quot;sensor3&quot;}, &quot;J1&quot; : {&quot;B&quot; : &quot;&quot;, &quot;A&quot; : &quot;sensor5&quot;, &quot;D&quot; : &quot;sensor6&quot; , &quot;C&quot; : &quot;sensor7&quot;} } </code></pre> <p>I tried the following to check J1.B is empty:</p> <pre><code>s=`jq '.J1.B' ~/package/sensor_data.json` </code></pre> <p>With the following methods:</p> <pre><code>if [[ $s = &quot;&quot;&quot;&quot; ]]; then echo &quot;empty&quot; else echo &quot;not_empty&quot; echo &quot;$s&quot; fi jq -r '.[] | if .J1.B == &quot;&quot; then &quot;description is empty&quot; else .J1.B end' ~/package/sensor_data.json k=`jq '.J1.B' ~/package/sensor_data.json select (.!=null)` echo &quot;$k&quot; if [ -z &quot;$s&quot; ] then echo &quot;\$var is empty&quot; else echo &quot;\$var is NOT empty&quot; echo &quot;$s&quot; fi </code></pre> <p>None of them work. Everything gives me non-empty and</p> <pre><code>jq -r '.[] | if .J1.B == &quot;&quot; then &quot;description is empty&quot; else .J1.B end' ~/package/sensor_data.json </code></pre> <p>gives me Error as:</p> <pre><code> Cannot index number with string &quot;J1&quot; </code></pre> <p>Can you please let me know how I can check empty string of json file in bash script?</p>
[ { "answer_id": 74281918, "author": "Giselle Valladares", "author_id": 17390145, "author_profile": "https://Stackoverflow.com/users/17390145", "pm_score": 1, "selected": false, "text": "Method: spreadsheets.get" }, { "answer_id": 74282904, "author": "Tanaike", "author_id":...
2022/11/01
[ "https://Stackoverflow.com/questions/74281251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13868687/" ]
74,281,263
<p>For a school projet that wants us to use python turtle but no external libraries (that you have to install from command line), I firstly made a car that can move following a few tutorials. The car worked perfectly. I then tried to add multiple cars. Because I couldn't use multi threading libraries, I succesfully used the exec function to create autmatically a given number of turtles acting as cars. They work fine (although having to many of them is laggy, I don't need a lot of them)</p> <p>My problem is when the cars are colliding, one frame it shows a car on top and the next frame it's the other car on top, and each frame it switches making them &quot;flicker&quot;, while I want the bottom one (with the smallest Y value) to be the one shown when 2 or more cars are colliding (for perspective reasons).</p> <p>Here is my code that I simplified the best I could :</p> <pre><code>from turtle import * from random import * from tkinter import * #Setup of Turtles and Screen root = Tk() screen = Screen() screen.setup(width=root.winfo_screenwidth(), height=root.winfo_screenheight()) screen.tracer(False) root.destroy() for loop in range(1, 3): exec(&quot;car&quot; + str(loop) + &quot; = Turtle()&quot;) for loop in range(1, 3): exec(&quot;car&quot; + str(loop) + &quot;.hideturtle()&quot;) exec(&quot;car&quot; + str(loop) + &quot;.speed(0)&quot;) #Car itself (simplified to a rectangle) def car_form(car_color: tuple, car): size = 1.7 car.pendown() colormode(255) car.fillcolor(car_color) car.begin_fill() car.setx(car.xcor() + 75 * size) car.sety(car.ycor() + 20 * size) car.setx(car.xcor() - 75 * size) car.sety(car.ycor() - 20 * size) car.end_fill() #Movement of the cars def infinite_car(car, car_color, way): screen.update() car.clear() car_form(car_color, car) car.setheading(0) if way == 1: car.setx(car.xcor() + 0.2) else: car.setx(car.xcor() - 0.2) #Main function that position the cars, give some values and start the movement loop def main(): for loop in range(1, 3): exec('car_color' + str(loop) +' = (randint(0, 255), randint(0, 255), randint(0, 255))') if loop == 1: exec('car' + str(loop) + '.setx(-100)') else: exec('car' + str(loop) + '.setx(100)') while True: for loop in range(1, 3): if loop == 1: exec('infinite_car(car' + str(loop) + ', car_color' + str(loop) + ', 1' + ')') else: exec('infinite_car(car' + str(loop) + ', car_color' + str(loop) + ', 2' + ')') main() </code></pre>
[ { "answer_id": 74281918, "author": "Giselle Valladares", "author_id": 17390145, "author_profile": "https://Stackoverflow.com/users/17390145", "pm_score": 1, "selected": false, "text": "Method: spreadsheets.get" }, { "answer_id": 74282904, "author": "Tanaike", "author_id":...
2022/11/01
[ "https://Stackoverflow.com/questions/74281263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14796589/" ]
74,281,287
<p>Im trying to create a function where if file modified, then perform task. I am able to do this if a file exists by doing -</p> <pre><code>import os file_path = 'C:/Hi/' if os.listdir(file_path): do xyz </code></pre> <p>But how can i do xyz based on if a files date was modified?</p> <pre><code>os.path.getmtime(file_path) </code></pre> <p>Only gets the time but cant be used in my if statement</p>
[ { "answer_id": 74281384, "author": "Claudio", "author_id": 7711283, "author_profile": "https://Stackoverflow.com/users/7711283", "pm_score": 2, "selected": true, "text": "import os \nimport time\nno_of_seconds_since_last_check = 30\nif time.time() - os.path.getmtime(file_path) < no_of_se...
2022/11/01
[ "https://Stackoverflow.com/questions/74281287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18572659/" ]
74,281,319
<p>I have the below dataframe. How can I filter it to find only unique emails that are in both event years (e.g. 2022 and 2023)?</p> <pre><code>df_current = pd.DataFrame({'Email':['Bob_Jones@gmail.com', 'Mike_Smith@gmail.com', 'Mike_Smith@gmail.com', 'Bob_Jones@gmail.com'], 'Tickets Sold':[1, 2, 1, 1], 'Year':['2022', '2023', '2023', '2023']}) df_desired = pd.DataFrame({'Email':['Bob_Jones@gmail.com', 'Bob_Jones@gmail.com'], 'Tickets Sold':[1, 1], 'Year':['2022', '2023']}) </code></pre>
[ { "answer_id": 74281384, "author": "Claudio", "author_id": 7711283, "author_profile": "https://Stackoverflow.com/users/7711283", "pm_score": 2, "selected": true, "text": "import os \nimport time\nno_of_seconds_since_last_check = 30\nif time.time() - os.path.getmtime(file_path) < no_of_se...
2022/11/01
[ "https://Stackoverflow.com/questions/74281319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12421758/" ]
74,281,325
<p>I have an input field and a button (when clicked on displays a dropdown with few items) when selecting the items it has to be shown on the first input field. Similarly when clicking on the 2nd button where the dropdown is shown the selected value is shown in the 2nd input field. This entire runs in a for loop , which is where I am facing the problem.</p> <pre class="lang-html prettyprint-override"><code>&lt;tr v-for=&quot;items in itemList&quot;&gt; &lt;td valign=&quot;top&quot;&gt;&amp;nbsp;{{items}}&amp;nbsp;&lt;/td&gt; &lt;td align=&quot;left&quot; nowrap&gt; &lt;input v-model=&quot;itemCode&quot; type=&quot;text&quot; :id=&quot;'item_code_'+items&quot; @input=&quot;handleInput&quot; size=&quot;20&quot; maxlength=&quot;27&quot; autocomplete=&quot;off&quot;&gt; &lt;br/&gt; &lt;/td&gt; &lt;td align=&quot;left&quot; nowrap&gt; &lt;a id=&quot;myDropdown&quot; class=&quot;dropdown&quot; style=&quot;text-decoration:none;font- size:10pt; padding-left: 10px;padding-right: 10px;&quot; @click=&quot;loadFavs()&quot; href=&quot;javascript:void(0)&quot; title=&quot;Click to choose an item from your favorites&quot;&gt; &lt;img hspace=&quot;3&quot; alt=&quot;Favorites&quot; src=&quot;/images/icons/LoadFav.png&quot; height=&quot;16&quot; width=&quot;16&quot; onmousemove=&quot;this.style.cursor='pointer'&quot; :id=&quot;'bd_fav_image_' + items&quot; title=&quot;Click to choose an item from your favorites&quot;&gt; &lt;select class=&quot;dropdown-content&quot; v-if=&quot;showFav&quot; name=&quot;BOMList&quot; :id=&quot;'bd_list_'+items&quot; style=&quot;font-size:10pt;width: 100%&quot; v- model=&quot;selected&quot; @change=&quot;selectingFav(items)&quot;&gt; &lt;option value=&quot;&quot;&gt;&lt;/option&gt; &lt;option v-for=&quot;(fav,index) in favList&quot; :id=&quot;index&quot; v- bind:value=&quot;fav&quot; :key=&quot;fav&quot; v-bind:index=&quot;index&quot;&gt;{{fav}} {{index}}&lt;/option&gt; &lt;/select&gt; &lt;/a&gt; &lt;/td&gt; &lt;td valign=&quot;top&quot; nowrap &gt; &lt;input type=&quot;Text&quot; :id=&quot;'bd_qty_ '+ index&quot; value=&quot;&quot; size=&quot;2&quot; inputmode=&quot;numeric&quot; maxlength=&quot;&quot;&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>favList--&gt; this list holds a list of items , For eg:- A,B,C,D When I select A it has to be shown in the input field.</p> <pre class="lang-js prettyprint-override"><code> selectingFav: function(value) { console.log(&quot;Inside the selectingFav...&quot; + this.selected + &quot;value is .&quot; +value); setTheValue(value); } function setTheValue(val){ console.log(&quot;Inside the setThevlaue&quot;); if (val === 1 ){ console.log(&quot;inside the if&quot;); $j('#item_code_1').val(this.selected); console.log(&quot;inside the if witht the value &quot; + $j('#item_code_1').val()); } </code></pre> <p>Tried setting the value based on the id of the input field but nothing is showing up. If I set the v-model to the input field then all the 3 fields will be showing up the same value.</p> <p>Can someone please let me know what is the issue. Hope these details are sufficient.</p>
[ { "answer_id": 74281384, "author": "Claudio", "author_id": 7711283, "author_profile": "https://Stackoverflow.com/users/7711283", "pm_score": 2, "selected": true, "text": "import os \nimport time\nno_of_seconds_since_last_check = 30\nif time.time() - os.path.getmtime(file_path) < no_of_se...
2022/11/01
[ "https://Stackoverflow.com/questions/74281325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16627646/" ]
74,281,339
<p>I have some scraped data from an ecommerce website and that has the package unit count in the name (see example below). I want to take the unit count information from the name and add the number of units as a int into a &quot;Unit&quot; column. I know I can use <code>df.loc[product_column].str.contains('10 pk'), unitColumn] = 10</code>, or even loop through a list that holds sample strings of each unit count. But it becomes a little more cumbersome when your looking at data from 150 stores.</p> <p>What I'm looking for is a way for python to figure it out automatically and change set the value for with ML. I don't know if it's possible but I'm hoping someone can point me in then right direction.</p> <pre><code>Product name 10 pack flavor 10 Pack product name 10 pack name product name flavor 10pk flavor product name 14Pk 1gx14 Product name name 2-Pack 2pk different name store name 3 pack product name 5 pack store name name 5 pack 5 Pack product name Name 5-pack product name randome name 5pk product name name 5pk flavor 6 Pack flavor flavor 7 pack prduct name 7 pack 7pk flavor pack x2 name </code></pre> <p>I know I can do</p> <pre><code>df.loc[product_column].str.contains('10 pk'), unitColumn] = 10 </code></pre> <p>But I'm looking for more of an automated solution.</p>
[ { "answer_id": 74309012, "author": "Luke ", "author_id": 20391324, "author_profile": "https://Stackoverflow.com/users/20391324", "pm_score": 2, "selected": true, "text": " dfQty={\n 2:tuple(['Pack x2', '2-pack', '2pk','2-pack']),\n 3: tuple(['3 pack', '3pk']),\n #4: tuple([])...
2022/11/01
[ "https://Stackoverflow.com/questions/74281339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391324/" ]
74,281,344
<p>I've just created my own website with my own domain with IONOS.</p> <p>On the side, I had created a webpage which was hosted using XAMP, so currently to view my webpage I have to use the URL <code>http://localhost/project1/index.html#</code></p> <p>However, I'd like to integrate it into my website if possible?</p> <p>For example have a section on my webpage where I show a thumbnail of the webpage and when clicked it takes me to <code>www.mywebsite.co.uk/project1</code></p> <p>I'm not sure how to go about this though?</p>
[ { "answer_id": 74309012, "author": "Luke ", "author_id": 20391324, "author_profile": "https://Stackoverflow.com/users/20391324", "pm_score": 2, "selected": true, "text": " dfQty={\n 2:tuple(['Pack x2', '2-pack', '2pk','2-pack']),\n 3: tuple(['3 pack', '3pk']),\n #4: tuple([])...
2022/11/01
[ "https://Stackoverflow.com/questions/74281344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20372474/" ]
74,281,347
<p>I need to show the number of valid inspectors we have by month over the last five years. Inspectors are considered valid when the expiration date on their certification has not yet passed, recorded as the month end date. The below SQL code is text of the query to count valid inspectors for January 2017:</p> <pre><code>SELECT Count(*) AS RecordCount FROM dbo_Insp_Type WHERE (dbo_Insp_Type.CERT_EXP_DTE)&gt;=#2/1/2017#); </code></pre> <p>Rather than designing 60 queries, one for each month, and compiling the results in a final table (or, err, query) are there other methods I can use that call for less manual input?</p>
[ { "answer_id": 74309012, "author": "Luke ", "author_id": 20391324, "author_profile": "https://Stackoverflow.com/users/20391324", "pm_score": 2, "selected": true, "text": " dfQty={\n 2:tuple(['Pack x2', '2-pack', '2pk','2-pack']),\n 3: tuple(['3 pack', '3pk']),\n #4: tuple([])...
2022/11/01
[ "https://Stackoverflow.com/questions/74281347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19461439/" ]
74,281,366
<p>I want to change an element position base on the mouse position. I have a list of images displayed in a line using flex and I want to move the container (track) to the right when the mouse is moved to the left.</p> <p>For this, I want to change the track style but I find it difficult. I tried using</p> <pre class="lang-js prettyprint-override"><code>navTrack.current.transform = `translateX(${-x})`; </code></pre> <p>but it throws an error.</p> <p>This is the function:</p> <pre class="lang-js prettyprint-override"><code>const handleMouseMove = (e) =&gt; { const x = e.clientX; console.log(x); navTrack.current.transform = `translateX(${-x})`; }; </code></pre> <p>The function is called on onMouseMove.</p>
[ { "answer_id": 74281637, "author": "Ludolfyn", "author_id": 11472399, "author_profile": "https://Stackoverflow.com/users/11472399", "pm_score": 0, "selected": false, "text": "style" }, { "answer_id": 74281728, "author": "Henry Woody", "author_id": 8068625, "author_pro...
2022/11/01
[ "https://Stackoverflow.com/questions/74281366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18190313/" ]
74,281,381
<p>I've written a Flutter Desktop MacOS application that uses a command line argument to process a file:</p> <pre class="lang-dart prettyprint-override"><code>void main(List&lt;String&gt; args) async { if (args.isNotEmpty) { runApp(MyApp(args.first)) } else ...; } </code></pre> <p>which works as expected when I run it from the shell:</p> <pre class="lang-bash prettyprint-override"><code># this command is ok: /Applications/TommyView.app/Contents/MacOS/TommyView Pictures/hey.png </code></pre> <p>But when I assign this app to all *.png images, and want to run it from Finder, it shows:</p> <p><a href="https://i.stack.imgur.com/IacR4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IacR4.png" alt="enter image description here" /></a></p> <p>(or sometimes another error depending on Info.plist: <code>TommyView cannot open files in the “PNG image” format.</code>)</p> <p>Also I noticed that the execution goes to <code>&quot;else&quot;</code> case (i.e. <code>args</code> are empty).</p> <p>I guess some magic is missing in Info.plist. Please help to figure out.</p>
[ { "answer_id": 74281637, "author": "Ludolfyn", "author_id": 11472399, "author_profile": "https://Stackoverflow.com/users/11472399", "pm_score": 0, "selected": false, "text": "style" }, { "answer_id": 74281728, "author": "Henry Woody", "author_id": 8068625, "author_pro...
2022/11/01
[ "https://Stackoverflow.com/questions/74281381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2212849/" ]
74,281,425
<p><strong>I need a help for get a date from a position in a month.</strong></p> <p>For example:</p> <ul> <li>The 4º day, considering just the workdays (days except saturday and sunday) on a week in November 2022 is 2022/11/07.</li> <li>The 21º day, considering just the workdays (days except saturday and sunday) on a week in November 2022 is 2022/11/29.</li> </ul> <p>I have:</p> <pre><code>import calendar c = calendar.Calendar(firstweekday=calendar.SUNDAY) year = 2022; month = 11 monthcal = c.monthdatescalendar(year,month) ordinal_date = [day for week in monthcal for day in week if \ day.month == month] ordinal_date: [datetime.date(2022, 11, 1), datetime.date(2022, 11, 2), datetime.date(2022, 11, 3), datetime.date(2022, 11, 4), datetime.date(2022, 11, 5), datetime.date(2022, 11, 6), datetime.date(2022, 11, 7), datetime.date(2022, 11, 8), datetime.date(2022, 11, 9), datetime.date(2022, 11, 10), datetime.date(2022, 11, 11), datetime.date(2022, 11, 12), datetime.date(2022, 11, 13), datetime.date(2022, 11, 14), datetime.date(2022, 11, 15), datetime.date(2022, 11, 16), datetime.date(2022, 11, 17), datetime.date(2022, 11, 18), datetime.date(2022, 11, 19), datetime.date(2022, 11, 20), datetime.date(2022, 11, 21), datetime.date(2022, 11, 22), datetime.date(2022, 11, 23), datetime.date(2022, 11, 24), datetime.date(2022, 11, 25), datetime.date(2022, 11, 26), datetime.date(2022, 11, 27), datetime.date(2022, 11, 28), datetime.date(2022, 11, 29), datetime.date(2022, 11, 30)] </code></pre> <p>When i do that, for the eighth workday, i have the wrong result:</p> <pre><code>ordinal_date[8]: datetime.date(2022, 11, 9) </code></pre> <p>The result that i need for the eighth workday should be:</p> <pre><code>datetime.date(2022, 11, 10) </code></pre> <p>How can i get only de weekdays based on position ?</p> <p>Thanks!</p>
[ { "answer_id": 74281637, "author": "Ludolfyn", "author_id": 11472399, "author_profile": "https://Stackoverflow.com/users/11472399", "pm_score": 0, "selected": false, "text": "style" }, { "answer_id": 74281728, "author": "Henry Woody", "author_id": 8068625, "author_pro...
2022/11/01
[ "https://Stackoverflow.com/questions/74281425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12126272/" ]
74,281,429
<p>Say I have 4 regions: A, B, C, D, key, and values. How can I structure a DAX query to get</p> <ol> <li>The top N keys</li> <li>by value (descending)</li> <li>for <em><strong>each</strong></em> of the regions? So basically, top 100 keys for A by value, top 100 keys for B by value, etc.</li> </ol> <p>Something like</p> <pre><code>EVALUATE TOPN ( 100, SUMMARIZECOLUMNS( key, region), value, [DESC] ) </code></pre> <p>Thanks</p>
[ { "answer_id": 74282270, "author": "Ozan Sen", "author_id": 19469088, "author_profile": "https://Stackoverflow.com/users/19469088", "pm_score": 1, "selected": false, "text": "CalcTable =\nVAR RegionSelected = \"A\"\nRETURN\n TOPN (\n 100,\n FILTER ( YourTable, YourTable[...
2022/11/01
[ "https://Stackoverflow.com/questions/74281429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432779/" ]
74,281,440
<pre><code>from typing import NewType import sqlite3 connection = sqlite3.connect(&quot;uids.db&quot;) cursor = connection.cursor() table = &quot;&quot;&quot;CREATE TABLE USERS ( UID INT USERNAME VARCHAR(25) NOT NULL );&quot;&quot;&quot; cursor.execute(&quot;DROP TABLE IF EXISTS USERS&quot;) cursor.execute(table) print(&quot;table ok&quot;) uid = NewType('uid', int) def ucheck(id: uid) -&gt; int: if id &lt;= 18446744073709551615: print(&quot;uid good&quot;) return 0 else: raise ValueError(&quot;UID not less than or equal to 64 bit signed integer limit&quot;) return 1 def ucreate(idx: uid, usrname: str): cursor.execute(f&quot;&quot;&quot;INSERT INTO USERS VALUES ({uid}, ?)&quot;&quot;&quot;, (usrname)) print(f&quot;USER WITH NAME {usrname} AND ID {uid} CREATED&quot;) ucreate(1, &quot;admin&quot;) </code></pre> <p>When I run this code, it returns this error:</p> <pre><code>table ok Traceback (most recent call last): File &quot;main.py&quot;, line 35, in &lt;module&gt; ucreate(1, &quot;admin&quot;) File &quot;main.py&quot;, line 31, in ucreate cursor.execute(f&quot;&quot;&quot;INSERT INTO USERS VALUES ({uid}, ?)&quot;&quot;&quot;, (usrname)) sqlite3.OperationalError: near &quot;&lt;&quot;: syntax error </code></pre> <p>Can anyone help me? I am kind of new to SQLITE</p> <p>I tried changing the quotations, I tried using the <code>?</code> operator and putting the parameters after and it still did not work.</p>
[ { "answer_id": 74282270, "author": "Ozan Sen", "author_id": 19469088, "author_profile": "https://Stackoverflow.com/users/19469088", "pm_score": 1, "selected": false, "text": "CalcTable =\nVAR RegionSelected = \"A\"\nRETURN\n TOPN (\n 100,\n FILTER ( YourTable, YourTable[...
2022/11/01
[ "https://Stackoverflow.com/questions/74281440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12973708/" ]
74,281,441
<p>I am trying to build a website up and down checker. but when I try to run my program I get this error: (cannot apply operator '!' to operand of type 'string')</p> <p>How can I fix it?</p> <p>I'm new to c# btw.</p> <p>the error is in the if statement.</p> <p>this is the code:</p> <pre><code>using System; using System.Net; namespace cc { class Program { static void Main(string[] args) { Console.WriteLine(&quot;Enter Your Website for further checking: &quot;); string url = Console.ReadLine(); System.Threading.Thread.Sleep(3); Console.WriteLine(&quot;Checking...&quot;); System.Threading.Thread.Sleep(3); Console.WriteLine(&quot;Found some shit.&quot;); System.Threading.Thread.Sleep(3); Console.WriteLine(&quot;Printing Request...&quot;); WebClient client = new WebClient(); string checksite = client.DownloadString(url); if (!checksite == HttpStatusCode.OK) { Console.WriteLine(&quot;Your Bitch is Down!&quot;); } } } } </code></pre>
[ { "answer_id": 74281484, "author": "Matteo Maestri", "author_id": 20262119, "author_profile": "https://Stackoverflow.com/users/20262119", "pm_score": 0, "selected": false, "text": "()" }, { "answer_id": 74281555, "author": "Joel Coehoorn", "author_id": 3043, "author_p...
2022/11/01
[ "https://Stackoverflow.com/questions/74281441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20317198/" ]
74,281,471
<p>I have a script that gets the username by PlayFab id and writes it to the variable <code>TestName</code></p> <p>It was taken (and slightly modified) from the original documentation: <a href="https://learn.microsoft.com/en-us/gaming/playfab/features/data/playerdata/getting-player-profiles" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/gaming/playfab/features/data/playerdata/getting-player-profiles</a></p> <pre><code>// Initially TestName not set void GetPlayerProfile(string playFabId) { PlayFabClientAPI.GetPlayerProfile( new GetPlayerProfileRequest() { PlayFabId = playFabId, ProfileConstraints = new PlayerProfileViewConstraints() { ShowDisplayName = true } }, result =&gt; TestName = result.PlayerProfile.DisplayName, error =&gt; Debug.LogError(error.GenerateErrorReport())); } </code></pre> <p>Next, I have a script that takes an array of leaderboard data and writes it to the <code>Leaders</code> variable in a user-friendly format</p> <pre><code>void OnLeaderboardGet(GetLeaderboardResult result) { foreach (var item in result.Leaderboard) { GetPlayerProfile(item.PlayFabId); Debug.Log(TestName); Leaders += ((item.Position + 1) + &quot;) &quot; + TestName + &quot;: &quot; + item.StatValue + &quot;\n&quot;); } LeaderboardText.text = Leaders.ToString(); Debug.Log(Leaders); } </code></pre> <p>The problem occurs in the first function <code>GetPlayerProfile(item.PlayFabId);</code>. The function receives a username with a delay and does not have time to overwrite the variable <code>TestName</code></p> <p>As a result I get this:</p> <p><a href="https://i.stack.imgur.com/opEdH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/opEdH.png" alt="enter image description here" /></a></p> <p>Are there any solutions for fast loading leaderboards?</p>
[ { "answer_id": 74288690, "author": "RedStone", "author_id": 9804370, "author_profile": "https://Stackoverflow.com/users/9804370", "pm_score": 2, "selected": true, "text": "GetLeaderboardResult _leaderBoard;\n\nIEnumerator GetLeaderBoardData()\n{\n int getLeaderBoard = 1;\n PlayFabC...
2022/11/01
[ "https://Stackoverflow.com/questions/74281471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17454874/" ]
74,281,481
<p>I have the table below with codes. I would like to create two new columns. 1 that identifies any code with the letters YYY and another that identifies the letters WWW as seen in the intermediate table. After that, I would like to aggregate these and have a ID's columns with all the YYY codes and WWW codes and their totals.</p> <p>I am a bit new to python. I am trying to get to the final table below but am stuck trying to get to the intermediate table and have provided my code below. I am receiving a KeyError: 'code':</p> <pre><code>#for YYY def categorise(y): if y['Code'].str.contains('YYY'): return 1 return 0 df1['Code'] = df.apply(lambda y: categorise(y), axis=1) #for WWW def categorise(w): if w['Code'].str.contains('WWW'): return 1 return 0 df1['Code'] = df.apply(lambda w: categorise(w), axis=1) </code></pre> <p>Any help would be appreciated on this.</p> <p><strong>Current Table:</strong></p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Code</th> </tr> </thead> <tbody> <tr> <td>001,ABC,123,YYY</td> </tr> <tr> <td>002,ABC,546,WWW</td> </tr> <tr> <td>003,ABC,342,WWW</td> </tr> <tr> <td>004,ABC,635,YYY</td> </tr> </tbody> </table> </div> <p><strong>Intermediate Table:</strong></p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Code</th> <th>Location_Y</th> <th>Location_W</th> </tr> </thead> <tbody> <tr> <td>001,ABC,123,YYY</td> <td>1</td> <td>0</td> </tr> <tr> <td>002,ABC,546,WWW</td> <td>0</td> <td>1</td> </tr> <tr> <td>003,ABC,342,WWW</td> <td>0</td> <td>1</td> </tr> <tr> <td>004,ABC,635,YYY</td> <td>1</td> <td>0</td> </tr> </tbody> </table> </div> <p><strong>Final Table:</strong></p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>IDs</th> <th>Location_Y</th> <th>Location_W</th> </tr> </thead> <tbody> <tr> <td>001,ABC,123,YYY - 004,ABC,635,YYY</td> <td>2</td> <td>0</td> </tr> <tr> <td>002,ABC,546,WWW - 003,ABC,342,WWW</td> <td>0</td> <td>2</td> </tr> </tbody> </table> </div> <p>Any help would be appreciated</p>
[ { "answer_id": 74288690, "author": "RedStone", "author_id": 9804370, "author_profile": "https://Stackoverflow.com/users/9804370", "pm_score": 2, "selected": true, "text": "GetLeaderboardResult _leaderBoard;\n\nIEnumerator GetLeaderBoardData()\n{\n int getLeaderBoard = 1;\n PlayFabC...
2022/11/01
[ "https://Stackoverflow.com/questions/74281481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19852587/" ]
74,281,511
<p>Good evenening (at least where I live ;) )</p> <p>I have a carousel set up. I would like to remove the class 'invisible' to the current slide. Unfortunately, I'm a total noob when it comes to JQuery, and I'm having a really hard time understanding how to set this up properly.</p> <p>This is the snippet</p> <p>HTML</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const move = 600; const margin_reset = (move * -1) + 'px' setInterval(()=&gt;{ $("#inside-container").animate({ marginLeft: (move * -2) +"px" }, 1800, function() { $(this).append( $(this).find('.items:first') ) .css('margin-left', margin_reset); $('items.active').removeClass('active', 'invisible'); $(this).addClass('active'); } ); }, 4000)</code></pre> <pre class="snippet-code-css lang-css prettyprint-override"><code>#outside-container{ display: block; width: 600px; height: 50vh; border: 1px solid #000; overflow: hidden; margin: 0px auto; } #inside-container{ display: block; width: 2400px; height: 100%; overflow: hidden; margin-left: -200px; } .items{ float: left; margin: 0px; width: 600px; height: 100%; } #item1{ background: green; } #item2{ background: red; } #item3{ background: blue; } #item4{ background: yellow; } .carousel-img { position: relative; width: 100%; height: 100%; } .invisible { display: none; } .data-div { position: absolute; top: 31%; left: 19%; overflow: hidden; color: rgb(255, 255, 255); font-weight: 600; font-size: large; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="main"&gt; &lt;div id="outside-container"&gt; &lt;div id="inside-container" class="cf"&gt; &lt;div class="items" id="item1"&gt; &lt;div class="data-div invisible"&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;{{rio_de_janeiro.city}}&lt;/b&gt; &lt;/li&gt; &lt;li&gt;{{rio_de_janeiro.weather.description}}&lt;/li&gt; &lt;!-- &lt;img src="{{rio_de_janeiro.weather.icon}}" alt=""&gt; --&gt; &lt;li&gt;{{rio_de_janeiro.main.temperature}}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;img src="{% static 'weather/images/cities/' %}{{rio_de_janeiro.city_capitalized}}.jpg" class="carousel-img"&gt; &lt;/div&gt; &lt;div class="items active" id="item2"&gt; &lt;div class="data-div invisible"&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;{{new_york.city}}&lt;/b&gt; &lt;/li&gt; &lt;li&gt;{{new_york.weather.description}}&lt;/li&gt; &lt;!-- &lt;img src="{{new_york.weather.icon}}" alt=""&gt; --&gt; &lt;li&gt;{{new_york.main.temperature}}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;img src="{% static 'weather/images/cities/' %}{{new_york.city_capitalized}}.jpg" class="carousel-img"&gt; &lt;/div&gt; &lt;div class="items" id="item3"&gt; &lt;div class="data-div invisible"&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;{{london.city}}&lt;/b&gt; &lt;/li&gt; &lt;li&gt;{{london.weather.description}}&lt;/li&gt; &lt;!-- &lt;img src="{{london.weather.icon}}" alt=""&gt; --&gt; &lt;li&gt;{{london.main.temperature}}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;img src="{% static 'weather/images/cities/' %}{{london.city_capitalized}}.jpg" class="carousel-img"&gt; &lt;/div&gt; &lt;div class="items" id="item4"&gt; &lt;div class="data-div invisible"&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;{{sidney.city}}&lt;/b&gt; &lt;/li&gt; &lt;li&gt;{{sidney.weather.description}}&lt;/li&gt; &lt;!-- &lt;img src="{{sidney.weather.icon}}" alt=""&gt; --&gt; &lt;li&gt;{{sidney.main.temperature}}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;img src="{% static 'weather/images/cities/' %}{{sidney.city_capitalized}}.jpg" class="carousel-img"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>#1 I don't even think that adding the 'active' class is needed in this case, but honestly I just threw it in there and see if it would help (bad idea I know, LOL)</p> <p>#2 This should definitely be possible just by using plain JS, and if you feel more comfortable solving this using JS, feel totally free to do so. I'm not fixated on using JQuery</p> <p>thank you very much in advance for any help :)</p>
[ { "answer_id": 74288690, "author": "RedStone", "author_id": 9804370, "author_profile": "https://Stackoverflow.com/users/9804370", "pm_score": 2, "selected": true, "text": "GetLeaderboardResult _leaderBoard;\n\nIEnumerator GetLeaderBoardData()\n{\n int getLeaderBoard = 1;\n PlayFabC...
2022/11/01
[ "https://Stackoverflow.com/questions/74281511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
74,281,623
<p>I have two dates that are UTC</p> <pre><code>&quot;2022-11-01T22:16:19.844Z&quot; // &lt;-- in the past but later in the day </code></pre> <pre><code>&quot;2022-11-08T20:16:19.844Z&quot; // &lt;--- in the future but earlier in the day </code></pre> <p>The first date is &lt; the second date BUT it is later in the day...</p> <p>I am trying to return the date the is the earliest in the day ex the least amount of hours and minutes... I dont want to return the date that is in the past, ONLY the date that occurs earliest in the day</p> <p>I have tried</p> <pre><code>const date_a = new Date(&quot;2022-11-01T22:16:19.844Z&quot;).getTime() const date_b = new Date(&quot;2022-11-08T20:16:19.844Z&quot;).getTime() //this is always comparing the ENTIRE date, which will return date_a as the lessor when in reality what I want is date_b because it is actually occuring earlier in the day... </code></pre>
[ { "answer_id": 74288690, "author": "RedStone", "author_id": 9804370, "author_profile": "https://Stackoverflow.com/users/9804370", "pm_score": 2, "selected": true, "text": "GetLeaderboardResult _leaderBoard;\n\nIEnumerator GetLeaderBoardData()\n{\n int getLeaderBoard = 1;\n PlayFabC...
2022/11/01
[ "https://Stackoverflow.com/questions/74281623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17697574/" ]
74,281,636
<p>how do i add a digit to an integer in python ?</p> <pre><code>value = 9 #add a 9 to &quot;value&quot; to get 99 print(value) </code></pre> <p>So i want the console to return :</p> <pre><code>99 </code></pre> <p>I tryed to do</p> <pre><code>value.append(9) </code></pre> <p>but it didnt work</p>
[ { "answer_id": 74281679, "author": "Igor Moraru", "author_id": 4645291, "author_profile": "https://Stackoverflow.com/users/4645291", "pm_score": 0, "selected": false, "text": "value = 9\n\nadd = 9\n\nprint(int(str(value) + str(add)))\n" }, { "answer_id": 74281733, "author": "...
2022/11/01
[ "https://Stackoverflow.com/questions/74281636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391791/" ]
74,281,638
<p>I have a dataframe given below:</p> <pre><code>df1 = pd.DataFrame({&quot;timestamp&quot;: [pd.Timestamp(2016, 7, 29), pd.Timestamp(2017, 8, 22), pd.Timestamp(2017, 10, 9), pd.Timestamp(2018, 1, 9), pd.Timestamp(2018, 3, 31), pd.Timestamp(2018, 7, 5),pd.Timestamp(2018, 8, 5), pd.Timestamp(2018, 9,5), pd.Timestamp(2018, 11, 6),pd.Timestamp(2018, 12, 6), pd.Timestamp(2018, 12, 8)], &quot;userId&quot;: [1, 2, 2, 2, 2,2,3, 4, 4, 4,4 ], &quot;movieId&quot;: [111065, 35455, 132531, 132531, 2863, 132531, 4493, 133813,8888, 133813,133813], &quot;rating&quot;:[3,4,5,2,4,3, 2,2 ,3,1, 3] }) </code></pre> <p><a href="https://i.stack.imgur.com/cOPVv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cOPVv.png" alt="enter image description here" /></a></p> <p>I want to first group by the &quot;userId&quot; column and then for each group remove rows wherever the &quot;movieId&quot; has consecutive duplications. To illustrate better, this is how the end Dataframe should like : (the red rows should be filtered out)</p> <p><a href="https://i.stack.imgur.com/6vGM1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6vGM1.png" alt="enter image description here" /></a></p> <p>I tried a groupby and filter technique with custom function in lambda, however that doesn't retain all the columns. Please help!</p>
[ { "answer_id": 74281679, "author": "Igor Moraru", "author_id": 4645291, "author_profile": "https://Stackoverflow.com/users/4645291", "pm_score": 0, "selected": false, "text": "value = 9\n\nadd = 9\n\nprint(int(str(value) + str(add)))\n" }, { "answer_id": 74281733, "author": "...
2022/11/01
[ "https://Stackoverflow.com/questions/74281638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6922785/" ]
74,281,649
<p>I have a very long script that contains a huge list of brand names that is not in alphabetical order. The result of many different people working on it over a few years :) Question - is there a way to re-order lines of code alphabetically in Visual Studio Code (VSCode)? I know this is possible for single lines of code, but is it possible for multi-line blocks of code that have been indented? See attached example - so in this case I would be looking to select all these lines of code and sort by the brand name (acer, acqua, aeg, amazon etc) and retain the nested parts of the code for each. Many thanks in advance if anyone has any ideas or suggestions</p> <p><a href="https://i.stack.imgur.com/bxUyl.jpg" rel="nofollow noreferrer">Screenshot of code to be sorted</a></p> <p>I tried sorting in VSCode, but it only sorts individual lines of code and mixes them together. It does not recognize multiline, nested blocks of code as being one group of code that can be sorted individually</p>
[ { "answer_id": 74281679, "author": "Igor Moraru", "author_id": 4645291, "author_profile": "https://Stackoverflow.com/users/4645291", "pm_score": 0, "selected": false, "text": "value = 9\n\nadd = 9\n\nprint(int(str(value) + str(add)))\n" }, { "answer_id": 74281733, "author": "...
2022/11/01
[ "https://Stackoverflow.com/questions/74281649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391764/" ]
74,281,657
<p>I'm trying to use <code>opentelemetry</code> and <code>open telemetry-otlp</code> to provide observability data over OTLP to Honeycomb.</p> <p>I'm using something like this as a proof of concept (extracted out into this repo if you want to run it: <a href="https://github.com/timfpark/honeycomb-rust-poc" rel="nofollow noreferrer">https://github.com/timfpark/honeycomb-rust-poc</a>)</p> <pre><code>fn init_tracer(metadata: &amp;MetadataMap) -&gt; Result&lt;sdktrace::Tracer, TraceError&gt; { let opentelemetry_endpoint = env::var(&quot;OTEL_ENDPOINT&quot;).unwrap_or_else(|_| &quot;https://api.honeycomb.io&quot;.to_owned()); let opentelemetry_endpoint = Url::parse(&amp;opentelemetry_endpoint).expect(&quot;OTEL_ENDPOINT is not a valid url&quot;); opentelemetry_otlp::new_pipeline() .tracing() .with_exporter( opentelemetry_otlp::new_exporter() .tonic() .with_endpoint(opentelemetry_endpoint.as_str()) .with_metadata(metadata.clone()) .with_tls_config( ClientTlsConfig::new().domain_name( opentelemetry_endpoint .host_str() .expect(&quot;OTEL_ENDPOINTshould have a valid host&quot;), ), ), ) .install_batch(opentelemetry::runtime::Tokio) } #[tokio::main] async fn main() -&gt; anyhow::Result&lt;()&gt; { let mut metadata = MetadataMap::with_capacity(2); metadata.insert( &quot;x-honeycomb-team&quot;, &quot;...honeycomb api key...&quot;.parse().unwrap(), ); metadata.insert(&quot;x-honeycomb-dataset&quot;, &quot;my-api&quot;.parse().unwrap()); let tracer = init_tracer(&amp;metadata).expect(&quot;failed to instantiate opentelemetry tracing&quot;); tracing_subscriber::registry() .with(tracing_subscriber::EnvFilter::from_default_env()) .with(tracing_opentelemetry::layer().with_tracer(tracer)) .with(tracing_subscriber::fmt::layer()) .try_init() .expect(&quot;failed to register tracer with registry&quot;); let tracer = global::tracer(&quot;ex.com/basic&quot;); </code></pre> <p>but I am getting:</p> <pre><code>2022-11-02T17:01:01.088429Z DEBUG hyper::client::connect::http: connecting to 52.5.162.226:443 2022-11-02T17:01:01.170767Z DEBUG hyper::client::connect::http: connected to 52.5.162.226:443 2022-11-02T17:01:01.171870Z DEBUG rustls::client::hs: No cached session for DnsName(DnsName(DnsName(&quot;api.honeycomb.io&quot;))) 2022-11-02T17:01:01.172555Z DEBUG rustls::client::hs: Not resuming any session 2022-11-02T17:01:01.269218Z DEBUG rustls::client::hs: ALPN protocol is Some(b&quot;h2&quot;) 2022-11-02T17:01:01.269398Z DEBUG rustls::client::hs: Using ciphersuite TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 2022-11-02T17:01:01.269504Z DEBUG rustls::client::tls12::server_hello: Server supports tickets 2022-11-02T17:01:01.269766Z DEBUG rustls::client::tls12: ECDHE curve is ECParameters { curve_type: NamedCurve, named_group: secp256r1 } 2022-11-02T17:01:01.269843Z DEBUG rustls::client::tls12: Server DNS name is DnsName(DnsName(DnsName(&quot;api.honeycomb.io&quot;))) 2022-11-02T17:01:01.271123Z WARN rustls::conn: Sending fatal alert BadCertificate 2022-11-02T17:01:01.271861Z DEBUG tonic::transport::service::reconnect: reconnect::poll_ready: hyper::Error(Connect, Custom { kind: InvalidData, error: InvalidCertificateData(&quot;invalid peer certificate: UnknownIssuer&quot;) }) 2022-11-02T17:01:01.271967Z DEBUG tower::buffer::worker: service.ready=true processing request 2022-11-02T17:01:01.272169Z DEBUG tonic::transport::service::reconnect: error: error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer OpenTelemetry trace error occurred. Exporter otlp encountered the following error(s): the grpc server returns error (The service is currently unavailable): , detailed error message: error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer </code></pre> <p>which seems to indicate that something about my TLS setup is not correct... Does anyone have a snippet of <code>opentelemetry</code> code in Rust that works with Honeycomb?</p>
[ { "answer_id": 74296211, "author": "Jessitron", "author_id": 943732, "author_profile": "https://Stackoverflow.com/users/943732", "pm_score": 3, "selected": true, "text": "let pem = tokio::fs::read(\"/etc/ssl/certs/Starfield_Services_Root_Certificate_Authority_-_G2.pem\").await.expect(\"r...
2022/11/01
[ "https://Stackoverflow.com/questions/74281657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/851004/" ]
74,281,662
<p>I am trying to write a simple <strong>Bash</strong> loop to concatenate the first <em>10 bytes</em> of all the files in a directory. So far, I have the code block:</p> <pre><code>for filename in /content/*.bin; do cat -- (`head --bytes 10 $filename`) &gt; &quot;file$i.combined&quot; done </code></pre> <p>However, the the syntax is clearly incorrect here. I know the inner command:</p> <pre><code>head --bytes 10 $filename </code></pre> <p>...returns what I need; the first 10 bytes of the passed filename. And when I use:</p> <pre><code>cat -- $filename &gt; &quot;file$i.combined&quot; </code></pre> <p>...the code works, only it concats the entire file contents.</p> <p><strong>How can I combine the two functions so that my loop concatenates the first 10 bytes of all the looped files?</strong></p>
[ { "answer_id": 74281686, "author": "chepner", "author_id": 1126841, "author_profile": "https://Stackoverflow.com/users/1126841", "pm_score": 2, "selected": false, "text": "head" }, { "answer_id": 74281812, "author": "Charles Duffy", "author_id": 14122, "author_profile...
2022/11/01
[ "https://Stackoverflow.com/questions/74281662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304684/" ]
74,281,665
<p>Hello I'm trying to get the input value but the result its blank. Can you help me?</p> <pre><code>**HTML:** &lt;input type=&quot;text&quot; id=&quot;totalscore2&quot; ng-model=&quot;10&quot;&gt; **JavaScript:** angular.module('teB', []) .controller('teBB', ['$scope', function($scope) { let total = document.getElementById(&quot;totalscore2&quot;).value console.log(total) const options = { series: [total], chart: { height: 350, type: 'radialBar', }, plotOptions: { radialBar: { hollow: { size: '70%', } }, }, labels: ['Puntuación'], } let chart = new ApexCharts(document.querySelector(&quot;#charttest&quot;), options) chart.render() }]); </code></pre> <p>I want to get the ng-model value to then show it in a chart</p>
[ { "answer_id": 74281686, "author": "chepner", "author_id": 1126841, "author_profile": "https://Stackoverflow.com/users/1126841", "pm_score": 2, "selected": false, "text": "head" }, { "answer_id": 74281812, "author": "Charles Duffy", "author_id": 14122, "author_profile...
2022/11/01
[ "https://Stackoverflow.com/questions/74281665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19361614/" ]
74,281,701
<p>I have 2 numpy arrays:</p> <pre><code>A [['12345' 45 100] ['12345' 29 100] ['45451' 23 0] ['56789' 45 450] ['56789' 56 50] ['56567' 5 500] ['89321' 15 0] ['90234' 43 40] ['90234' 55 0] ['99843' 18 5500]] B [['12345'] ['90234'] ['45451'] ['56789'] ['89321']] </code></pre> <p>I need to leave in array B only rows where elements equals the elements from 1 column in array A and the 3rd column contains value &quot;0&quot;. Basically, these are '45451' and '89321'.</p> <p>I have the next code:</p> <pre><code>for ind1 in range(len(A)): for ind2 in range(len(B)): if (A[ind1][0] == B[ind2]) and (A[ind1][2] &gt; 0): B = np.delete(B, ind2, axis=0) B </code></pre> <p>I've got the following error message:</p> <p><strong>IndexError: index 4 is out of bounds for axis 0 with size 4</strong></p> <p>I suppose it's something with array dimensions but can't figure out. Would appreciate if you can fix the code :)</p> <p>Tried to change the conditions</p>
[ { "answer_id": 74281686, "author": "chepner", "author_id": 1126841, "author_profile": "https://Stackoverflow.com/users/1126841", "pm_score": 2, "selected": false, "text": "head" }, { "answer_id": 74281812, "author": "Charles Duffy", "author_id": 14122, "author_profile...
2022/11/01
[ "https://Stackoverflow.com/questions/74281701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391839/" ]
74,281,740
<p>I'm developing a project that will use XML files to dump data for sharing between servers. Does it matter if I use an extension other than <code>.xml</code> in the file name? eg. 'myfile.abc' instead of 'myfile.xml'.</p> <p>These files would be read by client servers using CURL / LWP commands. Are there any issues with <code>MIME-TYPES</code> that might cause the files to be unopenable or unreadable as XML? (They will be W3C compliant XML files)</p> <p>The reason is we need the files to be distinguishable from other XML files on the server. Thanks.</p>
[ { "answer_id": 74283127, "author": "kjhughes", "author_id": 290085, "author_profile": "https://Stackoverflow.com/users/290085", "pm_score": 1, "selected": false, "text": ".xml" }, { "answer_id": 74284696, "author": "Misunderstood", "author_id": 3813605, "author_profil...
2022/11/01
[ "https://Stackoverflow.com/questions/74281740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1009504/" ]
74,281,746
<p>I'm self learning programming and practicing my skills as I move forward. I've been consistently encountering a bug, and fixing it by trial and error but haven't really learned my actual mistake so far, if it is syntax or logic and how to avoid encountering it in the future.</p> <p>my problem is as follows: I build a method that uses certain data or inputs certain data, and after the program successfully runs through the method and exits it, the data that was created/sorted/input within the method is lost for the rest of the program. If anyone would help me understand what I am missing every time, I'd really appreciate it.</p> <pre><code>public static void EnterArray(double[] array, int arraySize) { Scanner input = new Scanner(System.in); System.out.println(&quot;Array size: &quot;); arraySize = input.nextInt(); array = new double[arraySize]; for(int i=0; i&lt;arraySize; i++) { array[i]= input.nextInt(); } input.close(); } </code></pre> <p>This method will create an array from the users input. Within the method, the data is stored correctly, but once it exits the method, the array created is gone. I would like to use that array within my next steps and methods in my program</p> <p>Thank you!</p> <pre><code></code></pre>
[ { "answer_id": 74283127, "author": "kjhughes", "author_id": 290085, "author_profile": "https://Stackoverflow.com/users/290085", "pm_score": 1, "selected": false, "text": ".xml" }, { "answer_id": 74284696, "author": "Misunderstood", "author_id": 3813605, "author_profil...
2022/11/01
[ "https://Stackoverflow.com/questions/74281746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391904/" ]
74,281,761
<p>Rather than looking for &quot;$env:HOMEDIR&quot;, I'm looking for a way to query the home directory of a different user account. The powershell equivalent of &quot;~bob&quot;.</p> <p>I attempted using [ADSI]:</p> <pre><code># After creating a local account called 'other.user' PS&gt; $user = [ADSI]'WinNT://localhost/other.user,user' PS&gt; $user.name other.user PS&gt; $user.HomeDirectory PS&gt; </code></pre> <p>even when executed from the Administrator account in an elevated powershell.</p> <p>For sanity, I tried doing the same check on the existing user:</p> <pre><code>PS&gt; $user = [ADSI]('WinNT://localhost/{0},user' -f [Environment]::UserName) PS&gt; $user.name this.user # paraphrase PS&gt; $user.HomeDirectory PS&gt; $user.properties.HomeDirectory PS&gt; </code></pre>
[ { "answer_id": 74281884, "author": "mklement0", "author_id": 45375, "author_profile": "https://Stackoverflow.com/users/45375", "pm_score": 3, "selected": true, "text": "Get-CimInstance" }, { "answer_id": 74282032, "author": "Santiago Squarzon", "author_id": 15339544, ...
2022/11/01
[ "https://Stackoverflow.com/questions/74281761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257645/" ]
74,281,773
<p>I have some code that connects to a database using JDBC using a basic URL:</p> <pre><code>String url = &quot;jdbc:mysql://&quot; + getHostname() + &quot;:&quot; + getPort(); </code></pre> <p>I am using the following arguments:</p> <pre><code>setProperty(&quot;connectTimeout&quot;, &quot;2000&quot;); setProperty(&quot;autoReconnect&quot;, &quot;true&quot;); </code></pre> <p>I don't include the database name, since it might not exist yet. I check whether one exist upon connection, and create it as needed. Then I select the database.</p> <p>I use two queries:</p> <pre><code>CREATE DATABASE IF NOT EXISTS &lt;name&gt; </code></pre> <p>then</p> <pre><code>USE &lt;name&gt; </code></pre> <p>So the database is selected here upon connection.</p> <p>The issue I'm having is that I saw an error in the log:</p> <pre><code>... Caused by: java.sql.SQLException: No database selected </code></pre> <p>This doesn't make sense, because the database is <em>always</em> selected upon connection, otherwise an exception would have been thrown. However, this exception about a missing selection occurs hours later.</p> <p>My guess is that, upon reconnecting, it uses the URL, which doesn't include the database name. So it reconnects, but now the database isn't selected.</p> <p>Can someone confirm whether this is the cause of the behavior I am experiencing?</p>
[ { "answer_id": 74281884, "author": "mklement0", "author_id": 45375, "author_profile": "https://Stackoverflow.com/users/45375", "pm_score": 3, "selected": true, "text": "Get-CimInstance" }, { "answer_id": 74282032, "author": "Santiago Squarzon", "author_id": 15339544, ...
2022/11/01
[ "https://Stackoverflow.com/questions/74281773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1762276/" ]
74,281,805
<p>I'm continuously hitting an error when trying to psql into a docker composed postgres image that has its ports forwarded. (this issue seems to persist also when attempting to access the DB programatically via node application).</p> <p>Running <code>docker-compose up -d</code> on the following docker compose file:</p> <pre><code>services: postgres: container_name: cnc-matches image: postgres:12.1-alpine ports: - '5432:5432' environment: POSTGRES_USER: dbuser POSTGRES_PASSWORD: pass POSTGRES_DB: cnc-matches </code></pre> <p>When running psql to attempt to access it I hit the following error continuously:</p> <pre><code>C:\Users\danie\Desktop\dev\cnc-db\db-setup&gt;psql -h &quot;localhost&quot; -p &quot;5432&quot; -U dbuser Password for user dbuser: pass psql: error: connection to server at &quot;localhost&quot; (::1), port 5432 failed: FATAL: password authentication failed for user &quot;dbuser&quot; </code></pre> <p>When running docker exec I'm able to access the table and info fine:</p> <pre><code>C:\Users\danie\Desktop\dev\cnc-db\db-setup&gt;docker exec -it cnc-matches psql -U dbuser cnc-matches psql (12.1) Type &quot;help&quot; for help. cnc-matches=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------+----------- dbuser | Superuser, Create role, Create DB, Replication, Bypass RLS | {} </code></pre> <p>I've tried creating a new user as well as altering the dbuser profiles passwords in here with ALTER PASSWORD dbuser WITH PASSWORD 'pass' and I still cannot access the db with default psql command locally.</p> <pre><code>cnc-matches=# CREATE USER tester WITH PASSWORD 'tester'; CREATE ROLE cnc-matches=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------+----------- dbuser | Superuser, Create role, Create DB, Replication, Bypass RLS | {} tester | | {} C:\Users\danie\Desktop\dev\cnc-db\db-setup&gt;psql -h &quot;localhost&quot; -p &quot;5432&quot; -U tester Password for user tester: tester psql: error: connection to server at &quot;localhost&quot; (::1), port 5432 failed: FATAL: password authentication failed for user &quot;tester&quot; </code></pre> <p>Not sure what it is I'm misisng here, if relevant running via windows 11 cmd. Any help/suggestions appreciated.</p>
[ { "answer_id": 74282273, "author": "Ryan Cahill", "author_id": 9178159, "author_profile": "https://Stackoverflow.com/users/9178159", "pm_score": 0, "selected": false, "text": "psql -h \"0.0.0.0\" -p \"5432\" -U dbuser cnc-matches\n" }, { "answer_id": 74283199, "author": "ISee...
2022/11/01
[ "https://Stackoverflow.com/questions/74281805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13355621/" ]
74,281,815
<p>Currently, I'm using this function in my code:</p> <pre><code>fn lines_from_file(filename: impl AsRef&lt;Path&gt;) -&gt; Vec&lt;String&gt; { let file = File::open(filename).expect(&quot;no such file&quot;); let buf = BufReader::new(file); buf.lines().map(|l| l.expect(&quot;Could not parse line&quot;)).collect() } </code></pre> <p>How can I safely read the last x lines only in the file?</p>
[ { "answer_id": 74281885, "author": "ShadowRanger", "author_id": 364696, "author_profile": "https://Stackoverflow.com/users/364696", "pm_score": 1, "selected": false, "text": "tail" }, { "answer_id": 74282737, "author": "Brandon Kauffman", "author_id": 14256876, "autho...
2022/11/01
[ "https://Stackoverflow.com/questions/74281815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14256876/" ]
74,281,831
<p>I have a data frame like this:</p> <pre class="lang-none prettyprint-override"><code>+------------+-----------------+------------------------------------+ | Name | Age | Answers | +------------+-----------------+------------------------------------+ | Maria | 23 | [apple, mango, orange, banana] | | John | 55 | [apple, orange, banana] | | Brad | 44 | [banana] | | Alex | 55 | [apple, mango, orange, banana] | +------------+-----------------+------------------------------------+ </code></pre> <p>The &quot;Answers&quot; column contains an array of elements.</p> <p>My expected output:</p> <pre class="lang-none prettyprint-override"><code>+-----+---+--------+-------+ | Name|Age| answer| value | +-----+---+--------+-------+ |Maria| 23| apple| True | |Maria| 23| mango| True | |Maria| 23| orange| True | |Maria| 23| banana| True | | John| 55| apple| True | | John| 55| mango| False | | John| 55| orange| True | | John| 55| banana| True | | Brad| 44| apple| False | | Brad| 44| mango| False | | Brad| 44| orange| False | | Brad| 44| banana| True | |Alex | 55| apple| True | |Alex | 55| mango| True | |Alex | 55| orange| True | |Alex | 55| banana| True | +-----+---+--------+-------+ </code></pre> <p>How can I explode the &quot;Answers&quot; column in such a way that I would get the &quot;value&quot; column with True or False based on the array?</p> <p>For example,</p> <pre class="lang-none prettyprint-override"><code>| John| 55| mango| False | </code></pre> <p>there is no &quot;mango&quot; in John's answer. Hence the value is false. Similarly for Brad there will be three false rows.</p>
[ { "answer_id": 74282252, "author": "ZygD", "author_id": 2753501, "author_profile": "https://Stackoverflow.com/users/2753501", "pm_score": 2, "selected": true, "text": "from pyspark.sql import functions as F\ndf = spark.createDataFrame(\n [('Maria', 23, ['apple', 'mango', 'orange', 'ba...
2022/11/01
[ "https://Stackoverflow.com/questions/74281831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19831970/" ]
74,281,872
<p>So I want to create something like</p> <p><code>myvariable = n * 0</code></p> <p>but I want zeros to repeat N times back to back (not on different lines) the thing i need to do: 00000</p> <p>How can I do this?</p>
[ { "answer_id": 74281931, "author": "jprebys", "author_id": 3268228, "author_profile": "https://Stackoverflow.com/users/3268228", "pm_score": 1, "selected": false, "text": ">>> n = 5\n>>> myvariable = n * '0'\n>>> print(myvariable)\n00000\n" }, { "answer_id": 74282013, "author...
2022/11/01
[ "https://Stackoverflow.com/questions/74281872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20339851/" ]
74,281,888
<p>I want to send several independent messages from a client to a server, depending on a variable that changes. To simulate the scenario I have created a loop to send several numbers, but only the first iteration is working. In the second iteration (which would be, the second message in real) I am getting this error in the client:</p> <pre><code>OSError: [WinError 10038] An operation was attempted on something that is not a socket </code></pre> <p>Do you know how to solve it?</p> <p>I would like to send several values from my client to the server, using the same socket if possible. The client and the server are implemented on my PC for this example.</p> <p>Server:</p> <pre class="lang-py prettyprint-override"><code>import socket HOST='127.0.0.1' PORT=6595 #Code for the socket server=socket.socket(socket.AF_INET,socket.SOCK_STREAM) server.bind((HOST,PORT)) server.listen(5) while True: communication_socket,address=server.accept() message=communication_socket.recv(1024).decode('utf-8') print(f&quot;Message from client is: {message}&quot;) communication_socket.close() </code></pre> <p>Client:</p> <pre class="lang-py prettyprint-override"><code>import socket HOST='127.0.0.1' PORT=6595 #Code for the socket cli=socket.socket(socket.AF_INET,socket.SOCK_STREAM) i=1 while i&lt;10: cli.connect((HOST,PORT)) i=str(i) cli.send(i.encode('utf-8')) #print(cli.recv(1024).decode('utf-8')) i=int(i) i=i+1 cli.close() print(i) </code></pre> <p>Error I face:</p> <pre><code>Traceback (most recent call last): File &quot;d:\Python projects\collision.py&quot;, line 11, in &lt;module&gt; cli.connect((HOST,PORT)) OSError: [WinError 10038] An operation was attempted on something that is not a socket </code></pre>
[ { "answer_id": 74281931, "author": "jprebys", "author_id": 3268228, "author_profile": "https://Stackoverflow.com/users/3268228", "pm_score": 1, "selected": false, "text": ">>> n = 5\n>>> myvariable = n * '0'\n>>> print(myvariable)\n00000\n" }, { "answer_id": 74282013, "author...
2022/11/01
[ "https://Stackoverflow.com/questions/74281888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16306538/" ]
74,281,904
<p>Using <code>p5.js</code>, I want to create 100 concentric circles that do the below:</p> <ol> <li><p>Draw initial circle:</p> <ul> <li>choose size based on 0.8 x width</li> <li>start at color 1 (based on HSB color mode)</li> <li>start at opacity 0.01 (based on HSB color mode )</li> <li>start at shade 100 (based on HSB color mode)).</li> </ul> </li> <li><p>Draw next circle:</p> <ul> <li>size to be 0.98 x previous circle size</li> <li>color to progress by 1</li> <li>opacity to increase by 0.01</li> <li>shade to decrease by 1</li> </ul> </li> </ol> <p>I understand how to do this manually by drawing 100 circles with different inputs, but I want to wrap this all up in a for loop. I can get one parameter to change within the for loop but my expertise unfortunately stops there, I am very beginner. If I try hang the other parameters off the same for loop it gets really complex and something seems to break, and I don't quite understand how nested for loops work if that's what I need to do. Thank you for help in advance!</p> <p>This is what I have tried so far with just 10 circles:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function setup() { createCanvas(1000, 1000); colorMode(HSB, 360, 100, 100, 100); } function draw() { background(0, 0, 100); // white background for (let i = width; i &gt;= 0; i = i - width/10) { noStroke(); let colour = (i/1000)*360; let shade = i/10; let opacity = ((i/10)*-1)+100; fill(colour, 100, shade, opacity); let diameter = i; circle(width/2, height/2, diameter); } }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.2/p5.js"&gt;&lt;/script&gt;</code></pre> </div> </div> </p>
[ { "answer_id": 74284372, "author": "MLGMilk", "author_id": 9335843, "author_profile": "https://Stackoverflow.com/users/9335843", "pm_score": 0, "selected": false, "text": "function setup() \n{\n createCanvas(800, 800);\n stroke(255);\n strokeWeight(2);\n noFill();\n}\n\nfunction draw...
2022/11/01
[ "https://Stackoverflow.com/questions/74281904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17030265/" ]
74,281,929
<pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;map&gt; #include &lt;vector&gt; using namespace std; class Calificaciones{ private: map&lt;string, map&lt;string, vector&lt;float&gt;&gt;&gt;notas; map&lt;string, vector&lt;float&gt;&gt;Map2; vector&lt;float&gt;V; public: void AgregarNota(string seccion, string matricula, float nota); void Cantidad_De_Notas(); void alumnos_Mas_de_una_seccion(); }; void Calificaciones::Agregar_Nota(string seccion, string matricula, float nota){ V.push_back(nota); Map2.insert(matricula, V); Notas.insert(seccion, Map2); } int main() { cout&lt;&lt;&quot;Hello World&quot;; return 0; } </code></pre> <p><code>Agregar_nota</code> should add all 3 attributes, first the note to a <code>vector</code>, then the <code>vector</code> to a <code>map</code>, and that <code>map</code> to another <code>map</code>.</p> <p>I tried to use this inside <code>Agregar_nota()</code> but it does not work:</p> <pre class="lang-cpp prettyprint-override"><code>notas.insert(seccion,map&lt;string, vector&lt;float&gt;&gt;); notas[seccion].insert(matricula,vector&lt;float&gt;); notas[seccion][matricula].push_back(nota); </code></pre> <p>What should I do?</p>
[ { "answer_id": 74282277, "author": "Remy Lebeau", "author_id": 65863, "author_profile": "https://Stackoverflow.com/users/65863", "pm_score": 1, "selected": false, "text": "map::insert()" }, { "answer_id": 74282461, "author": "rturrado", "author_id": 260313, "author_pr...
2022/11/01
[ "https://Stackoverflow.com/questions/74281929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391955/" ]
74,281,971
<p>I have a dataset of spatial locations <a href="https://drive.google.com/drive/folders/11bstg2760SoKVAH79rMJNmMxIyU966TU?usp=share_link" rel="nofollow noreferrer">data</a>. I want to do a point pattern analysis using the spatstat package in R using this data. I want the best polygon area for the analysis instead of the rectangle area. The code I have is</p> <pre><code>original_data = read.csv(&quot;/home/hudamoh/PhD_Project_Moh_Huda/Dataset_files/my_coordinates.csv&quot;) plot(original_data$row, original_data$col) </code></pre> <p>which results in a plot that looks like this <a href="https://i.stack.imgur.com/inpop.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/inpop.png" alt="original_data" /></a></p> <p>Setting the data for point pattern data</p> <pre><code>point_pattern_data = ppp(original_data$row, original_data$col, c(0, 77), c(0, 116)) plot(point_pattern_data) summary(point_pattern_data) </code></pre> <p>resulting in a plot that looks like this <a href="https://i.stack.imgur.com/xsmaj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xsmaj.png" alt="point_pattern" /></a></p> <p>#The observed data has considerably wide white spaces, which I want to remove for a better analysis area. Therefore, I want to make the point pattern a polygon instead of a rectangle. The vertices for the polygon are the pairs of (x,y) below to avoid white space as much as possible.</p> <pre><code>x = c(3,1,1,0.5,0.5,1,2,2.5,5.5, 16,21,28,26,72,74,76,75,74,63,58,52,47,40) y = c(116,106,82.5,64,40,35,25,17.5,5,5,5,10,8,116,100,50,30,24,17,10,15,15,8) </code></pre> <p>I find these vertices above manually by considering the plot below (with the grid lines)</p> <pre><code>plot(original_data$row,original_data$col) grid(nx = 40, ny = 25, lty = 2, # Grid line type col = &quot;gray&quot;, # Grid line color lwd = 2) # Grid line width </code></pre> <p><a href="https://i.stack.imgur.com/81oI3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/81oI3.png" alt="plot_grid" /></a></p> <p>So I want to make the point pattern polygon. The code is</p> <pre><code>my_data_poly = owin(poly = list(x = c(3,1,1,0.5,0.5,1,2,2.5,5.5, 16,21,28,26,72,74,76,75,74,63,58,52,47,40), y = c(116,106,82.5,64,40,35,25,17.5,5,5,5,10,8,116,100,50,30,24,17,10,15,15,8))) plot(my_data_poly) </code></pre> <p>but it results in an error. The error is</p> <p><a href="https://i.stack.imgur.com/2kvKY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2kvKY.png" alt="poly_error" /></a></p> <p>I fix it by</p> <pre><code>my_data_poly = owin(poly = list(x = c(116,106,82.5,64,40,35,25,17.5,5,5,5,10,8,116,100,50,30,24,17,10,15,15,8), y = c(3,1,1,0.5,0.5,1,2,2.5,5.5, 16,21,28,26,72,74,76,75,74,63,58,52,47,40))) plot(my_data_poly) </code></pre> <p>It results in a plot <a href="https://i.stack.imgur.com/NVDqu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NVDqu.png" alt="enter image description here" /></a></p> <p>However, this is not what I want. How to get the observed area as a polygon in point pattern data analysis?</p>
[ { "answer_id": 74282190, "author": "sconfluentus", "author_id": 6258859, "author_profile": "https://Stackoverflow.com/users/6258859", "pm_score": 2, "selected": false, "text": "require(sp)\n\npoly = Polygon(\ncbind(original_data$col, \noriginal_data$row)\n ))\n" }, { "answe...
2022/11/01
[ "https://Stackoverflow.com/questions/74281971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13282670/" ]
74,281,974
<p>I would like to align an enlarged Compose <code>CircularProgressIndicator</code> by its enlarged center point instead of by the center point of the original non-modified circle.</p> <p>The following aligns as if <code>CircularProgressIndicator</code> were not modified at all, which is demonstrated by the attached screenshots.</p> <pre class="lang-kotlin prettyprint-override"><code>Box(contentAlignment = Alignment.Center) { CircularProgressIndicator(modifier = Modifier.fillMaxWidth()) } </code></pre> <p><a href="https://i.stack.imgur.com/YeFBxl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YeFBxl.png" alt="progress indicator aligned to non-modified center" /></a> <a href="https://i.stack.imgur.com/jHP5el.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jHP5el.png" alt="original non-enlarged alignment for reference" /></a></p> <p>I attempted various combinations/orders of alignment modifiers to no avail. Is there a way to fix this without using a manual offset?</p>
[ { "answer_id": 74282132, "author": "Cirilo Bido", "author_id": 11920524, "author_profile": "https://Stackoverflow.com/users/11920524", "pm_score": 0, "selected": false, "text": "CircularProgressIndicator()" }, { "answer_id": 74282845, "author": "z.y", "author_id": 1902374...
2022/11/01
[ "https://Stackoverflow.com/questions/74281974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5270459/" ]
74,281,993
<p>I have a background worker running doing its thing. In the foreground, I have a tight while loop that only looks at a local variable to exit. The local variable is set by an event handler triggered by the background worker.</p> <p>My thought was that I would need to call sleep to allow the background thread to run, but that does not appear to be the case. Why does this work?</p> <p>This is a console app for test purposes, so no GUI thread.</p> <pre><code> while (true) { //System.Threading.Thread.Sleep(50); /* Get out if scripts are finished. */ if (!m_NfcScriptRunning) break; } </code></pre> <p>Regards, Lee</p>
[ { "answer_id": 74282039, "author": "rotgers", "author_id": 2223566, "author_profile": "https://Stackoverflow.com/users/2223566", "pm_score": 3, "selected": true, "text": "Thread.Sleep" } ]
2022/11/01
[ "https://Stackoverflow.com/questions/74281993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4756939/" ]
74,281,997
<p>Is there a way to set height of elements in a <code>Scaffold</code> to be exactly the same? I want both the top bar and the content to occupy half of the screen's height</p> <pre><code>Scaffold( topBar = { MyLargeTopAppBar(modifier = Modifier.height(1f)) }, content = { LazyColumn(modifier = Modifier.padding(it).height(1f)) { ... } }, containerColor = MaterialTheme.colorScheme.background ) </code></pre> <p><strong>Arthur Kasparian's suggestion</strong></p> <p><a href="https://i.stack.imgur.com/gcOoZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gcOoZ.png" alt="enter image description here" /></a></p>
[ { "answer_id": 74282626, "author": "Serge", "author_id": 13002482, "author_profile": "https://Stackoverflow.com/users/13002482", "pm_score": 1, "selected": false, "text": "val configuration = LocalConfiguration.current\nval screenHeight = configuration.screenHeightDp.dp\nval size = scree...
2022/11/01
[ "https://Stackoverflow.com/questions/74281997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3293579/" ]
74,282,006
<p>I would like to construct a String-typed enum. The following works:</p> <pre><code>my Str enum E ( &lt;a b c&gt; Z=&gt; 'one', 'two', 'three' ); E.kv.raku.say; </code></pre> <blockquote> <p>(&quot;c&quot;, &quot;three&quot;, &quot;a&quot;, &quot;one&quot;, &quot;b&quot;, &quot;two&quot;).Seq</p> </blockquote> <p>However, trying the following does not:</p> <pre><code>my Str @a = &lt;a b c&gt;; my Str @b = &lt;one two three&gt;; my Str enum F ( @a Z=&gt; @b ); F.kv.raku.say; </code></pre> <blockquote> <p>No values supplied to enum (does @a Z=&gt; @b need to be declared constant?)</p> </blockquote> <p><strong>Is this not supported?</strong></p> <p>Raku/roast covers enum construction like in <code>E</code> but I didn't see any test cases for <code>F</code>.</p> <p>Out of curiosity, I also tried:</p> <pre><code>my $a = &lt;a b c&gt;; my $b = &lt;one two three&gt;; my Str enum G ( $a&lt;&gt; Z=&gt; $b&lt;&gt;.map( { .Str } ) ); G.kv.raku.say; </code></pre> <blockquote> <p>(&quot;&quot;, &quot;&quot;).Seq</p> </blockquote>
[ { "answer_id": 74282968, "author": "Jonathan Worthington", "author_id": 7832584, "author_profile": "https://Stackoverflow.com/users/7832584", "pm_score": 4, "selected": true, "text": "enum" }, { "answer_id": 74283951, "author": "jubilatious1", "author_id": 7270649, "a...
2022/11/01
[ "https://Stackoverflow.com/questions/74282006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1915829/" ]
74,282,012
<p>I only want the hovered element to be affected by its height. But all row items increase in height. What can i do to increase the height of the element that is just hovered ? (If there is a solution with javascript, it will be too)</p> <p>HTML and CSS codes:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.names { display: grid; grid-template-columns: repeat(3, 1fr); } .names div { display: flex; align-items: center; flex-direction: column; padding: 16px 0; text-align: center; } .names div a { font-size: 16px; color: #25282e; text-decoration: none; } .names div a:hover { font-weight: 700; } .names div a:hover~img { display: block; } .names div img { width: 40px; margin-top: 16px; display: none; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="names"&gt; &lt;div&gt;&lt;a class="name" href="#"&gt;Name&lt;/a&gt;&lt;img src="https://picsum.photos/seed/picsum/200/300"&gt;&lt;/div&gt; &lt;div&gt;&lt;a class="name" href="#"&gt;Name&lt;/a&gt;&lt;img src="https://picsum.photos/seed/picsum/200/300"&gt;&lt;/div&gt; &lt;div&gt;&lt;a class="name" href="#"&gt;Name&lt;/a&gt;&lt;img src="https://picsum.photos/seed/picsum/200/300"&gt;&lt;/div&gt; &lt;div&gt;&lt;a class="name" href="#"&gt;Name&lt;/a&gt;&lt;img src="https://picsum.photos/seed/picsum/200/300"&gt;&lt;/div&gt; &lt;div&gt;&lt;a class="name" href="#"&gt;Name&lt;/a&gt;&lt;img src="https://picsum.photos/seed/picsum/200/300"&gt;&lt;/div&gt; &lt;div&gt;&lt;a class="name" href="#"&gt;Name&lt;/a&gt;&lt;img src="https://picsum.photos/seed/picsum/200/300"&gt;&lt;/div&gt; &lt;div&gt;&lt;a class="name" href="#"&gt;Name&lt;/a&gt;&lt;img src="https://picsum.photos/seed/picsum/200/300"&gt;&lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p>
[ { "answer_id": 74282149, "author": "Fraser", "author_id": 74861, "author_profile": "https://Stackoverflow.com/users/74861", "pm_score": 3, "selected": true, "text": "position: absolute" }, { "answer_id": 74282165, "author": "Tamir Abutbul", "author_id": 8274756, "auth...
2022/11/01
[ "https://Stackoverflow.com/questions/74282012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14668666/" ]
74,282,048
<p>I'm hoping there's just something major I'm missing here with <code>inline-flex</code>.</p> <p>I'm using <code>display: inline-flex</code> and the order of the 2 items inside of the element change how the element aligns with its siblings.</p> <p>In this scenario I have 3 anchor tags each with some text and an &quot;icon&quot; element. On the 2nd anchor tag I've put the &quot;icon&quot; element as the first child which causes the element to not align with its sibling anchor tags.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; } .icon { display: inline-block; width: 20px; height: 20px; background: red; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="#" class="item"&gt; item &lt;span class="icon"&gt;&lt;/span&gt; &lt;/a&gt; &lt;a href="#" class="item"&gt; &lt;span class="icon"&gt;&lt;/span&gt; item &lt;/a&gt; &lt;a href="#" class="item"&gt; item &lt;span class="icon"&gt;&lt;/span&gt; &lt;/a&gt;</code></pre> </div> </div> </p> <p>Here's a CodePen that shows the issue: <a href="https://codepen.io/Fernker/pen/BaVjvXB" rel="nofollow noreferrer">https://codepen.io/Fernker/pen/BaVjvXB</a></p>
[ { "answer_id": 74282148, "author": "TylerH", "author_id": 2756409, "author_profile": "https://Stackoverflow.com/users/2756409", "pm_score": 3, "selected": true, "text": "vertical-align" }, { "answer_id": 74283777, "author": "Chris Schober", "author_id": 8396541, "auth...
2022/11/01
[ "https://Stackoverflow.com/questions/74282048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/756383/" ]
74,282,056
<p>I have a Pandas DataFrame whose rows and columns are a DatetimeIndex.</p> <pre><code>import pandas as pd data = pd.DataFrame( { &quot;PERIOD_END_DATE&quot;: pd.date_range(start=&quot;2018-01&quot;, end=&quot;2018-04&quot;, freq=&quot;M&quot;), &quot;first&quot;: list(&quot;abc&quot;), &quot;second&quot;: list(&quot;efg&quot;) } ).set_index(&quot;PERIOD_END_DATE&quot;) data.columns = pd.date_range(start=&quot;2018-01&quot;, end=&quot;2018-03&quot;, freq=&quot;M&quot;) data </code></pre> <p><a href="https://i.stack.imgur.com/o7gOt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o7gOt.png" alt="DataFrame" /></a></p> <p>Unfortunately, I am getting a variety of errors when I try to pull out a value:</p> <pre><code>data['2018-01', '2018-02'] # InvalidIndexError: ('2018-01', '2018-02') data['2018-01', ['2018-02']] # InvalidIndexError: ('2018-01', ['2018-02']) data.loc['2018-01', '2018-02'] # TypeError: only integer scalar arrays can be converted to a scalar index data.loc['2018-01', ['2018-02']] # KeyError: &quot;None of [Index(['2018-02'], dtype='object')] are in the [columns]&quot; </code></pre> <p>How do I extract a value from a DataFrame that uses a DatetimeIndex?</p>
[ { "answer_id": 74282141, "author": "Kevin", "author_id": 20266865, "author_profile": "https://Stackoverflow.com/users/20266865", "pm_score": 3, "selected": true, "text": "a) data.loc[rows_index_name, [column__index_name]]\n" }, { "answer_id": 74283181, "author": "Naveed", ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396266/" ]
74,282,066
<p>I've added 3 default Blazor projects to my solution.</p> <ol> <li>Blazor WebAssembly1</li> <li>Blazor WebAsssembly2</li> <li>Blazor Server</li> </ol> <p>The first WebAssembly project is converted to a razor library in order to share code between server and webassembly projects. I also deleted the default pages like FetchData.razor and such.</p> <p>On compilation I still get compile error on this (the app runs fine though), and I can't seem to resolve them. I've search through the entire solution but can't find any of the files that results in the compile errors.</p> <p>How to locate the reason for the errors and remove the references? The files are deleted from the project.</p> <p>Example of compiler error: CS0246 The type or namepace 'WeatherForecastService' could not be found (are you missing a using directive or an assembly reference?)</p>
[ { "answer_id": 74285355, "author": "Nicola Biada", "author_id": 11109967, "author_profile": "https://Stackoverflow.com/users/11109967", "pm_score": 1, "selected": false, "text": "<Project Sdk=\"Microsoft.NET.Sdk.Razor\">" } ]
2022/11/01
[ "https://Stackoverflow.com/questions/74282066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/630973/" ]
74,282,080
<p>I'm using the Microsoft Graph PowerShell SDK to try and get some data from SharePoint sites using the <code>Get-MgSite</code> command. I'm running this command specifically</p> <pre><code>$site = Get-MgSite -SiteId &lt;siteId&gt; -Property Id,DisplayName,Name,WebUrl,CreatedDateTime,CreatedBy,CreatedByUser </code></pre> <p>I also tried this command</p> <pre><code>$site = Get-MgSite -SiteId &lt;siteId&gt; -Property Id,DisplayName,Name,WebUrl,CreatedDateTime,CreatedBy -ExpandProperty CreatedByUser </code></pre> <p>The <code>$site</code> variable contains all the requested items from the <code>Property</code> parameter except for the <code>CreatedBy</code> and <code>CreatedByUser</code>. I see in the <a href="https://learn.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-1.0" rel="nofollow noreferrer">documentation</a> that the <code>CreatedBy</code> and <code>CreatedByUser</code> on the <code>site</code> resource are actually inherited from the <code>baseItem</code> type.</p> <p>Is it possible to get the <code>CreatedBy</code> or <code>CreatedByUser</code> properties through the <code>Get-MgSite</code> command or is this data not returned through that endpoint?</p> <p>I know it's not the same thing, but the SharePoint Admin Center does show a value for Created by when you view site properties</p> <p><a href="https://i.stack.imgur.com/qLtzY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qLtzY.png" alt="enter image description here" /></a></p>
[ { "answer_id": 74285355, "author": "Nicola Biada", "author_id": 11109967, "author_profile": "https://Stackoverflow.com/users/11109967", "pm_score": 1, "selected": false, "text": "<Project Sdk=\"Microsoft.NET.Sdk.Razor\">" } ]
2022/11/01
[ "https://Stackoverflow.com/questions/74282080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3969420/" ]
74,282,117
<p>In my Angular code, I save the JSON object in the service before routing to another page. When the page opens, the service is called to return the BehaviorSubject .getValue() which is always empty. I tried .subscribed but no success. My goal is to save the json object in the service where it can be retrieved by another component.</p> <p>Here is my 1st component that call the save</p> <p>my .ts code on the 1st component</p> <p>constructor(private myService: MyService) { }</p> <pre><code>onClicktoRouteToAnotherComponent(event: any) { this.myService.saveData(this.populatedJSONData); // this has data window.open(&quot;http://localhost:4200/myOtherComponent&quot;, &quot;_blank&quot;); } </code></pre> <p>In the service code</p> <pre><code>private mySubject: BehaviorSubject&lt; MyJSONData &gt; = new BehaviorSubject&lt;MyJSONData&gt;({} as MyJSONData); public readonly $myJSONData: Observable&lt;MyJSONData&gt; = this.mySubject.asObservable(); saveJSONData(_data: MyJSONData) { this.mySubject.next(_data); } getJSONData() { return this.mySubject.getValue(); } </code></pre> <p>When the new component is being called, it only goes to the constructor and not the ngOnInit or ngOnChanges</p> <pre><code> constructor(myService: MyService) { myService.subcribe(data =&gt; { console.log(data); // always empty } let data = myService.getJSONData(); always empty } </code></pre> <p>In the app.module.ts</p> <pre><code>providers: [MyService], </code></pre> <p>Any help is appreciated. If there is another way to persist object on the service, that would be great. Thanks in advance.</p>
[ { "answer_id": 74288071, "author": "Drazu", "author_id": 15281426, "author_profile": "https://Stackoverflow.com/users/15281426", "pm_score": 3, "selected": true, "text": "this.router.navigate('route-to-my-other-component');" }, { "answer_id": 74288073, "author": "Andrew Allen...
2022/11/01
[ "https://Stackoverflow.com/questions/74282117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10354765/" ]
74,282,121
<p>I'm trying to find the overlap of character data type in two different objects (dataframes in this case) and return the percentage of overlap in R.</p> <p>My dataframes look something like</p> <pre><code>dput(lyrics_acousticness_upcoming0.01_frequency[1:100,]) structure(list(tolower.lyrics_acousticness_upcoming0.01. = structure(1:100, .Label = c(&quot; late&quot;, &quot; miss it&quot;, &quot; yeah&quot;, &quot;1&quot;, &quot;100&quot;, &quot;1発打ったこのビートを鳴らしてよ&quot;, &quot;3x&quot;, &quot;40&quot;, &quot;5&quot;, &quot;6&quot;, &quot;9&quot;, &quot;999&quot;, &quot;a&quot;, &quot;à&quot;, &quot;aah&quot;, &quot;aaliyah&quot;, &quot;about&quot;, &quot;above&quot;, &quot;account&quot;, &quot;act&quot;, &quot;actavis&quot;, &quot;actin&quot;, &quot;acting&quot;, &quot;acto&quot;, &quot;acura&quot;, &quot;add&quot;, &quot;addicts&quot;, &quot;adding&quot;, &quot;admit&quot;, &quot;afraid&quot;, &quot;after&quot;, &quot;afterlife&quot;, &quot;again&quot;, &quot;against&quot;, &quot;age&quot;, &quot;ago&quot;, &quot;ah&quot;, &quot;ahead&quot;, &quot;ai&quot;, &quot;aim&quot;, &quot;ain&quot;, &quot;air&quot;, &quot;airin&quot;, &quot;al&quot;, &quot;album&quot;, &quot;alguien&quot;, &quot;algún&quot;, &quot;alive&quot;, &quot;all&quot;, &quot;almost&quot;, &quot;alone&quot;, &quot;along&quot;, &quot;already&quot;, &quot;alright&quot;, &quot;always&quot;, &quot;am&quot;, &quot;amazing&quot;, &quot;amends&quot;, &quot;âmes&quot;, &quot;amor&quot;, &quot;an&quot;, &quot;and&quot;, &quot;and care&quot;, &quot;and every morning&quot;, &quot;and neither&quot;, &quot;and nobody&quot;, &quot;and on&quot;, &quot;and you shoulda too&quot;, &quot;ange&quot;, &quot;angry&quot;, &quot;another&quot;, &quot;any&quot;, &quot;anybody&quot;, &quot;anyhow&quot;, &quot;anymore&quot;, &quot;anyone&quot;, &quot;anything&quot;, &quot;apologized&quot;, &quot;apparel&quot;, &quot;arc&quot;, &quot;are&quot;, &quot;aren&quot;, &quot;arenas&quot;, &quot;armes&quot;, &quot;around&quot;, &quot;arrest&quot;, &quot;as&quot;, &quot;ask&quot;, &quot;asked&quot;, &quot;askin&quot;, &quot;at&quot;, &quot;atlanta&quot;, &quot;attached&quot;, &quot;attention&quot;, &quot;attitude&quot;, &quot;aussi&quot;, &quot;austin&quot;, &quot;autres&quot;, &quot;avenir&quot;, &quot;aventura&quot;, &quot;avenue&quot;, &quot;away&quot;, &quot;aww&quot;, &quot;ayy&quot;, &quot;b&quot;, &quot;baby&quot;, &quot;babylon&quot;, &quot;back&quot;, &quot;backflips&quot;, &quot;backwards&quot;, &quot;backwoods&quot;, &quot;bad&quot;, &quot;badder&quot;, &quot;badge&quot;, &quot;ball&quot;, &quot;balloon&quot;, &quot;band&quot;, &quot;bandit&quot;, &quot;bank&quot;, &quot;banks&quot;, &quot;based&quot;, &quot;basement&quot;, &quot;bay&quot;, &quot;bbk&quot;, &quot;be&quot;, &quot;be cool&quot;, &quot;beach&quot;, &quot;beast&quot;, &quot;beat&quot;, &quot;beautiful&quot;, &quot;beauty&quot;, &quot;because&quot;, &quot;becky&quot;, &quot;bed&quot;, &quot;been&quot;, &quot;beens&quot;, &quot;bees&quot;, &quot;before&quot;, &quot;behind&quot;, &quot;being&quot;, &quot;believe&quot;, &quot;believed&quot;, &quot;belong&quot;, &quot;below&quot;, &quot;bench&quot;, &quot;bendin&quot;, &quot;bent&quot;, &quot;best&quot;, &quot;bet&quot;, &quot;better&quot;, &quot;big&quot;, &quot;bigger&quot;, &quot;billin&quot;, &quot;billion&quot;, &quot;biscayne&quot;, &quot;bitch&quot;, &quot;bitches&quot;, &quot;bitter&quot;, &quot;black&quot;, &quot;blade&quot;, &quot;blame&quot;, &quot;blamin&quot;, &quot;blatt&quot;, &quot;blend&quot;, &quot;bling&quot;, &quot;block&quot;, &quot;blossom&quot;, &quot;blue&quot;, &quot;blunt&quot;, &quot;bo&quot;, &quot;boardin&quot;, &quot;boat&quot;, &quot;body&quot;, &quot;bogey&quot;, &quot;bone&quot;, &quot;born&quot;, &quot;both&quot;, &quot;bothers&quot;, &quot;bottles&quot;, &quot;bottom&quot;, &quot;boucle&quot;, &quot;bought&quot;, &quot;bounce&quot;, &quot;bound&quot;, &quot;bout&quot;, &quot;bowtie&quot;, &quot;boy&quot;, &quot;boys&quot;, &quot;bracelet&quot;, &quot;brain&quot;, &quot;brand&quot;, &quot;breads&quot;, &quot;break&quot;, &quot;breed&quot;, &quot;bridge&quot;, &quot;briefcase&quot;, &quot;brim&quot;, &quot;bring&quot;, &quot;britain&quot;, &quot;britney&quot;, &quot;broke&quot;, &quot;buckle&quot;, &quot;building&quot;, &quot;built&quot;, &quot;bullshit&quot;, &quot;bunny&quot;, &quot;buried&quot;, &quot;burning&quot;, &quot;bus&quot;, &quot;business&quot;, &quot;bust&quot;, &quot;busy&quot;, &quot;but&quot;, &quot;butt&quot;, &quot;buy&quot;, &quot;by&quot;, &quot;bye&quot;, &quot;c&quot;, &quot;cada&quot;, &quot;cadillacs&quot;, &quot;cafe&quot;, &quot;call&quot;, &quot;callin&quot;, &quot;came&quot;, &quot;can&quot;, &quot;cannot&quot;, &quot;cap&quot;, &quot;capaces&quot;, &quot;cards&quot;, &quot;care&quot;, &quot;carpet&quot;, &quot;carried&quot;, &quot;cars&quot;, &quot;cartier&quot;, &quot;cash&quot;, &quot;cashin&quot;, &quot;catch&quot;, &quot;catfish&quot;, &quot;cathedral&quot;, &quot;cause&quot;, &quot;cause i&quot;, &quot;ce&quot;, &quot;ceiling&quot;, &quot;celebratin&quot;, &quot;cell&quot;, &quot;certains&quot;, &quot;cette&quot;, &quot;chain&quot;, &quot;champagne&quot;, &quot;changed&quot;, &quot;changes&quot;, &quot;cheapskate&quot;, &quot;check&quot;, &quot;chercher&quot;, &quot;chest&quot;, &quot;chill&quot;, &quot;choice&quot;, &quot;choose&quot;, &quot;chubbs&quot;, &quot;ciel&quot;, &quot;cielo&quot;, &quot;city&quot;, &quot;claimed&quot;, &quot;class&quot;, &quot;cleansing&quot;, &quot;clear&quot;, &quot;clearly&quot;, &quot;clearport&quot;, &quot;clock&quot;, &quot;close&quot;, &quot;closed&quot;, &quot;closer&quot;, &quot;clothes&quot;, &quot;cloud&quot;, &quot;clouds&quot;, &quot;clubbin&quot;, &quot;coals&quot;, &quot;cobblestone&quot;, &quot;coeur&quot;, &quot;coke&quot;, &quot;cold&quot;, &quot;collect&quot;, &quot;college&quot;, &quot;come&quot;, &quot;comfort&quot;, &quot;comfortable&quot;, &quot;coming&quot;, &quot;comma&quot;, &quot;comme&quot;, &quot;common&quot;, &quot;condo&quot;, &quot;control&quot;, &quot;cool&quot;, &quot;corner&quot;, &quot;cosign&quot;, &quot;could&quot;, &quot;couldn&quot;, &quot;count&quot;, &quot;countin&quot;, &quot;country&quot;, &quot;couple&quot;, &quot;coups&quot;, &quot;courtside&quot;, &quot;cover&quot;, &quot;cozy&quot;, &quot;crack&quot;, &quot;crackhead&quot;, &quot;crave&quot;, &quot;crazy&quot;, &quot;create&quot;, &quot;credit&quot;, &quot;crest&quot;, &quot;crew&quot;, &quot;crib&quot;, &quot;crime&quot;, &quot;crossed&quot;, &quot;crown&quot;, &quot;cure&quot;, &quot;cursive&quot;, &quot;cut&quot;, &quot;cuz&quot;, &quot;cuz in&quot;, &quot;d&quot;, &quot;dabble&quot;, &quot;dame&quot;, &quot;damn&quot;, &quot;damnation&quot;, &quot;damned&quot;, &quot;damon&quot;, &quot;dance&quot;, &quot;dangerous&quot;, &quot;dar&quot;, &quot;dare&quot;, &quot;darling&quot;, &quot;dawg&quot;, &quot;dawn&quot;, &quot;day&quot;, &quot;days&quot;, &quot;de&quot;, &quot;dead&quot;, &quot;deal&quot;, &quot;dealing&quot;, &quot;deals&quot;, &quot;death&quot;, &quot;debatin&quot;, &quot;decide&quot;, &quot;decision&quot;, &quot;decisions&quot;, &quot;decorating&quot;, &quot;deep&quot;, &quot;deepest&quot;, &quot;defend&quot;, &quot;definitely&quot;, &quot;dem&quot;, &quot;denzel&quot;, &quot;des&quot;, &quot;deserve&quot;, &quot;desire&quot;, &quot;destruction&quot;, &quot;detest&quot;, &quot;devil&quot;, &quot;di&quot;, &quot;diamonds&quot;, &quot;did&quot;, &quot;didn&quot;, &quot;die&quot;, &quot;died&quot;, &quot;diet&quot;, &quot;different&quot;, &quot;difícil&quot;, &quot;diggin&quot;, &quot;direct&quot;, &quot;dirty&quot;, &quot;dirtyin&quot;, &quot;dis&quot;, &quot;disait&quot;, &quot;distance&quot;, &quot;ditches&quot;, &quot;divide&quot;, &quot;do&quot;, &quot;dodging&quot;, &quot;does&quot;, &quot;doesn&quot;, &quot;dog&quot;, &quot;dogs&quot;, &quot;doin&quot;, &quot;doing&quot;, &quot;dois&quot;, &quot;dolled&quot;, &quot;dolly&quot;, &quot;dominatin&quot;, &quot;don&quot;, &quot;done&quot;, &quot;donuts&quot;, &quot;door&quot;, &quot;doorknob&quot;, &quot;dormais&quot;, &quot;dormir&quot;, &quot;dosed&quot;, &quot;double&quot;, &quot;doubt&quot;, &quot;down&quot;, &quot;downplayin&quot;, &quot;drake&quot;, &quot;drama&quot;, &quot;dre&quot;, &quot;dream&quot;, &quot;dreams&quot;, &quot;drink&quot;, &quot;drive&quot;, &quot;driven&quot;, &quot;driving&quot;, &quot;drizzy&quot;, &quot;drop&quot;, &quot;drove&quot;, &quot;drowned&quot;, &quot;drug&quot;, &quot;drum&quot;, &quot;dry&quot;, &quot;dubplate&quot;, &quot;dude&quot;, &quot;due&quot;, &quot;dug&quot;, &quot;dumb&quot;, &quot;dying&quot;, &quot;dеfend&quot;, &quot;e&quot;, &quot;each&quot;, &quot;early&quot;, &quot;eastside&quot;, &quot;easy&quot;, &quot;eat&quot;, &quot;eating&quot;, &quot;economy&quot;, &quot;ed&quot;, &quot;edge&quot;, &quot;eh&quot;, &quot;either&quot;, &quot;el&quot;, &quot;else&quot;, &quot;em&quot;, &quot;embassy&quot;, &quot;emotion&quot;, &quot;en&quot;, &quot;end&quot;, &quot;endlessly&quot;, &quot;ends&quot;, &quot;enemies&quot;, &quot;energizer&quot;, &quot;enfuir&quot;, &quot;enough&quot;, &quot;entends&quot;, &quot;entero&quot;, &quot;entourage&quot;, &quot;envolent&quot;, &quot;es&quot;, &quot;escape&quot;, &quot;especially&quot;, &quot;espère&quot;, &quot;est&quot;, &quot;eternal&quot;, &quot;eternity&quot;, &quot;eux&quot;, &quot;even&quot;, &quot;ever&quot;, &quot;every&quot;, &quot;everybody&quot;, &quot;everyday&quot;, &quot;everyone&quot;, &quot;everything&quot;, &quot;everywhere&quot;, &quot;evil&quot;, &quot;exactly&quot;, &quot;excited&quot;, &quot;execute&quot;, &quot;expect&quot;, &quot;expecting&quot;, &quot;exposed&quot;, &quot;exposеd&quot;, &quot;extra&quot;, &quot;eye&quot;, &quot;eyes&quot;, &quot;f&quot;, &quot;face&quot;, &quot;fact&quot;, &quot;fade&quot;, &quot;failure&quot;, &quot;fair&quot;, &quot;fait&quot;, &quot;faith&quot;, &quot;fake&quot;, &quot;fall&quot;, &quot;fam&quot;, &quot;fame&quot;, &quot;famous&quot;, &quot;fantasies&quot;, &quot;fast&quot;, &quot;fate&quot;, &quot;fault&quot;, &quot;fausses&quot;, &quot;faut&quot;, &quot;favorite&quot;, &quot;fear&quot;, &quot;fears&quot;, &quot;features&quot;, &quot;fed&quot;, &quot;feel&quot;, &quot;feel straight&quot;, &quot;feeling&quot;, &quot;feelings&quot;, &quot;feet&quot;, &quot;fela&quot;, &quot;fell&quot;, &quot;felt&quot;, &quot;feu&quot;, &quot;feus&quot;, &quot;fight&quot;, &quot;fighting&quot;, &quot;final&quot;, &quot;finally&quot;, &quot;find&quot;, &quot;fine&quot;, &quot;fines&quot;, &quot;finger&quot;, &quot;fingertips&quot;, &quot;finna&quot;, &quot;firm&quot;, &quot;first&quot;, &quot;fish&quot;, &quot;fit&quot;, &quot;five&quot;, &quot;fix&quot;, &quot;fixate&quot;, &quot;fl&quot;, &quot;flame&quot;, &quot;flashy&quot;, &quot;flatline&quot;, &quot;flex&quot;, &quot;float&quot;, &quot;floor&quot;, &quot;floors&quot;, &quot;flow&quot;, &quot;fly&quot;, &quot;flyin&quot;, &quot;flying&quot;, &quot;fo&quot;, &quot;fooled&quot;, &quot;for&quot;, &quot;for myself&quot;, &quot;forced&quot;, &quot;fore&quot;, &quot;forever&quot;, &quot;forget&quot;, &quot;fort&quot;, &quot;found&quot;, &quot;fout&quot;, &quot;fragrance&quot;, &quot;frankenstein&quot;, &quot;franny&quot;, &quot;frère&quot;, &quot;fresh&quot;, &quot;friday&quot;, &quot;friend&quot;, &quot;friendly&quot;, &quot;friends&quot;, &quot;from&quot;, &quot;front&quot;, &quot;fuck&quot;, &quot;fucked&quot;, &quot;fuckin&quot;, &quot;fucking&quot;, &quot;fucks&quot;, &quot;full&quot;, &quot;funny&quot;, &quot;furs&quot;, &quot;further&quot;, &quot;future&quot;, &quot;g&quot;, &quot;gala&quot;, &quot;gallon&quot;, &quot;game&quot;, &quot;gang&quot;, &quot;gangstas&quot;, &quot;gangster&quot;, &quot;gasoline&quot;, &quot;gave&quot;, &quot;get&quot;, &quot;gets&quot;, &quot;gettin&quot;, &quot;getting&quot;, &quot;gibbo&quot;, &quot;gig&quot;, &quot;gimme&quot;, &quot;gimmе&quot;, &quot;girl&quot;, &quot;girls&quot;, &quot;give&quot;, &quot;given&quot;, &quot;glass&quot;, &quot;glasses&quot;, &quot;glowin&quot;, &quot;go&quot;, &quot;god&quot;, &quot;goddamn&quot;, &quot;goes&quot;, &quot;goin&quot;, &quot;going&quot;, &quot;gold&quot;, &quot;gon&quot;, &quot;gone&quot;, &quot;gonna&quot;, &quot;good&quot;, &quot;got&quot;, &quot;gotta&quot;, &quot;gotten&quot;, &quot;gotti&quot;, &quot;graduated&quot;, &quot;grammy&quot;, &quot;grams&quot;, &quot;grandeza&quot;, &quot;grandir&quot;, &quot;grave&quot;, &quot;gravel&quot;, &quot;greatest&quot;, &quot;greatness&quot;, &quot;greaze&quot;, &quot;green&quot;, &quot;grew&quot;, &quot;grind&quot;, &quot;grippin&quot;, &quot;grips&quot;, &quot;groovy&quot;, &quot;guarantee&quot;, &quot;guardin&quot;, &quot;guest&quot;, &quot;guidance&quot;, &quot;guide&quot;, &quot;gun&quot;, &quot;guy&quot;, &quot;guys&quot;, &quot;ha&quot;, &quot;had&quot;, &quot;hair&quot;, &quot;hall&quot;, &quot;halloween&quot;, &quot;hand&quot;, &quot;hands&quot;, &quot;hang&quot;, &quot;hangin&quot;, &quot;happened&quot;, &quot;happiness&quot;, &quot;hard&quot;, &quot;harder&quot;, &quot;has&quot;, &quot;hate&quot;, &quot;hates&quot;, &quot;haunted&quot;, &quot;have&quot;, &quot;have some love&quot;, &quot;havin&quot;, &quot;hawks&quot;, &quot;he&quot;, &quot;head&quot;, &quot;headlines&quot;, &quot;hear&quot;, &quot;heard&quot;, &quot;hearin&quot;, &quot;heart&quot;, &quot;heat&quot;, &quot;heaven&quot;, &quot;heavenly&quot;, &quot;hectic&quot;, &quot;hell&quot;, &quot;hello&quot;, &quot;help&quot;, &quot;hen&quot;, &quot;henn&quot;, &quot;hennessy&quot;, &quot;her&quot;, &quot;here&quot;, &quot;hey&quot;, &quot;hi&quot;, &quot;hide&quot;, &quot;high&quot;, &quot;higher&quot;, &quot;him&quot;, &quot;himself&quot;, &quot;his&quot;, &quot;hit&quot;, &quot;hits&quot;, &quot;ho&quot;, &quot;hoes&quot;, &quot;hold&quot;, &quot;holiday&quot;, &quot;holler&quot;, &quot;holy&quot;, &quot;home&quot;, &quot;homies&quot;, &quot;honey&quot;, &quot;hood&quot;, &quot;hookers&quot;, &quot;hope&quot;, &quot;hot&quot;, &quot;hotel&quot;, &quot;hotline&quot;, &quot;house&quot;, &quot;how&quot;, &quot;howard&quot;, &quot;huh&quot;, &quot;hundred&quot;, &quot;hundreds&quot;, &quot;hurt&quot;, &quot;hustlin&quot;, &quot;hype&quot;, &quot;i&quot;, &quot;i have smaller&quot;, &quot;i try&quot;, &quot;i wanted to go&quot;, &quot;ice&quot;, &quot;icy&quot;, &quot;if&quot;, &quot;il&quot;, &quot;ill&quot;, &quot;ils&quot;, &quot;imagine&quot;, &quot;immortal&quot;, &quot;important&quot;, &quot;in&quot;, &quot;inhibitions&quot;, &quot;innocent&quot;, &quot;inside&quot;, &quot;inspirin&quot;, &quot;into&quot;, &quot;invested&quot;, &quot;invitation&quot;, &quot;invited&quot;, &quot;involved&quot;, &quot;ironic&quot;, &quot;is&quot;, &quot;islands&quot;, &quot;isn&quot;, &quot;it&quot;, &quot;italians&quot;, &quot;its&quot;, &quot;j&quot;, &quot;jacket&quot;, &quot;jail&quot;, &quot;jang&quot;, &quot;jealousy&quot;, &quot;jeans&quot;, &quot;jeez&quot;, &quot;jet&quot;, &quot;jeu&quot;, &quot;jheeze&quot;, &quot;job&quot;, &quot;jokes&quot;, &quot;joking&quot;, &quot;julie&quot;, &quot;just&quot;, &quot;karaoke&quot;, &quot;keep&quot;, &quot;keep on&quot;, &quot;keeping&quot;, &quot;keepsake&quot;, &quot;kettle&quot;, &quot;keychain&quot;, &quot;kid&quot;, &quot;kiddin&quot;, &quot;kill&quot;, &quot;kind&quot;, &quot;kinda&quot;, &quot;king&quot;, &quot;kiss&quot;, &quot;knew&quot;, &quot;know&quot;, &quot;know i&quot;, &quot;knowing&quot;, &quot;known&quot;, &quot;knows&quot;, &quot;kobe&quot;, &quot;kush&quot;, &quot;kuti&quot;, &quot;l&quot;, &quot;la&quot;, &quot;là&quot;, &quot;labels&quot;, &quot;lady&quot;, &quot;land&quot;, &quot;lang&quot;, &quot;language&quot;, &quot;larmes&quot;, &quot;last&quot;, &quot;late&quot;, &quot;lately&quot;, &quot;lay&quot;, &quot;le&quot;, &quot;lead&quot;, &quot;leads&quot;, &quot;leaf&quot;, &quot;learned&quot;, &quot;learning&quot;, &quot;least&quot;, &quot;leather&quot;, &quot;leave&quot;, &quot;leavin&quot;, &quot;leaving&quot;, &quot;left&quot;, &quot;legacy&quot;, &quot;legal&quot;, &quot;lens&quot;, &quot;les&quot;, &quot;less&quot;, &quot;lessons&quot;, &quot;let&quot;, &quot;lettre&quot;, &quot;lie&quot;, &quot;lies&quot;, &quot;life&quot;, &quot;lifestyle&quot;, &quot;light&quot;, &quot;like&quot;, &quot;line&quot;, &quot;linea&quot;, &quot;lis&quot;, &quot;list&quot;, &quot;listen&quot;, &quot;liter&quot;, &quot;little&quot;, &quot;live&quot;, &quot;lived&quot;, &quot;livin&quot;, &quot;living&quot;, &quot;ll&quot;, &quot;lo&quot;, &quot;lonely&quot;, &quot;long&quot;, &quot;look&quot;, &quot;looking&quot;, &quot;looks&quot;, &quot;lord&quot;, &quot;lose&quot;, &quot;lost&quot;, &quot;lot&quot;, &quot;lotta&quot;, &quot;louis&quot;, &quot;love&quot;, &quot;loved&quot;, &quot;loves&quot;, &quot;low&quot;, &quot;loyalty&quot;, &quot;luke&quot;, &quot;luna&quot;, &quot;luther&quot;, &quot;lyin&quot;, &quot;m&quot;, &quot;m2&quot;, &quot;m6&quot;, &quot;ma&quot;, &quot;mac&quot;, &quot;machine&quot;, &quot;mack&quot;, &quot;mad&quot;, &quot;made&quot;, &quot;madness&quot;, &quot;magazine&quot;, &quot;magdalene&quot;, &quot;maint&quot;, &quot;major&quot;, &quot;make&quot;, &quot;makes&quot;, &quot;makin&quot;, &quot;making&quot;, &quot;male&quot;, &quot;male friends&quot;, &quot;malibu&quot;, &quot;mall&quot;, &quot;mally&quot;, &quot;mama&quot;, &quot;man&quot;, &quot;mannie&quot;, &quot;mansions&quot;, &quot;many&quot;, &quot;margherita&quot;, &quot;mark&quot;, &quot;marry&quot;, &quot;martin&quot;, &quot;martyr&quot;, &quot;más&quot;, &quot;mascot&quot;, &quot;matrix&quot;, &quot;matter&quot;, &quot;matters&quot;, &quot;maybe&quot;, &quot;me&quot;, &quot;mean&quot;, &quot;mean i&quot;, &quot;meant&quot;, &quot;medical&quot;, &quot;medicine&quot;, &quot;melt&quot;, &quot;mêmes&quot;, &quot;memphis&quot;, &quot;men&quot;, &quot;menti&quot;, &quot;mention&quot;, &quot;menu&quot;, &quot;met&quot;, &quot;metal&quot;, &quot;mi&quot;, &quot;miami&quot;, &quot;miedo&quot;, &quot;miette&quot;, &quot;might&quot;, &quot;mil&quot;, &quot;mile&quot;, &quot;miles&quot;, &quot;million&quot;, &quot;millions&quot;, &quot;mind&quot;, &quot;mine&quot;, &quot;mines&quot;, &quot;minute&quot;, &quot;mirror&quot;, &quot;miss&quot;, &quot;missed&quot;, &quot;missions&quot;, &quot;missus&quot;, &quot;mistake&quot;, &quot;mistakes&quot;, &quot;mixed&quot;, &quot;mixtape&quot;, &quot;mj&quot;, &quot;mm&quot;, &quot;mmm&quot;, &quot;mo&quot;, &quot;moi&quot;, &quot;moment&quot;, &quot;monday&quot;, &quot;monde&quot;, &quot;money&quot;, &quot;monster&quot;, &quot;months&quot;, &quot;montre&quot;, &quot;moon&quot;, &quot;more&quot;, &quot;most&quot;, &quot;mostrarle&quot;, &quot;motel&quot;, &quot;motherfucker&quot;, &quot;motherfuckers&quot;, &quot;motherfuckin&quot;, &quot;motion&quot;, &quot;motor&quot;, &quot;motto&quot;, &quot;mountain&quot;, &quot;mouth&quot;, &quot;move&quot;, &quot;moved&quot;, &quot;moves&quot;, &quot;movie&quot;, &quot;movin&quot;, &quot;mr&quot;, &quot;much&quot;, &quot;muddy&quot;, &quot;multiplying&quot;, &quot;must&quot;, &quot;my&quot;, &quot;my heart&quot;, &quot;myself&quot;, &quot;n&quot;, &quot;na&quot;, &quot;nadie&quot;, &quot;nan&quot;, &quot;nant&quot;, &quot;nasty&quot;, &quot;naturally&quot;, &quot;ne&quot;, &quot;need&quot;, &quot;needed&quot;, &quot;needle&quot;, &quot;needs&quot;, &quot;negative&quot;, &quot;neither&quot;, &quot;nerve&quot;, &quot;nerves&quot;, &quot;nervous&quot;, &quot;never&quot;, &quot;nevermind&quot;, &quot;new&quot;, &quot;news&quot;, &quot;next&quot;, &quot;nice&quot;, &quot;nicki&quot;, &quot;nigga&quot;, &quot;niggas&quot;, &quot;night&quot;, &quot;nights&quot;, &quot;niko&quot;, &quot;nine&quot;, &quot;nir&quot;, &quot;no&quot;, &quot;nobody&quot;, &quot;noddin&quot;, &quot;noise&quot;, &quot;none&quot;, &quot;normal&quot;, &quot;not&quot;, &quot;nother&quot;, &quot;nothin&quot;, &quot;nothing&quot;, &quot;nous&quot;, &quot;now&quot;, &quot;nuit&quot;, &quot;number&quot;, &quot;nеrve&quot;, &quot;o&quot;, &quot;of&quot;, &quot;off&quot;, &quot;oh&quot;, &quot;ojos&quot;, &quot;okay&quot;, &quot;old&quot;, &quot;older&quot;, &quot;on&quot;, &quot;once&quot;, &quot;one&quot;, &quot;online&quot;, &quot;only&quot;, &quot;ooh&quot;, &quot;open&quot;, &quot;opened&quot;, &quot;opi&quot;, &quot;opinion&quot;, &quot;opposite&quot;, &quot;or&quot;, &quot;orleans&quot;, &quot;ot&quot;, &quot;other&quot;, &quot;oti&quot;, &quot;ouais&quot;, &quot;our&quot;, &quot;out&quot;, &quot;outs&quot;, &quot;outta&quot;, &quot;over&quot;, &quot;overrated&quot;, &quot;overseas&quot;, &quot;ovo&quot;, &quot;owe&quot;, &quot;own&quot;, &quot;p&quot;, &quot;paddle&quot;, &quot;pages&quot;, &quot;paid&quot;, &quot;pain&quot;, &quot;panoramic&quot;, &quot;papa&quot;, &quot;paparazzi&quot;, &quot;papers&quot;, &quot;para&quot;, &quot;pardon&quot;, &quot;park&quot;, &quot;part&quot;, &quot;partir&quot;, &quot;parton&quot;, &quot;party&quot;, &quot;pas&quot;, &quot;pass&quot;, &quot;passion&quot;, &quot;passport&quot;, &quot;past&quot;, &quot;patek&quot;, &quot;patience&quot;, &quot;patron&quot;, &quot;pay&quot;, &quot;peace&quot;, &quot;peach&quot;, &quot;peaks&quot;, &quot;peel&quot;, &quot;pen&quot;, &quot;pendus&quot;, &quot;people&quot;, &quot;pepperoni&quot;, &quot;percocet&quot;, &quot;perderme&quot;, &quot;perdus&quot;, &quot;persian&quot;, &quot;person&quot;, &quot;personified&quot;, &quot;pete&quot;, &quot;phone&quot;, &quot;photo&quot;, &quot;piece&quot;, &quot;pimp&quot;, &quot;pimpin&quot;, &quot;pink&quot;, &quot;pippen&quot;, &quot;pissed&quot;, &quot;place&quot;, &quot;places&quot;, &quot;plan&quot;, &quot;planeta&quot;, &quot;planner&quot;, &quot;plans&quot;, &quot;plat&quot;, &quot;platinum&quot;, &quot;play&quot;, &quot;players&quot;, &quot;playground&quot;, &quot;playin&quot;, &quot;plus&quot;, &quot;po&quot;, &quot;pocket&quot;, &quot;point&quot;, &quot;poison&quot;, &quot;pole&quot;, &quot;police&quot;, &quot;politician&quot;, &quot;pool&quot;, &quot;pop&quot;, &quot;por&quot;, &quot;posing&quot;, &quot;poster&quot;, &quot;posеd&quot;, &quot;pour&quot;, &quot;powers&quot;, &quot;prada&quot;, &quot;pray&quot;, &quot;preaching&quot;, &quot;precious&quot;, &quot;prefer&quot;, &quot;president&quot;, &quot;presidential&quot;, &quot;pretend&quot;, &quot;pretty&quot;, &quot;price&quot;, &quot;pride&quot;, &quot;prime&quot;, &quot;prison&quot;, &quot;probably&quot;, &quot;problem&quot;, &quot;problems&quot;, &quot;profile&quot;, &quot;promis&quot;, &quot;proof&quot;, &quot;protest&quot;, &quot;proud&quot;, &quot;prove&quot;, &quot;psychic&quot;, &quot;puerta&quot;, &quot;puisque&quot;, &quot;pull&quot;, &quot;purpose&quot;, &quot;pushin&quot;, &quot;pushing&quot;, &quot;pussy&quot;, &quot;pussyholes&quot;, &quot;put&quot;, &quot;puttin&quot;, &quot;qu&quot;, &quot;qualification&quot;, &quot;quand&quot;, &quot;que&quot;, &quot;quick&quot;, &quot;quit&quot;, &quot;quitte&quot;, &quot;quizá&quot;, &quot;r&quot;, &quot;race&quot;, &quot;rain&quot;, &quot;ralentit&quot;, &quot;ran&quot;, &quot;rap&quot;, &quot;rapper&quot;, &quot;rappin&quot;, &quot;ras&quot;, &quot;rate&quot;, &quot;rather&quot;, &quot;razor&quot;, &quot;re&quot;, &quot;reached&quot;, &quot;reaction&quot;, &quot;read&quot;, &quot;ready&quot;, &quot;real&quot;, &quot;realest&quot;, &quot;reality&quot;, &quot;realize&quot;, &quot;really&quot;, &quot;reason&quot;, &quot;record&quot;, &quot;records&quot;, &quot;red&quot;, &quot;referring&quot;, &quot;refuse to&quot;, &quot;regarde&quot;, &quot;relay&quot;, &quot;religion&quot;, &quot;remake&quot;, &quot;remember&quot;, &quot;reply&quot;, &quot;reputation&quot;, &quot;researchin&quot;, &quot;reservations&quot;, &quot;respect&quot;, &quot;rest&quot;, &quot;restera&quot;, &quot;restraint&quot;, &quot;retirement&quot;, &quot;rev&quot;, &quot;revenge&quot;, &quot;rhythm&quot;, &quot;rich&quot;, &quot;riddim&quot;, &quot;ride&quot;, &quot;ridge&quot;, &quot;riding&quot;, &quot;right&quot;, &quot;ring&quot;, &quot;rips&quot;, &quot;risk&quot;, &quot;road&quot;, &quot;rock&quot;, &quot;rockin&quot;, &quot;roll&quot;, &quot;rolled&quot;, &quot;rollie&quot;, &quot;rolling&quot;, &quot;romance&quot;, &quot;room&quot;, &quot;rough&quot;, &quot;round&quot;, &quot;row&quot;, &quot;rr&quot;, &quot;rubber&quot;, &quot;rugs&quot;, &quot;ruin&quot;, &quot;run&quot;, &quot;runnin&quot;, &quot;running&quot;, &quot;runs&quot;, &quot;rush&quot;, &quot;rushing&quot;, &quot;s&quot;, &quot;sad&quot;, &quot;safe&quot;, &quot;sag&quot;, &quot;said&quot;, &quot;saigne&quot;, &quot;sailed&quot;, &quot;sake&quot;, &quot;salad&quot;, &quot;salir&quot;, &quot;same&quot;, &quot;santa&quot;, &quot;satan&quot;, &quot;save&quot;, &quot;saviour&quot;, &quot;saw&quot;, &quot;say&quot;, &quot;sayin&quot;, &quot;saying&quot;, &quot;says&quot;, &quot;scared&quot;, &quot;scene&quot;, &quot;scènes&quot;, &quot;scottie&quot;, &quot;scratch&quot;, &quot;sea&quot;, &quot;seat&quot;, &quot;secret&quot;, &quot;secrets&quot;, &quot;security&quot;, &quot;see&quot;, &quot;seem&quot;, &quot;seen&quot;, &quot;self&quot;, &quot;send&quot;, &quot;sense&quot;, &quot;sensе&quot;, &quot;separa&quot;, &quot;service&quot;, &quot;seven&quot;, &quot;seventeen&quot;, &quot;sex&quot;, &quot;shame&quot;, &quot;share&quot;, &quot;she&quot;, &quot;sheet&quot;, &quot;shelter&quot;, &quot;sheriff&quot;, &quot;shh&quot;, &quot;shine&quot;, &quot;shing&quot;, &quot;ship&quot;, &quot;shirt&quot;, &quot;shit&quot;, &quot;shocking&quot;, &quot;shoes&quot;, &quot;shorty&quot;, &quot;shots&quot;, &quot;should&quot;, &quot;shoulda&quot;, &quot;shouldn&quot;, &quot;shout&quot;, &quot;shovel&quot;, &quot;show&quot;, &quot;shower&quot;, &quot;showin&quot;, &quot;showing&quot;, &quot;showtime&quot;, &quot;shut&quot;, &quot;si&quot;, &quot;side&quot;, &quot;sides&quot;, &quot;sign&quot;, &quot;signals&quot;, &quot;silence&quot;, &quot;simple&quot;, &quot;since&quot;, &quot;singin&quot;, &quot;singing&quot;, &quot;single&quot;, &quot;sit&quot;, &quot;sittin&quot;, &quot;sitting&quot;, &quot;six&quot;, &quot;skeet&quot;, &quot;sleep&quot;, &quot;slice&quot;, &quot;slow&quot;, &quot;smaller&quot;, &quot;smart&quot;, &quot;smoke&quot;, &quot;snowin&quot;, &quot;snug&quot;, &quot;so&quot;, &quot;social&quot;, &quot;solid&quot;, &quot;solo&quot;, &quot;some&quot;, &quot;somebody&quot;, &quot;someday&quot;, &quot;someone&quot;, &quot;something&quot;, &quot;sometimes&quot;, &quot;somewhere&quot;, &quot;son&quot;, &quot;sont&quot;, &quot;soon&quot;, &quot;soul&quot;, &quot;sound&quot;, &quot;sound different&quot;, &quot;south&quot;, &quot;space&quot;, &quot;spaceship&quot;, &quot;spanish&quot;, &quot;speak&quot;, &quot;special&quot;, &quot;speed&quot;, &quot;spell&quot;, &quot;spend&quot;, &quot;spit&quot;, &quot;spotlight&quot;, &quot;spray&quot;, &quot;squad&quot;, &quot;stacks&quot;, &quot;stand&quot;, &quot;star&quot;, &quot;start&quot;, &quot;started&quot;, &quot;starting&quot;, &quot;state&quot;, &quot;statement&quot;, &quot;stay&quot;, &quot;stick&quot;, &quot;still&quot;, &quot;stones&quot;, &quot;stop&quot;, &quot;stories&quot;, &quot;story&quot;, &quot;straddling&quot;, &quot;straight&quot;, &quot;street&quot;, &quot;streets&quot;, &quot;strength&quot;, &quot;stressed&quot;, &quot;stripper&quot;, &quot;strong&quot;, &quot;stuck&quot;, &quot;study&quot;, &quot;stunna&quot;, &quot;stunt&quot;, &quot;stupid&quot;, &quot;style&quot;, &quot;such&quot;, &quot;sugar&quot;, &quot;suicide&quot;, &quot;summer&quot;, &quot;sunshine&quot;, &quot;supermodel&quot;, &quot;suppose&quot;, &quot;supposed&quot;, &quot;sur&quot;, &quot;sure&quot;, &quot;surely&quot;, &quot;sûrement&quot;, &quot;surface&quot;, &quot;surprised&quot;, &quot;surrounded&quot;, &quot;survived&quot;, &quot;suzuki&quot;, &quot;swag&quot;, &quot;swam&quot;, &quot;swear&quot;, &quot;sweepstakes&quot;, &quot;sweet&quot;, &quot;sweetest&quot;, &quot;swervin&quot;, &quot;switch&quot;, &quot;switches&quot;, &quot;switchin&quot;, &quot;symptom&quot;, &quot;t&quot;, &quot;t say what&quot;, &quot;tag&quot;, &quot;tailor&quot;, &quot;take&quot;, &quot;taken&quot;, &quot;takes&quot;, &quot;takin&quot;, &quot;taking&quot;, &quot;taliban&quot;, &quot;talk&quot;, &quot;talkin&quot;, &quot;talking&quot;, &quot;talks&quot;, &quot;tall&quot;, &quot;taller&quot;, &quot;tanto&quot;, &quot;taping&quot;, &quot;taught&quot;, &quot;te&quot;, &quot;tea&quot;, &quot;team&quot;, &quot;tech&quot;, &quot;tell&quot;, &quot;tellin&quot;, &quot;telling&quot;, &quot;tells&quot;, &quot;temps&quot;, &quot;tengo&quot;, &quot;tenir&quot;, &quot;tennessee&quot;, &quot;tenue&quot;, &quot;testimony&quot;, &quot;text&quot;, &quot;texts&quot;, &quot;than&quot;, &quot;thang&quot;, &quot;that&quot;, &quot;the&quot;, &quot;them&quot;, &quot;then&quot;, &quot;there&quot;, &quot;these&quot;, &quot;they&quot;, &quot;thing&quot;, &quot;things&quot;, &quot;think&quot;, &quot;thinkin&quot;, &quot;thinking&quot;, &quot;thirsty&quot;, &quot;thirty&quot;, &quot;this&quot;, &quot;those&quot;, &quot;thou&quot;, &quot;though&quot;, &quot;thought&quot;, &quot;thoughts&quot;, &quot;thread&quot;, &quot;three&quot;, &quot;through&quot;, &quot;throwin&quot;, &quot;thе&quot;, &quot;ti&quot;, &quot;ticket&quot;, &quot;tied&quot;, &quot;tiempo&quot;, &quot;ties&quot;, &quot;tight&quot;, &quot;til&quot;, &quot;till&quot;, &quot;time&quot;, &quot;times&quot;, &quot;timin&quot;, &quot;ting&quot;, &quot;tints&quot;, &quot;tit&quot;, &quot;tits&quot;, &quot;to&quot;, &quot;toast&quot;, &quot;today&quot;, &quot;todos&quot;, &quot;together&quot;, &quot;toi&quot;, &quot;told&quot;, &quot;tongue&quot;, &quot;tonight&quot;, &quot;too&quot;, &quot;toodles&quot;, &quot;took&quot;, &quot;top&quot;, &quot;tore&quot;, &quot;toronto&quot;, &quot;tote&quot;, &quot;touch&quot;, &quot;touched&quot;, &quot;touching&quot;, &quot;tough&quot;, &quot;toujours&quot;, &quot;tour&quot;, &quot;tout&quot;, &quot;town&quot;, &quot;tracin&quot;, &quot;traitors&quot;, &quot;trampoline&quot;, &quot;trauma&quot;, &quot;travel&quot;, &quot;treadmill&quot;, &quot;treat&quot;, &quot;tree&quot;, &quot;tried&quot;, &quot;trigger&quot;, &quot;trillion&quot;, &quot;trip&quot;, &quot;trippin&quot;, &quot;trop&quot;, &quot;trophy&quot;, &quot;trouble&quot;, &quot;troubled&quot;, &quot;true&quot;, &quot;trust&quot;, &quot;truth&quot;, &quot;try&quot;, &quot;try to be cool&quot;, &quot;trying&quot;, &quot;tryna&quot;, &quot;tu&quot;, &quot;tune&quot;, &quot;tunechi&quot;, &quot;tunnel&quot;, &quot;turn&quot;, &quot;turnin&quot;, &quot;turns&quot;, &quot;turnt&quot;, &quot;tus&quot;, &quot;twenty&quot;, &quot;twisted&quot;, &quot;two&quot;, &quot;tyme&quot;, &quot;type&quot;, &quot;ugk&quot;, &quot;uh&quot;, &quot;uhh&quot;, &quot;umbrella&quot;, &quot;umpire&quot;, &quot;un&quot;, &quot;una&quot;, &quot;unbearable&quot;, &quot;uncle&quot;, &quot;under&quot;, &quot;underground&quot;, &quot;understand&quot;, &quot;undiscovered&quot;, &quot;unless&quot;, &quot;unlucky&quot;, &quot;unreal&quot;, &quot;unruly&quot;, &quot;until&quot;, &quot;up&quot;, &quot;upside&quot;, &quot;uptown&quot;, &quot;us&quot;, &quot;used&quot;, &quot;values&quot;, &quot;vas&quot;, &quot;vayan&quot;, &quot;ve&quot;, &quot;venue&quot;, &quot;venus&quot;, &quot;verme&quot;, &quot;very&quot;, &quot;veut&quot;, &quot;vez&quot;, &quot;viens&quot;, &quot;view&quot;, &quot;views&quot;, &quot;villain&quot;, &quot;vision&quot;, &quot;voodoo&quot;, &quot;voulais&quot;, &quot;waist&quot;, &quot;wait&quot;, &quot;walk&quot;, &quot;walking&quot;, &quot;wall&quot;, &quot;walls&quot;, &quot;wanna&quot;, &quot;want&quot;, &quot;want to&quot;, &quot;want to know&quot;, &quot;wanted&quot;, &quot;wants&quot;, &quot;warm&quot;, &quot;was&quot;, &quot;wasn&quot;, &quot;waste&quot;, &quot;wasted&quot;, &quot;watch&quot;, &quot;watched&quot;, &quot;water&quot;, &quot;way&quot;, &quot;wayans&quot;, &quot;ways&quot;, &quot;we&quot;, &quot;weak&quot;, &quot;weakness&quot;, &quot;weapon&quot;, &quot;wear&quot;, &quot;wearing&quot;, &quot;wedding&quot;, &quot;weed&quot;, &quot;weekend&quot;, &quot;well&quot;, &quot;went&quot;, &quot;were&quot;, &quot;wet&quot;, &quot;what&quot;, &quot;whatever&quot;, &quot;when&quot;, &quot;whenever&quot;, &quot;where&quot;, &quot;where my&quot;, &quot;whereabouts&quot;, &quot;which&quot;, &quot;whip&quot;, &quot;whippin&quot;, &quot;whitney&quot;, &quot;who&quot;, &quot;whoever&quot;, &quot;whole&quot;, &quot;why&quot;, &quot;wife&quot;, &quot;wildin&quot;, &quot;will&quot;, &quot;williams&quot;, &quot;win&quot;, &quot;wind&quot;, &quot;wine&quot;, &quot;wings&quot;, &quot;winnin&quot;, &quot;wise&quot;, &quot;wish&quot;, &quot;wished&quot;, &quot;wishing&quot;, &quot;with&quot;, &quot;with a&quot;, &quot;without&quot;, &quot;woman&quot;, &quot;women&quot;, &quot;won&quot;, &quot;wonder&quot;, &quot;wonderin&quot;, &quot;wondering&quot;, &quot;woo&quot;, &quot;wood&quot;, &quot;woodgrain&quot;, &quot;word&quot;, &quot;work&quot;, &quot;workin&quot;, &quot;working&quot;, &quot;world&quot;, &quot;worry&quot;, &quot;worse&quot;, &quot;worth&quot;, &quot;would&quot;, &quot;wouldn&quot;, &quot;wow&quot;, &quot;wrist&quot;, &quot;wrong&quot;, &quot;wrote&quot;, &quot;wе&quot;, &quot;xanax&quot;, &quot;y&quot;, &quot;ya&quot;, &quot;yachts&quot;, &quot;yale&quot;, &quot;yeah&quot;, &quot;year&quot;, &quot;years&quot;, &quot;yes&quot;, &quot;yesterday&quot;, &quot;ymca&quot;, &quot;ymcmb&quot;, &quot;yo&quot;, &quot;yolo&quot;, &quot;york&quot;, &quot;you&quot;, &quot;young&quot;, &quot;youngest&quot;, &quot;your&quot;, &quot;yours&quot;, &quot;yourself&quot;, &quot;zone&quot;, &quot;ぁあ&quot;, &quot;あなたの言葉は この鼻を伸ばす&quot;, &quot;あの子の顔 探しても見当たらない&quot;, &quot;あれほど生きてきたけど全ては夢みたい&quot;, &quot;あれもこれも&quot;, &quot;あれもこれも魅力的でも私は君がいい&quot;, &quot;あんたに聴かすだけだから&quot;, &quot;カッコの悪い 恋の歌&quot;, &quot;ここに&quot;, &quot;このくらいがちょうどいいかなって&quot;, &quot;さぁ&quot;, &quot;さながら&quot;, &quot;さよならがあんたに捧ぐ愛の言葉&quot;, &quot;さよならべいべ&quot;, &quot;そのエロい体を貸してくれ&quot;, &quot;その一瞬の隙を運命は 見逃してくれない&quot;, &quot;それでいいでしょ&quot;, &quot;そんなことはどうでもいいからって&quot;, &quot;だいたいこんなもん&quot;, &quot;だいたいそんなもん&quot;, &quot;だから涙は見せずに さよならべいべ&quot;, &quot;だから笑って手を振る さよならべいべ&quot;, &quot;だけどそれが分かって本当に良かった&quot;, &quot;ちょっと待ったって&quot;, &quot;ついハイになって&quot;, &quot;で&quot;, &quot;でも何もかもが不快だね&quot;, &quot;どうかしそうやこの胸は&quot;, &quot;どこにいたの 探してたよ&quot;, &quot;どこまでも どこまでも&quot;, &quot;どっかいっちゃって&quot;, &quot;どれほど朽ち果てようと最後にゃ笑いたい&quot;, &quot;なんとかしてや&quot;, &quot;の歌詞&quot;, &quot;はみ出したったモノを隠す場所もない&quot;, &quot;まぁいいかな&quot;, &quot;まぁいいから&quot;, &quot;まやかしの宝 見せかけの光&quot;, &quot;もう二度と犯さない&quot;, &quot;もう行く時間か 最後までカッコ悪いわしじゃったな&quot;, &quot;わしかてずっと一緒におりたかったわ&quot;, &quot;世間は許しちゃくれやせんよ&quot;, &quot;今日も愉快だね&quot;, &quot;伝えた日&quot;, &quot;何か分かったようで 何も分かってなくて&quot;, &quot;何のために戦おうとも動機は愛がいい&quot;, &quot;何もかも 捨ててくよ&quot;, &quot;余裕のない 愛の言葉&quot;, &quot;優しかった いつも支えてくれた 信じてた&quot;, &quot;先天的だ過敏なこの衝動&quot;, &quot;別れはみんないつか通る道じゃんか&quot;, &quot;刺さった枯れ木に注いだ火&quot;, &quot;前に進むことしか出来ん道じゃから&quot;, &quot;叶えたい想像に&quot;, &quot;君とならば さらり さらり&quot;, &quot;君とならばさらり さらり&quot;, &quot;塞いだ目&quot;, &quot;大炎上大炎上大炎上大炎上大炎上&quot;, &quot;常にここに ここに&quot;, &quot;引き返せなくて&quot;, &quot;当たり前なんてない&quot;, &quot;恥ずかしいカン違い&quot;, &quot;息せき切ってきたの&quot;, &quot;意地はっても すぐに崩れるし&quot;, &quot;手を抜いて&quot;, &quot;振られるくらいが僕らしいんだもん&quot;, &quot;携帯越しの タッグファイト&quot;, &quot;支えたいと君に&quot;, &quot;散々だな後悔はないけど&quot;, &quot;新しい扉を叩き割った&quot;, &quot;新しい日々は探さずとも常に ここに&quot;, &quot;新しい日々も 拙い過去も 全てがきらり&quot;, &quot;明け行く夕日の中を今夜も昼下がり さらり&quot;, &quot;時には途方に暮れてただ風に吹かれて ゆらり&quot;, &quot;時間てこんな 冷たかったかな&quot;, &quot;来んと思った 時はすぐに来た&quot;, &quot;気付けば&quot;, &quot;気恥ずかしいから 置き手紙だけで許してな&quot;, &quot;永遠に きらり&quot;, &quot;泣いとる時間もないようになるけどな 今&quot;, &quot;瀬戸際の見栄が この首を絞める&quot;, &quot;無くしてしまったものを振り返って ほろり&quot;, &quot;煩わしいから 何にも包まずにおくわ&quot;, &quot;珍回答だ僕は気にしないけど&quot;, &quot;理不尽がお決まりの世界だもん&quot;, &quot;生きてきたけど全ては夢みたい&quot;, &quot;着色の言葉 無味無臭の心&quot;, &quot;私だって 私だって&quot;, &quot;空気の読めぬ 恋の歌&quot;, &quot;紛らわしいから まっすぐな言葉にするわ&quot;, &quot;自分で一人 生きてきたって 果たしたって&quot;, &quot;自分にも周りの人にもバレないように&quot;, &quot;自分にも周りの人にもバレないように利を振って&quot;, &quot;自分のモンなんてない&quot;, &quot;自己満たちが踊る世界だもん&quot;, &quot;色々見てきたけれどこの瞳は永遠に きらり&quot;, &quot;荒れ狂う 季節の中も 群衆の中も&quot;, &quot;荒れ狂う季節の中を二人は一人きり さらり&quot;, &quot;藤井風&quot;, &quot;行き先は決めたの&quot;, &quot;行き違って 行き違って&quot;, &quot;裸のまま透明な服を着た王様だ&quot;, &quot;裸足だって 裸足だって&quot;, &quot;見栄はっても すぐに剥がれるし&quot;, &quot;誰も知らない ミッドナイト&quot;, &quot;誰も見とらんから少しくらいええかな&quot;, &quot;調子のっちゃって&quot;, &quot;調子のんないで&quot;, &quot;迷わずに行きたいけど保証はしないよ&quot;, &quot;連れてって 連れてって&quot;, &quot;風に乗って 風に乗って&quot;, &quot;飾りのない 愛の言葉&quot;, &quot;魅力的でも私は君がいい&quot; ), class = &quot;factor&quot;), Freq = c(1L, 2L, 4L, 2L, 4L, 2L, 1L, 2L, 2L, 4L, 1L, 2L, 670L, 1L, 4L, 6L, 87L, 1L, 22L, 28L, 2L, 2L, 3L, 2L, 12L, 3L, 1L, 15L, 6L, 4L, 3L, 2L, 20L, 1L, 5L, 8L, 38L, 16L, 2L, 2L, 90L, 68L, 2L, 2L, 1L, 2L, 2L, 14L, 220L, 6L, 43L, 14L, 14L, 1L, 53L, 91L, 10L, 2L, 4L, 2L, 12L, 577L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 4L, 5L, 7L, 9L, 4L, 18L, 8L, 12L, 2L, 5L, 4L, 78L, 2L, 2L, 4L, 32L, 1L, 38L, 39L, 13L, 6L, 54L, 4L, 2L, 6L, 5L, 2L, 1L, 1L, 1L, 3L)), row.names = c(NA, 100L), class = &quot;data.frame&quot;) dput(sad_words[1:100,]) structure(list(word = c(&quot;abandon&quot;, &quot;abandoned&quot;, &quot;abandonment&quot;, &quot;abduction&quot;, &quot;abortion&quot;, &quot;abortive&quot;, &quot;abscess&quot;, &quot;absence&quot;, &quot;absent&quot;, &quot;absentee&quot;, &quot;abuse&quot;, &quot;abysmal&quot;, &quot;abyss&quot;, &quot;accident&quot;, &quot;accursed&quot;, &quot;ache&quot;, &quot;aching&quot;, &quot;adder&quot;, &quot;adrift&quot;, &quot;adultery&quot;, &quot;adverse&quot;, &quot;adversity&quot;, &quot;afflict&quot;, &quot;affliction&quot;, &quot;affront&quot;, &quot;aftermath&quot;, &quot;aggravating&quot;, &quot;agony&quot;, &quot;ail&quot;, &quot;ailing&quot;, &quot;alcoholism&quot;, &quot;alienated&quot;, &quot;alienation&quot;, &quot;anathema&quot;, &quot;anchorage&quot;, &quot;anguish&quot;, &quot;animosity&quot;, &quot;annihilated&quot;, &quot;annihilation&quot;, &quot;annulment&quot;, &quot;anthrax&quot;, &quot;antisocial&quot;, &quot;anxiety&quot;, &quot;apathetic&quot;, &quot;apathy&quot;, &quot;apologize&quot;, &quot;appendicitis&quot;, &quot;arid&quot;, &quot;arraignment&quot;, &quot;arsenic&quot;, &quot;art&quot;, &quot;ashamed&quot;, &quot;ashes&quot;, &quot;assailant&quot;, &quot;assassin&quot;, &quot;assassination&quot;, &quot;atherosclerosis&quot;, &quot;atrocity&quot;, &quot;atrophy&quot;, &quot;attacking&quot;, &quot;attenuation&quot;, &quot;austere&quot;, &quot;autopsy&quot;, &quot;avalanche&quot;, &quot;awful&quot;, &quot;backwater&quot;, &quot;bacteria&quot;, &quot;bad&quot;, &quot;badly&quot;, &quot;bang&quot;, &quot;banish&quot;, &quot;banished&quot;, &quot;banishment&quot;, &quot;bankrupt&quot;, &quot;bankruptcy&quot;, &quot;banshee&quot;, &quot;barren&quot;, &quot;bastard&quot;, &quot;battered&quot;, &quot;battled&quot;, &quot;beating&quot;, &quot;beg&quot;, &quot;beggar&quot;, &quot;belittle&quot;, &quot;bereaved&quot;, &quot;bereavement&quot;, &quot;betray&quot;, &quot;betrayal&quot;, &quot;bier&quot;, &quot;bigoted&quot;, &quot;bitch&quot;, &quot;bitterly&quot;, &quot;bitterness&quot;, &quot;blackness&quot;, &quot;bleak&quot;, &quot;bleeding&quot;, &quot;blemish&quot;, &quot;blight&quot;, &quot;blighted&quot;, &quot;blindly&quot;), sadness = c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE)), row.names = c(NA, -100L), class = c(&quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot;)) </code></pre> <p>Here the <code>tolower.lyrics_acousticness_upcoming0.01.</code> column entries from the <code>lyrics_acousticness_upcoming0.01_frequency</code> dataframe has to be checked for overlap content with <code>word</code> column from the <code>sad_words</code> dataframe and out of all the words present in the <code>lyrics_acousticness_upcoming0.01_frequency</code> dataframe, the percent of overlapping content is what is needed.</p> <p>All suggestions will be welcomed.</p>
[ { "answer_id": 74288071, "author": "Drazu", "author_id": 15281426, "author_profile": "https://Stackoverflow.com/users/15281426", "pm_score": 3, "selected": true, "text": "this.router.navigate('route-to-my-other-component');" }, { "answer_id": 74288073, "author": "Andrew Allen...
2022/11/01
[ "https://Stackoverflow.com/questions/74282121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18052237/" ]
74,282,126
<p>I have a piece of code that uses the ranges library of C++20, taken from <a href="https://stackoverflow.com/a/74229054/12173376">this SO anwer</a>. The code is rejected by some compiler (versions) and some older GCC versions return garbage. Which compiler is right?</p> <p>The code is supposed to print the elements of the first column in a <code>std::vector&lt;std::vector&gt;</code>.</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;vector&gt; #include &lt;string&gt; #include &lt;ranges&gt; #include &lt;iostream&gt; int main() { // returns a range containing only the i-th element of an iterable container auto ith_element = [](size_t i) { // drop the first i elements in the range and take the first element from the remaining range return std::views::drop(i) | std::views::take(1); }; // returns a range over the i-th column auto column = [ith_element](size_t i) { return std::views::transform(ith_element(i)) | std::views::join; // returns a range containing only the i-th elements of the elements in the input range }; std::vector&lt;std::vector&lt;std::string&gt;&gt; myvec = { { &quot;a&quot;, &quot;aaa&quot;, &quot;aa&quot;}, {&quot;bb&quot;, &quot;b&quot;, &quot;bbbb&quot;}, {&quot;cc&quot;, &quot;cc&quot;, &quot;ccc&quot;} }; for (auto const&amp; v: myvec | column(0)){ std::cout &lt;&lt; v &lt;&lt; std::endl; } return 0; } </code></pre> <p><a href="https://godbolt.org/z/39h6bMzsq" rel="noreferrer">Compiler Explorer</a></p> <h2>Output:</h2> <p>With GCC 10.1, 10.2, 10.3, 10.4:</p> <pre><code>b </code></pre> <p>Doesn't compile with GCC 11.1 and clang.</p> <pre><code>error: no match for 'operator|' (operand types are 'std::vector&lt;std::vector&lt;std::__cxx11::basic_string&lt;char&gt; &gt; &gt;' and 'std::ranges::views::__adaptor::_Pipe&lt;std::ranges::views::__adaptor::_Partial&lt;std::ranges::views::_Transform, std::ranges::views::__adaptor::_Pipe&lt;std::ranges::views::__adaptor::_Partial&lt;std::ranges::views::_Drop, long unsigned int&gt;, std::ranges::views::__adaptor::_Partial&lt;std::ranges::views::_Take, int&gt; &gt; &gt;, std::ranges::views::_Join&gt;') </code></pre> <h2>Expected</h2> <pre><code>a bb cc </code></pre> <p>Works as expected with GCC 11.2, 11.3, 12.1, 12.2, MSVC 19.33</p>
[ { "answer_id": 74284173, "author": "oraqlle", "author_id": 13429386, "author_profile": "https://Stackoverflow.com/users/13429386", "pm_score": 1, "selected": false, "text": "stdv::transform" }, { "answer_id": 74287613, "author": "cpplearner", "author_id": 4672588, "au...
2022/11/01
[ "https://Stackoverflow.com/questions/74282126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12173376/" ]
74,282,131
<p>I'm very new to Javascript and I found myself stuck with this issue. I want to make this countdown repeat after the time runs out, however I'm not really sure how to do it, and my attempts to make it work failed. Would appreciate help how to do it, Thanks.</p> <pre><code>function startTimer(duration, display) { var timer = duration, minutes, seconds; setInterval(function () { minutes = parseInt(timer / 60, 10); seconds = parseInt(timer % 60, 10); minutes = minutes &lt; 10 ? &quot;0&quot; + minutes : minutes; seconds = seconds &lt; 10 ? &quot;0&quot; + seconds : seconds; display.textContent = minutes + &quot;:&quot; + seconds; if (--timer &lt; 0) { // here's the problem. not sure how to make it repeat } }, 1000); } window.onload = function () { var fiveMinutes = 60 * 5, display = document.querySelector('#time'); startTimer(fiveMinutes, display); }; </code></pre> <p>Tried using clearInterval() and setTimeout() but instead of it working the countdown either went past 00:00 (00:0-1 and so on) or just didn't work at all.</p>
[ { "answer_id": 74282235, "author": "Dr. Vortex", "author_id": 17637456, "author_profile": "https://Stackoverflow.com/users/17637456", "pm_score": 2, "selected": true, "text": "timer" }, { "answer_id": 74282307, "author": "Stephen Quan", "author_id": 881441, "author_pr...
2022/11/01
[ "https://Stackoverflow.com/questions/74282131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16969846/" ]
74,282,152
<p>I have two raster layers for same area. I need to find the Euclidean distance between cell of coarse resolution raster and cell of fine resolution raster that fall within each cell of the pixels from my coarse resolution raster. For example:</p> <p><a href="https://i.stack.imgur.com/SNR1Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SNR1Z.png" alt="example" /></a></p> <p>The red square is the pixel of coarse resolution raster while the blue squares are the pixels of fine resolution raster. The black dot is the centroid of coarse resolution raster and the blue dots are the centroids of fine resolution raster.</p> <p>There are similar questions posted, but the difference with my question is that I don't want to compute the nearest distances between raster cells.</p> <p>My coarse resolution raster has a pixel size of 460m and my fine resolution raster of 100m. What I have done so far is to create point symbols from the centroids of the raster cells for both rasters. How can I compute the Euclidean distance between each coarse pixel and its corresponding fine pixels?</p> <pre><code>library(terra) fr = rast(&quot;path/fine_image.tif&quot;) # fine resolution raster cr = rast(&quot;path/coarse_image.tif&quot;) # coarse resolution raster fr_p = as.points(fr, values = T, na.rm = T, na.all = F) # fine resolution points cr_p = as.points(cr, values = T, na.rm = T, na.all = F) # coarse resolution points </code></pre> <p>I am not sure how to proceed from here. Any recommendations?</p> <p>Here are my rasters:</p> <pre><code>fr = rast(ncols=108, nrows=203, nlyrs=1, xmin=583400, xmax=594200, ymin=1005700, ymax=1026000, names=c('B10_median'), crs='EPSG:7767') cr = rast(ncols=23, nrows=43, nlyrs=1, xmin=583280, xmax=593860, ymin=1006020, ymax=1025800, names=c('coarse_image'), crs='EPSG:7767') </code></pre> <p><strong>The solution</strong> came from the @michael answer and the output raster (after cropping and masking with a polygon shp) looks like this:</p> <p><a href="https://i.stack.imgur.com/2pFEy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2pFEy.png" alt="output" /></a></p> <p>where the yellow squares are the cells from the coarse raster and the raster underneath it's the output from the code in the answer section.</p>
[ { "answer_id": 74282235, "author": "Dr. Vortex", "author_id": 17637456, "author_profile": "https://Stackoverflow.com/users/17637456", "pm_score": 2, "selected": true, "text": "timer" }, { "answer_id": 74282307, "author": "Stephen Quan", "author_id": 881441, "author_pr...
2022/11/01
[ "https://Stackoverflow.com/questions/74282152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13087048/" ]
74,282,181
<p>I'm attempting to make a basic count-down timer in React. It should start at 30 seconds, and count down by 1 each second. When clicking the button, the timer should restart at 30 and begin the countdown again.</p> <p>This seems simple enough, and it's printing to the console exactly as I expect it to. However, as soon as I try to update state with my timer so I can render the countdown on-screen (uncomment the commented line below) the console.log duplicates, the render doubles, and I seem to have two states running simultaneously. I'm not sure what to do about this.</p> <p>Any help is greatly appreciated!</p> <pre><code>const [seconds, setSeconds] = useState(30) let interval = null function startTimer() { stopTimer() let start = 30 interval = setInterval(() =&gt; { // setSeconds(start) console.log('start: ', start) start-- }, 1000) } function stopTimer() { clearInterval(interval) } return ( &lt;p&gt;{seconds}s&lt;/p&gt; &lt;button onClick={startTimer}&gt;Start&lt;/button&gt; ) </code></pre> <p>I've looked around to see what I could find myself before posting. I read through a number of articles on React and setInterval, and watched some tutorials, but couldn't find what I was looking for. I attempted to rewrite the code in different ways but always ended with the same result.</p>
[ { "answer_id": 74282315, "author": "Thomas Zimmermann", "author_id": 13527621, "author_profile": "https://Stackoverflow.com/users/13527621", "pm_score": 1, "selected": false, "text": "start = 30" }, { "answer_id": 74289948, "author": "Eric Winkelspecht", "author_id": 1836...
2022/11/01
[ "https://Stackoverflow.com/questions/74282181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18368851/" ]
74,282,185
<p>First exercise with bash, this is taking a lot of time...</p> <p>I'm trying to create a script where, giving 2 arguments (height,weight) on <a href="https://raw.githubusercontent.com/flother/rio2016/master/athletes.csv" rel="nofollow noreferrer">athletes.csv</a> returns number of coincidence on both values and predominant nationality based on that. And if that was not enough, if predominance is equal for 2 countries, then <code>echo</code> predominance with lowest id.</p> <p>Also i can't use awk, grep, sed or csvkit.</p> <p>Here is csv header:</p> <pre><code>id,name,nationality,sex,date_of_birth,height,weight,sport,gold,silver,bronze,info 736041664,A Jesus Garcia,ESP,male,1969-10-17,1.72,64,athletics,0,0,0, 532037425,A Lam Shin,KOR,female,1986-09-23,1.68,56,fencing,0,0,0, 435962603,Aaron Brown,CAN,male,1992-05-27,1.98,79,athletics,0,0,1, 521041435,Aaron Cook,MDA,male,1991-01-02,1.83,80,taekwondo,0,0,0, 33922579,Aaron Gate,NZL,male,1990-11-26,1.81,71,cycling,0,0,0, 173071782,Aaron Royle,AUS,male,1990-01-26,1.80,67,triathlon,0,0,0, 266237702,Aaron Russell,USA,male,1993-06-04,2.05,98,volleyball,0,0,1, </code></pre> <p>Until now:</p> <pre><code>count=0 while IFS=, read -a id _ nation _ _ height weight _ _ _ _; do if (( $height == &quot;$2&quot; )) &amp;&amp; (( &quot;$weight&quot; == $3 )) ; then ((count++)) fi done &lt; athletes.csv echo &quot;$count&quot; </code></pre> <p>I have seen <a href="https://stackoverflow.com/questions/71717519/bash-count-occurences-based-on-parameters">a similiar problem</a>. But can't find the way to return the most common nationality (strings).</p> <p>Looking for something similar to:</p> <pre><code>Count, Predominant_nationality 1.85 130 8460, BRA </code></pre> <p>Should i try to work the hole exercise with arrays instead trying with lopps? Probably i could do it indexes, but looks like arrays are 1d here?</p> <p>Any help would be a blessing</p>
[ { "answer_id": 74282668, "author": "LMC", "author_id": 2834978, "author_profile": "https://Stackoverflow.com/users/2834978", "pm_score": 1, "selected": false, "text": "csv='athletes.csv'\ncrit='1\\.85,90'\n\necho \"Count Predominant_nationality $crit\"\n# Get fields from csv and sort on ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391920/" ]
74,282,187
<p>Visual studio code consumes a lot of disk space during execution:</p> <ul> <li>3GB on start-up.</li> <li>2GB when running a script (Julia, in my case).</li> </ul> <ul> <li>When I kill the in-built terminal and rerun the code, the available storage first goes up by 2GB and then down again by 2GB.</li> </ul> <p>When I exit VSCode all of the disk space reappears.</p> <p>I'm wondering if there is a way to have VSCode consume less disk space.</p> <p>From <a href="https://techformist.com/clean-temporary-storage-vscode/" rel="nofollow noreferrer">previous questions</a>, it seems that VSCode may take up lots of storage in the workspace folder</p> <pre><code>C:\Users\&lt;user&gt;\AppData\Roaming\Code\User\workspaceStorage </code></pre> <p>and possibly in a <a href="http://tipsarea.com/2020/07/07/reclaim-the-disk-space-when-you-use-visual-studio-code/" rel="nofollow noreferrer">C++ related folder </a>.</p> <pre><code>C:\Users\&lt;user&gt;\AppData\Local\Microsoft\vscode-cpptools\ipch </code></pre> <p>Both folders take up no or very little space in my case.</p> <p>I'm running VSCode version 1.72.2 on Windows 10. I tried to pinpoint the directory(ies) used by VSCode for this kind of temporary storage with <a href="https://windirstat.net/" rel="nofollow noreferrer">windirstat</a> but to no avail.</p>
[ { "answer_id": 74282668, "author": "LMC", "author_id": 2834978, "author_profile": "https://Stackoverflow.com/users/2834978", "pm_score": 1, "selected": false, "text": "csv='athletes.csv'\ncrit='1\\.85,90'\n\necho \"Count Predominant_nationality $crit\"\n# Get fields from csv and sort on ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20391890/" ]
74,282,197
<p>in react-native, I am trying to add a simple filtering option on the top of my screen. <a href="https://unft-marketplace-cosmicjs.vercel.app/search?category=627e1ed78bb13a000911ea47" rel="nofollow noreferrer">Just like this one</a>.</p> <p>But the filter works only on the first hit. After the first, the new array resolves always as empty.</p> <p>Could anyone tell me where/why is this code failing? Thanks a lot!</p> <pre><code> import { exercisesList } from '-utils/exercisesList' const [items, setItems] = useState(exercisesList) const handleFilter = (treatment = 'All') =&gt; { console.log('FILTER-TREATMENTE----&gt;', treatment) let filteredList = exercisesList if (treatment === 'All') { setItems(exercisesList) } else { filteredList = items.filter((item) =&gt; item.treatment === treatment) console.log('filteredList-----&gt;', filteredList) setItems(filteredList) } } </code></pre>
[ { "answer_id": 74282323, "author": "brianangulo", "author_id": 12778760, "author_profile": "https://Stackoverflow.com/users/12778760", "pm_score": 0, "selected": false, "text": "const handleFilter = (treatment = 'All') => {\n console.log('FILTER-TREATMENTE---->', treatment);\n let ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9580666/" ]
74,282,210
<p>I'm trying to build a page with snap scrollbar using Tailwind.<br /> My goal is to have few slides which can be scrolled and a sticky navbar at the top.</p> <p>Scroll with only slides works fine, however after adding a sticky navbar to the top I've noticed a problem.</p> <ul> <li>scroll preview notices navbar as additional space (a one more slide which cannot be accessed)</li> <li>when scrolling to the top a white space can be seen.</li> </ul> <p>Tried using absolute positioning instead of sticky, but cannot figure out how would i move the nav across pages.</p> <p>Code example:</p> <pre class="lang-html prettyprint-override"><code>&lt;head&gt; &lt;script src=&quot;https://cdn.tailwindcss.com&quot;&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class=&quot;h-screen w-screen snap-y snap-mandatory overflow-scroll&quot;&gt; &lt;div class=&quot;sticky w-screen h-screen top-0 left-0&quot;&gt; &lt;div class=&quot;w-screen h-[100px] bg-gray-400&quot;&gt;Nav Bar&lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;snap-start snap-mandatory w-screen h-screen bg-cyan-400&quot;&gt;&lt;/div&gt; &lt;div class=&quot;snap-start snap-mandatory w-screen h-screen bg-yellow-400&quot;&gt;&lt;/div&gt; &lt;div class=&quot;snap-start snap-mandatory w-screen h-screen bg-red-400&quot;&gt;&lt;/div&gt; &lt;div class=&quot;snap-start snap-mandatory w-screen h-screen bg-lime-400&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
[ { "answer_id": 74282323, "author": "brianangulo", "author_id": 12778760, "author_profile": "https://Stackoverflow.com/users/12778760", "pm_score": 0, "selected": false, "text": "const handleFilter = (treatment = 'All') => {\n console.log('FILTER-TREATMENTE---->', treatment);\n let ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17227652/" ]
74,282,226
<p>I have a dictionary that I want to convert into DataFrame, the problem I'm having is my dictionary is in the following format:</p> <pre><code> sample_dict = {'test':['test string',['feature1','feature2', 'feature3']]} </code></pre> <p>When trying to convert using something like</p> <pre><code>df = pd.DataFrame.from_dict([sample_dict]) </code></pre> <p>I get:</p> <p><a href="https://i.stack.imgur.com/7oMrR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7oMrR.png" alt="enter image description here" /></a></p> <p>What I'm trying to achieve is something like:</p> <p><a href="https://i.stack.imgur.com/XJAXk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XJAXk.png" alt="enter image description here" /></a></p> <p>Any ideas?</p>
[ { "answer_id": 74282281, "author": "BENY", "author_id": 7964527, "author_profile": "https://Stackoverflow.com/users/7964527", "pm_score": 2, "selected": true, "text": "orient" }, { "answer_id": 74282303, "author": "rafaelc", "author_id": 2535611, "author_profile": "ht...
2022/11/01
[ "https://Stackoverflow.com/questions/74282226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11058930/" ]
74,282,231
<p>Suppose I wanted to modify the implementation of an existing instruction. For instance, suppose I wanted to change the microcode that is executed by my processor when a &quot;mov&quot; instruction is executed after being fetched and decoded. How would I do that?</p> <p>Also, suppose I wanted to add a new instruction to the ISA. For instance, suppose there is an opcode that isn't currently being used that I wanted my processor to be able to decode and execute after it is fetched. How would I do that?</p> <p>Truthfully, I don't even know where to begin with this, which is why I'm asking on stack overflow. I don't have any experience writing microcode, and I only know the term from my computer architecture class. I know it's pretty easy to look up x86 instruction listings, but I don't know where I would even look up microinstruction listings. I don't even know if Intel makes their microcode listings public. I don't know what program I would need to use to load those new microprograms into the appropriate memory inside my CPU. I think the bootloader might be involved, but I could be totally wrong about that. If I own my CPU, I think I am legally able to modify its microcode and reverse engineer its instructions, but it would be easier to understand how my CPU works and how its microcode can be altered through existing documentation, rather than through reverse engineering.</p> <p>I know there are some smaller hardware vendors that make open source ISAs--so maybe buying a CPU from one of those vendors would be good if I want to experiment with this? But I don't know what CPU from an alternative vendor would be the best for that. But really, I don't think buying a new CPU should be necessary for what I'm trying to do, since I could just use my existing CPU to run an open source ISA in a virtual machine if I had to (I'm interested in microinstructions and microprograms from a software perspective, not a hardware perspective).</p>
[ { "answer_id": 74282554, "author": "Brendan", "author_id": 559737, "author_profile": "https://Stackoverflow.com/users/559737", "pm_score": 3, "selected": false, "text": "mov" }, { "answer_id": 74282663, "author": "Peter Cordes", "author_id": 224132, "author_profile": ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20390502/" ]
74,282,290
<p>I have a bunch of keywords stored in a 620x2 pandas dataframe seen below. I think I need to treat each entry as its own set, where semicolons separate elements. So, we end up with 1240 sets. Then I'd like to be able to search how many times keywords of my choosing appear together. For example, I'd like to figure out how many times 'computation theory' and 'critical infrastructure' appear together as a subset in these sets, in any order. Is there any straightforward way I can do this? <a href="https://i.stack.imgur.com/j9a6F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j9a6F.png" alt="My current dataframe." /></a></p>
[ { "answer_id": 74282554, "author": "Brendan", "author_id": 559737, "author_profile": "https://Stackoverflow.com/users/559737", "pm_score": 3, "selected": false, "text": "mov" }, { "answer_id": 74282663, "author": "Peter Cordes", "author_id": 224132, "author_profile": ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18095308/" ]
74,282,298
<p>I have data like in the dataframe below. As you can see, there are columns &quot;2019&quot; and &quot;2019_p&quot;, &quot;2020&quot; and &quot;2020_p&quot;, &quot;2021&quot; and &quot;2021_p&quot;.</p> <p><a href="https://i.stack.imgur.com/4I3fR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4I3fR.png" alt="enter image description here" /></a></p> <p>I want to select the final columns dynamically where if &quot;2019&quot; is null, take the value of &quot;2019_p&quot; and if the value of &quot;2020&quot; is null, take the value of &quot;2020_p&quot; and the same applies to &quot;2021&quot; etc.</p> <p>I want to select the columns dynamically without hardcoding the column names. How do I achieve this?</p> <p>I need output like this:</p> <p><a href="https://i.stack.imgur.com/Q5a63.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q5a63.png" alt="enter image description here" /></a></p>
[ { "answer_id": 74282554, "author": "Brendan", "author_id": 559737, "author_profile": "https://Stackoverflow.com/users/559737", "pm_score": 3, "selected": false, "text": "mov" }, { "answer_id": 74282663, "author": "Peter Cordes", "author_id": 224132, "author_profile": ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4057692/" ]
74,282,336
<p>I want to use the Bottom Navigation bar to move between pages the Bottom Navigation bar is exist on every page, and clicking the back button directs me to the home page</p> <p>My main</p> <pre><code>import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { @override State&lt;MyHomePage&gt; createState() =&gt; _MyHomePageState(); } class _MyHomePageState extends State&lt;MyHomePage&gt; { int selectedPage = 2; final _pageOptions = [const PageOne(),const PageTwo(),const PageThree()]; @override Widget build(BuildContext context) { return Scaffold( body: _pageOptions[selectedPage], bottomNavigationBar: BottomNavigationBar( items:const [ BottomNavigationBarItem(icon: Icon(Icons.add), label: &quot;&quot;), BottomNavigationBarItem(icon: Icon(Icons.abc), label: &quot;&quot;), BottomNavigationBarItem(icon: Icon(Icons.access_alarm), label: &quot;&quot;), ], onTap: (int index) { setState(() { selectedPage = index; }); }, ), ); } } </code></pre> <p>by using This code I can move between pages but when clicking The back button I get out of the program.</p> <p>Thanks in advance.</p>
[ { "answer_id": 74282554, "author": "Brendan", "author_id": 559737, "author_profile": "https://Stackoverflow.com/users/559737", "pm_score": 3, "selected": false, "text": "mov" }, { "answer_id": 74282663, "author": "Peter Cordes", "author_id": 224132, "author_profile": ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20033412/" ]
74,282,369
<p>My binary search algorithm manages to find some items but does not find others:</p> <pre class="lang-py prettyprint-override"><code>myList = [1,3,4,7,12,13,14,16,19,20,28,29,40,45,48,50,67,89,91,94] item = 67 found = False lowerBound = 0 upperBound = len(myList) - 1 index = 0 while not found and lowerBound != upperBound: index = (upperBound+lowerBound) // 2 if item == myList[index]: found=True if item &gt; myList[index]: lowerBound = index+1 if item &lt; myList[index]: upperBound = index-1 if found: print('Item found') else: print('Item not found') </code></pre> <p>For example, it manages to find 91, 89, 50, 48, 40, 29, etc., but doesn't find 94, 67, 45, or 28.</p> <p>There seems to be a pattern in the numbers it finds and those it doesn't. Did I make a mistake somewhere in the code?</p>
[ { "answer_id": 74282554, "author": "Brendan", "author_id": 559737, "author_profile": "https://Stackoverflow.com/users/559737", "pm_score": 3, "selected": false, "text": "mov" }, { "answer_id": 74282663, "author": "Peter Cordes", "author_id": 224132, "author_profile": ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11256737/" ]
74,282,411
<p>here are some lines from my DataFrame composed as follows :</p> <pre><code>Index ['TimeStamp'] ['ThreadID'] ['Start|End'] ['StepIdentifier'] 1017 18:44:22,997 [12] Start FetchMasterData 1018 18:44:22,997 [12] Start GetSmrCalculatedMeterData 1020 18:44:22,997 [12] End GetSmrCalculatedMeterData 1021 18:44:22,997 [12] Start GetSmrPhysicalMeterData 1023 18:44:23,013 [12] End GetSmrPhysicalMeterData 1024 18:44:23,013 [12] Start GetSmrMarketDeliveryPointData 1026 18:44:23,013 [12] End GetSmrMarketDeliveryPointData 1027 18:44:23,013 [12] Start GetSmrMarketHeadpointData 1029 18:44:23,013 [12] End GetSmrMarketHeadpointData 1030 18:44:23,013 [12] End FetchMasterData </code></pre> <p>I need for each Thread to get the Start and End time for each process. We can see that the &quot;Start&quot; and the &quot;End&quot; for a process (like FetchMasterData) do not necessarily follow each other.</p> <p>In order to create a new DataFrame like this:</p> <pre><code>['ThreadID'] ['StepIdentifier'] ['Start'] ['End'] [12] FetchMasterData 18:44:22,997 18:44:23,013 </code></pre> <p>I tried to compare a line that has a process start with all the following ones until I find the end of the process, then to create a line in the new dataframe :</p> <pre><code>def iterateDfStartEnd(df): df = createDataFrame() // Function to create the DataFrame shown above new_df = pd.DataFrame(columns=['ThreadID','StepIdentifier','StartTime','EndTime']) j = 1013 // Because i starts at 1012(like j = i + 1) and i ends at 1140 for i in df.index while(df.iloc[i,'End|Start'] == &quot;Start&quot; &amp; df.iloc[j,'End|Start'] == &quot;End&quot; &amp; df.iloc[i,'StepIdentifier'] == df.iloc[j,'StepIdentifier'] &amp; df.iloc[i,'ThreadID'] == df.iloc[j,'ThreadID'] &amp; j &lt; 1141): j += 1 new_df['ThreadID'] = df.iloc[i,'ThreadID'] new_df['StepIdentifier'] = df.iloc[i,'StepIdentifier'] new_df['StartTime'] = df.iloc[i,'TimeStamp'] new_df['EndTime'] = df.iloc[j,'TimeStamp'] j = i + 1 return new_df </code></pre> <p>For finally calculate for each process the time between the operations Start and End and to have a DataFrame like this (just for your information) :</p> <pre><code>['ThreadID'] ['StepIdentifier'] ['Time'] [12] FetchMasterData 16s </code></pre> <p>I don't understand how to iterate the dataframe by comparing rows as I do, I have errors with the indexes. Does anyone have another way to create the new dataframe ? Thanks everyone !</p> <p>Edit : Many thanks to the 2 proposed solutions but there is a problem, a &quot;StepIdentifier&quot; is not unique, it can appear several times in the DataFrame but with different start and end times</p> <p>Like this :</p> <pre><code>['TimeStamp'] ['ThreadID'] ['Start|End'] ['StepIdentifier'] 18:44:22,997 [12] Start FetchMasterData 18:44:22,997 [12] Start GetSmrCalculatedMeterData 18:44:22,997 [12] End GetSmrCalculatedMeterData 18:44:22,997 [12] Start GetSmrPhysicalMeterData 18:44:23,013 [12] End GetSmrPhysicalMeterData 18:44:23,013 [12] End FetchMasterData 18:44:23,013 [12] Start GGetSmrCalculatedMeterData 18:44:23,023 [12] End GetSmrCalculatedMeterData </code></pre> <p>We can see that the 'StepIdentifier' &quot;GetSmrCalculatedMeterData&quot; appears twice.</p> <p>Here is a DataFrame to reproduce this display :</p> <pre><code>df = pd.DataFrame({'TimeStamp': ['18:44:22,997','18:44:22,997','18:44:22,997','18:44:22,997','18:44:23,013','18:44:23,013','18:44:23,013','18:44:23,023'], 'ThreadID': ['[12]','[12]','[12]','[12]','[12]','[12]','[12]','[12]'], 'Start|End': ['Start', 'Start', 'End', 'Start', 'End', 'End', 'Start', 'End'], 'StepIdentifier': ['FetchMasterData','GetSmrCalculatedMeterData','GetSmrCalculatedMeterData','GetSmrPhysicalMeterData','GetSmrPhysicalMeterData','FetchMasterData','GetSmrCalculatedMeterData','GetSmrCalculatedMeterData']}) </code></pre>
[ { "answer_id": 74282816, "author": "Vincent Rupp", "author_id": 4024409, "author_profile": "https://Stackoverflow.com/users/4024409", "pm_score": 1, "selected": false, "text": ".groupby()" }, { "answer_id": 74282858, "author": "ttsak", "author_id": 14594208, "author_p...
2022/11/01
[ "https://Stackoverflow.com/questions/74282411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18681411/" ]
74,282,422
<p>Admittedly, I'm new to coding so I'm sure there may be many issues in my code. The errors that are showing up right now are all &quot; Element ol is not allowed here.&quot; If someone can please help me resolve this, it would be greatly appreciated, thank you. My code is listed below:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt; &lt;title&gt;Paula's Lists&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;lists.css&quot;&gt; &lt;style&gt; .instagramlogo{ position: absolute; width: 50px; left: 20px; top: 20px; cursor: pointer; } .linkedinlogo{ position: absolute; width: 50px; left: 100px; top: 20px; cursor: pointer; } * { box-sizing: border-box; } .column1 { margin-top: 40px; margin-bottom: 20px; margin-left: 600px; width: 40%; padding: 10px; border-radius: 25px; } .column2{ margin-top: 20px; margin-bottom: 20px; margin-left: 600px; width: 40%; padding: 10px; border-radius: 25px; } .column3{ margin-top: 20px; margin-bottom: 20px; margin-left: 600px; width: 40%; padding: 10px; border-radius: 25px; } .column4{ margin-top: 20px; margin-bottom: 20px; margin-left: 600px; width: 40%; padding: 10px; border-radius: 25px; } .column5{ margin-top: 20px; margin-bottom: 20px; margin-left: 600px; width: 40%; padding: 10px; border-radius: 25px; } hr{ position: center; margin-top: 10px; border-color: #009688; width: 40%; margin-left: 31.5%; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class=&quot;banner&quot;&gt; &lt;div class=&quot;navbar&quot;&gt; &lt;a href=&quot;https://www.instagram.com/shegonnacode/&quot;&gt;&lt;img src=&quot;images/pngfind.com-instagram-png-22629.png&quot; alt=&quot;Instagram logo&quot; class=&quot;instagramlogo&quot;&gt;&lt;/a&gt; &lt;a href=&quot;https://www.linkedin.com/in/paula-m-175737200/&quot;&gt;&lt;img src=&quot;images/pngfind.com-linkedin-png-533561.png&quot; alt=&quot;Linkedin logo&quot; class=&quot;linkedinlogo&quot;&gt;&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;index.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;resume.html&quot;&gt;Resume&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;lists.html&quot;&gt;Lists&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;contacts.html&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;h1&gt;Paula's Lists&lt;/h1&gt; &lt;span&gt;Get to know me better with the following lists which showcase my perspectives on tech-related concepts!&lt;/span&gt; &lt;div class=&quot;row&quot;&gt; &lt;div class=&quot;column1&quot; style=&quot;background-color:#aaa;&quot;&gt; &lt;h3&gt;Programming Languages I'd Like to Learn&lt;/h3&gt; &lt;ol&gt; &lt;ol type=&quot;1&quot;&gt; &lt;li&gt;Python&lt;/li&gt; &lt;/ol&gt; &lt;ol type=&quot;a&quot;&gt; &lt;li&gt;Javascript&lt;/li&gt; &lt;/ol&gt; &lt;ol type=&quot;A&quot;&gt; &lt;li&gt;C&lt;/li&gt; &lt;/ol&gt; &lt;ol type=&quot;i&quot;&gt; &lt;li&gt;Swift&lt;/li&gt; &lt;/ol&gt; &lt;ol type=&quot;I&quot;&gt; &lt;li&gt;PHP&lt;/li&gt; &lt;/ol&gt; &lt;/ol&gt; &lt;/div&gt; &lt;hr&gt; &lt;div class=&quot;column2&quot; style=&quot;background-color:#bbb;&quot;&gt; &lt;h3&gt;Career Aspirations&lt;/h3&gt; &lt;ul style=&quot;list-style-type:disc;&quot;&gt; &lt;li&gt;Software Engineer&lt;/li&gt; &lt;/ul&gt; &lt;ul style=&quot;list-style-type:circle;&quot;&gt; &lt;li&gt;Video Game Developer&lt;/li&gt; &lt;/ul&gt; &lt;ul style=&quot;list-style-type:square;&quot;&gt; &lt;li&gt;Cyber Security Analyst&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;hr&gt; &lt;div class=&quot;column3&quot; style=&quot;background-color:#ccc;&quot;&gt; &lt;h3&gt;Favorite Language so Far&lt;/h3&gt; &lt;dl&gt; &lt;dt&gt;CSS&lt;/dt&gt; &lt;dd&gt;CSS stands for Cascading Style Sheets&lt;/dd&gt; &lt;/dl&gt; &lt;/div&gt; &lt;hr&gt; &lt;div class=&quot;column4&quot; style=&quot;background-color:#ddd;&quot;&gt; &lt;h3&gt;Favorite Class + Topic&lt;/h3&gt; &lt;ol&gt; &lt;li&gt;Introduction to Web Development&lt;/li&gt; &lt;ul&gt; &lt;li&gt;HTML&lt;/li&gt; &lt;li&gt;CSS&lt;/li&gt; &lt;/ul&gt; &lt;/ol&gt; &lt;/div&gt; &lt;hr&gt; &lt;div class=&quot;column5&quot; style=&quot;background-color:#ddd;&quot;&gt; &lt;h3&gt;My Inspiration in Tech&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;Elon Musk&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Founder and CEO of Tesla + SpaceX&lt;/li&gt; &lt;/ul&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script src=https://my.gblearn.com/js/loadscript.js&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>As I stated, I am a noob with coding as I have just begun so I believe it may have something to do with spacing. I have tried to rearrange, but have failed miserably. Any help would be appreciated, thank you!</p>
[ { "answer_id": 74282816, "author": "Vincent Rupp", "author_id": 4024409, "author_profile": "https://Stackoverflow.com/users/4024409", "pm_score": 1, "selected": false, "text": ".groupby()" }, { "answer_id": 74282858, "author": "ttsak", "author_id": 14594208, "author_p...
2022/11/01
[ "https://Stackoverflow.com/questions/74282422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20392134/" ]
74,282,432
<p>I don't know what to do, my program is not working</p> <p>I need to sort a two-dimensional array by the first elements of a row in descending order by rearranging the rows (need to sort string without sort item)</p> <p>Let's say I'm given an array:<br /> 1 2 3<br /> 4 5 6<br /> 7 8 9</p> <p>As a result of the program, I need to get:<br /> 7 8 9<br /> 4 5 6<br /> 1 2 3 `</p> <pre><code>using System; namespace BubbleSort { internal class Program { static void Main(string[] args) { //Объявление массива и его размерности const int n = 3; int bubble; int[,] A = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, }; //Алгоритм пузырьковой сортировки for (int i = 0; i &lt; n; i++) { for(int j = 0; j &lt; n - 1; j++) { if (A[i, 0] &lt; A[i++, 0]) { for(j = 0; j &lt; n-1; j++) { bubble = A[i, j]; A[i, j] = A[i, j+1]; A[i, j+1] = bubble; } } } } //Вывод массива for (int y = 0; y &lt; n; y++) { for (int x = 0; x &lt; n; x++) { Console.Write(A[y, x] + &quot; &quot;); } Console.WriteLine(); } } } } </code></pre> <p>`</p>
[ { "answer_id": 74282816, "author": "Vincent Rupp", "author_id": 4024409, "author_profile": "https://Stackoverflow.com/users/4024409", "pm_score": 1, "selected": false, "text": ".groupby()" }, { "answer_id": 74282858, "author": "ttsak", "author_id": 14594208, "author_p...
2022/11/01
[ "https://Stackoverflow.com/questions/74282432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20050091/" ]
74,282,433
<p>I recently made some changes to code and was made aware that one of the pages that was updated does not work on the iPhone browser. Sure enough, it didn't, but worked in all other browsers I tested.</p> <p>Can anyone see something or give some insight as to why this particular line of code would fail on an iphone browser, but works elsewhere? There is something about the regex that iPhone does not like and I need to make it compatible. Note that the browser errors on this line not that the regex itself is failing if that makes sense.</p> <p>I don't know of a way to see the debug info on an iphone browser to see if any information is provided. I do know that if I remove the regex pattern from below the page works again on iPhone which tells me that is the problem.</p> <pre><code>return this.optional(element) || /^(\*\.|((?!-)[a-z0-9-]{1,255}(?&lt;!-)\.))((?!-)[a-z0-9-]{1,255}(?&lt;!-)\.)*[a-z]{2,}$/i.test(value); </code></pre>
[ { "answer_id": 74282588, "author": "trincot", "author_id": 5459839, "author_profile": "https://Stackoverflow.com/users/5459839", "pm_score": 2, "selected": true, "text": "(?<!-)" }, { "answer_id": 74285884, "author": "The fourth bird", "author_id": 5424988, "author_pr...
2022/11/01
[ "https://Stackoverflow.com/questions/74282433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/756659/" ]
74,282,452
<p>I've been learning Typescript for a few months and i started to discover zod recently, and i wonder how to build such a util getter such as <code>z.infer&lt;&gt;</code>, <code>z.input&lt;&gt;</code> or even <code>z.output&lt;&gt;</code></p> <p>What i understand is that <code>z</code> is a class that has a getter &quot;method&quot; that takes a generic and it returns a type, but i have no idea of how this works</p> <p>I tried to replicate it but couldn't figure it out, can someone help?</p>
[ { "answer_id": 74282588, "author": "trincot", "author_id": 5459839, "author_profile": "https://Stackoverflow.com/users/5459839", "pm_score": 2, "selected": true, "text": "(?<!-)" }, { "answer_id": 74285884, "author": "The fourth bird", "author_id": 5424988, "author_pr...
2022/11/01
[ "https://Stackoverflow.com/questions/74282452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14929430/" ]
74,282,459
<p>Suppose you have a class Delta that implements interface Alpha. Alpha has methods a, b, and c, and Delta defines an additional method d. If the line &quot;Alpha object = new Delta()&quot; is written, will the compiler allocate memory for the method d even though the reference will not be able to access it?</p>
[ { "answer_id": 74282611, "author": "Louis Wasserman", "author_id": 869736, "author_profile": "https://Stackoverflow.com/users/869736", "pm_score": 1, "selected": false, "text": "new Delta()" } ]
2022/11/01
[ "https://Stackoverflow.com/questions/74282459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15204753/" ]
74,282,477
<p>I have a program where, during a long task, I use System.out to print messages to indicate its progress. However, this can only be seen in the terminal in Visual Studio Code.</p> <p>When I export the program to a jar file and double-click it, it doesn't print out any System.out messages, although it is still able to do its tasks.</p> <p>So, how do I make my program open a terminal upon double-clicking its jar file so that it can print messages to it in a similar manner as using System.out?</p>
[ { "answer_id": 74282519, "author": "Szymon Wałachowski", "author_id": 14954718, "author_profile": "https://Stackoverflow.com/users/14954718", "pm_score": 0, "selected": false, "text": "java -jar yourjar.jar\n" }, { "answer_id": 74283622, "author": "Jesse Barnum", "author_...
2022/11/01
[ "https://Stackoverflow.com/questions/74282477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19227905/" ]
74,282,478
<p>I have 3-layer MVVM project, my solution folder, DLL folder and BLL folder are inside 'source &gt; repos &gt;' and project loads normally But if I move BLL or DLL(or both) to some other folder, or Desktop for example, my project doesn't load correctly and file moved to Desktop defined as not founded in solution explorer How could I fix it? I need put all this three project folders(DLL, BLL, View) to one folder, because I need to share it as one big project, but I can't, because any movement with files or folder finishes with error 'Files not founded' Sadly can not send images here, in y question( Thanks in advance for your answers!</p>
[ { "answer_id": 74282519, "author": "Szymon Wałachowski", "author_id": 14954718, "author_profile": "https://Stackoverflow.com/users/14954718", "pm_score": 0, "selected": false, "text": "java -jar yourjar.jar\n" }, { "answer_id": 74283622, "author": "Jesse Barnum", "author_...
2022/11/01
[ "https://Stackoverflow.com/questions/74282478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20140041/" ]
74,282,522
<p>I'm trying to search a list that I get from GET request based on the parameter that I pass from my TextField controller but the search isn't working, it doesn't display any result and it doesn't show any error either.</p> <p>Can you please help me figure out what I'm doing wrong?</p> <p>API request</p> <pre><code>static Future&lt;List&lt;Athlete&gt;&gt; searchAthletesByName(controller, context) async { try { final response = await http.get( Uri.parse( '$uri/search-athletes-by-name?name=$controller&amp;page=0&amp;length=50'), headers: { 'Authorization': 'Basic ..', 'Content-Type': 'application/json', 'Accept': 'application/json' }); if (response.statusCode == 200) { List jsonResponse = json.decode(utf8.decode(response.bodyBytes)); return jsonResponse .map((_athlete) =&gt; Athlete.fromJson(_athlete)) .toList(); } } catch (e) { logger.e(e.toString()); } return searchAthletesByName(controller, context); } </code></pre> <p>The screen where I want to implement the search</p> <pre><code>class _AddAthleteState extends State&lt;AddAthlete&gt; { final GlobalKey&lt;ScaffoldState&gt; _scaffoldKey = GlobalKey&lt;ScaffoldState&gt;(); TextEditingController myController = TextEditingController(); Future&lt;List&lt;Athlete&gt;&gt;? futureSearchAthleteByName; late List&lt;Athlete&gt; _athlete = []; @override void initState() { futureSearchAthleteByName = ApiService.searchAthletesByName(myController, context); super.initState(); } @override Widget build(BuildContext context) { return Scaffold( key: _scaffoldKey, body: SingleChildScrollView( child: Column( children: [ Align( alignment: Alignment.topCenter, child: Container( margin: const EdgeInsets.only( left: 10, right: 10, top: 10, bottom: 5), child: TextFormField( onChanged: (value) { setState(() {}); }, controller: myController, ), ), ), Stack( children: [ SingleChildScrollView( child: Column(children: [ const SizedBox( height: 10, ), const SizedBox( height: 10, ), FutureBuilder&lt;List&lt;Athlete&gt;&gt;( future: futureSearchAthleteByName, builder: (context, AsyncSnapshot snapshot) { if (snapshot.hasData) { List&lt;Athlete&gt; _athlete = snapshot.data; return ListView.builder( shrinkWrap: true, cacheExtent: 34, primary: true, physics: const ClampingScrollPhysics(), padding: const EdgeInsets.only( top: 10, bottom: 56, ), itemCount: _athlete.length, itemBuilder: (BuildContext context, int index) { if (myController.text == '') { return Container(); } else if (myController.text != '' &amp;&amp; _athlete[index] .lastName .toLowerCase() .contains(myController.text .toLowerCase()) || _athlete[index] .firstName .toLowerCase() .contains( myController.text.toLowerCase())) { return Column( children: [ ListTile( title: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Flexible( child: Text( '${_athlete[index].lastName} ${_athlete[index].firstName}', }); } else if (snapshot.hasError) { logger.e('${snapshot.error}'); } return Container(); </code></pre>
[ { "answer_id": 74282519, "author": "Szymon Wałachowski", "author_id": 14954718, "author_profile": "https://Stackoverflow.com/users/14954718", "pm_score": 0, "selected": false, "text": "java -jar yourjar.jar\n" }, { "answer_id": 74283622, "author": "Jesse Barnum", "author_...
2022/11/01
[ "https://Stackoverflow.com/questions/74282522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19179616/" ]
74,282,595
<p>I am trying to convert some python code into cython. In the python code I use data of type <code>array.array('i', [...])</code> and use the method <code>array.insert</code> to insert an element at a specific index. in cython however, when I try to insert an element using the same method I get this error: <code>BufferError: cannot resize an array that is exporting buffers</code></p> <p>basically:</p> <pre><code>from cpython cimport array cdef array.array[int] a = array.array('i', [1,2,3,3]) a.insert(1,5) # insert 5 in the index 1 -&gt; throws error </code></pre> <p>I have been looking at cyappend3 of this <a href="https://stackoverflow.com/questions/46980273/what-is-the-fastest-way-in-cython-to-create-a-new-array-from-an-existing-array-a">answer</a> but I am using libcpp and not sure I understand the magic written there. Any idea how to insert an element at a specific index in an array.array?</p>
[ { "answer_id": 74282519, "author": "Szymon Wałachowski", "author_id": 14954718, "author_profile": "https://Stackoverflow.com/users/14954718", "pm_score": 0, "selected": false, "text": "java -jar yourjar.jar\n" }, { "answer_id": 74283622, "author": "Jesse Barnum", "author_...
2022/11/01
[ "https://Stackoverflow.com/questions/74282595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13890967/" ]
74,282,612
<p>In node.js I am trying to get a list of bid and ask prices from a trade exchange website (within an async function). Within the foreach statement I can <code>console.info()</code> the object data(on each iteration) but when I put all of this into an array and then return it to another function it passes as 'undefined'.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const symbolPrice = async() =&gt; { let symbolObj = {} let symbolList = [] await bookTickers((error, ticker) =&gt; { ticker.forEach(symbol =&gt; { if (symbol.symbol.toUpperCase().startsWith(starts.toUpperCase())) { symbolObj = { symbol: symbol.symbol, bid: symbol.bidPrice, ask: symbol.askPrice } console.info(symbolObj); } symbolList.push(symbolObj) }); const results = Promise.all(symbolList) return results; }); } const symbolPriceTest = async() =&gt; { const res = await symbolPrice(null, 'ETH', true); console.log(res) }</code></pre> </div> </div> </p> <p>I have tried pretty much everything I can find on the internet like different awaits/Promise.all()'s. I do admit I am not as familiar with async coding as I would like to be.</p>
[ { "answer_id": 74282519, "author": "Szymon Wałachowski", "author_id": 14954718, "author_profile": "https://Stackoverflow.com/users/14954718", "pm_score": 0, "selected": false, "text": "java -jar yourjar.jar\n" }, { "answer_id": 74283622, "author": "Jesse Barnum", "author_...
2022/11/01
[ "https://Stackoverflow.com/questions/74282612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12835213/" ]
74,282,625
<p>I am working in Azure DevOps, creating an automated build process.</p> <p>Doing the PowerShell command:</p> <pre><code>$batchNodes = az batch node list --pool-id $poolId </code></pre> <p>...results in a json structure complete with all Nodes in my Pool, and all Node details. I am only looking for a list of node ids though, because I need to restart each Node in the Pool, which requires a Node id.</p> <p>I expected this PowerShell command to work, but it doesn't. ($batchNodes is blank)</p> <pre><code>$batchNodes = az batch node list --pool-id $poolId | ConvertFrom-Json </code></pre> <p>Is there a fancier or simpler method I can use to get an array of Node id values from the 'az batch node list' command results?</p> <p>I'm using PowerShell 7.2. If you know of some way to restart all of the Nodes in a Pool, please share this information.</p> <p>Much thanks.</p>
[ { "answer_id": 74286006, "author": "Antonia Wu-MSFT", "author_id": 19229290, "author_profile": "https://Stackoverflow.com/users/19229290", "pm_score": 1, "selected": false, "text": "steps:\n- task: AzureCLI@2\n displayName: 'Azure CLI '\n inputs:\n azureSubscription: 'internalsub-ws...
2022/11/01
[ "https://Stackoverflow.com/questions/74282625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2130445/" ]
74,282,628
<p>I have a dataframe:</p> <pre><code>df1 = pd.DataFrame({'id': ['1','2','2','3','3','4','4'], 'name': ['James','Jim','jimy','Daniel','Dane','Ash','Ash'], 'event': ['Basket','Soccer','Soccer','Basket','Soccer','Basket','Soccer']}) </code></pre> <p>I want to count unique values of id but with the name, the result I except are:</p> <pre><code>id name count 1 James 1 2 Jim, jimy 2 3 Daniel, Dane 2 4 Ash 2 </code></pre> <p>I try to group by id and name but it doesn't count as i expected</p>
[ { "answer_id": 74282677, "author": "ttsak", "author_id": 14594208, "author_profile": "https://Stackoverflow.com/users/14594208", "pm_score": 3, "selected": true, "text": "df1.groupby('id').agg(\n name=('name', lambda x: ', '.join(x.unique())),\n count=('name', 'count')\n)\n" }, ...
2022/11/01
[ "https://Stackoverflow.com/questions/74282628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20341621/" ]
74,282,667
<p>I am developing a spring boot REST API, which has to fetch large volume of data (100-200k records) from dynamoDB table based on search conditions and return the response to the API consumer without loading the entire object list in its memory. With SQL based database, I have used JDBCTemplate queryForStreams method for similar requirement. But for no-sql database like DynamoDB, I could not find similar methods to stream the data.</p> <p>One sample scenario is to fetch all passengers who booked business class ticket on Christmas weekend from xyz airline dynamoDB database.</p> <p>note: Edited for clarity.</p>
[ { "answer_id": 74287012, "author": "Lee Hannigan", "author_id": 7909676, "author_profile": "https://Stackoverflow.com/users/7909676", "pm_score": 1, "selected": false, "text": "Scan" }, { "answer_id": 74291755, "author": "alanionita", "author_id": 6456392, "author_pro...
2022/11/01
[ "https://Stackoverflow.com/questions/74282667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7183495/" ]