question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,370,234
Passing path of file to another Python File in Another Location<p>I have a Python file in another location that requires an image file path. Here is the file structure:</p> <pre><code>Main_Dir - main.py - test.jpg - Second_Dir - other.py </code></pre> <p>My <code>main.py</code> is calling a function in <code>oth...
<p>You probably want to use the 'absolute path' of the file, which is the full path which will work from any location on the same computer:</p> <pre><code>from pathlib import Path process_image(Path(&quot;test.jpg&quot;).absolute()) </code></pre> <p>Even better might be <code>.resolve()</code>, which will also resolve...
Passing path of file to another Python File in Another Location
python|python-3.x|function|relative-path|absolute-path
0
77
1
72,370,267
72,370,267
1
true
2022-05-24T22:49:33.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing path of file to another Python File in Another Location<p>I have a Python file in another location that requires an image file path. Here is the file...
72,379,380
Callback With Forwarding vs Without<p>Lets say I have a function which triggers a callback.</p> <pre><code>template &lt;typename Callback&gt; void call_callback(Callback&amp;&amp; rvalue_callback) </code></pre> <p>What is the difference between the following to calling snippets:</p> <ol> <li><p>no forwarding:</p> <pre>...
<blockquote> <pre><code> ... rvalue_callback </code></pre> </blockquote> <p>First of all, note that you are dealing with a <em>forwarding</em> (or <em>universal</em>; common non-standard word) reference here, not an rvalue reference. For details, see e.g.:</p> <ul> <li><a href="https://stackoverflow.com/questions/46213...
Callback With Forwarding vs Without
c++|templates|callback
1
77
1
72,379,469
72,379,469
1
true
2022-05-25T14:21:48.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Callback With Forwarding vs Without<p>Lets say I have a function which triggers a callback.</p> <pre><code>template &lt;typename Callback&gt; void call_callb...
72,361,384
Is k-folds cross validation a smarter idea than using a validation set instead?<p>I have a somewhat large (~2000) set of medical images I plan to use to train a CV model (using efficentnet architecture) in my workplace. In preparation for this, I was reading up on some good practices for training medical images. I have...
<h2>Common Practice</h2> <p>A train:test split with cross-validation on the training set is part of the standard workflow in many machine learning modules. For an example and further details, I recommend the excellent <a href="https://scikit-learn.org/stable/modules/cross_validation.html" rel="nofollow noreferrer">skle...
Is k-folds cross validation a smarter idea than using a validation set instead?
machine-learning|keras|computer-vision|cross-validation|medical-imaging
1
77
1
72,433,755
72,433,755
1
true
2022-05-24T10:35:03.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is k-folds cross validation a smarter idea than using a validation set instead?<p>I have a somewhat large (~2000) set of medical images I plan to use to trai...
72,392,632
No module named "Skimage" ModuleNotFoundError<p>I have tried untinstalling &quot;scikit-image&quot; and installing again but keep getting the same thing?</p> <pre><code>from skimage.metrics import structural_similarity as ssim ModuleNotFoundError: No module named 'skimage' </code></pre>
<p>Try this:</p> <pre><code>python -m pip install -U scikit-image </code></pre>
No module named "Skimage" ModuleNotFoundError
python|scikit-image
0
77
2
72,392,779
72,392,779
1
true
2022-05-26T13:30:06.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No module named "Skimage" ModuleNotFoundError<p>I have tried untinstalling &quot;scikit-image&quot; and installing again but keep getting the same thing?</p>...
72,266,088
Python PyQt: how to get mouse position x and y<p>I'm trying to get the x and y position from a QCursor variable</p> <pre><code>def run(self): pos = QCursor.pos() print(pos.toPoint()) </code></pre> <p>this prints the following:</p> <blockquote> <p>PyQt6.QtCore.QPoint(523, 590)</p> </blockquote> <p>if i try to prin...
<p><code>pos.x</code> and <code>pos.y</code> are methods, not properties so they need to be called.</p> <p>try:</p> <pre><code>pos.x() pos.y() </code></pre> <p>Anytime you print an object in python and it looks like <code>&lt;built-in method ...</code> that means the attribute is a method and needs to be invoked.</p>
Python PyQt: how to get mouse position x and y
python|pyqt
-2
77
2
72,266,199
72,266,199
1
true
2022-05-16T22:00:55.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python PyQt: how to get mouse position x and y<p>I'm trying to get the x and y position from a QCursor variable</p> <pre><code>def run(self): pos = QCurso...
72,261,124
How to iterate and run AsyncGenerator concurrently in Python<p>A bit new to Python, not sure if this question is too naive. Trying to grasp the concurrency model.</p> <p>Third party function (from the library) connects to multiple hosts through ssh and perform some bash command. This function returns AsyncGenerator.</p...
<p>In async model, no functions are run simultaneously. The event loop may switch functions if the current function is <code>await</code>-ing other functions / futures.</p> <p>The <code>async for</code> statement essentially means the event loop may run other scheduled callbacks/tasks between iterations.</p> <p>The <co...
How to iterate and run AsyncGenerator concurrently in Python
python|python-3.x|python-asyncio
0
77
1
72,271,647
72,271,647
1
true
2022-05-16T14:48:12.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to iterate and run AsyncGenerator concurrently in Python<p>A bit new to Python, not sure if this question is too naive. Trying to grasp the concurrency m...
72,332,610
How does this conditional statement work?<p>This function finds the middle value of an array. But the conditional statement makes no sense to me, since <code>arr.length === 0</code> is never true but the function still works for both even and odd numbers. I think the condition should be <code>arr.length % 2 !== 0</code...
<p>Since the condition is always false, this function will always return the first value which is <code>arr[Math.ceil((arr.length - 1) / 2)]</code> which is always correct I assume.</p> <ul> <li>For the first example (an array from 1 - 13): <code>arr.length</code> is <code>13</code>, arr.length / 2 will be <code>6.5</c...
How does this conditional statement work?
javascript|conditional-statements
1
77
2
72,332,693
72,332,693
1
true
2022-05-21T19:22:22.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does this conditional statement work?<p>This function finds the middle value of an array. But the conditional statement makes no sense to me, since <code...
72,341,050
How Do I Ensure a Candidate Latin Square Is a Valid Damm Operation Table<p>I am attempting to write a function in Scala that takes a valid <a href="https://en.wikipedia.org/wiki/Latin_square" rel="nofollow noreferrer">Latin Square</a> as input and then returns a <code>Boolean</code> value indicating whether the input L...
<p>In functional programming terms, the checksum algorithm is <code>foldLeft</code> with a carefully chosen binary operation. The requirements for this binary operation, in English:</p> <ul> <li>In every two-digit input, if we change one of the digits, then the checksum changes (Latin square…);</li> <li>In every three-...
How Do I Ensure a Candidate Latin Square Is a Valid Damm Operation Table
algorithm|scala|check-digit
1
77
2
72,342,123
72,342,123
1
true
2022-05-22T20:21:06.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Do I Ensure a Candidate Latin Square Is a Valid Damm Operation Table<p>I am attempting to write a function in Scala that takes a valid <a href="https://e...
72,261,568
Not able to render image from API<p>I am able to fetch the data from API endpoint but am not able to render it to the screen.</p> <p>This is my App.js component.</p> <pre><code> function App() { const [data, setData] = useState([]); const [img, setImg] = useState([]); useEffect(() =&gt; { fetchD...
<p>App.js:</p> <pre><code>function App() { const [data, setData] = useState(&quot;&quot;); useEffect(() =&gt; { fetchData(setData); }, []); return ( &lt;div className=&quot;App&quot;&gt; {data.map((details) =&gt; { return ( &lt;Card key={details.id} ema...
Not able to render image from API
reactjs|react-hooks
1
77
3
72,262,049
72,262,049
1
true
2022-05-16T15:17:52.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to render image from API<p>I am able to fetch the data from API endpoint but am not able to render it to the screen.</p> <p>This is my App.js compon...
72,283,555
KeyError on the 2nd loop on pandas df<p>so on the first run in the loop everything works fine but on the second loop, it causes a KeyError on the column values on my df. I don't understand why this is happening since in every loop I'm triggering a set of functions.</p> <p>Part of the code that creates the error</p> <pr...
<p>I don't have skills in 'request', but this worked for me. Try the following. In the 'deep market_data' function, after receiving the dataframe, set a check, if len(df)&lt;=0, then exit.</p> <p>Where the dataframe turns out to be empty, the request returns 200, that is, everything is fine. Printed out 'crypto'. An em...
KeyError on the 2nd loop on pandas df
python|pandas
0
77
1
72,286,881
72,286,881
1
true
2022-05-18T05:19:48.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: KeyError on the 2nd loop on pandas df<p>so on the first run in the loop everything works fine but on the second loop, it causes a KeyError on the column valu...
72,266,921
javascript - working with multiple promises inside loop - how to return data outside of promise?<p>I'm struggling to understand how I can return data from multiple promises to build up an array of data.</p> <p>Is there anyway I can return the data outside of the promise to push to the data variable?</p> <p>I have the f...
<p>You need two <code>Promise.all</code>s - one to iterate over each student, and a nested one to fetch the <code>getMealBooking</code> and <code>getStudentData</code> for each student.</p> <p>Put everything into an async function (that catches and sends <code>false</code> if needed) to make the control flow easier to ...
javascript - working with multiple promises inside loop - how to return data outside of promise?
javascript|arrays|loops|promise|es6-promise
-2
77
3
72,266,963
72,266,963
1
true
2022-05-17T00:18:54.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript - working with multiple promises inside loop - how to return data outside of promise?<p>I'm struggling to understand how I can return data from mu...
72,333,232
how to round a number to N decimal places in C++?<p>I want to round a number to 10 decimal places , but it returns '6.75677', although it could returns '6.7567653457'</p> <pre><code>#include &lt;iostream&gt; #include &lt;cmath&gt; using namespace std; double rounded(double number, int N) { return round(number * po...
<pre><code>cout &lt;&lt; fixed &lt;&lt; setprecision(10) &lt;&lt; value &lt;&lt; endl </code></pre>
how to round a number to N decimal places in C++?
python|c++
0
77
1
72,333,262
72,333,262
1
true
2022-05-21T21:10:15.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to round a number to N decimal places in C++?<p>I want to round a number to 10 decimal places , but it returns '6.75677', although it could returns '6.75...
72,264,596
How to block response on fastapi until script is ran?<p>I have a fastapi endpoint that calls a python script but has two problems on GCP:</p> <ol> <li>it always give a success code (because it's not blocking)</li> <li>The instances is always running as cloud rundoesn't know when to turn it off(because it's not blocking...
<p>Blocking operations could hang up your current worker. When you want to execute blocking code over a coroutine, send its logic to a executor.</p> <ol> <li>Get the event loop</li> </ol> <pre class="lang-py prettyprint-override"><code>loop = asyncio.get_running_loop() </code></pre> <ol start="2"> <li>Any blocking code...
How to block response on fastapi until script is ran?
python|fastapi
0
77
2
72,269,686
72,269,686
1
true
2022-05-16T19:25:35.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to block response on fastapi until script is ran?<p>I have a fastapi endpoint that calls a python script but has two problems on GCP:</p> <ol> <li>it alw...
72,350,633
BeautifulSoup not returning full html script from airbnb search page<p>I am trying to use BeautifulSoup and Selenium to scrape data from Airbnb. I want to gather each listing from <a href="https://www.airbnb.com/s/Kyoto--Japan/homes?adults=1&amp;place_id=ChIJ8cM8zdaoAWARPR27azYdlsA&amp;refinement_paths%5B%5D=%2Fhomes" ...
<p>I don't use selenium too often but recommend the <code>requests</code> lib.</p> <p>Try this</p> <pre><code>from requests import get from bs4 import BeautifulSoup headers = {'User-agent':'Mozilla/5.0 (X11; Linux i686; rv:100.0) Gecko/20100101 Firefox/100.0.'} res = get('https://www.airbnb.com/s/Kyoto-Prefecture--Ja...
BeautifulSoup not returning full html script from airbnb search page
python|selenium|selenium-webdriver|beautifulsoup|airbnb-js-styleguide
0
77
2
72,351,159
72,351,159
1
true
2022-05-23T14:55:38.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BeautifulSoup not returning full html script from airbnb search page<p>I am trying to use BeautifulSoup and Selenium to scrape data from Airbnb. I want to ga...
72,288,252
document.getElementById returns HTMLDivElement {}<p>I have the following code in my HTML file:</p> <pre><code> &lt;div id=&quot;calc-parent&quot;&gt; &lt;div class=&quot;row&quot;&gt; &lt;div class=&quot;column&quot; id=&quot;calc-display-val&quot;&gt;0&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I need to...
<p>You can use <code>.innerHTML</code> for this :</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 calcDisplayVal = document.getElementById("calc-display-val") function pre...
document.getElementById returns HTMLDivElement {}
javascript|getelementbyid
-1
77
2
72,288,372
72,288,372
1
true
2022-05-18T11:22:02.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: document.getElementById returns HTMLDivElement {}<p>I have the following code in my HTML file:</p> <pre><code> &lt;div id=&quot;calc-parent&quot;&gt; ...
72,242,524
How do i move the "interaction" with the "blob" in this animated blob?<p>I downloaded this javascript blob graphic, I've added it to my page, and moved it to the right using CSS, But when I move the mouse to interact with the blob, it still thinks the blob is in the middle of the screen. How do I move the interaction t...
<p>seems like it was pretty easy you just have to play with the position function in your JavaScript, First remove your CSS completely because it is unnecessary and find this particular line on your JavaScript and change the X axis position if you want to move the blob horizontally and Y axis if you want vertical movem...
How do i move the "interaction" with the "blob" in this animated blob?
javascript|html|css
1
77
1
72,243,512
72,243,512
2
true
2022-05-14T17:26:33.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i move the "interaction" with the "blob" in this animated blob?<p>I downloaded this javascript blob graphic, I've added it to my page, and moved it to...
72,268,055
How to create index to optimize a "Key Lookup"<p>I have an SP which on first run, can run for over a minute. On second run, it takes less than a second.</p> <p>To fix, I check the Execution Plan which shows this:</p> <p><a href="https://i.stack.imgur.com/2JcuD.png" rel="nofollow noreferrer"><img src="https://i.stack.i...
<p>Keylookup means that a specific field is not available in the index and we have to go to the data page to pick up the field.</p> <p>In your case, <code>accountid</code> is being used to pickup the <code>utility_id</code> from the data page of <code>Account</code> table.</p> <p>What you have to do is, add this utilit...
How to create index to optimize a "Key Lookup"
sql-server|sql-server-azure
0
77
1
72,268,197
72,268,197
2
true
2022-05-17T03:59:22.950Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create index to optimize a "Key Lookup"<p>I have an SP which on first run, can run for over a minute. On second run, it takes less than a second.</p>...
72,266,430
How can I fix this error "premium is not one of valid choices please select valid choice" from drop down in django?<p>Context:</p> <p>I was able to set a user to PREMIUM from the admin panel but after resetting the database I see this error. I'm unable to figure out what's going on or how to fix it.</p> <p>The error is...
<p>As the documentation on the <a href="https://docs.djangoproject.com/en/dev/ref/models/fields/#choices" rel="nofollow noreferrer"><strong><code>choices=…</code></strong> parameter <sup>[Django-doc]</sup></a> says:</p> <blockquote> <p>A sequence consisting itself of iterables of exactly two items (e.g. <code>[(A, B), ...
How can I fix this error "premium is not one of valid choices please select valid choice" from drop down in django?
django|django-models
2
77
1
72,271,540
72,271,540
2
true
2022-05-16T22:55:34.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I fix this error "premium is not one of valid choices please select valid choice" from drop down in django?<p>Context:</p> <p>I was able to set a use...
72,278,807
Why don't I get a response from my request?<p>I'm trying to make one simple request:</p> <pre><code>ua=UserAgent() req = requests.get('https://www.casasbahia.com.br/' , headers={'User-Agent':ua.random}) </code></pre> <p>I would understand if I received &lt;Response [403] or something like that, but instead, a recive no...
<p>I never used this API before, but from what I researched on <a href="https://serpapi.com/blog/how-to-reduce-chance-of-being-blocked-while-web/" rel="nofollow noreferrer">here</a> just now, there are sites that can block requests from fake users.</p> <p>So, for reproducing this example on my PC, I installed <em>fake_...
Why don't I get a response from my request?
python|web-scraping|python-requests|request
0
77
1
72,279,237
72,279,237
2
true
2022-05-17T18:10:17.123Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why don't I get a response from my request?<p>I'm trying to make one simple request:</p> <pre><code>ua=UserAgent() req = requests.get('https://www.casasbahia...
72,330,022
No jdbc driver for mysql 8.0.28<p>How to get the JDBC driver for mysql 8.0.28 the <a href="https://dev.mysql.com/downloads/connector/j/" rel="nofollow noreferrer">website</a> has installer only. Does they removed it? How to get the driver for this version?</p>
<p>Do you want 8.0.28 (mentioned in the title) or 8.0.29 (mentioned in the body of the question)? Either way, if you <em>only</em> want the JAR file, then use the &quot;Platform independent&quot; download option - either from the main download tab or from the archives tab in the link you provided. From there you can do...
No jdbc driver for mysql 8.0.28
mysql|jdbc
0
77
1
72,330,136
72,330,136
2
true
2022-05-21T13:32:05.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No jdbc driver for mysql 8.0.28<p>How to get the JDBC driver for mysql 8.0.28 the <a href="https://dev.mysql.com/downloads/connector/j/" rel="nofollow norefe...
72,350,763
Label are under the node's circle Gephi<p>I have an issue with the latest version of Gephi. In the start, it was working correctly. In the overview tab, it's working perfectly. The labels are shown over the circle as follows.</p> <p><a href="https://i.stack.imgur.com/zQb9A.png" rel="nofollow noreferrer"><img src="https...
<p>It feels like the order of renderers has been changed and labels are rendered before nodes. Try restoring the renderers order: <a href="https://i.stack.imgur.com/aFmB7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aFmB7.png" alt="enter image description here" /></a></p>
Label are under the node's circle Gephi
gephi
1
77
1
72,354,041
72,354,041
2
true
2022-05-23T15:04:06.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Label are under the node's circle Gephi<p>I have an issue with the latest version of Gephi. In the start, it was working correctly. In the overview tab, it's...
72,353,302
Stop for loop iteration trough a list at a certain point<p>Basically I want that my for loop stops itself after a certain element in the list is being processed. Here is the code:</p> <pre><code>vids = [ 'https://www.itatv.com/ita_video.php?viewkey=626de171d928a', 'https://www.itatv.com/ita_video.php?viewkey=60...
<p>The best way to go about this would probably be to create a new list which is basically a copy of the previous one from the wanted item onwards. There are many ways to do that but, probably the <em>cutest</em> one is the following:</p> <pre><code>new_list = vids[next((i for i, v in enumerate(vids) if '&amp;pkey=' in...
Stop for loop iteration trough a list at a certain point
python
1
77
2
72,353,401
72,353,401
2
true
2022-05-23T18:31:29.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stop for loop iteration trough a list at a certain point<p>Basically I want that my for loop stops itself after a certain element in the list is being proces...
72,242,974
How do I get a cell's color from a Google Sheets doc in Colab (python) without Google API?<p>I am importing a Google Sheets document into <strong>Google Colab</strong> for data analysis using python. I would like to <strong>get formatting information from the Google Sheets document, particularly <em>cell background col...
<h2>Several points</h2> <ol> <li></li> </ol> <blockquote> <p>I can successfully import the google sheets document without Google API with gspread</p> </blockquote> <ul> <li><a href="https://docs.gspread.org/en/latest/" rel="nofollow noreferrer">gspread</a> is a library does allows you to use the <a href="https://develo...
How do I get a cell's color from a Google Sheets doc in Colab (python) without Google API?
python|google-sheets|google-colaboratory
0
77
1
72,255,898
72,255,898
2
true
2022-05-14T18:34:06.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get a cell's color from a Google Sheets doc in Colab (python) without Google API?<p>I am importing a Google Sheets document into <strong>Google Cola...
72,367,680
callback is not a function - castv2<p>I'm following this <a href="http://siglerdev.us/blog/2021/02/26/google-home-message-broadcast-system-node-js/31" rel="nofollow noreferrer">http://siglerdev.us/blog/2021/02/26/google-home-message-broadcast-system-node-js/31</a> which uses this library castv2-client to send messages ...
<p>The error you reported:</p> <pre><code>C:\Users\Phil\Documents\google home\node_modules\castv2-client\lib\controllers\receiver.js:72 callback(null, response.status.volume); ^ TypeError: callback is not a function at C:\Users\Phil\Documents\google home\node_modules\castv2-client\lib\controllers\receiver....
callback is not a function - castv2
javascript|node.js
0
77
1
72,398,745
72,398,745
2
true
2022-05-24T18:18:08.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: callback is not a function - castv2<p>I'm following this <a href="http://siglerdev.us/blog/2021/02/26/google-home-message-broadcast-system-node-js/31" rel="n...
72,310,155
How to match one of two strings as a condition in bash<p>firstly I had very simple script like this</p> <pre><code>#!/bin/sh if cat /etc/redhat-release | grep -q 'AlmaLinux'; then echo &quot;your system is supported&quot; MY SCRIPT HERE else echo &quot;Unsupported OS&quot; exit0; fi </code></pre> <p>and...
<p>Maybe by using a <a href="https://www.cyberciti.biz/faq/grep-regular-expressions/" rel="nofollow noreferrer">regex pattern</a>?</p> <pre><code>#!/bin/sh if cat '/etc/redhat-release' | grep -q -E 'AlmaLinux|RockyLinux 8'; then echo &quot;your system is supported&quot; else echo &quot;Unsupported OS&quot; fi <...
How to match one of two strings as a condition in bash
bash|shell|script
0
77
3
72,310,364
72,310,364
2
true
2022-05-19T19:30:51.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to match one of two strings as a condition in bash<p>firstly I had very simple script like this</p> <pre><code>#!/bin/sh if cat /etc/redhat-release | gre...
72,260,852
How to append dataframes without losing/merging any data in R?<p>I'm relatively new to R so please accept my apologies if this seems obvious/silly question- I have tried googling to no avail.</p> <p>I have two dataframes that I would like to append without merging or losing any data. I hope the below explains what I me...
<p>An option is using the <code>rbind.fill</code> from <code>plyr</code> function like this:</p> <pre><code>df1 &lt;- data.frame(Name = c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;), Value1 = c(1,2,3), Value4 = c(7,3,5)) df2 &lt;- data.frame(Name = c(&quot;A&quot;, &quot;B&quot;, &...
How to append dataframes without losing/merging any data in R?
r|list|dataframe|merge
1
77
2
72,260,970
72,260,970
2
true
2022-05-16T14:29:09.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to append dataframes without losing/merging any data in R?<p>I'm relatively new to R so please accept my apologies if this seems obvious/silly question- ...
72,241,315
Convert std::vector to std::string without \0<p>I want to remove the vowels from a <code>std::string</code> with this code:</p> <pre><code># include &lt;string&gt; #include &lt;vector&gt; bool IsVowel(char c) { return ((c == 'a') || (c == 'A') || (c == 'e') || (c == 'E') || (c == 'i...
<p>As you can see, <code>inProgress</code> always contains <code>str.length()</code> many elements. <code>index</code> tells you the actual number of vowels in there. <code>std::string</code> has <a href="https://en.cppreference.com/w/cpp/string/basic_string/basic_string" rel="nofollow noreferrer">constructors</a> that...
Convert std::vector to std::string without \0
c++
0
77
4
72,241,389
72,241,389
3
true
2022-05-14T14:50:33.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert std::vector to std::string without \0<p>I want to remove the vowels from a <code>std::string</code> with this code:</p> <pre><code># include &lt;stri...
72,307,747
Is it possible to build a max heap from two heap without rebuilding the heap?<p>I recently took my Computer Science exam and there was a question like that.</p> <blockquote> <p>There are two max-heaps (array implemented). You need to come up with an algorithm that merges these two max-heaps and creates a new max-heap (...
<blockquote> <p>Is this algorithm correct?</p> </blockquote> <p>No.</p> <blockquote> <p>can someone gave the refutation data set?</p> </blockquote> <p>Take this input:</p> <ul> <li><p>First Heap: 10, 2, 9</p> <pre><code> 10 / \ 2 9 </code></pre> </li> <li><p>Second Heap: 8, 1, 4</p> <pre><code> 8 / \ ...
Is it possible to build a max heap from two heap without rebuilding the heap?
algorithm|heap|max-heap
2
77
2
72,314,991
72,314,991
3
true
2022-05-19T16:04:12.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to build a max heap from two heap without rebuilding the heap?<p>I recently took my Computer Science exam and there was a question like that.<...
72,337,620
What is the time complexity of following nested dependent loops<pre><code>for(int i = 2; i &lt; N; i ++) for(int j = 1; j &lt; N; j = j * i) sum += 1 </code></pre> <p>I got</p> <p><a href="https://i.stack.imgur.com/3Rvul.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Rvul.gif" alt="time...
<p>Using an algebraic identity about logarithms, logᵢ(N) = log N/log i, so we can take log N out as a factor and the summation is then of 1/log i. Approximating this summation as the integral of 1/log x, we get that asymptotically it is O(N/log N), per <a href="https://en.wikipedia.org/wiki/Logarithmic_integral_functio...
What is the time complexity of following nested dependent loops
algorithm|time-complexity
1
77
1
72,338,786
72,338,786
3
true
2022-05-22T12:34:57.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the time complexity of following nested dependent loops<pre><code>for(int i = 2; i &lt; N; i ++) for(int j = 1; j &lt; N; j = j * i) sum ...
72,400,407
Java Stream API: Modify a specific line in a file<p>I am reading the content of a <code>readme</code> file as a list of strings</p> <p>And I want to modify a specific line of this file (so a specific string of the list).</p> <p>I managed to achieve it, but is there an elegant way to do this with (only) java stream oper...
<p>You wouldn't need Apache commons, I'd suggest using <code>Files.lines</code> of <code>java.nio.file.Files</code>, also you can have the implementation one single method like below</p> <pre><code>import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.uti...
Java Stream API: Modify a specific line in a file
java|java-stream|file-writing
0
77
1
72,400,818
72,400,818
3
true
2022-05-27T04:15:11.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java Stream API: Modify a specific line in a file<p>I am reading the content of a <code>readme</code> file as a list of strings</p> <p>And I want to modify a...
72,246,117
Does modern compilers use copy elision when using the builder pattern<p>I am using a few builder patterns in my code base and I was wondering whether return by value should be favoured over the return by reference, given that is the push I am feeling with modern C++. The example, in my opinion, would generate loads of...
<p>There are many cases where returning by value is favored since it typically side-steps life-time issue. This is not one of those cases because life-time of the builder is usually well defined and well understood. Thus returning by reference should be favored.</p> <p>Also, in C++20 you can use <a href="https://en.cpp...
Does modern compilers use copy elision when using the builder pattern
c++|c++17|builder
1
77
1
72,246,335
72,246,335
3
true
2022-05-15T06:50:37.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does modern compilers use copy elision when using the builder pattern<p>I am using a few builder patterns in my code base and I was wondering whether return ...
72,383,406
Converting a 2D range into a 1D array with spaces in Google Sheets<p>I would like to convert a range/array like this</p> <pre><code>| Fruit | Strawberry | | Fruit | Blueberry | | Fruit | Banana | | Vegetable | Lettuce | | Vegetable | Cucumber | | Vegetable | Carrot | | Vegetable | Celery |...
<p>try:</p> <pre><code>=INDEX(QUERY(FLATTEN(TRANSPOSE(QUERY({A2:B, ROW(A2:A)}, &quot;select max(Col2) group by Col3 pivot Col1&quot;))), &quot;where Col1 is not null&quot;, )) </code></pre> <p><a href="https://i.stack.imgur.com/t4U2L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t4U2L.png" alt="...
Converting a 2D range into a 1D array with spaces in Google Sheets
arrays|google-sheets|filter|flatten|google-query-language
3
77
4
72,384,266
72,384,266
3
true
2022-05-25T19:49:38.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting a 2D range into a 1D array with spaces in Google Sheets<p>I would like to convert a range/array like this</p> <pre><code>| Fruit | Strawberry ...
72,364,268
.map is not a function with react functional component<p>i am trying to convert class component into a functional component , basically displaying all the nft's with map function using dummy data which i have declared. can anyone guide me through this . I've been getting this error .</p> <blockquote> <p>TypeError: nfts...
<p>The error is occurring because you're initialising <code>nfts</code> as zero, and you can't <code>map</code> over an integer.</p> <pre><code>const [nfts, setnfts] = useState(0); </code></pre> <p>Set it to an empty array instead.</p> <pre><code>const [nfts, setnfts] = useState([]); </code></pre> <p>And you should mov...
.map is not a function with react functional component
javascript|reactjs
-1
77
2
72,364,362
72,364,362
3
true
2022-05-24T13:58:25.583Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .map is not a function with react functional component<p>i am trying to convert class component into a functional component , basically displaying all the nf...
72,258,840
Function arguments alignment in C<p>The array in procedure breaking procedure arguments alignment. Having a following code:</p> <pre><code>void _func(unsigned long cnt, int* adr, ...){ char a[1]; printf(&quot;cnt: %p, adr: %p\n&quot;, &amp;cnt, &amp;adr); } int main(void){ _func(0, (int*)1, 2, 3, 4, 5); ...
<p><code>&amp;cnt</code> and <code>&amp;adr</code> are addresses of parameters. Parameters are variables local to the function that are initialized to the argument values passed by the caller. The compiler is not required to use the same space for parameters that is used to pass the arguments.</p> <p>When an argument i...
Function arguments alignment in C
c|function|pointers|arguments|size
0
77
1
72,259,419
72,259,419
4
true
2022-05-16T11:57:57.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function arguments alignment in C<p>The array in procedure breaking procedure arguments alignment. Having a following code:</p> <pre><code>void _func(unsigne...
72,386,190
Is there a way to conditionally set the type of a public data structure?<p>Is there a way to conditionally set a public data structure?</p> <p>For example:</p> <pre><code>MODULE EXAMPLE USE DATA_TYPE_Define, ONLY: DATA_TYPE_A, DATA_TYPE_B USE PARAMETER, ONLY: CaseAisTrue ! Disable all implicit typing I...
<p>I see two options.</p> <ol> <li>Can this change at runtime? Then, the only reason you may need to access the same <code>DATA</code> anywhere else in the code later is because <code>DATA_TYPE_A</code> and <code>DATA_TYPE_B</code> have essentially the same API. This is a typical example object-oriented programming pat...
Is there a way to conditionally set the type of a public data structure?
fortran
1
77
1
72,387,595
72,387,595
4
true
2022-05-26T02:57:19.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to conditionally set the type of a public data structure?<p>Is there a way to conditionally set a public data structure?</p> <p>For example:</...
72,295,715
Sort a list according to the indexes of a string<p>How to make the elements entered in a list have the same index as those of a given word?</p> <p>In this case it is a mystery word chosen at random in a game of hangman.</p> <p>It could look like this (that's just a code portion that I take but the problem is right here...
<p>IIUC, you may want to use some placeholders, e.g. underscores, for the letters that have not been guessed yet. For example:</p> <pre class="lang-py prettyprint-override"><code>import random WORDS = ('Fire', 'Wind', 'Water', 'Earth') word = random.choice(WORDS) letters = ['_' for letter in word] while '_' in letter...
Sort a list according to the indexes of a string
python|python-3.x
-1
77
1
72,295,853
72,295,853
4
true
2022-05-18T20:39:54.930Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort a list according to the indexes of a string<p>How to make the elements entered in a list have the same index as those of a given word?</p> <p>In this ca...
72,310,006
Stacked flat violin ggplot<p>I want to plot a violin ggplot where the x-axis are the years and the y-axis is the value. In each year, I need to have three of the violin plots. When I try to do so, the y-axis are not stacked together, so the density of these three isn't shown clearly. In each year, I want them to be plo...
<p>I can replicate something similar with this fake data:</p> <pre><code>set.seed(42) fake &lt;- data.frame(year = as.character(rep(2010:2021, each = 30)), tenor = rep(c(&quot;1&quot;, &quot;5&quot;, &quot;10&quot;), times = 120), value = rnorm(360, mean = 0.5)) library(Pupillometr...
Stacked flat violin ggplot
r|ggplot2|plot|violin-plot
1
77
1
72,310,234
72,310,234
5
true
2022-05-19T19:16:22.473Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stacked flat violin ggplot<p>I want to plot a violin ggplot where the x-axis are the years and the y-axis is the value. In each year, I need to have three of...
72,265,116
Is it safe to call <math.h> functions by reference?<p>Please, tell me is it safe to call math functions the following way:</p> <pre><code>map&lt;string,double(*)&lt;double&gt; func_map = { {&quot;sin&quot;, &amp;std::sin } ... } ... double arg = 2.9; double res = func_map[&quot;sin&quot;](arg); </code></pre>
<p>Taking the addresses of functions in the standard library not on the <a href="https://en.cppreference.com/w/cpp/language/extending_std#Designated_addressable_functions" rel="nofollow noreferrer"><em>Designated addressable functions</em></a> list leads to unspecified behavior (since at least C++20). <code>std::sin</c...
Is it safe to call <math.h> functions by reference?
c++|function|math|reference
1
77
1
72,265,200
72,265,200
6
true
2022-05-16T20:17:01.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it safe to call <math.h> functions by reference?<p>Please, tell me is it safe to call math functions the following way:</p> <pre><code>map&lt;string,doubl...
72,265,157
how to calculate as many primes as we can in ten seconds using threads in java<p>I just started java and I am trying to learn java as much as possible. I was trying to solve a problem but couldn't get the right solution. I have tried this program according to my own logic, ended in failure. Looking forwards for someone...
<p>I think you are trying to learn to use threads by implementing a function that calculate primies in 10 senconds. In other words, you want to stop the prime number calculation after 10 seconds by multithreading. So you could set a flag in the prime calculation loop to make it stop, and then in another thread make it ...
how to calculate as many primes as we can in ten seconds using threads in java
java|java-threads
0
77
1
72,268,000
72,268,000
-2
true
2022-05-16T20:20:20.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to calculate as many primes as we can in ten seconds using threads in java<p>I just started java and I am trying to learn java as much as possible. I was...
72,336,615
Footer overlaps body section when using 100vh<p>I am doing a portfolio project, and I observed this weird overlapping. I want to have 100vh for the &quot;about-section&quot; (Hey I am Lau). Is there a way to use 100vh without getting footer overlap?</p> <p><a href="https://codepen.io/laurentiucozma12/pen/VwQzmRZ" rel="...
<p>The footer has <code>position:absolute</code>. This will make the navbar overlap the footer since it is just floating at the bottom of the screen instead of actually their like a element that is position: relative;</p> <p>Making sure that the body is at least <code>100vh</code> in height and applying margin-top auto...
Footer overlaps body section when using 100vh
html|css|footer|overlap
-2
77
1
72,336,710
72,336,710
-2
true
2022-05-22T10:14:36.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Footer overlaps body section when using 100vh<p>I am doing a portfolio project, and I observed this weird overlapping. I want to have 100vh for the &quot;abo...
72,839,775
Tkinter Text widget scroll bar doesn't show the first character<p>I am trying to make a horizontal scroll bar for a text widget in tkinter, it works but when the text is long, it starts not showing some parts of the first character untill it's totally disappeared.</p> <p><a href="https://i.stack.imgur.com/3CnXG.png" re...
<p>I changed <code>root.resizable(280, 20)</code>, try this:</p> <pre><code>from tkinter import* root = Tk() root.resizable(280, 20) root.title(&quot;Scrollbar Widget Example&quot;) scrollbar = Scrollbar(root, orient='horizontal') scrollbar.pack(side=BOTTOM, fill=X) text = Text(root, font=(&quot;Calibri&quot;, 40), ...
Tkinter Text widget scroll bar doesn't show the first character
python|tkinter|scrollbar
-1
77
1
72,840,353
72,840,353
1
true
2022-07-02T14:20:57.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tkinter Text widget scroll bar doesn't show the first character<p>I am trying to make a horizontal scroll bar for a text widget in tkinter, it works but when...
72,988,141
Trying to position the hamburger icon for a responsive menu<p>I'm trying to create a responsive menu where the hamburger icon pops up under 640px width screen -- the menu mostly works but I cannot figure out how to get my menu items &quot;About,&quot; &quot;Work,&quot; and &quot;Resume&quot; to appear beneath the hambu...
<p>For the items to appear &quot;below&quot; the hamburger icon, it helps to have both the icon and the menu items inside the same div.</p> <p>I changed the icon to be a bit more up ↑ in your html.</p> <p>I also modified the way your header Bar was working abit. Mostly by removing the header bar width of 100% (which me...
Trying to position the hamburger icon for a responsive menu
html|css|responsive|hamburger-menu
1
77
1
72,991,186
72,991,186
1
true
2022-07-15T01:20:33.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to position the hamburger icon for a responsive menu<p>I'm trying to create a responsive menu where the hamburger icon pops up under 640px width scree...
72,956,450
pandas - ranking with tolerance?<p>Is there a way to rank values in a dataframe but considering a tolerance?</p> <p>Say I have the following values</p> <pre><code>ex = pd.Series([16.52,19.95,16.15,22.77,20.53,19.96]) </code></pre> <p>and if I ran rank:</p> <pre><code>ex.rank(method='average') 0 2.0 1 3.0 2 ...
<p>This function may works:</p> <pre><code>def rank_with_tolerance(sr, tolerance=0.01+1e-10, method='average'): vals = pd.Series(sr.unique()).sort_values() vals.index = vals vals = vals.mask(vals - vals.shift(1) &lt;= tolerance, vals.shift(1)) return sr.map(vals).fillna(sr).rank(method=method)...
pandas - ranking with tolerance?
python|pandas|rank
1
77
3
72,957,060
72,957,060
1
true
2022-07-12T17:47:53.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas - ranking with tolerance?<p>Is there a way to rank values in a dataframe but considering a tolerance?</p> <p>Say I have the following values</p> <pre>...
72,775,921
How to resize image in swift picker menu style<p>I want to use a image beside some text in my picker, but image is scaled up and I can't resize it with .resizable .frame and ... . How can i fix this problem? I use both svg and png format and neither of those don't working properly.</p> <p>I using image from asset</p> ...
<p>You can use <code>Menu</code> for this purpose:</p> <pre><code>struct ContentView: View { @State var array = [&quot;one&quot;, &quot;two&quot;, &quot;three&quot;, &quot;four&quot;] @State var selection: String = &quot;one&quot; var body: some View { Menu(content: { Picker(&quot;Select...
How to resize image in swift picker menu style
swift|image|svg|swiftui|picker
1
77
2
72,776,258
72,776,258
1
true
2022-06-27T17:09:39.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to resize image in swift picker menu style<p>I want to use a image beside some text in my picker, but image is scaled up and I can't resize it with .resi...
72,990,935
Grafana: How to use the selected range of time in a query?<p>I'm using Grafana with <a href="https://marcus.se.net/grafana-json-datasource/" rel="nofollow noreferrer">JSON API data source</a> and I'd like to build a query that depends on the selected period of time selected in the upper right corner of the screen.</p> ...
<p>You can use the <a href="https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables" rel="nofollow noreferrer">global variables</a> $__from and $__to. As explained in the <a href="https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables/#__from-and-__to" rel="nofollow ...
Grafana: How to use the selected range of time in a query?
python|json|api|grafana|timeserieschart
0
77
1
72,991,210
72,991,210
1
true
2022-07-15T08:09:37.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Grafana: How to use the selected range of time in a query?<p>I'm using Grafana with <a href="https://marcus.se.net/grafana-json-datasource/" rel="nofollow no...
72,959,484
I get an error in a downloaded project using typescript, mui and formik<p>I downloaded a project from this site: <a href="https://codesandbox.io/s/gn692" rel="nofollow noreferrer">https://codesandbox.io/s/gn692</a> I was getting some errors, that I didn't know how to resolve, so I downloaded this to see how its done. I...
<p>Your code is <strong>not</strong> the same as the linked sandbox. Specifically, you have changed the dependencies. The sandbox uses the old <code>@material-ui</code>:</p> <pre><code>import { TextFieldProps, TextField } from '@material-ui/core' </code></pre> <p>but you are using the new <code>@mui</code>:</p> <pre><c...
I get an error in a downloaded project using typescript, mui and formik
reactjs|typescript|material-ui|formik
0
77
1
72,959,693
72,959,693
1
true
2022-07-12T23:51:40.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I get an error in a downloaded project using typescript, mui and formik<p>I downloaded a project from this site: <a href="https://codesandbox.io/s/gn692" rel...
72,904,336
helm upgrade: Error: could not find a ready tiller pod<p>I'm new to EKS, Helm, and tiller. I am looking into why our build is breaking for our cluster deployment. I'm getting the error <code> Error: could not find a ready tiller pod</code> when running helm upgrade. I see a lot of threads with this problem, but I want ...
<p>If you specify the <code>--client-only</code> flag, the <code>tiller</code> server is never started in the cluster. Hence your problem. You can remove the flag and it should work.</p> <p>See <a href="https://v2.helm.sh/docs/helm/#options-16" rel="nofollow noreferrer">the docs</a> for more details.</p> <p>Update: Bas...
helm upgrade: Error: could not find a ready tiller pod
kubernetes|kubernetes-helm|amazon-eks
0
77
1
72,904,658
72,904,658
1
true
2022-07-07T21:18:07.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: helm upgrade: Error: could not find a ready tiller pod<p>I'm new to EKS, Helm, and tiller. I am looking into why our build is breaking for our cluster deploy...
72,832,485
Error in gsub("\n", br(), a, fixed = TRUE)<p>I'm trying to use ggplot to create a scatter plot of player data with a pop up that includes the players name. The data is from <a href="https://www.basketball-reference.com/leagues/NBA_2022_per_game.html" rel="nofollow noreferrer">here</a>. My code is below.</p> <pre><code>...
<p>I'm not sure what caused your error, but I went to your data source link and selected the &quot;Get table as CSV (for Excel)&quot; option from &quot;Share &amp; Export&quot;. I highlighted all the resulting table text, and copied to excel. I then did &quot;Text to columns&quot; and split the data by the comma delimi...
Error in gsub("\n", br(), a, fixed = TRUE)
r|ggplot2|popup|r-plotly|ggplotly
3
77
1
72,832,766
72,832,766
1
true
2022-07-01T16:55:58.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in gsub("\n", br(), a, fixed = TRUE)<p>I'm trying to use ggplot to create a scatter plot of player data with a pop up that includes the players name. T...
73,015,329
Aggregate a dataframe column based on a hierarichal condition from another column<p>I have an interesting problem and thought I will share it here for everyone. Let's assume we have a pandas DataFrame like this (dummy data):</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Category</th> <th>...
<p>Very tricky question especially with the structure of your data(because your grouper which is really the parts &quot;A,B&quot;, &quot;X,Y&quot;, etc. are not in a separate column. But I think you can do:</p> <pre><code>df.sort_values(by='Samples', inplace=True, ignore_index=True) #grouper containing groupby keys ['A...
Aggregate a dataframe column based on a hierarichal condition from another column
python|pandas|dataframe|data-manipulation
2
77
1
73,016,873
73,016,873
1
true
2022-07-17T21:01:46.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregate a dataframe column based on a hierarichal condition from another column<p>I have an interesting problem and thought I will share it here for everyo...
72,792,315
ggplot - Manually Rearrange Order of X-Axis Levels<p>I have <em>technically</em> seen answers to this question several times looking through SO, but my situation is a bit of a special case. I am trying to create a line plot for means of 8 variables:</p> <pre><code> &gt; reshape2::melt(CON_FCCFCNC_summary) No id vari...
<p>If I understand you correctly, you want to compare the FCC and FCNC points within each object type. In which case, it would be better to separate the object type into its own variable and FCC/FCNC into a different variable, since conceptually these <em>are</em> two different variables. To plot this, I might do somet...
ggplot - Manually Rearrange Order of X-Axis Levels
r|ggplot2
0
77
2
72,792,482
72,792,482
2
true
2022-06-28T19:43:49.550Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ggplot - Manually Rearrange Order of X-Axis Levels<p>I have <em>technically</em> seen answers to this question several times looking through SO, but my situa...
72,799,645
Why "=" in where clause, not match exact string (including spaces and special characters)?<p>Why &quot;=&quot; in where clause, not match exact string (including spaces and special characters).</p> <p>In this query I applied '$' Symbol for filtering repeated data on Data Table and null treated as empty strings. This qu...
<p>The problem is the <code>FORMAT(''where %I=''''%I'''' ''</code> part. The second %I isn't an identifier, but a literal for which you should use %L without the enclosing '.</p>
Why "=" in where clause, not match exact string (including spaces and special characters)?
sql|database|postgresql|row|where-clause
2
77
1
72,801,477
72,801,477
2
true
2022-06-29T10:14:43.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why "=" in where clause, not match exact string (including spaces and special characters)?<p>Why &quot;=&quot; in where clause, not match exact string (inclu...
72,821,557
How to access to a store into array of stores? Using Svelte<p>I'm using <a href="https://chainlist.github.io/svelte-forms/" rel="nofollow noreferrer">svelte-forms</a> and need to make an array of <a href="https://chainlist.github.io/svelte-forms/#field" rel="nofollow noreferrer">fields</a></p> <blockquote> <p>field() r...
<p>You can create a new top level scope by extracting the content of the each to a separate component. That way accessing the store will work as expected. E.g.</p> <pre class="lang-html prettyprint-override"><code>{#each fields as field} &lt;Sub {field} /&gt; {/each} </code></pre> <pre class="lang-html prettyprint-o...
How to access to a store into array of stores? Using Svelte
typescript|svelte|sveltekit|svelte-component|svelte-store
1
77
1
72,822,243
72,822,243
2
true
2022-06-30T20:18:08.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access to a store into array of stores? Using Svelte<p>I'm using <a href="https://chainlist.github.io/svelte-forms/" rel="nofollow noreferrer">svelte-...
72,844,324
How can i unmount a functional component from DOM on click of a Button<p>I would like to &quot;Unmount a simple Functional Component&quot; from the DOM. I searched a lot and saw most of the tutorials are based on Class Components and I did'nt see any simple example on it. My requirement is Unmounting a Functional compo...
<p>If you want to unmount a component then you can use conditional rendering where you can declare state in parent component and based on the state you can mount or unmount component as:</p> <p>This is the parent component from where you want to <code>mount</code> or <code>unmount</code></p> <p><a href="https://codesan...
How can i unmount a functional component from DOM on click of a Button
reactjs|functional-programming|components|unmount
-1
77
2
72,844,402
72,844,402
2
true
2022-07-03T06:21:30.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i unmount a functional component from DOM on click of a Button<p>I would like to &quot;Unmount a simple Functional Component&quot; from the DOM. I se...
72,844,221
Pandoc Lua : how to add a markdown block around a header without losing the markdown syntax #<p>I am trying to add a div around a markdown header in a Lua filter, but the # in front of the title disappear in the output.</p> <pre><code>Header = function(el) if el.level == 1 then local content = el.content ...
<p>The <code>content</code> field contains the heading text, but the heading itself is the <code>el</code> element that's not returned. Returning it together with the raw blocks should work though:</p> <pre class="lang-lua prettyprint-override"><code>return { pre, el, post } </code></pre> <p>Or use a Div element:</p>...
Pandoc Lua : how to add a markdown block around a header without losing the markdown syntax #
lua|pandoc
1
77
1
72,844,790
72,844,790
2
true
2022-07-03T05:58:52.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandoc Lua : how to add a markdown block around a header without losing the markdown syntax #<p>I am trying to add a div around a markdown header in a Lua fi...
72,789,194
Can't find the `I18n` widget up in the tree. Please make sure to wrap some ancestor widget with `I18n`<p>I try to change language after press button. I succes to change after app reboot, but I don't success to reload page after press button. I have this error.</p> <pre><code> Can't find the `I18n` widget up in the tre...
<p>@Nitneuq The problem is because the I18n widget is not there in the widget tree in which your page is. you should move your I18n widget at the top of the widget tree as suggested here:</p> <p><a href="https://github.com/marcglasberg/i18n_extension/issues/10#issuecomment-594716633" rel="nofollow noreferrer">https://g...
Can't find the `I18n` widget up in the tree. Please make sure to wrap some ancestor widget with `I18n`
flutter
1
77
1
72,845,884
72,845,884
2
true
2022-06-28T15:23:43.573Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't find the `I18n` widget up in the tree. Please make sure to wrap some ancestor widget with `I18n`<p>I try to change language after press button. I succe...
72,866,819
Configuring functionResponseType in typescript serverless template<p>I am trying to configure <code>functionResponseType</code> in a TypeScript Serverless framework template (in order to make use of partial batch responses).</p> <p>This is my event declaration for the function in question:</p> <pre><code> events: [ ...
<p>You can use <code>&quot;ReportBatchItemFailures&quot; as const</code> to make it type safe</p>
Configuring functionResponseType in typescript serverless template
typescript|amazon-sqs|serverless-framework
0
77
1
72,867,896
72,867,896
2
true
2022-07-05T09:11:46.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Configuring functionResponseType in typescript serverless template<p>I am trying to configure <code>functionResponseType</code> in a TypeScript Serverless fr...
72,868,510
Scala seems to require 'return' keyword for recursive functions<p>I'm new to Scala and know that the 'return' keyword is redundant. However, when writing a recursive function, the control doesn't return from a call stack when the desired condition is met if the 'return' keyword is missing.</p> <p>Below is a code to che...
<p>As currently implemented, <code>parenBalanceRecur()</code> has 3 top-level <code>if</code> expressions, they each evaluate to a boolean value, but the rule in scala is that only the last expression of the function is the return value of the function =&gt; the first two are simply ignored.</p> <p>=&gt; in your second...
Scala seems to require 'return' keyword for recursive functions
scala|recursion
1
77
3
72,872,212
72,872,212
2
true
2022-07-05T11:16:46.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scala seems to require 'return' keyword for recursive functions<p>I'm new to Scala and know that the 'return' keyword is redundant. However, when writing a r...
72,877,137
Count occurrences of a string character in an array<pre><code>int count(char letter, int* array, int number) { int sum= 0; int i; for(i = 0; i &lt; number; ++i) { if(array[i] == letter) ++sum; } return sum; } int main(){ char array[] = { 'A','B','B','C'}; int number=...
<p>I did a bit of tweaking of your code so that the parameters in your function align with the parameters passed when your function is called. Following is an example of what your code might look like in order to count characters.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; int count(char letter...
Count occurrences of a string character in an array
c
0
77
1
72,877,341
72,877,341
2
true
2022-07-06T01:50:38.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count occurrences of a string character in an array<pre><code>int count(char letter, int* array, int number) { int sum= 0; int i; for(i = 0; i &l...
72,894,547
Are globals considered statements?<p>This might be a simple question, but are globals, and anything written outside of a function (structs, enums, functions...), considered statements? If so, are all of them statements, or only some of them?</p>
<p>In the formal C grammar, a <em>translation-unit</em>, which is the sequence of tokens resulting from reading one source file and applying “preprocessing” to it (including macro replacement and inclusion of files via <code>#include</code>), consists of <em>function-definition</em> and <em>declaration</em> items. Thes...
Are globals considered statements?
c|global
3
77
1
72,896,232
72,896,232
2
true
2022-07-07T08:25:22.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are globals considered statements?<p>This might be a simple question, but are globals, and anything written outside of a function (structs, enums, functions....
72,912,540
How can I add progress bar to my github action<p>I am writing some GitHub actions for my project and I would like to have the orange progress bar to track the progress of my action.</p> <p><a href="https://i.stack.imgur.com/KDsWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KDsWm.png" alt="example...
<p>The progress bar is shown on jobs that define the <a href="https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#using-an-environment" rel="nofollow noreferrer">attribute <code>environment</code></a></p> <p>Here's an example of how to use it:</p> <pre class=...
How can I add progress bar to my github action
github|github-actions
0
77
2
72,913,299
72,913,299
2
true
2022-07-08T13:59:12.120Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I add progress bar to my github action<p>I am writing some GitHub actions for my project and I would like to have the orange progress bar to track th...
72,932,303
react-animarker highlight not updating with state change<p>I have some text that I want to simply highlight using a simple react package called 'react-animarker'. I have tried to use useState hook as I want to dynamically update the speed of the animation as shown. However, the duration does not change the way I want i...
<p>After taking a look at the library you are using, I found a solution:</p> <p>For some reason, React does not see any state change with the <code>&lt;Mark&gt;</code> component when the <code>duration</code> property changes, therefore, React does not force a refresh of the component. If you add a <code>key</code> pr...
react-animarker highlight not updating with state change
javascript|reactjs|react-hooks|use-state
3
77
1
72,933,399
72,933,399
2
true
2022-07-10T22:34:38.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react-animarker highlight not updating with state change<p>I have some text that I want to simply highlight using a simple react package called 'react-animar...
72,955,976
Ignore case with multiple strings using str_detect in R<p>I'm trying to use an &quot;or&quot; statement using <code>ignore_case</code> with <code>str_detect</code>. I want to convert everything that contains &quot;ag&quot; to &quot;Agricultural&quot; and everything that contains &quot;field&quot; to &quot;Agricultural&...
<p>A possible solution would be to bring everything to lower case and match that with <code>ag|field</code>.</p> <pre><code>dat %&gt;% mutate(Class_2 = case_when( str_detect(string = str_to_lower(Class), pattern = &quot;ag|field&quot;) ~ &quot;Agricultural&quot;, TRUE ~ Class )) # A tibble: ...
Ignore case with multiple strings using str_detect in R
r|dplyr|tidyverse|stringr
0
77
3
72,956,058
72,956,058
2
true
2022-07-12T17:05:04.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ignore case with multiple strings using str_detect in R<p>I'm trying to use an &quot;or&quot; statement using <code>ignore_case</code> with <code>str_detect<...
72,956,597
Why is the values()-method in an enum static and implicit, and not defined as native?<p>This question is similar to <a href="https://stackoverflow.com/questions/15452703/why-the-static-methods-values-and-valueof-in-enum-are-added-by-the-compiler">this</a> one, but I'm not satisfied with its answer. Why is the values()-...
<p>It has to be <code>static</code>: Because... that's the point of the method. Given an enum <em>type</em>, let's say <code>CardSuit</code>, you'd want to invoke <code>CardSuit.values()</code>, not <code>CardSuit.SPADES.values()</code>, that makes no sense.</p> <p>It cannot be <code>native</code>: <code>native</code>,...
Why is the values()-method in an enum static and implicit, and not defined as native?
java
4
77
2
72,957,325
72,957,325
2
true
2022-07-12T18:01:05.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is the values()-method in an enum static and implicit, and not defined as native?<p>This question is similar to <a href="https://stackoverflow.com/questi...
72,982,514
PHP Google API - login without phisical user?<p>I have to use my google account for gmail and drive services. For drive services now i am using an service account but i cant find any possibility for send emails by service account. Can i login to my account by google api php only using code? I have registered in db my t...
<p><a href="https://developers.google.com/gmail/api/guides/delegate_settings" rel="nofollow noreferrer">Gmail api does support service accounts</a>, the only issue is that it only works with google workspace gmail accounts, you need to set up <a href="https://developers.google.com/admin-sdk/directory/v1/guides/delegati...
PHP Google API - login without phisical user?
php|google-api|gmail-api|google-api-php-client|service-accounts
1
77
1
72,983,515
72,983,515
2
true
2022-07-14T14:50:31.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Google API - login without phisical user?<p>I have to use my google account for gmail and drive services. For drive services now i am using an service ac...
72,971,904
Creating a function in Coldfusion to dynamically convert a multidimensional array to a query object<p>The problem I'm running into is the API I'm using for this particular project uses periods in the keys which is not allowed in query column names. So I need to figure out a way to rename the array keys to remove the pe...
<pre><code>&lt;cfset varResults = '[{&quot;roW_NUMBER&quot;:1,&quot;membership.Individual.LocalID&quot;:999,&quot;membership.Individual.FirstName&quot;:&quot;AA&quot;,&quot;membership.Individual.LastName&quot;:&quot;AA&quot;,&quot;membership.Individual.Company&quot;:null,&quot;membership.Individual.Work_Address_Line1&q...
Creating a function in Coldfusion to dynamically convert a multidimensional array to a query object
multidimensional-array|coldfusion
2
77
1
72,987,274
72,987,274
2
true
2022-07-13T19:53:40.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a function in Coldfusion to dynamically convert a multidimensional array to a query object<p>The problem I'm running into is the API I'm using for t...
72,993,414
What is universally unique identifier (UUID)? In swift<p>What is UUID (universally unique identifier) in swift . I looked at apple documents but I still don't understand what we use for how we use it and what is the use</p> <p>Thanks.</p>
<p>A UUID is a universally unique identifier, which means if you generate a UUID right now using UUID it's guaranteed to be unique across all devices in the world. This means it's a great way to generate a unique identifier for users, for files, or anything else you need to reference individually – guaranteed.</p> <p>H...
What is universally unique identifier (UUID)? In swift
swift
-4
77
1
72,993,587
72,993,587
2
true
2022-07-15T11:40:02.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is universally unique identifier (UUID)? In swift<p>What is UUID (universally unique identifier) in swift . I looked at apple documents but I still don'...
73,001,393
Use async await in forEach loop, node js<p>I had a problem when I tried to use <code>forEach</code> that contained <code>await</code> inside the loop, so I need to define the <code>async</code> in front of the <code>forEach</code> loop and it returned the error.</p> <pre><code>exports.filterAverageRatingsEachSkillForSt...
<p><code>.forEach()</code> is not async-aware. Use a plain <code>for/of</code> loop instead. In fact, pretty much stop using <code>.forEach()</code> entirely these days as its basically obsolete. With block scope available now with <code>let</code> and <code>const</code>, there is no reason to use <code>.forEach()</...
Use async await in forEach loop, node js
node.js|mongodb|express|mongoose|async-await
0
77
2
73,001,435
73,001,435
2
true
2022-07-16T03:55:21.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use async await in forEach loop, node js<p>I had a problem when I tried to use <code>forEach</code> that contained <code>await</code> inside the loop, so I n...
73,007,914
What data type to use for ratings in PostgreSQL<p>I am making a table right now, and I'm confused about what to use, because I used to use <code>smallint(6)</code> but it doesn't work in PostgreSQL.</p>
<p>If the column can only have integer values between 1 and 5 you can use a <code>SMALLINT</code> for it with a <code>CHECK</code> constraint.</p> <p>For example:</p> <pre><code>create table review ( rating smallint not null check (rating between 1 and 5) ); </code></pre> <p>The <code>NOT NULL</code> constraint ensur...
What data type to use for ratings in PostgreSQL
sql|spring|postgresql
0
77
1
73,007,982
73,007,982
2
true
2022-07-16T22:01:34.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What data type to use for ratings in PostgreSQL<p>I am making a table right now, and I'm confused about what to use, because I used to use <code>smallint(6)<...
73,010,388
Why does this custom function cost too much time while backward in pytorch?<p>I'm revising a baseline method in pytorch. But when I add a custom function in the training phase, the cost time of backward increases 4x on a single V100. Here is an example of the custom function:</p> <pre><code>def batch_function(M, kernel...
<p>You might be able to get a performance boost on the double tensor multiplication by using <code>torch.einsum</code>:</p> <pre><code>&gt;&gt;&gt; o = torch.einsum('acdefg,bshigj,kldejm-&gt;bsdefm', ZZ_t, INV_SIGMA, ZZ) </code></pre> <p>The resulting tensor <code>o</code> will be shaped <code>(b, h*w, k, k, 1, 1)</cod...
Why does this custom function cost too much time while backward in pytorch?
python|pytorch
1
77
2
73,023,634
73,023,634
2
true
2022-07-17T08:46:12.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does this custom function cost too much time while backward in pytorch?<p>I'm revising a baseline method in pytorch. But when I add a custom function in ...
72,944,963
Get the complete info of a Wikidata item<p>I'm using the following query to get the info of a specific Wikidata item.</p> <p>For example, this one gets the info about the movie Titanic</p> <pre><code>SELECT ?wd ?wdLabel ?ps ?ps_Label ?wdpqLabel ?pq_Label { VALUES (?film) {(wd:Q44578)} ?film ?p ?statement . ?statement ...
<p>You could add <code>?ps_</code> to the <code>SELECT</code>:</p> <pre><code>SELECT ?wd ?wdLabel ?ps ?ps_Label ?ps_ ?wdpqLabel ?pq_Label </code></pre> <p>Result: <a href="https://i.stack.imgur.com/1IrGh.png" rel="nofollow noreferrer">Screenshot</a></p>
Get the complete info of a Wikidata item
wikidata|wikidata-query-service
1
77
1
73,048,372
73,048,372
2
true
2022-07-11T21:44:19.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the complete info of a Wikidata item<p>I'm using the following query to get the info of a specific Wikidata item.</p> <p>For example, this one gets the i...
72,948,876
Firebase Remote Config - Cannot create conditions on the console<p>I've created a project in Firebase and have added apps to it, but on the Remote Config screen, I don't see the expected <strong>Conditions</strong> tab next to the Parameters tab and also I am getting a message <strong>&quot;You've already provided a va...
<p>You have to create a personalisation first.</p> <p><a href="https://i.stack.imgur.com/yiqBf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yiqBf.png" alt="enter image description here" /></a></p> <p>Fill out create personalisation form then create a new condition.</p> <p><a href="https://i.stack....
Firebase Remote Config - Cannot create conditions on the console
firebase-remote-config
1
77
1
73,165,268
73,165,268
2
true
2022-07-12T07:59:37.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase Remote Config - Cannot create conditions on the console<p>I've created a project in Firebase and have added apps to it, but on the Remote Config scr...
73,023,962
How to show only avg and max values in labels on Y axis using MPAndroidChart?<p>I have graph which show speed value on Y axis. I want to show exactly 2 values: avg value (i. e. middle value label) and max value. I'm using <code>YAxis.setLabelCount(2)</code> to set only two labels on Axis. But graph always showing me mi...
<p>YAxis.setLabelCount(2, true) there is another paramerter called force, by set it as true, the axis will have the exactly number as label count you set.</p> <p>Updated July 19th: To display label on special value, the ValueFormatter can be invoked, and the entries labels can be changed manually. It's better to change...
How to show only avg and max values in labels on Y axis using MPAndroidChart?
android|kotlin|mpandroidchart
1
77
1
73,031,070
73,031,070
2
true
2022-07-18T14:26:38.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show only avg and max values in labels on Y axis using MPAndroidChart?<p>I have graph which show speed value on Y axis. I want to show exactly 2 value...
72,950,157
How to loop over Ansible variable names<p>I'd like to find all variables with the <code>myvar_</code> prefix and make a shell script that uses their names and contents.</p> <pre class="lang-yaml prettyprint-override"><code>--- - set_fact: myvar_a: &quot;a&quot; myvar_b: &quot;b&quot; myvar_c: &quot;c&quot; - ...
<p>This happens because the lookup return you a comma separated list of variable names, not a list.</p> <p>As demonstrated by the task:</p> <pre class="lang-yaml prettyprint-override"><code>- debug: var: lookup('ansible.builtin.varnames', '^myvar_.+') vars: myvar_a: a myvar_b: b myvar_c: c </code></pr...
How to loop over Ansible variable names
ansible|jinja2
2
77
1
72,950,396
72,950,396
2
true
2022-07-12T09:37:54.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to loop over Ansible variable names<p>I'd like to find all variables with the <code>myvar_</code> prefix and make a shell script that uses their names an...
72,805,009
Removing duplicates from list of dicts throws Exception?<p>I have the following list in python:</p> <pre><code>[('admin', '', {'type': 'telnet'}), ('admin', '', {'type': 'telnet'})] </code></pre> <p>Where I'm trying to remove duplicates (something is considered duplicate if it's <strong>100%</strong> the same) so I wro...
<p>The issue is that <code>dict.fromkeys</code> uses the elements of the list as the keys of the resultant dictionary. All keys of a dictionary must be hashable. Your list contains tuples. Tuples are hashable if and only if all of their elements are hashable. Dictionaries, which your tuples contain, are not hashabl...
Removing duplicates from list of dicts throws Exception?
python|dictionary
2
77
5
72,805,077
72,805,077
2
true
2022-06-29T16:40:02.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing duplicates from list of dicts throws Exception?<p>I have the following list in python:</p> <pre><code>[('admin', '', {'type': 'telnet'}), ('admin', ...
72,786,969
How to bind WPF window title to a viewmodel property and to a static resource property?<p>In my WPF application, I have a window whose title is a 2 word string. First word, i need to bind to a ViewModel property and second word, I need to get from resource file as i need to apply localization to that word.</p> <p>I am ...
<p>You can set a <code>MultiBinding</code> like that.</p> <pre><code>&lt;Window ...&gt; &lt;Window.Title&gt; &lt;MultiBinding StringFormat=&quot; {0} {1}&quot;&gt; &lt;Binding Path=&quot;ViewModelProperty&quot;/&gt; &lt;Binding Source=&quot;{x:Static local:YourStaticProperty}&quot;/&gt; ...
How to bind WPF window title to a viewmodel property and to a static resource property?
c#|wpf|xaml|mvvm
-1
77
1
72,787,188
72,787,188
2
true
2022-06-28T13:04:26.823Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bind WPF window title to a viewmodel property and to a static resource property?<p>In my WPF application, I have a window whose title is a 2 word stri...
72,930,890
Cannot find an overload for "ToLookup" and the argument count: "2" LINQ<p>I have a PowerShell script that runs every hour, it essentially updates product info through a drip process. The script is failing in the dev environment, but continues to work in prod and qual. The failure point is at a line that uses LINQ. Here...
<p>Even though the error doesn't give much details, from your currently reproducible code we can tell that the issue is because <code>$productInfos</code> is a single object of the type <a href="https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.psobject?view=powershellsdk-7.0.0" rel="nofollow nor...
Cannot find an overload for "ToLookup" and the argument count: "2" LINQ
powershell|linq
2
77
2
72,933,506
72,933,506
2
true
2022-07-10T18:24:59.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot find an overload for "ToLookup" and the argument count: "2" LINQ<p>I have a PowerShell script that runs every hour, it essentially updates product inf...
72,999,912
How to count() and aggregate values without using group by?<p>I'm having trouble obtaining data and categorizing it within a select without filtering it through the group by clause.</p> <p>I have a table populated with the results of a customer satisfaction poll, which includes the office at which the client was served...
<pre><code>with breakout as ( select service, office, count(case when score between 0 and 6 then 1 end) as qty_detractors, count(case when score between 7 and 8 then 1 end) as qty_passives, count(case when score between 9 and 10 then 1 end) as qty_promoters, count(*) as qty_answers...
How to count() and aggregate values without using group by?
sql|sql-server
1
77
2
73,000,165
73,000,165
2
true
2022-07-15T21:51:47.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count() and aggregate values without using group by?<p>I'm having trouble obtaining data and categorizing it within a select without filtering it thro...
72,911,298
Null safety in Kotlin for MutableMap with MutableList<p>I am trying to run this example</p> <pre><code>fun main() { val mlist: MutableList&lt;String&gt; = mutableListOf&lt;String&gt;() val mapp: MutableMap&lt;Int, MutableList&lt;String&gt;&gt; = mutableMapOf(1 to mlist) println(mapp) mapp[1].add(&quot;a...
<p>in mutableMap, value can be added or removed, the compiler has no guarantee that the value is still present or has been changed before accessing the value in mutableMap types</p>
Null safety in Kotlin for MutableMap with MutableList
kotlin|kotlin-null-safety
1
77
2
72,911,554
72,911,554
2
true
2022-07-08T12:17:29.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Null safety in Kotlin for MutableMap with MutableList<p>I am trying to run this example</p> <pre><code>fun main() { val mlist: MutableList&lt;String&gt; ...
72,831,917
data.table fread, how to read in csv file last N rows<p>Hі! Can someone show on the example of iris.csv how to load the last 10 rows with the <code>fread</code> function from the <code>data.table</code> thanks</p> <p>udp=====</p> <pre><code>write.csv(iris,&quot;C:\\Users\\TARAS\\Desktop\\iris.csv&quot;) data.table::fr...
<p>You can have <code>fread</code> read the last n rows of a .csv using <code>cmd</code> param</p> <pre><code>fread(cmd=&quot;tail -10 iris.csv&quot;) </code></pre> <p>If you want the header information also, you can wrap the above in a call to <code>data.table::setnames</code>, where the names are obtained by reading ...
data.table fread, how to read in csv file last N rows
r|csv|data.table|fread
0
77
1
72,832,201
72,832,201
2
true
2022-07-01T16:02:05.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: data.table fread, how to read in csv file last N rows<p>Hі! Can someone show on the example of iris.csv how to load the last 10 rows with the <code>fread</c...
72,772,045
use short hash of the current git commit in a makefile<p>I have the following problem: I have a makefile that compiles a C Project and generates a .hex file. I am using Git for the source files Unfortunately the makefile generates an app.hex file, so I would like to add in the makefile a new clause that will generate a...
<p>This problem pops up regularly with <code>make</code>. Recipe lines are executed line by line, each in a separate shell process, which means that you can't simply instantiate shell variables and use them a few lines down, as they are disposed with the shell process immediately at line end. You have two options, #1 i...
use short hash of the current git commit in a makefile
git|makefile|hash
0
77
1
72,772,749
72,772,749
2
true
2022-06-27T12:22:34.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: use short hash of the current git commit in a makefile<p>I have the following problem: I have a makefile that compiles a C Project and generates a .hex file....
73,023,037
How to check if non-nullable object is not null?<p>I need to write validation method that validates if non-nullable/nullable object is valid.</p> <p>For example:</p> <pre><code>public void Example() { object obj = null; //Can't be null. object? obj2 = null; //Can be null. object obj3 = new(); //Can't be nul...
<p>You simply write it is such:</p> <pre><code>public bool ObjIsValid(object obj) =&gt; obj is not null; </code></pre> <p>In other words, I wouldn't consider whether the original type was nullable or not at all. <a href="https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references" rel="nofollow noreferrer">Nulla...
How to check if non-nullable object is not null?
c#|.net
0
77
1
73,023,391
73,023,391
2
true
2022-07-18T13:24:02.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if non-nullable object is not null?<p>I need to write validation method that validates if non-nullable/nullable object is valid.</p> <p>For exam...
72,978,522
How to prevent asyncio.Task from being cancelled<p>I am implementing graceful shutdown that needs to wait for certain tasks to finish execution before shutting down the application. I am waiting for tasks using <code>asyncio.gather(*asyncio.Task.all_tasks())</code> in the shutdown handler.</p> <p>The problem I have how...
<p><em>Note:</em> <code>asyncio.Task.all_tasks()</code> is <a href="https://docs.python.org/3/whatsnew/3.7.html#whatsnew37-asyncio-deprecated" rel="nofollow noreferrer">depricated</a>, will refer it as <code>asyncio.all_tasks()</code> instead.</p> <hr /> <h2>TL;DR Demo code</h2> <p>Different solutions per os type.</p> ...
How to prevent asyncio.Task from being cancelled
python|python-asyncio|aiohttp
0
77
1
72,999,861
72,999,861
2
true
2022-07-14T09:46:48.627Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prevent asyncio.Task from being cancelled<p>I am implementing graceful shutdown that needs to wait for certain tasks to finish execution before shutti...
72,881,349
how do i add a number limit in an input field?<p>How can i have a number limit? im trying to make it so that you can only type the number 1-100 in &quot;app-benutzer&quot; and 1-15 in &quot;backend-benutzer&quot; also is there a way to display these numbers in the input field without typing them so it would show the us...
<p>You can achieve this only by using HTML.</p> <p>This way, you can't really write anything more than what you specify in your terms.</p> <p><strong>Clarification:</strong></p> <p><code>Placeholder</code> is the attribute that you use to put some text inside of your input field, but that text will disappear as soon as...
how do i add a number limit in an input field?
javascript|html
1
77
2
72,881,580
72,881,580
2
true
2022-07-06T09:49:35.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do i add a number limit in an input field?<p>How can i have a number limit? im trying to make it so that you can only type the number 1-100 in &quot;app-...
73,016,028
SAS: how to load a text file with a lot of spaces in between columns<p>I have a text file downloaded from the <a href="https://download.bls.gov/pub/time.series/la/la.data.2.AllStatesU" rel="nofollow noreferrer">BLS website</a> that has a lot of spaces in between columns.</p> <p><strong>Code:</strong></p> <pre><code>dat...
<p>The file from that website</p> <pre><code>filename bls url &quot;https://download.bls.gov/pub/time.series/la/la.data.2.AllStatesU&quot; ; </code></pre> <p>has tab characters in it. That is shown in the example you posted of line 3 from the SAS LOG.</p> <p>You can either tell the INFILE statement to expand the ta...
SAS: how to load a text file with a lot of spaces in between columns
sas|dataset|multiple-columns|loaddata
0
77
1
73,023,792
73,023,792
2
true
2022-07-17T23:24:36.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SAS: how to load a text file with a lot of spaces in between columns<p>I have a text file downloaded from the <a href="https://download.bls.gov/pub/time.seri...
72,914,624
I want my code run once every 20t in a `PlayerMoveEvent`<p>I want my code to run once every 20t when a player touches the water</p> <pre><code>package me.pgk.Listeners; import me.pgk.PGK; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import...
<p>The <code>PlayerMoveEvent</code> fires many times a second when the player moves. Even if they're moving their head, this is why the answer given by Blue Dev is making your message print many more times than expected.</p> <p>Instead of creating a new task every time the player moves in water. You should use a <code>...
I want my code run once every 20t in a `PlayerMoveEvent`
java|minecraft|spigot
2
77
2
72,916,848
72,916,848
2
true
2022-07-08T16:53:18.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want my code run once every 20t in a `PlayerMoveEvent`<p>I want my code to run once every 20t when a player touches the water</p> <pre><code>package me.pgk...
72,801,729
how to do malloc to array from struct<p>I have a stract and there should be an array whose size I don't know yet in <code>main</code> I try. Here, for example, I created a define <code>N</code>, but in fact, I accept different data in different ways, including the array <code>W</code>. I have to allocate memory for my ...
<p>you need to allocate the ptr first with your structure type. right now ptr=Null, and you need it to point to a memory location with the size of your structure before you can allocate ptr-&gt;arr.</p> <p>try this:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #define N 10 typedef struct vector {...
how to do malloc to array from struct
c|struct|malloc
1
77
1
72,801,897
72,801,897
2
true
2022-06-29T12:50:13.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to do malloc to array from struct<p>I have a stract and there should be an array whose size I don't know yet in <code>main</code> I try. Here, for exampl...
73,000,167
jq how to merge two JSON streams into a single JSON stream<p>How to merge two json streams/lists into a single stream of jsons like the following.</p> <p>file 1:</p> <pre><code>{&quot;key1&quot;: 1} {&quot;key1&quot;: 2} {&quot;key1&quot;: 3} </code></pre> <p>file 2:</p> <pre><code>{&quot;key2&quot;: -1} {&quot;key2&q...
<p>Here is a &quot;streaming&quot; solution that is more efficient (both memory-wise and otherwise) than one that requires that both files be read in their entirety before producing any output:</p> <pre><code>&lt; file1.json jq -nc --slurpfile file2 file2.json ' # For each item $s in the stream s, # emit [$s, $t] w...
jq how to merge two JSON streams into a single JSON stream
json|merge|stream|jq
1
77
2
73,000,801
73,000,801
2
true
2022-07-15T22:32:01.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jq how to merge two JSON streams into a single JSON stream<p>How to merge two json streams/lists into a single stream of jsons like the following.</p> <p>fil...
72,848,686
SVG Shape Lighting<p><strong>Summary:</strong> I'm trying to create a canvas of randomized rock climbing holds using vector graphics generated with properties such as color, rotation, size and path values. To add depth to these I'm trying to add a sort of randomized shadow to them to show that one or more sides of the ...
<p>Diffuse light effects should be multiplied with the original, otherwise you'll see the the lighting color rather than the combination of original color + lighting. So just add a feBlend with a multiply - like so. Update: and then add a feComposite/in to &quot;clip to self&quot; - so you don't see the background lit ...
SVG Shape Lighting
javascript|html|svg|vector-graphics|svg-filters
1
77
1
72,850,151
72,850,151
2
true
2022-07-03T17:45:41.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SVG Shape Lighting<p><strong>Summary:</strong> I'm trying to create a canvas of randomized rock climbing holds using vector graphics generated with propertie...
72,846,955
Why are some modules imported with "*" and some not?<p>Why for some modules do we type a '*' for example:</p> <pre><code>from tkinter import * </code></pre> <p>and for some of them we don't, like this one:</p> <pre><code>import time </code></pre>
<p>When importing a package, objects from the package are in a namespace, e.g.,</p> <pre><code>import time time.sleep(1) </code></pre> <p>But when explicitly importing objects from a package, they are imported into the global namespace, e.g.,</p> <pre><code>from time import sleep sleep(1) </code></pre> <p>When using <c...
Why are some modules imported with "*" and some not?
python
0
77
1
72,847,031
72,847,031
3
true
2022-07-03T13:38:13.793Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why are some modules imported with "*" and some not?<p>Why for some modules do we type a '*' for example:</p> <pre><code>from tkinter import * </code></pre> ...
72,872,382
Change specific items in List when using DiffUtil<p>In case,<br /> When there is a list with 100 items and wanna change only some of them, should I need to create a new list for comparison with DiffUtil?</p> <pre><code>fun fetchDynamicItems() { val items = repository.fetchOnlyDynamicItems() replaceDynamicItems(...
<p>No, you have to create a new list. Otherwise, it can't compare old and new versions.</p> <p>Note that generally, creating a new list is trivial. The items that are the same instance in both lists are only taking up one more word of memory each, since the Lists merely hold references to the same instances.</p>
Change specific items in List when using DiffUtil
android|kotlin|android-recyclerview|android-diffutils
0
77
1
72,872,640
72,872,640
3
true
2022-07-05T15:57:32.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change specific items in List when using DiffUtil<p>In case,<br /> When there is a list with 100 items and wanna change only some of them, should I need to c...
72,835,657
Are there standards for expressing dates akin to holidays?<p>For example, Foo Holiday is the 3rd Tuesday in March. Bar Holiday is the 7th minute of the 7th hour of the 7th day of the 7th Month.</p> <p>I have looked at standards like ISO8601 but it seems those are more concerned with explicit points in time.</p>
<p>As <a href="https://stackoverflow.com/a/72865979">AlexApps99 described in their answer</a>, there is no standard that will cover all holidays.</p> <p>For example, the start of Ramadan often depends on physically sighting the new moon, so it's impossible to predict the exact date, as cloudy weather might prevent anyb...
Are there standards for expressing dates akin to holidays?
date|datetime|standards
1
77
2
72,877,751
72,877,751
3
true
2022-07-02T00:26:41.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are there standards for expressing dates akin to holidays?<p>For example, Foo Holiday is the 3rd Tuesday in March. Bar Holiday is the 7th minute of the 7th h...
72,887,703
Sum all rows wherever cell value meets condition in R<p>I have a data frame such as:</p> <pre><code>df &lt;- data.frame(col1 = c(1, 2500,1, 1, 1), col2 = c(12, NA, 8,9, 5), col3 = c(25, 48, 7, 9, 14)) df col1 col2 col3 1 1 12 25 2 2500 NA 48 3 1 8 7 4 1 9 ...
<p>Using <code>summarise</code> with <code>across</code></p> <pre><code>library(dplyr) df %&gt;% summarise(across(everything(), ~ sum(.x[.x &gt; 1], na.rm = TRUE))) col1 col2 col3 1 2500 34 103 </code></pre> <hr /> <p>Or in <code>base R</code> with <code>colSums</code> after <code>replace</code>ing the elements...
Sum all rows wherever cell value meets condition in R
r|dplyr
3
77
4
72,887,812
72,887,812
3
true
2022-07-06T17:29:56.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sum all rows wherever cell value meets condition in R<p>I have a data frame such as:</p> <pre><code>df &lt;- data.frame(col1 = c(1, 2500,1, 1, 1), ...
72,890,154
Calling functions with different string names<p>So I'm trying to make a 2D game (C#) where the player has different skills that they can use. The problem is that I don't know how to call a function with the string containing the skill name. There is always another way to do it, which is by making a really long list ful...
<p>What you're looking for are delegates (and more specifically a dictionary of delegates).</p> <pre><code>void Main() { var things = new Dictionary&lt;string, Action&gt; { {&quot;Thing1&quot;, DoThing1}, {&quot;Thing2&quot;, DoThing2}, {&quot;Thing3&quot;, DoThing3}, }; thi...
Calling functions with different string names
c#|string|function|2d
0
77
3
72,890,226
72,890,226
3
true
2022-07-06T21:40:36.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calling functions with different string names<p>So I'm trying to make a 2D game (C#) where the player has different skills that they can use. The problem is ...
73,005,073
Extract just one value from json array result in vb6<p>The result of json that I received from the SMS sending panel by Rest API is as follows and display in textbox :</p> <pre><code>{ &quot;status&quot;: &quot;OK&quot;, &quot;code&quot;: &quot;OK&quot;, &quot;message&quot;: &quot;Ok&quot;, &quot;data&quot;: { &quot;me...
<p>Short answer:</p> <blockquote> <p><code>o.item(&quot;data&quot;).item(&quot;messages&quot;).item(1).item(&quot;number&quot;)</code></p> </blockquote> <p>Easy way to find out..</p> <ol> <li>Put a breakpoint right after the <code>.Parse(...)</code> call and then stop your execution and proceed to the &quot;Immediate W...
Extract just one value from json array result in vb6
arrays|json|vb6
4
77
2
73,037,726
73,037,726
3
true
2022-07-16T14:37:58.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract just one value from json array result in vb6<p>The result of json that I received from the SMS sending panel by Rest API is as follows and display in...
72,906,620
I have a lot of Kubernetes processes installed when i haven't installed it (what do i do and how do i delete it)<p><a href="https://i.stack.imgur.com/dLCUi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dLCUi.png" alt="Running Netstat in terminal" /></a> <a href="https://i.stack.imgur.com/2JQyb.png"...
<p>This isn't a kubernetes process. This is a result of installing docker and how it configures itself to <em>enable</em> you to run kubernetes locally. The string &quot;kubernetes&quot; is coming from your <code>hosts</code> file even though you might not have turned on the feature to use k8s.</p> <p>If you open <code...
I have a lot of Kubernetes processes installed when i haven't installed it (what do i do and how do i delete it)
kubernetes
2
77
1
72,953,624
72,953,624
3
true
2022-07-08T04:22:46.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I have a lot of Kubernetes processes installed when i haven't installed it (what do i do and how do i delete it)<p><a href="https://i.stack.imgur.com/dLCUi.p...
72,768,601
Why does my && concatenated comparison return different results?<p>Can somebody explain why the comparison without brackets <code>result1 == true</code> returns a different result than the comparison with brackets <code>result2 == false</code>? Both results should be false because <code>_enum != TestEnum.Member2</code>...
<p>The reason is operator precedence</p> <p>This is the order of precedence for the operators that you're using.</p> <ol> <li><code>()</code></li> <li><code>==</code></li> <li><code>&amp;&amp;</code></li> <li><code>? :</code></li> </ol> <p>So...</p> <pre><code>var result1 = _enum == TestEnum.Member2 &amp;&amp; ...
Why does my && concatenated comparison return different results?
c#|.net
1
77
1
72,769,073
72,769,073
3
true
2022-06-27T07:47:02.707Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does my && concatenated comparison return different results?<p>Can somebody explain why the comparison without brackets <code>result1 == true</code> retu...
72,896,997
Replacing line breaks with <br> inside a tag using BeautifulSoup<p>I want to parse some <code>HTML</code> using <code>BeautifulSoup</code> and replace any line breaks (<code>\n</code>) that are within <code>&lt;blockquote&gt;</code> tags with <code>&lt;br&gt;</code> tags. It is extra difficult because the <code>&lt;blo...
<p>An alternative would be to use <code>descendants</code> to look for <code>NavigableString</code>s, and replace just those, leaving other elements alone:</p> <pre><code>from bs4 import BeautifulSoup, NavigableString html = &quot;&quot;&quot; &lt;p&gt;Hello there&lt;/p&gt; &lt;blockquote&gt;Line 1 Line 2 &lt;strong&g...
Replacing line breaks with <br> inside a tag using BeautifulSoup
python|html|web-scraping|beautifulsoup
0
77
2
72,897,280
72,897,280
3
true
2022-07-07T11:26:39.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing line breaks with <br> inside a tag using BeautifulSoup<p>I want to parse some <code>HTML</code> using <code>BeautifulSoup</code> and replace any li...
72,779,939
None Output in for loop<p>I am trying to loop a string using for loop, but instead, the &quot;None&quot; output popup.</p> <p>how do I get rid of &quot;none&quot; output? thank you</p> <pre><code>def name(a): for b in a: print (b) print (name(&quot;hello123&quot;)) </code></pre> <p>output:</p> <pre><code>h...
<p>Your <code>name</code> function doesn't return anything explicitly, so its return value is <code>None</code>, which you then print.</p> <p>In this case, there's no point in printing the return value of <code>name</code> at all.</p> <pre><code>def name(a): for b in a: print(b) name(&quot;hello123&quot;) ...
None Output in for loop
python|python-3.x|string|for-loop
-1
77
2
72,779,965
72,779,965
3
true
2022-06-28T01:55:38.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: None Output in for loop<p>I am trying to loop a string using for loop, but instead, the &quot;None&quot; output popup.</p> <p>how do I get rid of &quot;none&...
72,834,794
why Im failing to access axios.get() data once I pass it to a reactive object vuejs?<p>I'm quite new with Vue and what I'm doing is really simple, must be some reactivity issue I think, the thing is that I'm doing an axios.get(), and when I console.log(res.data) it shows all ok. But when I try to make the res.data = re...
<p>you aren't assigning the value of the axios response to the state, try it:</p> <pre><code>onMounted(async () =&gt; { const response = await axios.get( &quot;https://my-json-server.typicode.com/Tommydemian/vue-school-router/db&quot; ); state.destinations = response.data.destinations; }); </code></pre> <p>No...
why Im failing to access axios.get() data once I pass it to a reactive object vuejs?
javascript|reactjs|vue.js|frontend|vuejs3
1
77
1
72,835,084
72,835,084
3
true
2022-07-01T21:31:55.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why Im failing to access axios.get() data once I pass it to a reactive object vuejs?<p>I'm quite new with Vue and what I'm doing is really simple, must be so...
72,908,714
Shape of passed values is (12, 1), indices imply (1, 12)<p>I tried to create a table.</p> <pre><code>p_data = [&quot;20&quot;, &quot;30&quot;, &quot;40&quot;, &quot;50&quot;, &quot;60&quot;, &quot;70&quot;, &quot;80&quot;, &quot;90&quot;, &quot;100&quot;, &quot;110&quot;, &quot;120&quot;, &quot;130&quot;]; p_...
<p>You need to use <code>[data]</code> as the input must be 2D if you specify the index/columns:</p> <pre><code>data_frame = pd.DataFrame(columns=p_data, index=&quot;house&quot;, data=[p_data]) </code></pre> <p>output:</p> <pre><code> 20 30 40 50 60 70 80 90 100 110 120 130 house 20 30 40 50 60 7...
Shape of passed values is (12, 1), indices imply (1, 12)
python|pandas|dataframe|matrix
0
77
1
72,908,722
72,908,722
3
true
2022-07-08T08:30:37.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shape of passed values is (12, 1), indices imply (1, 12)<p>I tried to create a table.</p> <pre><code>p_data = [&quot;20&quot;, &quot;30&quot;, &quot;40&quot;...