qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
74,648,730
<p>Currently in day 15 of Angela's 100 days of python. What I understood from all the exercises and project is that variables outside the function cannot be used inside a function unless it is passed as an argument or you input &quot;global&quot; inside the function.</p> <pre><code>MENU = { &quot;espresso&quot;: {...
[ { "answer_id": 74648889, "author": "tdelaney", "author_id": 642070, "author_profile": "https://Stackoverflow.com/users/642070", "pm_score": 1, "selected": true, "text": "resources = {\n \"water\": 300,\n \"milk\": 200,\n \"coffee\": 100,\n}\n\ndef test(item, val):\n resources...
2022/12/01
[ "https://Stackoverflow.com/questions/74648730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18126961/" ]
74,648,743
<p>What is the correct way to represent this structure in JSON<br /> Its Array of strings, with identifiers (A is identifier Printer is the array item)<br /> then there is nested list of strings, with identifiers</p> <pre><code>A Printer A0010 Not printing A0020 Out of ink A0030 No power A0040 Noise...
[ { "answer_id": 74648874, "author": "Kyle Wilson", "author_id": 11653689, "author_profile": "https://Stackoverflow.com/users/11653689", "pm_score": 2, "selected": true, "text": "const json = {\n data: [{\n identifier: 'A',\n itemType: 'Printer',\n error: [\n {\n ...
2022/12/01
[ "https://Stackoverflow.com/questions/74648743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/648026/" ]
74,648,762
<p>I have a following block of code:</p> <pre><code>import json from types import SimpleNamespace data=json.dumps( { &quot;update_id&quot;: 992108054, &quot;message&quot;: { &quot;delete_chat_photo&quot;: False, &quot;new_chat_members&quot;: [], &quot;date&quot;: 1669931418, &quot;photo&quot;: [], ...
[ { "answer_id": 74648874, "author": "Kyle Wilson", "author_id": 11653689, "author_profile": "https://Stackoverflow.com/users/11653689", "pm_score": 2, "selected": true, "text": "const json = {\n data: [{\n identifier: 'A',\n itemType: 'Printer',\n error: [\n {\n ...
2022/12/01
[ "https://Stackoverflow.com/questions/74648762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7829214/" ]
74,648,818
<p>I am trying to scrape data from <a href="https://openbilanci.it/armonizzati/bilanci/veglio-comune-bi/entrate/dettaglio?year=2021&amp;type=preventivo" rel="nofollow noreferrer">this website</a>. To be specific, I want to scrape all the data from the following:</p> <pre><code>var bilancio_tree = [{&quot;slug&quot;: &q...
[ { "answer_id": 74648874, "author": "Kyle Wilson", "author_id": 11653689, "author_profile": "https://Stackoverflow.com/users/11653689", "pm_score": 2, "selected": true, "text": "const json = {\n data: [{\n identifier: 'A',\n itemType: 'Printer',\n error: [\n {\n ...
2022/12/01
[ "https://Stackoverflow.com/questions/74648818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19738691/" ]
74,648,858
<p>Say I have a code snippet like so:</p> <pre class="lang-ml prettyprint-override"><code>type 'a mylist = | Nil | Cons of 'a * 'a mylist let rec last l = match l with | Nil -&gt; None | Cons(x, Nil) -&gt; Some(x) | Cons(x, xs) -&gt; last xs </code></pre> <p>Obviously, this pattern matches over the con...
[ { "answer_id": 74649557, "author": "amalloy", "author_id": 625403, "author_profile": "https://Stackoverflow.com/users/625403", "pm_score": 3, "selected": false, "text": "type {-# LANGUAGE RankNTypes #-}\n\nimport Prelude hiding (head, tail, last)\n\nnewtype List a = List\n (forall r. -...
2022/12/01
[ "https://Stackoverflow.com/questions/74648858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13967062/" ]
74,648,911
<p>How do I make the text to be justified but at the same lenght as the image above it? I tried putting it inside a div, but it's not working, <a href="https://i.stack.imgur.com/pHSNT.png" rel="nofollow noreferrer">The text looks like this</a></p> <p>Any tip to fix this?</p> <p>On the code posted, I used a simple web i...
[ { "answer_id": 74649557, "author": "amalloy", "author_id": 625403, "author_profile": "https://Stackoverflow.com/users/625403", "pm_score": 3, "selected": false, "text": "type {-# LANGUAGE RankNTypes #-}\n\nimport Prelude hiding (head, tail, last)\n\nnewtype List a = List\n (forall r. -...
2022/12/01
[ "https://Stackoverflow.com/questions/74648911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17421059/" ]
74,648,926
<p>I'm new to C++. Whenever I try to compare a string and a string from a vector, it gives me an error. I included two examples below. Why does this happen?</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;string&gt; int main() { std::string vowels =...
[ { "answer_id": 74648958, "author": "Kelly", "author_id": 7363490, "author_profile": "https://Stackoverflow.com/users/7363490", "pm_score": -1, "selected": false, "text": "#include <vector>\n#include <string>\n\nint main() {\n std::string vowels = (\"aeiou\");\n std::string whale_talk =...
2022/12/01
[ "https://Stackoverflow.com/questions/74648926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17762920/" ]
74,649,003
<p>I'm newer to Python. I'm using openpyxl for a SEO project for my brother and I'm trying to get a number of rows that contain a specific value in them.</p> <p>I have a spreadsheet that looks something like this: <a href="https://i.stack.imgur.com/qzzHd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.co...
[ { "answer_id": 74649446, "author": "j-p", "author_id": 20541460, "author_profile": "https://Stackoverflow.com/users/20541460", "pm_score": 0, "selected": false, "text": "print(\"\\nValue of fourth column\")\n\nmissouri_list = [] # empty list\nillinois_list = [] # empty list\n\nfor i in r...
2022/12/01
[ "https://Stackoverflow.com/questions/74649003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6100299/" ]
74,649,010
<p>I have to call an api that returns an array of objects:</p> <pre><code>&quot;supervisors&quot;: [ { &quot;jurisdiction&quot;: &quot;u&quot;, &quot;lastName&quot;: &quot;Olson&quot;, &quot;firstName&quot;: &quot;Karson&quot; }, { &quot;jurisdiction&quot;: &quot;9&quot;, ...
[ { "answer_id": 74649446, "author": "j-p", "author_id": 20541460, "author_profile": "https://Stackoverflow.com/users/20541460", "pm_score": 0, "selected": false, "text": "print(\"\\nValue of fourth column\")\n\nmissouri_list = [] # empty list\nillinois_list = [] # empty list\n\nfor i in r...
2022/12/01
[ "https://Stackoverflow.com/questions/74649010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20660803/" ]
74,649,029
<p>I am getting data from an API and storing it in json format. The data I pull is in a list of dictionaries. I am using Python. My task is to only grab the information from the dictionary that matches the ticker symbol.</p> <p>This is the short version of my data printing using json dumps</p> <pre><code>[ { ...
[ { "answer_id": 74649055, "author": "user19077881", "author_id": 19077881, "author_profile": "https://Stackoverflow.com/users/19077881", "pm_score": 0, "selected": false, "text": "for entry in mylist:\n print(entry['ticker'])\n for entry in mylist:\n if entry['ticker'] == 'TSLA.US':...
2022/12/01
[ "https://Stackoverflow.com/questions/74649029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15032207/" ]
74,649,039
<p>I'm trying to understand why my SVG will resize when I change the width of its parent but it won't resize when I change the height.</p> <p>I just made a very simple jsFiddle. You can try resizing the little window at the bottom right corner.</p> <p>From what I understand, it's key that the parent has 100% width and ...
[ { "answer_id": 74649963, "author": "Robert Longson", "author_id": 1038015, "author_profile": "https://Stackoverflow.com/users/1038015", "pm_score": 1, "selected": false, "text": "div, html, body, svg {\n height: 100%;\n width: 100%;\n} <div>\n <svg viewBox=\"0 0 200 200\" xmlns=\"http...
2022/12/01
[ "https://Stackoverflow.com/questions/74649039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11237235/" ]
74,649,065
<p>I tried making two input fields one for dimensions and one for weight, and both had seperate select drop down to allow the user to select a unit. <a href="https://4x.ant.design/components/input/#:%7E:text=%3CInput%20defaultValue%3D%2226888888%22" rel="nofollow noreferrer">I saw on Ant design docs that they had somet...
[ { "answer_id": 74649963, "author": "Robert Longson", "author_id": 1038015, "author_profile": "https://Stackoverflow.com/users/1038015", "pm_score": 1, "selected": false, "text": "div, html, body, svg {\n height: 100%;\n width: 100%;\n} <div>\n <svg viewBox=\"0 0 200 200\" xmlns=\"http...
2022/12/01
[ "https://Stackoverflow.com/questions/74649065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5660533/" ]
74,649,068
<p>Write a program that gets a list of integers from input, and outputs non-negative integers in ascending order (lowest to highest).</p> <p>Example: If the input is:</p> <p>10 -7 4 39 -6 12 2</p> <p>the output is:</p> <p>2 4 10 12 39</p> <p>My code that I came up with looks like this:</p> <pre><code>user_input = input...
[ { "answer_id": 74649203, "author": "mbunic", "author_id": 17736261, "author_profile": "https://Stackoverflow.com/users/17736261", "pm_score": 0, "selected": false, "text": "for item in nums:\n if int(item) < 0:\n nums.remove(item)\n onlyPositiveIntegers = [x for x in nums if x ...
2022/12/01
[ "https://Stackoverflow.com/questions/74649068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20325517/" ]
74,649,080
<p>I am trying to create a list of the last days of each month for the past n months from the current date but not including current month</p> <p>I tried different approaches:</p> <pre><code>def last_n_month_end(n_months): &quot;&quot;&quot; Returns a list of the last n month end dates &quot;&quot;&quot; ...
[ { "answer_id": 74652123, "author": "rainingdistros", "author_id": 13280838, "author_profile": "https://Stackoverflow.com/users/13280838", "pm_score": 2, "selected": false, "text": "pip install python-dateutil\n # import datetime package\nfrom datetime import date, timedelta\nfrom dateuti...
2022/12/01
[ "https://Stackoverflow.com/questions/74649080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12981766/" ]
74,649,083
<p>I have the simplest nuxt3 project and my button when pressed doesn't register a click event.</p> <p>Why? Or where can I look for a solution?</p> <p><code>&lt;button @click=&quot;console.log('PRESSED')&quot; class=&quot;bg-gray-500&quot;&gt;GENERATE TEXT&lt;/button&gt;</code></p> <p>. Replication:</p> <ol> <li><code>...
[ { "answer_id": 74649909, "author": "kissu", "author_id": 8816585, "author_profile": "https://Stackoverflow.com/users/8816585", "pm_score": 1, "selected": false, "text": "console.log <script setup>\nfunction consoleHitOn() {\n console.log('I got hit on')\n}\n</script>\n\n<template>\n <b...
2022/12/01
[ "https://Stackoverflow.com/questions/74649083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10099689/" ]
74,649,128
<p>I am creating a react project and I'd like to know if it's okay to use FontAwesome icons on a ReactJS project that is using MaterialUI.</p> <p>I tried to use the Material UI Icons and also use FontAwesome Icons but I thought that there's a repetition.</p>
[ { "answer_id": 74649909, "author": "kissu", "author_id": 8816585, "author_profile": "https://Stackoverflow.com/users/8816585", "pm_score": 1, "selected": false, "text": "console.log <script setup>\nfunction consoleHitOn() {\n console.log('I got hit on')\n}\n</script>\n\n<template>\n <b...
2022/12/01
[ "https://Stackoverflow.com/questions/74649128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14590441/" ]
74,649,152
<p>I'm a beginner with regex and stuck with creating regex with the following conditions:</p> <ul> <li>Minimum of 8 characters</li> <li>Maximum of 60 characters</li> <li>Must contain 2 letters</li> <li>Must contain 1 number</li> <li>Must contain 1 special character</li> <li>Special character cannot be the following: &a...
[ { "answer_id": 74649222, "author": "esqew", "author_id": 269970, "author_profile": "https://Stackoverflow.com/users/269970", "pm_score": 1, "selected": false, "text": ".* (?=^.{8,60}$)(?=.*\\d)(?=.*[a-zA-Z]{2,})(?!.*[&`()=[|;\"''\\]'<>]).*\n" }, { "answer_id": 74649267, "auth...
2022/12/01
[ "https://Stackoverflow.com/questions/74649152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20660911/" ]
74,649,209
<p>Can anyone clarify for me what I have shown in the 'image' attached is achievable in flutter? if yes, how? explaining the image is a bit hard.</p> <p>I am new to flutter and trying to nest some scrollable views inside each other.</p> <p>at first I tried to achieve this by nesting simple scrollable row and columns in...
[ { "answer_id": 74649222, "author": "esqew", "author_id": 269970, "author_profile": "https://Stackoverflow.com/users/269970", "pm_score": 1, "selected": false, "text": ".* (?=^.{8,60}$)(?=.*\\d)(?=.*[a-zA-Z]{2,})(?!.*[&`()=[|;\"''\\]'<>]).*\n" }, { "answer_id": 74649267, "auth...
2022/12/01
[ "https://Stackoverflow.com/questions/74649209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12555138/" ]
74,649,268
<p>I am trying to submit a form and then the browser has to close. But I cannot understand why it will not work. For some reason, it will close the window, but it does not submit the form.</p> <pre><code>$('.cancel-confirm').on('click', function () { $(this).closest('form').submit(); alert('Submitted - your win...
[ { "answer_id": 74651264, "author": "Nagonus Lrak", "author_id": 20476491, "author_profile": "https://Stackoverflow.com/users/20476491", "pm_score": 1, "selected": false, "text": "$('#form-id').submit(function () {\n window.close();\n});\n" }, { "answer_id": 74664217, "auth...
2022/12/01
[ "https://Stackoverflow.com/questions/74649268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20531127/" ]
74,649,296
<p>I'm using a library that itself makes the call to <code>asyncio.run(internal_function)</code> so I can't control that at all. I do however have access to the event loop, it's something that I pass into this library.</p> <p>Given that, is there some way I can set up an recurring async event that will execute every X ...
[ { "answer_id": 74651264, "author": "Nagonus Lrak", "author_id": 20476491, "author_profile": "https://Stackoverflow.com/users/20476491", "pm_score": 1, "selected": false, "text": "$('#form-id').submit(function () {\n window.close();\n});\n" }, { "answer_id": 74664217, "auth...
2022/12/01
[ "https://Stackoverflow.com/questions/74649296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4496354/" ]
74,649,314
<p>Assume 2022-10-01 and 2022-10-8 are Monday, and the original table looks like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Date</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>2022-10-03</td> <td>x</td> </tr> <tr> <td>2022-10-04</td> <td>y</td> </tr> <tr> <td>2022-10-09</td>...
[ { "answer_id": 74649403, "author": "Paddy Alton", "author_id": 9044370, "author_profile": "https://Stackoverflow.com/users/9044370", "pm_score": 0, "selected": false, "text": " SELECT\n truncate_date(week, Date) + interval '1' day AS date,\n Value\n FROM\n ta...
2022/12/01
[ "https://Stackoverflow.com/questions/74649314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19523362/" ]
74,649,329
<p>I'm trying to make a SPA with html, css and vanilla JS (I have very little idea of JS). The problem I have is that the method I am using, works correctly in my header where I have only &quot;a&quot; with text inside. But when I want to use an img as &quot;a&quot;, the script does not work inside the img, it only all...
[ { "answer_id": 74649403, "author": "Paddy Alton", "author_id": 9044370, "author_profile": "https://Stackoverflow.com/users/9044370", "pm_score": 0, "selected": false, "text": " SELECT\n truncate_date(week, Date) + interval '1' day AS date,\n Value\n FROM\n ta...
2022/12/01
[ "https://Stackoverflow.com/questions/74649329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20661030/" ]
74,649,340
<p>I'm having some trouble with data being sent through my controller, here's a simplified example:</p> <pre><code> public ActionResult EditNote(NotesModel model) { model.Author = Session[&quot;UserName&quot;].ToString(); model.Note = null; model.Title = null; return V...
[ { "answer_id": 74649762, "author": "Charles Han", "author_id": 11514907, "author_profile": "https://Stackoverflow.com/users/11514907", "pm_score": 0, "selected": false, "text": "public ActionResult EditNote(NotesModel model)\n{\n if(model.Id > 0) //assuming existing notes has id or any...
2022/12/01
[ "https://Stackoverflow.com/questions/74649340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20268332/" ]
74,649,350
<p>I'm working on developing both the client(C) and server(C++) side of an RF connection. I need to send a float value, but the way the architecture is set up I have to arrange my message in a struct that limits me to 3 uint8t parameters: p0, p1, p2. My solution was to break the float into an array of 4 uint8_ts and s...
[ { "answer_id": 74649457, "author": "0___________", "author_id": 6110094, "author_profile": "https://Stackoverflow.com/users/6110094", "pm_score": 0, "selected": false, "text": "float toFloat(const uint8_t *arr)\n{\n float result;\n\n memcpy(&result, arr, sizeof(result));\n\n ret...
2022/12/01
[ "https://Stackoverflow.com/questions/74649350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20660833/" ]
74,649,393
<p>I am trying to sum up two rows. I have a table1 as the below:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>MEASURES</th> <th>APR</th> <th>MAY</th> <th>JUN</th> <th>JUL</th> </tr> </thead> <tbody> <tr> <td>Measure 1</td> <td>61</td> <td>67</td> <td>79</td> <td>62</td> </tr> <tr> <td>Me...
[ { "answer_id": 74649419, "author": "Dale K", "author_id": 1127428, "author_profile": "https://Stackoverflow.com/users/1127428", "pm_score": 2, "selected": true, "text": "SELECT 'Total'\n , SUM(CASE WHEN MEASURES = 'Measure 2' THEN -1 ELSE 1 END * APR) APR\n , SUM(CASE WHEN MEASURES...
2022/12/01
[ "https://Stackoverflow.com/questions/74649393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1342446/" ]
74,649,400
<p>I have a running master csv file with various data columns for 896 eucalypt species (i.e., 896 rows). I recently collected new columns of information in a separate data frame, but only for 474 of those 896 species. How do I add the new columns to the master data frame and make sure they are sorted into the correct r...
[ { "answer_id": 74649419, "author": "Dale K", "author_id": 1127428, "author_profile": "https://Stackoverflow.com/users/1127428", "pm_score": 2, "selected": true, "text": "SELECT 'Total'\n , SUM(CASE WHEN MEASURES = 'Measure 2' THEN -1 ELSE 1 END * APR) APR\n , SUM(CASE WHEN MEASURES...
2022/12/01
[ "https://Stackoverflow.com/questions/74649400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10297843/" ]
74,649,421
<p>I need to write SQL query to output the Maximum number and Minimum number of movies produces by diffrent actors and actresses between year 1991 and 2001 <a href="https://i.stack.imgur.com/6rDap.png" rel="nofollow noreferrer">query written </a>. When I tried this, I got error <a href="https://i.stack.imgur.com/bBcOl....
[ { "answer_id": 74649419, "author": "Dale K", "author_id": 1127428, "author_profile": "https://Stackoverflow.com/users/1127428", "pm_score": 2, "selected": true, "text": "SELECT 'Total'\n , SUM(CASE WHEN MEASURES = 'Measure 2' THEN -1 ELSE 1 END * APR) APR\n , SUM(CASE WHEN MEASURES...
2022/12/01
[ "https://Stackoverflow.com/questions/74649421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20036774/" ]
74,649,437
<p>How to improve the following batch script by making so whenever a new script is added into the directory, it doesn't require to manually hardcode an extra line of code in script. like: <code>3) source $(pwd)/script-3.sh; myfunc;;</code></p> <p>script:</p> <pre><code>#Menu script title=&quot;Menu&quot; prompt=&quot;P...
[ { "answer_id": 74650736, "author": "Peter", "author_id": 11865845, "author_profile": "https://Stackoverflow.com/users/11865845", "pm_score": 0, "selected": false, "text": "select opt in \"${options[@]}\" \"Quit\"; do \n source $(pwd)/$opt; myfunc\ndone\n $((${#options[@]}+1))) ech...
2022/12/01
[ "https://Stackoverflow.com/questions/74649437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11865845/" ]
74,649,453
<p>I was wondering if there is a way or a resource I could refer to in order to achieve a side effect on a <code>LazyRow</code> when an item is scrolled? The side effect is basically to call a function in the viewModel to alter the state of the list's state.</p> <ul> <li>The side effect should be only executed only if ...
[ { "answer_id": 74653191, "author": "Gabriele Mariotti", "author_id": 2016562, "author_profile": "https://Stackoverflow.com/users/2016562", "pm_score": 2, "selected": false, "text": "LazyListState#firstVisibleItemIndex @Composable\nprivate fun LazyListState.itemIndexScrolledUp(): Int {\n ...
2022/12/02
[ "https://Stackoverflow.com/questions/74649453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2057782/" ]
74,649,471
<p>I have written a python for loop iteration as show below. I was wondering if its possible to convert into a recursive function.</p> <pre><code>a = int(input(&quot;Please enter the first number: &quot;)) b = int(input(&quot;Please enter the second number: &quot;)) res = 0 for i in range(a,b+1): temp = 1 ...
[ { "answer_id": 74653191, "author": "Gabriele Mariotti", "author_id": 2016562, "author_profile": "https://Stackoverflow.com/users/2016562", "pm_score": 2, "selected": false, "text": "LazyListState#firstVisibleItemIndex @Composable\nprivate fun LazyListState.itemIndexScrolledUp(): Int {\n ...
2022/12/02
[ "https://Stackoverflow.com/questions/74649471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20661176/" ]
74,649,484
<p>I was given a function that I have to fill out and it has these input parameters:</p> <pre class="lang-c prettyprint-override"><code>char * replace( const char * text, const char * (*word)[2] ) </code></pre> <p>From my understanding, the function should return a string and is given a string in the first parameter.</...
[ { "answer_id": 74653191, "author": "Gabriele Mariotti", "author_id": 2016562, "author_profile": "https://Stackoverflow.com/users/2016562", "pm_score": 2, "selected": false, "text": "LazyListState#firstVisibleItemIndex @Composable\nprivate fun LazyListState.itemIndexScrolledUp(): Int {\n ...
2022/12/02
[ "https://Stackoverflow.com/questions/74649484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18361723/" ]
74,649,522
<pre><code>def prodListePos_rec(l, len(l)): if (len(l)&gt;0): if l[len(l)-1] &gt; 0: product = prodListePos_rec(l,len(l)) * l[len(l)-1] else: product = 1 return product l = [1,-2, 5, 0, 6,-5] prodListePos_rec(l,len(l)) </code></pre> <p>I don't get why it shows the invalid...
[ { "answer_id": 74649658, "author": "wjandrea", "author_id": 4518341, "author_profile": "https://Stackoverflow.com/users/4518341", "pm_score": 2, "selected": false, "text": "l len(l) l 1 I lst len() def prodListePos_rec(lst):\n n = len(lst)\n if n > 0:\n x = lst[n-1]\n ...
2022/12/02
[ "https://Stackoverflow.com/questions/74649522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20661222/" ]
74,649,535
<p>I try to redirect <code>domain.tld/?cur=usd</code> to <code>domain.tld</code> (there are many curencies, this is only example of one currency - we do not use anymore this solution). I need to redirect only home with parameter to home without parameter. The other urls worked for me, I'm just having trouble getting wo...
[ { "answer_id": 74649658, "author": "wjandrea", "author_id": 4518341, "author_profile": "https://Stackoverflow.com/users/4518341", "pm_score": 2, "selected": false, "text": "l len(l) l 1 I lst len() def prodListePos_rec(lst):\n n = len(lst)\n if n > 0:\n x = lst[n-1]\n ...
2022/12/02
[ "https://Stackoverflow.com/questions/74649535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3237083/" ]
74,649,536
<p>I tried to sorting upper case and lower case in the perl language. A bunch of text are save in as &quot;electricity.txt&quot; in the .txt file:</p> <blockquote> <p>Today's scientific question is: What in the world is electricity and where does it go after it leaves the toaster?</p> <p>Here is a simple experiment tha...
[ { "answer_id": 74653205, "author": "pmqs", "author_id": 2030808, "author_profile": "https://Stackoverflow.com/users/2030808", "pm_score": 2, "selected": false, "text": "$count{lc($word)}++;\n while %count foreach printf \"%-31s \\n\", sort {\"\\$a\" cmp uc\"\\$b\"} lc($word);\n sort lc($...
2022/12/02
[ "https://Stackoverflow.com/questions/74649536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18703242/" ]
74,649,538
<p>Suppose I have a <code>char</code> in the variable <code>c</code> and a positive <code>int</code> in the variable <code>n</code>. I want to build the <code>str</code> containing <code>c</code> occurring <code>n</code> times. How can I do it?</p> <p>I tried building it as a <code>String</code>, and maybe I just got...
[ { "answer_id": 74651729, "author": "Miiao", "author_id": 20028181, "author_profile": "https://Stackoverflow.com/users/20028181", "pm_score": -1, "selected": false, "text": "String &'static str fn leak(s: String) -> &'static str {\n let ptr = s.as_str() as *const str;\n core::mem::f...
2022/12/02
[ "https://Stackoverflow.com/questions/74649538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3047729/" ]
74,649,540
<p>Currently, I have a radial-gradient as my background with a blur effect. Without a scale effect, it has white edges around the entire gradient. To combat this, I scaled the entire gradient, which works great, except for the fact it extends the page to the right, and allows the user to scroll left and right.</p> <p>H...
[ { "answer_id": 74651729, "author": "Miiao", "author_id": 20028181, "author_profile": "https://Stackoverflow.com/users/20028181", "pm_score": -1, "selected": false, "text": "String &'static str fn leak(s: String) -> &'static str {\n let ptr = s.as_str() as *const str;\n core::mem::f...
2022/12/02
[ "https://Stackoverflow.com/questions/74649540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10920201/" ]
74,649,544
<p>How to make the parent layout - <code>Box</code> wrap its content in Jetpack compose? The current implementation below fills the entire screen, I only want the <code>Box</code> to wrap around its child - <code>Switch</code>. How do I define <em>wrap content</em> for the <code>Box</code>?</p> <pre><code>@Composable f...
[ { "answer_id": 74651729, "author": "Miiao", "author_id": 20028181, "author_profile": "https://Stackoverflow.com/users/20028181", "pm_score": -1, "selected": false, "text": "String &'static str fn leak(s: String) -> &'static str {\n let ptr = s.as_str() as *const str;\n core::mem::f...
2022/12/02
[ "https://Stackoverflow.com/questions/74649544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4192614/" ]
74,649,564
<p><a href="https://i.stack.imgur.com/ze1tx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ze1tx.png" alt="enter image description here" /></a></p> <p>I can't seem to figure out why I can't get the information out of the array</p> <pre><code>const usedPlatformLog: Date[] = [] users.forEach(el =&gt; ...
[ { "answer_id": 74651729, "author": "Miiao", "author_id": 20028181, "author_profile": "https://Stackoverflow.com/users/20028181", "pm_score": -1, "selected": false, "text": "String &'static str fn leak(s: String) -> &'static str {\n let ptr = s.as_str() as *const str;\n core::mem::f...
2022/12/02
[ "https://Stackoverflow.com/questions/74649564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15654610/" ]
74,649,624
<p>I'm trying to get my oauth2 android app verified by the google cloud console so more than 100 users can use it but I'm stuck on this part here: <a href="https://i.stack.imgur.com/9cLIj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9cLIj.png" alt="enter image description here" /></a></p> <p>What ...
[ { "answer_id": 74651729, "author": "Miiao", "author_id": 20028181, "author_profile": "https://Stackoverflow.com/users/20028181", "pm_score": -1, "selected": false, "text": "String &'static str fn leak(s: String) -> &'static str {\n let ptr = s.as_str() as *const str;\n core::mem::f...
2022/12/02
[ "https://Stackoverflow.com/questions/74649624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17792511/" ]
74,649,671
<p>New to frontend and extension itself here. I tried searching and trying different things at this point. I have been to many questions like these: <a href="https://stackoverflow.com/questions/37033449/click-function-not-working-on-document-getelementsbyclassname">click function not working on document.getElementsByCl...
[ { "answer_id": 74651729, "author": "Miiao", "author_id": 20028181, "author_profile": "https://Stackoverflow.com/users/20028181", "pm_score": -1, "selected": false, "text": "String &'static str fn leak(s: String) -> &'static str {\n let ptr = s.as_str() as *const str;\n core::mem::f...
2022/12/02
[ "https://Stackoverflow.com/questions/74649671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4463330/" ]
74,649,728
<pre><code>public class PreferenceManager { private static PreferenceManager _instance = null; private static readonly object _lock = new object(); private PreferenceManager() { } public static PreferenceManager Instance { get { lock (_lock) { ...
[ { "answer_id": 74651121, "author": "Liqun Shen-MSFT", "author_id": 20118901, "author_profile": "https://Stackoverflow.com/users/20118901", "pm_score": 2, "selected": true, "text": "public void SetPreference<T>(string key,T value)\n{\n if (value is string)\n {\n Preferences.S...
2022/12/02
[ "https://Stackoverflow.com/questions/74649728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20343943/" ]
74,649,757
<p>I just started working with Numpy because I want to use their log method. I am trying to do -log2(79/859) but can only see how to do log2(74/571) which outputs a negative value when it should be positive. Read the Doc but don't see how to make it a negative log?</p> <p>How can I fix this?</p> <pre><code>print(np.log...
[ { "answer_id": 74649891, "author": "MarianD", "author_id": 7023590, "author_profile": "https://Stackoverflow.com/users/7023590", "pm_score": 0, "selected": false, "text": "print(-np.log2(74/571))\n" }, { "answer_id": 74649929, "author": "GusSL", "author_id": 6269268, ...
2022/12/02
[ "https://Stackoverflow.com/questions/74649757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20422490/" ]
74,649,776
<p>I have a table similar to this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>product_id</th> <th>client_id</th> <th>category</th> <th>price</th> <th>created_date</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>1</td> <td>A</td> <td>3.1</td> <td>2022-11-01</td> </tr> <tr> <td>2</td> <t...
[ { "answer_id": 74649891, "author": "MarianD", "author_id": 7023590, "author_profile": "https://Stackoverflow.com/users/7023590", "pm_score": 0, "selected": false, "text": "print(-np.log2(74/571))\n" }, { "answer_id": 74649929, "author": "GusSL", "author_id": 6269268, ...
2022/12/02
[ "https://Stackoverflow.com/questions/74649776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6227441/" ]
74,649,777
<p>I'm fairly new to window functions and have been learning about them recently. There is this query which returns the total sales for each month and quarter using a group by and an aggregate function. Additionally, it returns the total sales for the whole year (using a window function) and the max total sales for ea...
[ { "answer_id": 74650270, "author": "ysth", "author_id": 17389, "author_profile": "https://Stackoverflow.com/users/17389", "pm_score": 1, "selected": false, "text": "Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fiddle.payment.amount' which is n...
2022/12/02
[ "https://Stackoverflow.com/questions/74649777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798677/" ]
74,649,783
<p>i'm trying to make a grid using react native that's responsive to multiple screen sizes but having troubles drawing the lines in (the sides of the box can't have a stroke). this is what it needs to look like: <a href="https://i.stack.imgur.com/KwVl6.png" rel="nofollow noreferrer">example grid</a> <a href="https://i....
[ { "answer_id": 74649959, "author": "PaleRedDot", "author_id": 10607003, "author_profile": "https://Stackoverflow.com/users/10607003", "pm_score": 1, "selected": false, "text": "import * as React from 'react';\nimport {Dimensions, SafeAreaView, StyleSheet, Text, View} from 'react-native';...
2022/12/02
[ "https://Stackoverflow.com/questions/74649783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19385910/" ]
74,649,807
<p>I have a site where the h1 tag and an image load in when I scroll to them. I have the css set to load an animation on the tags when they load, so I really don't want them to load before they are visible.</p> <p>I have it working perfectly on desktop/laptop, but on mobile the elements are just loaded automatically wi...
[ { "answer_id": 74659223, "author": "Alverstone", "author_id": 19703001, "author_profile": "https://Stackoverflow.com/users/19703001", "pm_score": 0, "selected": false, "text": "import React, { useEffect, useState } from 'react';\nimport Headshot from '../../../assets/images/about/Headsho...
2022/12/02
[ "https://Stackoverflow.com/questions/74649807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19703001/" ]
74,649,816
<p>I'm starting out with C# (two weeks in) and I'm trying to display a variable based on user input via Console.Readline(); method. This basic app is a calculator with two steps: Step 1 is a simple calculator; Step 2 should display material information (the name and price of the material).</p> <p>The issue I'm having i...
[ { "answer_id": 74659223, "author": "Alverstone", "author_id": 19703001, "author_profile": "https://Stackoverflow.com/users/19703001", "pm_score": 0, "selected": false, "text": "import React, { useEffect, useState } from 'react';\nimport Headshot from '../../../assets/images/about/Headsho...
2022/12/02
[ "https://Stackoverflow.com/questions/74649816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19811649/" ]
74,649,819
<p>I have encountered very weird behavior using angular model when user selects from an option. I will provide screenshots + code snippets. In summary, I am getting undefined for property that is populated. Model object returns expected string but if I directly call the property, it returns undefined.</p> <p>Object tha...
[ { "answer_id": 74659223, "author": "Alverstone", "author_id": 19703001, "author_profile": "https://Stackoverflow.com/users/19703001", "pm_score": 0, "selected": false, "text": "import React, { useEffect, useState } from 'react';\nimport Headshot from '../../../assets/images/about/Headsho...
2022/12/02
[ "https://Stackoverflow.com/questions/74649819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12154734/" ]
74,649,824
<p>is there a way to call a function in a spawned child process, a powershell script, from the parent node js script?</p> <p>node script:</p> <pre><code>const cp = require(&quot;child_process&quot;); const psData = cp.spawn (&quot;powershell -executionpolicy bypass ./powershell-script.ps1&quot;, [], { shell: &quot...
[ { "answer_id": 74659223, "author": "Alverstone", "author_id": 19703001, "author_profile": "https://Stackoverflow.com/users/19703001", "pm_score": 0, "selected": false, "text": "import React, { useEffect, useState } from 'react';\nimport Headshot from '../../../assets/images/about/Headsho...
2022/12/02
[ "https://Stackoverflow.com/questions/74649824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13332238/" ]
74,649,886
<p>I'm trying to assess the expected performance of calculating trigonometry functions as a function of the required precision. Obviously the wall clock time depends on the speed of the underlying arithmetic, so factoring that out by just counting number of operations:</p> <p>Using state-of-the-art algorithms, how many...
[ { "answer_id": 74650392, "author": "chux - Reinstate Monica", "author_id": 2410359, "author_profile": "https://Stackoverflow.com/users/2410359", "pm_score": 3, "selected": true, "text": "x = π/4 sin(x) sin() / - * sin() cos() sin() * sine_crap() sin()" }, { "answer_id": 74659839,...
2022/12/02
[ "https://Stackoverflow.com/questions/74649886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45843/" ]
74,649,960
<p>The following is a subset of my geoJSON object which has a combination of Multipolygons and GeometryCollections in its features. The GeometryCollections include multiple types of geometries.</p> <pre><code>json_str = '{&quot;type&quot;: &quot;FeatureCollection&quot;, &quot;features&quot;: [ {&quot;id&quot;: &qu...
[ { "answer_id": 74650392, "author": "chux - Reinstate Monica", "author_id": 2410359, "author_profile": "https://Stackoverflow.com/users/2410359", "pm_score": 3, "selected": true, "text": "x = π/4 sin(x) sin() / - * sin() cos() sin() * sine_crap() sin()" }, { "answer_id": 74659839,...
2022/12/02
[ "https://Stackoverflow.com/questions/74649960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14109040/" ]
74,649,965
<p>I got an old .net4.8 web app that uses MVC and controllers and trying to convert(Rewrite) it to .net 7 razor pages.</p> <p>I am trying to change the old url routing to be a standard.</p> <p>My Razor page routeing works fine and is as follows.</p> <pre><code>@page &quot;/flights/{FromIata:length(3)?}/{ToIata:length(3...
[ { "answer_id": 74651922, "author": "Mike Brind", "author_id": 134725, "author_profile": "https://Stackoverflow.com/users/134725", "pm_score": 1, "selected": false, "text": "@page @page \"flights/{FromIata:length(3)?}/{ToIata:length(3)?}\"\n" }, { "answer_id": 74662315, "autho...
2022/12/02
[ "https://Stackoverflow.com/questions/74649965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9666854/" ]
74,649,973
<p>I am working on a single page application (SPA) app that grants access to specific paths in the application, based on roles setup in Azure AD for the user logging in. As per this <a href="https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/5-AccessControl/1-call-api-roles" rel="nofollow ...
[ { "answer_id": 74651922, "author": "Mike Brind", "author_id": 134725, "author_profile": "https://Stackoverflow.com/users/134725", "pm_score": 1, "selected": false, "text": "@page @page \"flights/{FromIata:length(3)?}/{ToIata:length(3)?}\"\n" }, { "answer_id": 74662315, "autho...
2022/12/02
[ "https://Stackoverflow.com/questions/74649973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9188188/" ]
74,649,985
<p>My understanding is that SMIL animations are supported by chrome; however my svg SMIL animation <strong>does not</strong> in Chrome (v107) while it <strong>does</strong> work in Safari (v16.0)</p> <p>Here's a <a href="https://codepen.io/nickbewley/pen/zYjpgNR" rel="nofollow noreferrer">link</a> to a codepen illustra...
[ { "answer_id": 74650269, "author": "Kaiido", "author_id": 3702797, "author_profile": "https://Stackoverflow.com/users/3702797", "pm_score": 3, "selected": true, "text": "document.querySelector(\"button\").addEventListener(\"click\", (evt) => {\n document.querySelector(\"path animate\")....
2022/12/02
[ "https://Stackoverflow.com/questions/74649985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/903143/" ]
74,650,007
<p>So I've got this program that needs to take in information from a text file and use it to generate data for weather data recording stations. One of the lines looks like this:</p> <pre><code>KE000063612 3.117 35.617 515 1/1/14 -1 87 98 73 </code></pre> <p>the lines repeat for like 8700 lines with the same spa...
[ { "answer_id": 74650599, "author": "m3ow", "author_id": 20474278, "author_profile": "https://Stackoverflow.com/users/20474278", "pm_score": 1, "selected": false, "text": "Scanner scanner = new Scanner(System.in);\nString[] input = scanner.nextLine().split(\" \");\n\nSystem.out.println(in...
2022/12/02
[ "https://Stackoverflow.com/questions/74650007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20296823/" ]
74,650,043
<p>I want two <a href="/questions/tagged/plotly" class="post-tag" title="show questions tagged &#39;plotly&#39;" aria-label="show questions tagged &#39;plotly&#39;" rel="tag" aria-labelledby="plotly-container">plotly</a> figures to appear side by side using <a href="/questions/tagged/r-markdown" class="post-tag" title=...
[ { "answer_id": 74650599, "author": "m3ow", "author_id": 20474278, "author_profile": "https://Stackoverflow.com/users/20474278", "pm_score": 1, "selected": false, "text": "Scanner scanner = new Scanner(System.in);\nString[] input = scanner.nextLine().split(\" \");\n\nSystem.out.println(in...
2022/12/02
[ "https://Stackoverflow.com/questions/74650043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11103547/" ]
74,650,062
<p>iam new to flutter and i would like to add a text under a button, but i cant seems to do it, so far here's my result</p> <p>..</p> <p><a href="https://i.stack.imgur.com/vt9mm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vt9mm.png" alt="enter image description here" /></a></p> <p>i use two Rows ...
[ { "answer_id": 74650599, "author": "m3ow", "author_id": 20474278, "author_profile": "https://Stackoverflow.com/users/20474278", "pm_score": 1, "selected": false, "text": "Scanner scanner = new Scanner(System.in);\nString[] input = scanner.nextLine().split(\" \");\n\nSystem.out.println(in...
2022/12/02
[ "https://Stackoverflow.com/questions/74650062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20229067/" ]
74,650,064
<p>I have a list of dictionary as below.</p> <pre><code>[ {'name':['mallesh'],'email':['m@gmail.com']}, {'name':['bhavik'],'ssn':['1000011']}, {'name':['jagarini'],'email':['m@gmail.com'],'phone':['111111']}, {'name':['mallesh'],'email':['m@gmail.com'],'phone':['1234556'],'ssn':['10000012']} ] </code><...
[ { "answer_id": 74650283, "author": "Fran Casadome", "author_id": 1344280, "author_profile": "https://Stackoverflow.com/users/1344280", "pm_score": 2, "selected": false, "text": "update data = [\n {'name': ['mallesh'], 'email': ['m@gmail.com']},\n {'name': ['bhavik'], 'ssn': ['10000...
2022/12/02
[ "https://Stackoverflow.com/questions/74650064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9479925/" ]
74,650,090
<p>I'm trying to setup the dev environment for an existing project on another computer under WSL2 and Windows 10. Having installed the project from its own repo with <code>composer install</code> and making sure a basic .env file is in place, I ran <code>/vendor/bin/sail up</code> to do the initial build.</p> <p>Docker...
[ { "answer_id": 74650283, "author": "Fran Casadome", "author_id": 1344280, "author_profile": "https://Stackoverflow.com/users/1344280", "pm_score": 2, "selected": false, "text": "update data = [\n {'name': ['mallesh'], 'email': ['m@gmail.com']},\n {'name': ['bhavik'], 'ssn': ['10000...
2022/12/02
[ "https://Stackoverflow.com/questions/74650090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/483/" ]
74,650,147
<p>Is there a command that can initialize npm's package-lock.json and update all the libraries?<br /> With yarn, I can use the following command to update the library in one go, but is there a way to do the same with npm?</p> <pre><code>$ rm -rf node_modules yarn.lock $ npx npm-check-updates -u </code></pre>
[ { "answer_id": 74650283, "author": "Fran Casadome", "author_id": 1344280, "author_profile": "https://Stackoverflow.com/users/1344280", "pm_score": 2, "selected": false, "text": "update data = [\n {'name': ['mallesh'], 'email': ['m@gmail.com']},\n {'name': ['bhavik'], 'ssn': ['10000...
2022/12/02
[ "https://Stackoverflow.com/questions/74650147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10922854/" ]
74,650,152
<p>I have the following telegram export JSON dataset:</p> <pre><code>import pandas as pd df = pd.read_json(&quot;data/result.json&quot;) &gt;&gt;&gt;df.colums Index(['name', 'type', 'id', 'messages'], dtype='object') &gt;&gt;&gt; type(df) &lt;class 'pandas.core.frame.DataFrame'&gt; # Sample output sample_df = pd.Da...
[ { "answer_id": 74650420, "author": "Charles Han", "author_id": 11514907, "author_profile": "https://Stackoverflow.com/users/11514907", "pm_score": 0, "selected": false, "text": "def flatlist(srclist):\n flatlist=[]\n if srclist: #check if srclist is not None\n for item in sr...
2022/12/02
[ "https://Stackoverflow.com/questions/74650152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15518762/" ]
74,650,154
<p>Good day</p> <p>I moved to another company from a previous one, they task me to modify a existing system with a horrific code, but with patience and dedication, I managed to update the system, but I was shocked that they told me to put the source code on the system and it will be the one that the app in IIS will rea...
[ { "answer_id": 74650420, "author": "Charles Han", "author_id": 11514907, "author_profile": "https://Stackoverflow.com/users/11514907", "pm_score": 0, "selected": false, "text": "def flatlist(srclist):\n flatlist=[]\n if srclist: #check if srclist is not None\n for item in sr...
2022/12/02
[ "https://Stackoverflow.com/questions/74650154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7566234/" ]
74,650,197
<p>I want multiple <a href="/questions/tagged/plotly" class="post-tag" title="show questions tagged &#39;plotly&#39;" aria-label="show questions tagged &#39;plotly&#39;" rel="tag" aria-labelledby="plotly-container">plotly</a> figures to be displayed from an <code>if</code> <code>else</code> statement.</p> <pre><code>if...
[ { "answer_id": 74650420, "author": "Charles Han", "author_id": 11514907, "author_profile": "https://Stackoverflow.com/users/11514907", "pm_score": 0, "selected": false, "text": "def flatlist(srclist):\n flatlist=[]\n if srclist: #check if srclist is not None\n for item in sr...
2022/12/02
[ "https://Stackoverflow.com/questions/74650197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11103547/" ]
74,650,214
<p>When I'm doing this:</p> <pre><code>def pencil(): print(&quot;pencil&quot;) print(&quot;A&quot;, pencil()) </code></pre> <p>Output showing:</p> <pre class="lang-none prettyprint-override"><code>pencil A None </code></pre> <p>I tried some things but nothing worked.</p>
[ { "answer_id": 74650244, "author": "Leo Ward", "author_id": 20421592, "author_profile": "https://Stackoverflow.com/users/20421592", "pm_score": 2, "selected": true, "text": "def pencil():\n return \"pencil\"\n\n\nprint(\"A\", pencil()) # A pencil\n def pencil():\n print(\"pencil\")...
2022/12/02
[ "https://Stackoverflow.com/questions/74650214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20306417/" ]
74,650,215
<p>I have a very large iterable which means a lot of iterations must pass before the bar updates by 1%. It populates a sqlite database from legacy excel sheets.</p> <p>Minimum reproducible example is something like this.</p> <pre class="lang-py prettyprint-override"><code>from tqdm import tqdm, trange import time perc...
[ { "answer_id": 74650711, "author": "Sin Han Jinn", "author_id": 12128167, "author_profile": "https://Stackoverflow.com/users/12128167", "pm_score": 0, "selected": false, "text": "from tqdm import tqdm, trange\nimport time\n\ntotal = 1000\n\nclass TqdmExtraFormat(tqdm):\n @property\n ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8981253/" ]
74,650,216
<p>I have a parent functional component named Dashboard and a child class component named DashboardTable. I'm making a graphql call in the parent class and want to pass the result into the child like this <code>&lt;DashboardTable data={opportunityData}/&gt;.</code></p> <p>problem: I can get see the data in the parent b...
[ { "answer_id": 74650711, "author": "Sin Han Jinn", "author_id": 12128167, "author_profile": "https://Stackoverflow.com/users/12128167", "pm_score": 0, "selected": false, "text": "from tqdm import tqdm, trange\nimport time\n\ntotal = 1000\n\nclass TqdmExtraFormat(tqdm):\n @property\n ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10959395/" ]
74,650,266
<p>I have a <code>try .. catch</code> block when loggin in or signing up with <code>FirebaseAuth.instance</code></p> <p>This is the code that I have.</p> <pre><code> try { //... code here } on PlatformException catch (err) { var message = 'An error occured, please check your credentials.'; if (err.message != nu...
[ { "answer_id": 74650365, "author": "ramedju", "author_id": 20283624, "author_profile": "https://Stackoverflow.com/users/20283624", "pm_score": 0, "selected": false, "text": "on FirebaseAuthException on PlatformException" }, { "answer_id": 74650581, "author": "Nehil Koshiya", ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20283624/" ]
74,650,361
<p>Vue component hasn't <code>onShow</code> lifecycle method.</p> <p>How to call a component method each time this component show in vue2?</p>
[ { "answer_id": 74655182, "author": "Rohìt Jíndal", "author_id": 4116300, "author_profile": "https://Stackoverflow.com/users/4116300", "pm_score": 0, "selected": false, "text": "v-if v-show v-if Vue.component('child', {\n props: ['childmsg'],\n template: '<p>{{ childmsg }}</p>',\n moun...
2022/12/02
[ "https://Stackoverflow.com/questions/74650361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1516794/" ]
74,650,396
<p>In my React/Redux project I tend to use constants in switch case within <strong>reducer</strong>, since the name of each action tends to be long and complex, I'm wondering if it's a good practice?</p> <pre class="lang-js prettyprint-override"><code>const ACTION_LIST = { add: 'ACTION_TYPE/ADD_CUSTOMER', remove: '...
[ { "answer_id": 74655182, "author": "Rohìt Jíndal", "author_id": 4116300, "author_profile": "https://Stackoverflow.com/users/4116300", "pm_score": 0, "selected": false, "text": "v-if v-show v-if Vue.component('child', {\n props: ['childmsg'],\n template: '<p>{{ childmsg }}</p>',\n moun...
2022/12/02
[ "https://Stackoverflow.com/questions/74650396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5721873/" ]
74,650,404
<p>I'm working on a fun side project and would like to compute a moving sum for number of wins for NBA teams over 2 year periods. Consider the sample pandas dataframe below,</p> <pre><code>pd.DataFrame({'Team':['Hawks','Hawks','Hawks','Hawks','Hawks'], 'Season':[1970,1971,1972,1973,1974],'Wins':[40,34,30,46,42]}) </cod...
[ { "answer_id": 74655182, "author": "Rohìt Jíndal", "author_id": 4116300, "author_profile": "https://Stackoverflow.com/users/4116300", "pm_score": 0, "selected": false, "text": "v-if v-show v-if Vue.component('child', {\n props: ['childmsg'],\n template: '<p>{{ childmsg }}</p>',\n moun...
2022/12/02
[ "https://Stackoverflow.com/questions/74650404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8083465/" ]
74,650,405
<p>I'd like to figure out a way to compare columns in the SAME data frame, but in such a way that I create a new column called <code>STATUS</code> for the output. I have 3 columns 1)<code>SNPs</code>, 2)<code>gained</code>, and 3)<code>lost</code>. I want to know if the data in each cell in column 1 is present in eithe...
[ { "answer_id": 74650462, "author": "IRTFM", "author_id": 1855677, "author_profile": "https://Stackoverflow.com/users/1855677", "pm_score": 1, "selected": false, "text": "ifelse tbl$status <- ifelse(tbl$SNPs %in% tbl$GAINED, \"GAINED\",\n ifelse(tbl$SNPs %in%...
2022/12/02
[ "https://Stackoverflow.com/questions/74650405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11924976/" ]
74,650,437
<p>Background: I have an array (A) of new objects that need to be added to an array field in Mongoose. if successful it should print to screen the newly updated object but it prints null. I checked the database and confirmed it also does not update at all. I followed the docs to use the $push and $each modifiers here: ...
[ { "answer_id": 74650462, "author": "IRTFM", "author_id": 1855677, "author_profile": "https://Stackoverflow.com/users/1855677", "pm_score": 1, "selected": false, "text": "ifelse tbl$status <- ifelse(tbl$SNPs %in% tbl$GAINED, \"GAINED\",\n ifelse(tbl$SNPs %in%...
2022/12/02
[ "https://Stackoverflow.com/questions/74650437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9744790/" ]
74,650,451
<p>I have an example below that is an extremely simplified version of my actual code.</p> <p>I have a type that can either be an interface or another like so:</p> <pre class="lang-js prettyprint-override"><code>interface ChatBase { roomId?: string type: &quot;message&quot; | &quot;emoji&quot; configs: unkno...
[ { "answer_id": 74650469, "author": "Chris Hamilton", "author_id": 12914833, "author_profile": "https://Stackoverflow.com/users/12914833", "pm_score": 1, "selected": false, "text": "function hasDefinedEmoji(chat: Chat): chat is ChatEmoji & {configs: {emoji: string}} {\n return chat.typ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/517477/" ]
74,650,458
<p>I can't be the first one to ask this, but I'm having trouble finding the right search results. These terms are so overloaded.</p> <p>Eventually I want to make some additions to a remote branch. Remote branch may not exist. So first I clone remote repo, I only have default branch locally. Then:</p> <p>so far I have:<...
[ { "answer_id": 74650469, "author": "Chris Hamilton", "author_id": 12914833, "author_profile": "https://Stackoverflow.com/users/12914833", "pm_score": 1, "selected": false, "text": "function hasDefinedEmoji(chat: Chat): chat is ChatEmoji & {configs: {emoji: string}} {\n return chat.typ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745574/" ]
74,650,487
<p>I am trying to turn this: <code>const arr = ['last_updated_epoch', 1669949100]</code> into</p> <pre><code> {'last_updated_epoch': 1669949100} </code></pre> <p>I tried:</p> <pre><code>const arr = ['last_updated_epoch', 1669949100] arr.reduce((a, v) =&gt; ({ ...a, [v]: v}), {}) </code></pre> <p>but i get this:</p> <p...
[ { "answer_id": 74650469, "author": "Chris Hamilton", "author_id": 12914833, "author_profile": "https://Stackoverflow.com/users/12914833", "pm_score": 1, "selected": false, "text": "function hasDefinedEmoji(chat: Chat): chat is ChatEmoji & {configs: {emoji: string}} {\n return chat.typ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20576853/" ]
74,650,500
<p>In SQL Server, this query runs very fast, less than a second:</p> <pre><code>SELECT T1.id FROM first AS T1 WHERE T1.id = 21 </code></pre> <p>This query also runs very fast, less than a second, even though it has 53 million records but only has about six records for id 21:</p> <pre><code>SELECT TOP 1 T2.value FROM se...
[ { "answer_id": 74650469, "author": "Chris Hamilton", "author_id": 12914833, "author_profile": "https://Stackoverflow.com/users/12914833", "pm_score": 1, "selected": false, "text": "function hasDefinedEmoji(chat: Chat): chat is ChatEmoji & {configs: {emoji: string}} {\n return chat.typ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1828108/" ]
74,650,507
<p>We are trying to get the logs of pods after multiple restarts but we dont want to use any external solution like efk.</p> <p>i tried below config but its not working. does the below cmd run on the pod or it will run on node level</p> <pre><code>lifecycle: preStop: exec: command: [&quot;/bin/sh&quot;, &quo...
[ { "answer_id": 74650469, "author": "Chris Hamilton", "author_id": 12914833, "author_profile": "https://Stackoverflow.com/users/12914833", "pm_score": 1, "selected": false, "text": "function hasDefinedEmoji(chat: Chat): chat is ChatEmoji & {configs: {emoji: string}} {\n return chat.typ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20204033/" ]
74,650,509
<p>I have to generate a random walk for a sequence of positions in 2D. The person doing the random walk starts at (0,0). At every move, she goes left, right, up or down. The random walk stops if she comes back to (0,0), or until she made a 1000 steps. *I am using the R language</p> <p>I have done this so far, but I am ...
[ { "answer_id": 74650469, "author": "Chris Hamilton", "author_id": 12914833, "author_profile": "https://Stackoverflow.com/users/12914833", "pm_score": 1, "selected": false, "text": "function hasDefinedEmoji(chat: Chat): chat is ChatEmoji & {configs: {emoji: string}} {\n return chat.typ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20662050/" ]
74,650,572
<p>I am trying to print a string with \t at both beginning and end, like below.</p> <pre><code>name2print=&quot;\tabhinav\t&quot; lastname=&quot;gupta&quot; print(name2print,lastname) </code></pre> <pre><code>Expected output should be abhinav gupta But the actual output is abhinav gupta </cod...
[ { "answer_id": 74650469, "author": "Chris Hamilton", "author_id": 12914833, "author_profile": "https://Stackoverflow.com/users/12914833", "pm_score": 1, "selected": false, "text": "function hasDefinedEmoji(chat: Chat): chat is ChatEmoji & {configs: {emoji: string}} {\n return chat.typ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20662060/" ]
74,650,578
<p>Asslam o Alaikum.... I have a problem in my code...my jquery code is only implement of the first row of table not on others....please check my code</p> <pre><code> &lt;tr&gt; &lt;td&gt;&lt;?php echo $row['serial no.'] ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['pname'] ?&gt;&lt;/...
[ { "answer_id": 74651165, "author": "Ahmadreza Sadafi", "author_id": 9336947, "author_profile": "https://Stackoverflow.com/users/9336947", "pm_score": 0, "selected": false, "text": "each" }, { "answer_id": 74651191, "author": "Nagonus Lrak", "author_id": 20476491, "aut...
2022/12/02
[ "https://Stackoverflow.com/questions/74650578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20662131/" ]
74,650,597
<p>I have four buttons, I would like that each time one of them is clicked it has a blue border. And if another one is clicked, the previous one will immediately get back its usual border style.</p> <p>I tried with loop but it doesn't work</p>
[ { "answer_id": 74650646, "author": "Hao-Jung Hsieh", "author_id": 12598451, "author_profile": "https://Stackoverflow.com/users/12598451", "pm_score": 1, "selected": false, "text": ":focus" }, { "answer_id": 74650685, "author": "Thunder", "author_id": 16499723, "author...
2022/12/02
[ "https://Stackoverflow.com/questions/74650597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20662179/" ]
74,650,605
<p>Im a rookie in coding, an im figuring a way to shorten this code, it has too many if statements, if someone can help me out, i really apreciatted. I need to add a classList.remove to the same elements too after that</p> <p>So this is the code:</p> <pre><code>const inputElementName = document.getElementById(&quot;nam...
[ { "answer_id": 74650646, "author": "Hao-Jung Hsieh", "author_id": 12598451, "author_profile": "https://Stackoverflow.com/users/12598451", "pm_score": 1, "selected": false, "text": ":focus" }, { "answer_id": 74650685, "author": "Thunder", "author_id": 16499723, "author...
2022/12/02
[ "https://Stackoverflow.com/questions/74650605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20662176/" ]
74,650,624
<p>I just want to create a table on HTML with a PHP loop. So, I try to do this:</p> <pre><code>&lt;table id=&quot;tdesign&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;No&lt;/th&gt; &lt;th&gt;Nama&lt;/th&gt; &lt;th&gt;Kelas&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt;...
[ { "answer_id": 74650646, "author": "Hao-Jung Hsieh", "author_id": 12598451, "author_profile": "https://Stackoverflow.com/users/12598451", "pm_score": 1, "selected": false, "text": ":focus" }, { "answer_id": 74650685, "author": "Thunder", "author_id": 16499723, "author...
2022/12/02
[ "https://Stackoverflow.com/questions/74650624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13495863/" ]
74,650,627
<p>I can get the rank alias with this query:</p> <pre class="lang-sql prettyprint-override"><code>SELECT *, RANK() OVER (PARTITION BY some_field ORDER BY value) AS rk FROM my_table </code></pre> <p>Result:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>some_field</th> <th>value</th> <th...
[ { "answer_id": 74650768, "author": "NF Meola", "author_id": 2447320, "author_profile": "https://Stackoverflow.com/users/2447320", "pm_score": 0, "selected": false, "text": "SELECT *, \n 1 AS rk\nFROM my_table\nWHERE RANK() OVER (PARTITION BY some_field ORDER BY value) = 1\n" } ]
2022/12/02
[ "https://Stackoverflow.com/questions/74650627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9823251/" ]
74,650,675
<p>I have a list of dictionaries in another list, I want sort those lists of dictionaries according to the date but I can't use sort function I don't know how to access in list (May be date it is not in correct way) I WANT TO KNOW HOW TO SORT SOME THING LIKE THIS OR HOW TO GET ACCESS TO THE &quot;DATE&quot;</p> <pre><c...
[ { "answer_id": 74650768, "author": "NF Meola", "author_id": 2447320, "author_profile": "https://Stackoverflow.com/users/2447320", "pm_score": 0, "selected": false, "text": "SELECT *, \n 1 AS rk\nFROM my_table\nWHERE RANK() OVER (PARTITION BY some_field ORDER BY value) = 1\n" } ]
2022/12/02
[ "https://Stackoverflow.com/questions/74650675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20095556/" ]
74,650,717
<p>I am struggling with a problem that I haven't found a solution by searching, I hope someone can help me to unblock me : Given a vertex, I want to check if it form a self loop in a directed graph or not in O(|V|).</p> <p>Here s a brief implementation of my graph Class :</p> <pre><code>template &lt;class T&gt; class D...
[ { "answer_id": 74650768, "author": "NF Meola", "author_id": 2447320, "author_profile": "https://Stackoverflow.com/users/2447320", "pm_score": 0, "selected": false, "text": "SELECT *, \n 1 AS rk\nFROM my_table\nWHERE RANK() OVER (PARTITION BY some_field ORDER BY value) = 1\n" } ]
2022/12/02
[ "https://Stackoverflow.com/questions/74650717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20662282/" ]
74,650,746
<p>I want to add multiple Leaflet map with different content on the same page but it gives me the error:</p> <pre><code>Map container is already initialized. </code></pre> <p>I'm initializing the map in a <code>useEffect</code>:</p> <pre><code> useEffect(() =&gt; { if (!map) { const newMap = L.map(&quot;map&...
[ { "answer_id": 74650768, "author": "NF Meola", "author_id": 2447320, "author_profile": "https://Stackoverflow.com/users/2447320", "pm_score": 0, "selected": false, "text": "SELECT *, \n 1 AS rk\nFROM my_table\nWHERE RANK() OVER (PARTITION BY some_field ORDER BY value) = 1\n" } ]
2022/12/02
[ "https://Stackoverflow.com/questions/74650746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20313416/" ]
74,650,783
<p>I need to combine the <code>gid</code> and <code>subGroups</code> and output it into an array of strings without duplication. My problem now is that it only gets the first level.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre cla...
[ { "answer_id": 74650812, "author": "CertainPerformance", "author_id": 9515207, "author_profile": "https://Stackoverflow.com/users/9515207", "pm_score": 2, "selected": true, "text": ".flatMap .map .gid .subGroups const oldGroup = [\n {\n \"gid\": \"JFK\",\n \"subGroups\":...
2022/12/02
[ "https://Stackoverflow.com/questions/74650783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8305219/" ]
74,650,835
<p>I have 621224 * 1 data in my Excel Sheet and have to calculate total no. of duplicates in the sheet but it takes a lot too much time with<code> =IF(COUNTIF($J$1000:J14353,J5353)&gt;1,1,0)</code> so this formula might be taking n^2 complexity to find duplicates, I am looking for a formula that takes less time and if...
[ { "answer_id": 74651046, "author": "Harun24hr", "author_id": 5514747, "author_profile": "https://Stackoverflow.com/users/5514747", "pm_score": 0, "selected": false, "text": "IF() =SUM(--(COUNTIFS(A3:A13,A3:A13)>1))\n" }, { "answer_id": 74651321, "author": "Jos Woolley", "...
2022/12/02
[ "https://Stackoverflow.com/questions/74650835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20309275/" ]
74,650,846
<p>I placed the rectangles over the images. I then bound a click to a call that flipped tiles over by lowering the rectangle below the image. It works for the first call to the function, but when I click another tile, that one won't flip over. The program still registers the second flip because it'll flip everything ba...
[ { "answer_id": 74651046, "author": "Harun24hr", "author_id": 5514747, "author_profile": "https://Stackoverflow.com/users/5514747", "pm_score": 0, "selected": false, "text": "IF() =SUM(--(COUNTIFS(A3:A13,A3:A13)>1))\n" }, { "answer_id": 74651321, "author": "Jos Woolley", "...
2022/12/02
[ "https://Stackoverflow.com/questions/74650846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20662448/" ]
74,650,849
<p>So I'm trying to create a BarChart for the category, and each category will have a respective color. I map this information from the MongoDB.</p> <pre><code> const [topDepartment,setTopDepartment] = useState([]) useEffect(() =&gt;{ const getTopDepartment = async () =&gt;{ try { const res = ...
[ { "answer_id": 74651046, "author": "Harun24hr", "author_id": 5514747, "author_profile": "https://Stackoverflow.com/users/5514747", "pm_score": 0, "selected": false, "text": "IF() =SUM(--(COUNTIFS(A3:A13,A3:A13)>1))\n" }, { "answer_id": 74651321, "author": "Jos Woolley", "...
2022/12/02
[ "https://Stackoverflow.com/questions/74650849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18478430/" ]
74,650,865
<p>how to change a div to a textarea to edit the text in the div when a button is clicked and the same button is clicked again then that textarea change to a div.</p> <p>HTML</p> <pre><code>&lt;button class=&quot;button&quot;&gt;click me&lt;/button&gt; &lt;div class=&quot;div&quot;&gt;this is div or textarea&lt;/div&gt...
[ { "answer_id": 74651046, "author": "Harun24hr", "author_id": 5514747, "author_profile": "https://Stackoverflow.com/users/5514747", "pm_score": 0, "selected": false, "text": "IF() =SUM(--(COUNTIFS(A3:A13,A3:A13)>1))\n" }, { "answer_id": 74651321, "author": "Jos Woolley", "...
2022/12/02
[ "https://Stackoverflow.com/questions/74650865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20464992/" ]
74,650,920
<p>I have a Access DB table that have the following data.</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Room-Bed</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td>100-A</td> <td>Available</td> </tr> <tr> <td>100-B</td> <td>Occupied</td> </tr> <tr> <td>101-A</td> <td>Available</td> </tr...
[ { "answer_id": 74651136, "author": "seanb", "author_id": 14267425, "author_profile": "https://Stackoverflow.com/users/14267425", "pm_score": 0, "selected": false, "text": "room_bed_list room room-bed room-bed-status SELECT room_bed_status.room,\n IIF(Sum(IIf([room_bed_list].[room-b...
2022/12/02
[ "https://Stackoverflow.com/questions/74650920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12528631/" ]
74,650,928
<p>OS controls the max number of open file discripters.</p> <p>Is there any method that only a process sets a specific the max number of openfiles and, other processes only can use the traditional default max number of openfiles?</p>
[ { "answer_id": 74651021, "author": "Sunil Bojanapally", "author_id": 1079907, "author_profile": "https://Stackoverflow.com/users/1079907", "pm_score": 1, "selected": false, "text": "<PID>" }, { "answer_id": 74651048, "author": "Craig Estey", "author_id": 5382650, "aut...
2022/12/02
[ "https://Stackoverflow.com/questions/74650928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20182123/" ]
74,650,954
<p>I'm trying to import a route.js file in my index.js file. I am exporting in the routes file and importing it in the index with .js extension. What am I missing here?</p> <p>Folder structure:</p> <p>Routes folder is in the server folder, same as index.js - accessible by a single <code>.</code> VsCode also highlights ...
[ { "answer_id": 74651021, "author": "Sunil Bojanapally", "author_id": 1079907, "author_profile": "https://Stackoverflow.com/users/1079907", "pm_score": 1, "selected": false, "text": "<PID>" }, { "answer_id": 74651048, "author": "Craig Estey", "author_id": 5382650, "aut...
2022/12/02
[ "https://Stackoverflow.com/questions/74650954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16604189/" ]
74,650,981
<p>this is my first time deploying <code>nodejs</code> from <code>localhost</code> to the live server. I am using <code>aapanel</code> for my live server.</p> <p>Here is the relevant code in <code>node server.js</code> file:</p> <pre><code>const hostname = 'localhost'; // const hostname = 'www.thespacebar.io'; // set ...
[ { "answer_id": 74651021, "author": "Sunil Bojanapally", "author_id": 1079907, "author_profile": "https://Stackoverflow.com/users/1079907", "pm_score": 1, "selected": false, "text": "<PID>" }, { "answer_id": 74651048, "author": "Craig Estey", "author_id": 5382650, "aut...
2022/12/02
[ "https://Stackoverflow.com/questions/74650981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15469002/" ]
74,650,988
<p>I'm using Preact with HTM (no compiler required) and am having trouble looping through an object and creating a DOM element for each item.</p> <p>What is the correct way to procedurally generate DOM elements with Preact + HTM?</p> <pre><code>import { h, Component, render } from 'https://unpkg.com/preact?module'; imp...
[ { "answer_id": 74651021, "author": "Sunil Bojanapally", "author_id": 1079907, "author_profile": "https://Stackoverflow.com/users/1079907", "pm_score": 1, "selected": false, "text": "<PID>" }, { "answer_id": 74651048, "author": "Craig Estey", "author_id": 5382650, "aut...
2022/12/02
[ "https://Stackoverflow.com/questions/74650988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4383497/" ]
74,650,990
<p>Here is the code that I am testing. My string array a showing modified array elements as dogs, cats, turtles.</p> <pre class="lang-java prettyprint-override"><code>String[] a = {&quot;dog&quot;, &quot;cat&quot;, &quot;turtle&quot;}; System.out.println(java.util.Arrays.toString(a));//line int i1= 0; for (String j : a...
[ { "answer_id": 74651275, "author": "JustMe", "author_id": 14188847, "author_profile": "https://Stackoverflow.com/users/14188847", "pm_score": 1, "selected": false, "text": "a[i1]=j+\"s\";" }, { "answer_id": 74651309, "author": "Samanja Cartagena", "author_id": 18191906, ...
2022/12/02
[ "https://Stackoverflow.com/questions/74650990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19347264/" ]
74,651,000
<p>Consider this function</p> <pre><code>using Distributions using StatsBase test_vector = sample([1,2,3], 100000000) function test_1( test_vector) rand_vector = randn(3333) sum = 0.0 for t in 1:1000 if t in test_vector sum = sum +rand_vector[t] else sum = sum -...
[ { "answer_id": 74651268, "author": "Oscar Smith", "author_id": 5141328, "author_profile": "https://Stackoverflow.com/users/5141328", "pm_score": 0, "selected": false, "text": "Set O(1)" }, { "answer_id": 74651298, "author": "Bill", "author_id": 4282847, "author_profil...
2022/12/02
[ "https://Stackoverflow.com/questions/74651000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1691278/" ]
74,651,030
<p>I have a date pass from Angular frontend to Java backend.</p> <p>The date format I received from frontend is: Wed Mon 26 11:11:59 SGT 2022 and is in Java Date object</p> <p>How can I convert this format to dd/MM/yyyy and the final output should be 26/12/2022 <strong>in Java Date format.</strong></p> <p><strong>Curre...
[ { "answer_id": 74651273, "author": "Abra", "author_id": 2164365, "author_profile": "https://Stackoverflow.com/users/2164365", "pm_score": 1, "selected": false, "text": "java.time.format.DateTimeFormatter Locale Exception in thread \"main\" java.time.format.DateTimeParseException: Text 'W...
2022/12/02
[ "https://Stackoverflow.com/questions/74651030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16591189/" ]