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,936,389 | Is there a way to know if IoT hub quota exceed WITHOUT data ingestion?<p>I have below code which give me a nice exception about IoT quota exceeded while I am ingesting data to IOT hub, but does C# sdk has any method which gives me a way to find out that quota is out for a day WITH OUT data ingestion?</p>
<p><a href="ht... | <p>you can use the <a href="https://docs.microsoft.com/en-us/rest/api/iothub/iot-hub-resource/get-quota-metrics" rel="nofollow noreferrer">Iot Hub Resource - Get Quota Metrics</a></p>
<p>the following is the result of the F1-Free tier:</p>
<pre><code>{
"value":[
{
"name":"TotalMessa... | Is there a way to know if IoT hub quota exceed WITHOUT data ingestion? | c#|azure-iot-hub | 0 | 39 | 1 | 72,939,195 | 72,939,195 | 1 | true | 2022-07-11T09:32:10.263Z | 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 know if IoT hub quota exceed WITHOUT data ingestion?<p>I have below code which give me a nice exception about IoT quota exceeded while I am... |
72,944,361 | Getting segmentation fault (core dump) for binary search(recursive) to find a number in an array<p>This is a problem to find the target number in an array using the binary search recursive method.
<strong>Getting segmentation fault.</strong>
Have tried a lot but cannot find what is causing it.
need some help to avoid s... | <p><code>high</code>, <code>low</code>, <code>mid</code> are local to your function. So, each time you call <code>recursivebinarysearch</code> with the same vector <code>arr</code>, you get the same values. So, you infinitely recurse. The segmentation fault happens when the stack overflows.</p>
<p>If you want to keep t... | Getting segmentation fault (core dump) for binary search(recursive) to find a number in an array | c++|recursion|binary-search | 1 | 39 | 2 | 72,944,434 | 72,944,434 | 1 | true | 2022-07-11T20:32:55.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting segmentation fault (core dump) for binary search(recursive) to find a number in an array<p>This is a problem to find the target number in an array us... |
72,941,002 | r - How to track Changes in Rows of dataframe with characters?<p>Additional to my <a href="https://stackoverflow.com/questions/72668927/how-to-track-changes-in-rows-lines-of-data-frame">last question</a>, I am now looking for a way to track changes within a data frame of characters.</p>
<p>Suppose I have the following ... | <p>Try this</p>
<pre><code>df |> rowwise() |> mutate(change = case_when(all(c_across(X2015:X2018) == X2014) ~ 0 , TRUE ~ 1) ,
year = colnames(df)[-1][which(c_across(X2014) != c_across(X2014:X2018))[1]] ) |>
ungroup() |> mutate(before = ifelse(change == 1 , X2014 ,NA) ,
after = ifelse(change == 1 , X2018 ,NA... | r - How to track Changes in Rows of dataframe with characters? | r|dataframe | 0 | 39 | 2 | 72,945,694 | 72,945,694 | 1 | true | 2022-07-11T15:28:52.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
r - How to track Changes in Rows of dataframe with characters?<p>Additional to my <a href="https://stackoverflow.com/questions/72668927/how-to-track-changes-... |
72,947,929 | Reading URLs from CSV - Scraping Data - Saving to Same CSV File<p>I have a CSV file with over 3400 URLs from one website and I need to access all these URLs using cloudscraper in order to pull a specific string. For simplicity, let's call the URLs PRODUCT and the string COLOR. Once I retrieve the COLOR of the PRODUCT I... | <p>So if your CSV look like:</p>
<pre><code>URL
link1
link2
link3
....
linkN
</code></pre>
<p>We will go through each link, and immediately write the value in the COLOR column</p>
<pre><code>from bs4 import BeautifulSoup
import requests
import pandas as pd
def scrape(url):
response = requests.get(url)
soup = ... | Reading URLs from CSV - Scraping Data - Saving to Same CSV File | csv|web-scraping|beautifulsoup|python-requests | 0 | 39 | 1 | 72,948,265 | 72,948,265 | 1 | true | 2022-07-12T06:31:39.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading URLs from CSV - Scraping Data - Saving to Same CSV File<p>I have a CSV file with over 3400 URLs from one website and I need to access all these URLs ... |
72,947,896 | Procedure loop in Oracle to SQL Developer<p>I have a procedure which is written using Oracle database and now I want to migrate it to SQL Server but I am having an issue when it comes to loop. As far as I know, SQL Server doesn't have "FOR" loop, it only has "WHILE" loop. The code is :</p>
<pre><cod... | <p>You could use cursor:</p>
<pre><code>DECLARE @col_name VARCHAR(128);
DECLARE @col_value VARCHAR(128);
-- declare cursor
DECLARE columns CURSOR FOR
SELECT something, other_thing
FROM table_list;
-- open cursor
OPEN columns;
-- loop through a cursor
FETCH NEXT FROM columns INTO @col_name, @col_value;
WHILE ... | Procedure loop in Oracle to SQL Developer | sql-server|oracle|migration | 0 | 39 | 1 | 72,948,459 | 72,948,459 | 1 | true | 2022-07-12T06:27:56.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Procedure loop in Oracle to SQL Developer<p>I have a procedure which is written using Oracle database and now I want to migrate it to SQL Server but I am hav... |
72,948,451 | Indent xml data fetched via request | python |<p>I got stuck not getting how to achieve it.</p>
<p>Need your suggestion on this how to implement in my code</p>
<p><strong>My code :</strong></p>
<pre><code>import requests
url = '....' # not mentioning as its private
headers_details = {
'Host' : 'axb.vttp.com',
'Acce... | <p>You've need to parse the xml, then serialise it with indentation.</p>
<p>With <code>lxml</code>:</p>
<pre class="lang-py prettyprint-override"><code>from lxml import etree
import requests
url = r"https://www.w3schools.com/xml/note.xml"
rq = requests.get(url)
# Parse the xml
root = etree.fromstring(rq.co... | Indent xml data fetched via request | python | | python|python-requests|python-xmlschema | 0 | 39 | 1 | 72,948,991 | 72,948,991 | 1 | true | 2022-07-12T07:21:13.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Indent xml data fetched via request | python |<p>I got stuck not getting how to achieve it.</p>
<p>Need your suggestion on this how to implement in my code</... |
72,949,241 | Decorator pattern log each before and after<p>I want to log each iteration of my text changes nevertheless not sure what should be the proper way of doing that. See below. The first test is <code>GeeksforGeeks</code> and last one will be <code><i><u><b>GeeksforGeeks</b></u></i></code... | <p>You can iterate through a sequence of wrappers to be applied to the text, and wrap each wrapper call with <code>LoggerWrapper</code>:</p>
<pre><code>gfg = 'GeeksforGeeks'
for wrapper in WrittenText, BoldWrapper, UnderlineWrapper, ItalicWrapper:
gfg = LoggerWrapper(wrapper(gfg))
gfg.render()
</code></pre> | Decorator pattern log each before and after | python|visitor-pattern | -1 | 39 | 2 | 72,949,432 | 72,949,432 | 1 | true | 2022-07-12T08:29:04.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Decorator pattern log each before and after<p>I want to log each iteration of my text changes nevertheless not sure what should be the proper way of doing th... |
72,949,412 | Assistance needed regarding dictionary syntax in Python<p>I have a syntax issue while using dictionary for the first time. I hope you guys can help me with it. I'm reading election data from a .csv file. I'm trying to put the names and votes for each candidate into a dictionary so the display would look like this:</... | <p>Assuming that the element in position 2 is the name of the candidate and that each line in the csv is a single vote:</p>
<pre><code># Import the os module
import os
# Module for reading CSV files
import csv
# Store the file path associated with the file
csvpath = os.path.join('Resources', 'election_data.csv')
# O... | Assistance needed regarding dictionary syntax in Python | python|dictionary|read.csv | -1 | 39 | 1 | 72,949,539 | 72,949,539 | 1 | true | 2022-07-12T08:44:43.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assistance needed regarding dictionary syntax in Python<p>I have a syntax issue while using dictionary for the first time. I hope you guys can help me with ... |
72,949,518 | Returning the count of circles in the document<p>I have written code defining circles in documents. Can I return to the variable the count of circles found in the document? Thank you.</p>
<pre><code>img = cv2.imread(r"some parth to doc")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
minDist = 100
param1 = 30... | <p>Well, you're already doing</p>
<pre><code>for i in circles[0, :]:
</code></pre>
<p>to draw the circles, so <code>circles[0, :]</code> is presumably an iterable of circles.</p>
<p>Wouldn't it then make sense that</p>
<pre><code>n_circles = len(circles[0, :])
</code></pre>
<p>would give you the number of circles to dr... | Returning the count of circles in the document | python|opencv | -2 | 39 | 1 | 72,950,128 | 72,950,128 | 1 | true | 2022-07-12T08:52:46.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Returning the count of circles in the document<p>I have written code defining circles in documents. Can I return to the variable the count of circles found i... |
72,953,576 | How to turn a keyup event into a click button using angular<p>I have a input field with a working keyup event, and I need to turn the icon into a button, so when the user clicks on it, it applies the filter. This is my HTML:</p>
<pre><code><input type="text"
matInput
(keyup)="applyFilterOrgReach($ev... | <p>You can pass the input value in click event and use the existing method in ts same as yours.</p>
<pre><code><input type="text"
matInput #input
(keydown)="$event.stopPropagation()"/>
<i class="fas fa-search search-icon" (click)="applyFilterOrgReach(input.val... | How to turn a keyup event into a click button using angular | angular|ionic-framework | 0 | 39 | 1 | 72,953,680 | 72,953,680 | 1 | true | 2022-07-12T13:58:10.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to turn a keyup event into a click button using angular<p>I have a input field with a working keyup event, and I need to turn the icon into a button, so ... |
72,950,167 | PyPlot line plot changing color by column value<p>I have a dataframe with a structure similar to the following example.</p>
<pre><code>df = pd.DataFrame({'x': ['2008-01-01', '2008-01-02', '2008-01-03', '2008-01-04'], 'y': [1, 2, 3, 6],
'group_id': ['OBSERVED', 'IMPUTED', 'OBSERVED', 'IMPUTED'], 'colo... | <p>You can use the below code to do the forward looking colors. The key was to get the data right in the dataframe, so that the plotting was easy. You can <code>print(df)</code> after manipulation to see what was done. Primarily, I added the x and y from below row as additional columns in the current row for all except... | PyPlot line plot changing color by column value | pandas|matplotlib|group-by|data-visualization|styling | 2 | 39 | 1 | 72,955,415 | 72,955,415 | 1 | true | 2022-07-12T09:38:47.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PyPlot line plot changing color by column value<p>I have a dataframe with a structure similar to the following example.</p>
<pre><code>df = pd.DataFrame({'x'... |
72,956,521 | How to fetch a spreadsheet Id without opening the spreadsheet?<p>Basically question.</p>
<p>I tried this piece of code but It just returns:
TypeError: quoteName.getId is not a function</p>
<pre><code> quoteTemp = SpreadsheetApp.getActiveSpreadsheet();
var projectName = sheet.getRange('C10').getValue().toString();
pr... | <p>As a guess. Try to change the line:</p>
<pre><code>quoteTemp.copy(quoteName);
</code></pre>
<p>To:</p>
<pre><code>quoteName = quoteTemp.copy(quoteName);
</code></pre> | How to fetch a spreadsheet Id without opening the spreadsheet? | google-apps-script|google-sheets | 1 | 39 | 1 | 72,956,582 | 72,956,582 | 1 | true | 2022-07-12T17:54:21.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fetch a spreadsheet Id without opening the spreadsheet?<p>Basically question.</p>
<p>I tried this piece of code but It just returns:
TypeError: quoteN... |
72,958,609 | Returning Value From JS Closures<p>I am currently trying to understand closures but there is something which I don't seem to get no matter how many videos or forum posts I check.</p>
<p>As an example, here is a simple closure with a <code>parentFunction</code> and a <code>childFunction</code>:</p>
<pre><code>function p... | <p>When you put it into a variable first, you're also <em>invoking</em> it when logging the result.</p>
<pre><code>let test = parentFunction(1, 2)
console.log(test());
// ^^
</code></pre>
<p>Substituting in <code>parentFunction(1, 2)</code> and removing the <code>test</code> variable entirely would be equi... | Returning Value From JS Closures | javascript|closures | -4 | 39 | 1 | 72,958,638 | 72,958,638 | 1 | true | 2022-07-12T21:32:32.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Returning Value From JS Closures<p>I am currently trying to understand closures but there is something which I don't seem to get no matter how many videos or... |
72,959,552 | Show element at the mouse position when transform scale is applied<p>How to retrieve the correct mouse position when a transform scale, e.g <code> transform: scale(1.6);</code> is applied? In the example, the popup element appears too far down and too far to the right</p>
<p><a href="https://jsfiddle.net/Smolo/34nh6Lwb... | <p>Use offset position instead:</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>$(".spanhover").hover(
function (event) {
var divid = "#popup" + $(this).attr("id");
$... | Show element at the mouse position when transform scale is applied | javascript|html|css | 0 | 39 | 1 | 72,959,576 | 72,959,576 | 1 | true | 2022-07-13T00:07:59.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show element at the mouse position when transform scale is applied<p>How to retrieve the correct mouse position when a transform scale, e.g <code> transform:... |
72,955,856 | mapPropertyErrors seems to only return null<p>I can't seem to get the automatic error messages working. My configuration seems to be correct from what I've read online, yet the error always get's picked up in the catch after using the <code>repository.save(entity)</code> function. I'm specifically trying to get an erro... | <p>You also need to set <code>Required</code> flag to <code>TranslationsAssociationField</code> also.</p>
<pre><code>(new TranslationsAssociationField(UspTranslationDefinition::class, 'suiteseven_usp_id'))->addFlags(new Required()),
</code></pre> | mapPropertyErrors seems to only return null | error-handling|components|entity|field|shopware | 0 | 39 | 1 | 72,961,936 | 72,961,936 | 1 | true | 2022-07-12T16:54:21.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mapPropertyErrors seems to only return null<p>I can't seem to get the automatic error messages working. My configuration seems to be correct from what I've r... |
72,837,744 | How to use instance of API from Main View in Container View?<p>If i create an instance of mapView in MainView, how can i use that instance in Container View?</p>
<pre><code>class MainView: UIViewController {
var mapView = MapView()
}
class ContainerView: UIViewController {
MainView.mapView.changeCameraPosit... | <p>The solution i found and also with help from Burnsi and Rob is to pass the instance as an object when adding view controller to container view:</p>
<pre><code> let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let nextPageVC = storyboard.instantiateViewController(withIdentifier:"NextPa... | How to use instance of API from Main View in Container View? | swift|swift5|uicontainerview | 0 | 39 | 2 | 72,962,430 | 72,962,430 | 1 | true | 2022-07-02T08:50:55.407Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use instance of API from Main View in Container View?<p>If i create an instance of mapView in MainView, how can i use that instance in Container View?... |
72,958,191 | Where does visual studio deploy folders inside wwwroot in azure<p>I have an asp core webapp deployed on Azure using Visual Studio 2022 to publish. On my local machine I have a number of site folders and files under wwwroot like this:</p>
<pre><code>-wwwroot
----SimFiles
----StaticPages
----Videos
----Docs
Etc
</co... | <p>In your App Service, you could find an option App Service Editor under Developer tools.</p>
<p><a href="https://i.stack.imgur.com/mEihj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mEihj.png" alt="enter image description here" /></a></p>
<p>Click on It(App Service Editor) and then click on the ... | Where does visual studio deploy folders inside wwwroot in azure | c#|azure|visual-studio|asp.net-core | 0 | 39 | 2 | 72,962,944 | 72,962,944 | 1 | true | 2022-07-12T20:46:03.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Where does visual studio deploy folders inside wwwroot in azure<p>I have an asp core webapp deployed on Azure using Visual Studio 2022 to publish. On my loc... |
72,962,910 | How to disable Ligatures/Diacritics functionality in mpdf?<p>I generate PDFs with MPDF 8.1.1. These PDF include email addresses. But it looks like the "Combining Diacritics" functionality or the "Ligatures" of the font rendering destroys some of them. I provide UTF8 encoded text.</p>
<p>For example,... | <p>The <a href="https://mpdf.github.io/fonts-languages/opentype-layout-otl.html#examples" rel="nofollow noreferrer">mPDF documentation</a> gives this CSS style to disable ligatures:</p>
<pre class="lang-css prettyprint-override"><code>/* disable common ligatures, usually on by default */
.noligs { font-feature-settings... | How to disable Ligatures/Diacritics functionality in mpdf? | php|mpdf | 0 | 39 | 1 | 72,963,241 | 72,963,241 | 1 | true | 2022-07-13T08:09:54.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to disable Ligatures/Diacritics functionality in mpdf?<p>I generate PDFs with MPDF 8.1.1. These PDF include email addresses. But it looks like the "... |
72,964,617 | In Python is faster using "yield from" than yield in a loop?<p>I tried multiple ranges for this example I let above:</p>
<pre><code>import time
def reader():
for a in range(100000000):
yield a
def reader_wrapper(gen):
for i in gen:
yield i
def reader_wrapper_enhanced(gen):
yield from g... | <p>Yes, it's faster when the inputs are long enough (though not by much, as you've seen), and yes, you may as well let Python do the work of yielding from the delegate iterator by default.</p>
<p>The one time you wouldn't want to do this is when you are delegating to a generator that you <em>don't</em> want to receive ... | In Python is faster using "yield from" than yield in a loop? | python|python-3.x|performance|yield|yield-from | 0 | 39 | 1 | 72,964,729 | 72,964,729 | 1 | true | 2022-07-13T10:18:30.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In Python is faster using "yield from" than yield in a loop?<p>I tried multiple ranges for this example I let above:</p>
<pre><code>import time
def reader(... |
72,965,555 | Find values in a Pandas dataframe and insert the data in a column of another Pandas dataframe<p>I have a dataframe that I need to convert the Custom Field column rows to columns in a second dataframe. This part I have managed to do and it works fine.</p>
<p>The problem is that I need to add the corresponding values fro... | <p>Use <code>pivot_table</code></p>
<pre><code>df.pivot_table(index=['Name'], columns=['Custom Field'])
</code></pre>
<p>As a general rule of thumb, if you are doing for loops and changing <em>cells</em> manually, you're using pandas wrong. Explore the methods of the framework in the docs, it can be very powerful :)</p... | Find values in a Pandas dataframe and insert the data in a column of another Pandas dataframe | python|pandas|dataframe | 1 | 39 | 1 | 72,965,742 | 72,965,742 | 1 | true | 2022-07-13T11:33:05.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find values in a Pandas dataframe and insert the data in a column of another Pandas dataframe<p>I have a dataframe that I need to convert the Custom Field co... |
72,965,579 | How to change the dropdown backgroundColor of an MUI 5 TextField select?<p><a href="https://i.stack.imgur.com/ZCVpw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZCVpw.png" alt="enter image description here" /></a></p>
<p>As you can see from the image above, the background color of the dropdown nee... | <p>If you want to style the underlying menu you can pass in <code>SelectProps</code> to the <code>TextField</code>.</p>
<pre><code><TextField
select
id="version"
label="Version"
variant="outlined"
SelectProps={{
MenuProps: {
sx: styles.textField,
},
}}
>
</c... | How to change the dropdown backgroundColor of an MUI 5 TextField select? | reactjs|material-ui | 0 | 39 | 1 | 72,965,985 | 72,965,985 | 1 | true | 2022-07-13T11:35:19.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change the dropdown backgroundColor of an MUI 5 TextField select?<p><a href="https://i.stack.imgur.com/ZCVpw.png" rel="nofollow noreferrer"><img src="... |
72,965,974 | MySQL Get row from joined table only if 1 such type exists<p>Trying to get my head around a maybe really simple query. It concerns two tables that I'm joining, but need to filter its result based on user selection in the web interface.</p>
<p>Table 'reports':</p>
<div class="s-table-container">
<table class="s-table">
... | <p>You can use aggregation and set the conditions in the <code>HAVING</code> clause:</p>
<pre><code>SELECT policy_report_id
FROM policies
GROUP BY policy_report_id
HAVING SUM(policy_type <> 1) = 0; -- no other than policy_type = 1
</code></pre>
<p>or:</p>
<pre><code>HAVING SUM(policy_type <> 2) = 0; -- no o... | MySQL Get row from joined table only if 1 such type exists | mysql|join|select|group-by|having | 1 | 39 | 1 | 72,966,295 | 72,966,295 | 1 | true | 2022-07-13T12:02:32.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL Get row from joined table only if 1 such type exists<p>Trying to get my head around a maybe really simple query. It concerns two tables that I'm joinin... |
72,963,014 | Deleting element with D3 fails<p>Deleting dom with D3 fails
Hello everyone. I try to use D3 to manipulate doms, which are defined in html ahead of time.
Content in html:</p>
<pre><code><div>
<p class="child" id="1">James</p>
<p class="child" id="2">Kate&... | <p>The first argument in <code>selection.data()</code>, that you named <code>d</code>, is the datum of the element. The important information is that the key function is evaluated on the elements and on the data; however, the elements initially have no data bound to them, so the datum is <code>null</code>.</p>
<p>What ... | Deleting element with D3 fails | javascript|d3.js | 1 | 39 | 1 | 72,967,032 | 72,967,032 | 1 | true | 2022-07-13T08:18:48.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting element with D3 fails<p>Deleting dom with D3 fails
Hello everyone. I try to use D3 to manipulate doms, which are defined in html ahead of time.
Cont... |
72,969,505 | VBA-Excel - Graph creator<p>I'm trying to create a code for generate some graphs with some data already stored in arrays.</p>
<p>The actual final result of the macro is this graph:</p>
<p><a href="https://i.stack.imgur.com/mkYL7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mkYL7.png" alt="enter im... | <p>Untested, but something like this should work:</p>
<pre class="lang-vb prettyprint-override"><code>Sub CreateChart()
Dim sht As Worksheet, chtObj As ChartObject, cht As Chart
Set sht = ActiveSheet
Set chtObj = sht.ChartObjects.Add(100, 10, 500, 300)
Set cht = chtObj.Chart
AddSeries cht,... | VBA-Excel - Graph creator | excel|vba|graph | 0 | 39 | 1 | 72,969,801 | 72,969,801 | 1 | true | 2022-07-13T16:18:39.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VBA-Excel - Graph creator<p>I'm trying to create a code for generate some graphs with some data already stored in arrays.</p>
<p>The actual final result of t... |
72,967,159 | Is it possible to set Bot Framework Composer Bots to a diffrernt lanugage? If not, when will this be availabe?<p>i am working on a bot project with Microsofts Bot Framework. My bot is based on the SDK 4.0 and until this point, everything is working fine. In the last few days was thinking about making a change and go an... | <p>Composer already supports authoring bots in different languages. The documentation on <a href="https://docs.microsoft.com/en-us/composer/how-to-use-multiple-language?tabs=v2x" rel="nofollow noreferrer">multiple language support</a> should get you started. You can combine this with support for different cultures in L... | Is it possible to set Bot Framework Composer Bots to a diffrernt lanugage? If not, when will this be availabe? | botframework|bot-framework-composer | 0 | 39 | 1 | 72,970,357 | 72,970,357 | 1 | true | 2022-07-13T13:29:44.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to set Bot Framework Composer Bots to a diffrernt lanugage? If not, when will this be availabe?<p>i am working on a bot project with Microsoft... |
72,943,548 | Trying to add in a list of changes from an excel file to an email using VBA<p>In excel I have a list of departments on a worksheet named "Weekly Changes"</p>
<p><a href="https://i.stack.imgur.com/LV64o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LV64o.png" alt="| A header | Another head... | <p>Okay so, we have our data already being nicely converted to line entries with some array formulas:</p>
<p><a href="https://i.stack.imgur.com/tUsAb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tUsAb.png" alt="enter image description here" /></a></p>
<p>Store in array and check each value:
Add to... | Trying to add in a list of changes from an excel file to an email using VBA | excel|vba|outlook | 0 | 39 | 1 | 72,971,313 | 72,971,313 | 1 | true | 2022-07-11T19:12:43.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to add in a list of changes from an excel file to an email using VBA<p>In excel I have a list of departments on a worksheet named "Weekly Changes... |
72,971,780 | Fetch API in Javascript<p>I want to render a list from an API but the problem is I am able to console.log the element I want to render but I am not able to render it into the HTML side below is the code.
when I use <code><li>${element}</li></code> it gives an error.</p>
<p><div class="snippet" data-lang="js... | <p>You can break the code down a little to make your life easier.</p>
<ol>
<li>Put the URLs in an array to start with.</li>
<li><code>map</code> over the URLs array and call <code>apiCall</code> on each iteration to return an array of promises.</li>
<li><code>await Promise.all(promises)</code>.</li>
<li>You now have an... | Fetch API in Javascript | javascript|fetch-api | -1 | 39 | 2 | 72,972,000 | 72,972,000 | 1 | true | 2022-07-13T19:41:55.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fetch API in Javascript<p>I want to render a list from an API but the problem is I am able to console.log the element I want to render but I am not able to r... |
72,973,975 | HTML shows different DOCTYPE when opening with VIM<p>I have an HTML file with HTML 5 DOCTYPE. When I open it with TextEdit or any other Mac tools, it shows correctly with HTML 5. However, when I open it using VIM through Terminal, the HTML file shows up completely different, with HTML 4 DOCTYPE.</p>
<p>Original HTML 5 ... | <p>The lines you see added are from using TextEdit as an editor for html files, with a brief google search you can find information about it.</p> | HTML shows different DOCTYPE when opening with VIM | html|vim | -1 | 39 | 1 | 72,974,055 | 72,974,055 | 1 | true | 2022-07-14T00:21:07.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML shows different DOCTYPE when opening with VIM<p>I have an HTML file with HTML 5 DOCTYPE. When I open it with TextEdit or any other Mac tools, it shows c... |
72,977,890 | Refresh chart.js dataset background colors<p>How can I refresh the background color of dataset. I would like to change the colors when I switch to dark mode. I thought I can do it with update(), but it seems I can't.</p>
<p>When you switch to dark mode, the backgroud color is changing in the example, but you need to re... | <p>This is because you dont actually update anything, you will also need to update the colors before calling the update function:</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"><cod... | Refresh chart.js dataset background colors | javascript|chart.js|css-variables|darkmode | 0 | 39 | 1 | 72,978,454 | 72,978,454 | 1 | true | 2022-07-14T08:59:56.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Refresh chart.js dataset background colors<p>How can I refresh the background color of dataset. I would like to change the colors when I switch to dark mode.... |
72,979,674 | How to prevent keyboard and bottom textfield input blocking the ListView<p>When keyboard is opened, the bottom TextField is pushed up and blocking the content of the ListView (See the video)
<a href="https://i.stack.imgur.com/G4Phl.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G4Phl.gif" alt="enter... | <p>Try this code.</p>
<pre><code>ListView.builder(
controller: _scrollController,
itemCount: messages.length,
shrinkWrap: true,
reverse: true, // edit
padding: const EdgeInsets.only(top: 10, bottom: 10),
itemBuilder: (context, index) {
return MessageBubble(
message:... | How to prevent keyboard and bottom textfield input blocking the ListView | flutter|listview | 0 | 39 | 2 | 72,980,245 | 72,980,245 | 1 | true | 2022-07-14T11:18:52.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to prevent keyboard and bottom textfield input blocking the ListView<p>When keyboard is opened, the bottom TextField is pushed up and blocking the conten... |
72,968,835 | Orbit Simulator in Java returning odd values for velocity etc. despite correct math<p>I am using LibGDX to make an orbit simulator (elliptical as planets possess their own initial velocity) and I have the physics mapped out like so:</p>
<pre><code> public void move(float deltaTime, Planet planet) {
float de... | <p>I have been messing around and debugging the code and realised it was a very minor mistake, a classic mistake to assume that the math library's <code>cos()</code> and <code>sin()</code> functions use degrees. They don't. They use radians and that was the whole problem all along.</p>
<p>Instead of:</p>
<pre><code> ... | Orbit Simulator in Java returning odd values for velocity etc. despite correct math | java|libgdx|degrees|radians | 0 | 39 | 1 | 72,980,684 | 72,980,684 | 1 | true | 2022-07-13T15:27:28.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Orbit Simulator in Java returning odd values for velocity etc. despite correct math<p>I am using LibGDX to make an orbit simulator (elliptical as planets pos... |
72,984,032 | Datetime creation in Python for humans<p>Could you please recommend a Python library which can creates datetime from strings like these?</p>
<p>Sunday, 17 July 2022 - 01:00 UTC</p>
<p>7/14/2022 4:37:11 PM</p>
<p>And from any other typical human-readable forms. Without additional conversion from my side. Something like ... | <p>If you already know all the date format you'll encounter, you can store them in a list and loop over it.</p>
<pre class="lang-py prettyprint-override"><code>from datetime import datetime
FORMATS = ["%A, %d %B %Y - %H:%M %Z", "%m/%d/%Y %I:%M:%S %p"]
def try_formats(date_str: str) -> datetime:... | Datetime creation in Python for humans | python|datetime | -1 | 39 | 1 | 72,984,356 | 72,984,356 | 1 | true | 2022-07-14T16:47:36.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Datetime creation in Python for humans<p>Could you please recommend a Python library which can creates datetime from strings like these?</p>
<p>Sunday, 17 Ju... |
72,983,988 | Test if a given bit is set in a byte<p>I have an EasyDAQ relay board. To turn on relay 1, you send it one byte, relay 2, two bytes, relay 3, four bytes and relay 4, eight bytes. All the relays on = 15 bytes. To turn off a relay you have to basically subtract its byte number from the total of bytes from the relays that ... | <p>I think your terminology for "byte numbers" and sending a particular number of "bytes" is a little confused. I'm assuming what is going on is that you are reading a value from the board that is a single byte (consisting of 8 bits) where the individual bits represent the state of the relays. Thu... | Test if a given bit is set in a byte | python|bitwise-operators|pyserial|bitmask|bitwise-and | 0 | 39 | 1 | 72,984,357 | 72,984,357 | 1 | true | 2022-07-14T16:44:03.540Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Test if a given bit is set in a byte<p>I have an EasyDAQ relay board. To turn on relay 1, you send it one byte, relay 2, two bytes, relay 3, four bytes and r... |
72,984,052 | Why Catch statment not working React Js (Firebase Auth)?<pre class="lang-js prettyprint-override"><code>const submitHandler = async (e) => {
e.preventDefault();
setErr("");
try {
await signUp(email, password, firstName, lastName);
err.length === 0 &&
setTimeout(() =&... | <p>First of all, are you sure this <code>signUp</code> function throws an error?</p>
<p>Because it looks like this error is being handled somewhere else.. In order to catch the error, first you need to throw it.</p>
<p>So, for example, if there's a <code>try catch</code> inside <code>signUp</code>, you need to <code>th... | Why Catch statment not working React Js (Firebase Auth)? | reactjs|async-await|firebase-authentication | 2 | 39 | 2 | 72,984,615 | 72,984,615 | 1 | true | 2022-07-14T16:49:20.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why Catch statment not working React Js (Firebase Auth)?<pre class="lang-js prettyprint-override"><code>const submitHandler = async (e) => {
e.prevent... |
72,985,351 | Validate soft foreign key Django<p>Have a <code>model</code> in <code>django</code> that has a <code>json</code> field with list of <code>IDs</code>
to a different <code>model</code>.
How can we validate the inputs to that field are valid <code>foreign key</code>.</p>
<p>Not using <code>many to many field</code> or a j... | <p>This seems like a strange way of doing things but your best option would be to get a list of your valid IDs with <code>MyModel.objects.all().values_list('id', flat=True)</code> and compare your JSON data with the resulting list</p> | Validate soft foreign key Django | python-3.x|django|django-models|django-rest-framework | 0 | 39 | 2 | 72,985,640 | 72,985,640 | 1 | true | 2022-07-14T18:48:05.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Validate soft foreign key Django<p>Have a <code>model</code> in <code>django</code> that has a <code>json</code> field with list of <code>IDs</code>
to a dif... |
72,986,585 | How to check all checkboxes on a webpage with Selenium in Python (using a loop)<p>I am attempting to write a python program that will check all checkboxes on a given webpage. Currently, I only have the ability to select a single checkbox and am unsure why I am not able to iterate through the loop of elements containing... | <p><code>driver.find_element_by_xpath("//input[@type='checkbox']")</code> will return the first checkbox it finds every time, so it will always be the same one.</p>
<p>You can use the list of elements returned by <code>driver.find_elements_by_xpath("//*[@class='form-check-input']")</code> instead.</... | How to check all checkboxes on a webpage with Selenium in Python (using a loop) | python|css|selenium | 1 | 39 | 1 | 72,986,874 | 72,986,874 | 1 | true | 2022-07-14T20:57:02.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check all checkboxes on a webpage with Selenium in Python (using a loop)<p>I am attempting to write a python program that will check all checkboxes on... |
72,983,170 | Render DT Datatables in Bootstrap Card in R/Shiny<p>Below is a minimal reproducible example of my problem. What I need to do is render a datatable inside of a bootstrap card. In the example below, the rendering of <code>output$somethingMore</code> does just that. However, in my real world example, I have a slightly mor... | <p>Put your <code>DTOutput('somethingElse')...)</code> inside <code>renderUI</code></p>
<pre class="lang-r prettyprint-override"><code>library(shiny)
library(bslib)
library(shinyWidgets)
library(DT)
card <- function(body, title) {
div(class = "card",
div(icon("chart-line", style = &q... | Render DT Datatables in Bootstrap Card in R/Shiny | r|shiny | 0 | 39 | 1 | 72,987,357 | 72,987,357 | 1 | true | 2022-07-14T15:37:19.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Render DT Datatables in Bootstrap Card in R/Shiny<p>Below is a minimal reproducible example of my problem. What I need to do is render a datatable inside of ... |
72,988,803 | same values for all raws after grouping?<p>I'm getting duplicated data after doing some transformations.</p>
<p><a href="https://i.stack.imgur.com/w1Vni.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w1Vni.png" alt="enter image description here" /></a></p>
<p>grouping:</p>
<pre><code>
paid <- df%... | <p>As Ritchie's comment suggests, this is happening because <code>bounces/sessions</code> returns a vector.</p>
<p>Your example data only contains one date, so the output of the following only gives one row. However, if you create the <code>bounceRate</code> after the summarise I think you will get what you want.</p>
<... | same values for all raws after grouping? | r | 0 | 39 | 3 | 72,989,078 | 72,989,078 | 1 | true | 2022-07-15T03:36:46.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
same values for all raws after grouping?<p>I'm getting duplicated data after doing some transformations.</p>
<p><a href="https://i.stack.imgur.com/w1Vni.png"... |
72,993,056 | nuxt-color-mode not running. Returning undefined<p>Installed <a href="https://color-mode.nuxtjs.org/" rel="nofollow noreferrer"><code>nuxt-color-mode</code></a> following their official Docs. Though, when loading the page I'm getting <strong>Cannot read properties of undefined (reading 'value')</strong></p>
<p><code>np... | <p>You'll need to downgrade to the latest v2 of the package aka <code>"@nuxtjs/color-mode": "^2.1.1"</code>. It looks like the v3 is not properly working with Nuxt2.</p>
<hr />
<p>The following template works well</p>
<pre class="lang-html prettyprint-override"><code><template>
<div>
... | nuxt-color-mode not running. Returning undefined | nuxt.js | 1 | 39 | 1 | 72,993,379 | 72,993,379 | 1 | true | 2022-07-15T11:07:57.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
nuxt-color-mode not running. Returning undefined<p>Installed <a href="https://color-mode.nuxtjs.org/" rel="nofollow noreferrer"><code>nuxt-color-mode</code><... |
72,992,395 | Embedding maven and building a project using maven-core<p>I am currently trying to implement logic where maven is used to compile java source code. For that I don't want to use the maven cli but rather some sort of api, like the <a href="https://docs.gradle.org/current/userguide/third_party_integration.html" rel="nofol... | <p>You can examine code of <a href="https://github.com/apache/maven-verifier/blob/master/src/main/java/org/apache/maven/it/Embedded3xLauncher.java" rel="nofollow noreferrer">Embedded3xLauncher</a> in <a href="https://github.com/apache/maven-verifier" rel="nofollow noreferrer">maven-verifier</a> project.</p>
<p>Or simpl... | Embedding maven and building a project using maven-core | java|maven | 1 | 39 | 1 | 72,994,537 | 72,994,537 | 1 | true | 2022-07-15T10:10:56.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Embedding maven and building a project using maven-core<p>I am currently trying to implement logic where maven is used to compile java source code. For that ... |
72,988,048 | How to lock queue for one thread?<p>I have a queue that has several producer and consumer threads adding and removing items. Every once in a while, another thread needs to lock the queue, remove and process every item in the queue, and then release the queue back to the rest of the threads. How can I keep blocking ot... | <p>Thanks to martineau, who has a couple of good approaches to the solution in the comments. Here is an example class that locks the queue while processing all items in the queue:</p>
<pre><code>import queue
from threading import Thread
class PriorityConsumer(Thread):
def __init__(self, q):
super(Priori... | How to lock queue for one thread? | python|multithreading|queue|producer-consumer | 0 | 39 | 1 | 72,997,607 | 72,997,607 | 1 | true | 2022-07-15T01:01:03.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to lock queue for one thread?<p>I have a queue that has several producer and consumer threads adding and removing items. Every once in a while, another ... |
72,996,077 | Spring list validation - get field from invalid object<p>I'm trying to understand if it's possible to get the index of invalids objects inside a list that is validated with @Valid.</p>
<p>I already have validation in place where I send a response like this</p>
<pre><code>{
"status": "BAD_REQUEST"... | <p>You can access information about objects that violated the constraint by unwrapping your <code>ObjectError</code> or <code>FieldError</code> to <code>ConstraintViolation</code> (<a href="https://docs.oracle.com/javaee/7/api/javax/validation/ConstraintViolation.html" rel="nofollow noreferrer">https://docs.oracle.com/... | Spring list validation - get field from invalid object | java|spring-boot|validation | 1 | 39 | 1 | 72,999,016 | 72,999,016 | 1 | true | 2022-07-15T15:11:30.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring list validation - get field from invalid object<p>I'm trying to understand if it's possible to get the index of invalids objects inside a list that is... |
72,999,584 | Can someone explain the diction in the error: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'..."?<p>I know this issue is all over stack overflow and there are a lot of solutions to it, but my questions is regarding the phrasing of the error itself and what certain par... | <h2>TL;DR</h2>
<blockquote>
<p>Is this saying the Microsoft received or sent an <code>XMLHttpRequest</code>?</p>
</blockquote>
<p>Microsoft received the request.</p>
<blockquote>
<p>Is the originator of the <code>XMLHttpRequest</code> Apple?</p>
</blockquote>
<p>Yes.</p>
<hr />
<h2>More details</h2>
<p>I'm assuming tha... | Can someone explain the diction in the error: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'..."? | iis|cors|access-control-allow-origin | 0 | 39 | 1 | 73,000,047 | 73,000,047 | 1 | true | 2022-07-15T21:04:41.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can someone explain the diction in the error: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'..."?<p>I kno... |
72,997,792 | Rails How to create a Model, Controller and View using Inheritance?<p>I am working on this application that uses inheritance on models, but it is getting this <strong>error message</strong> on the view:</p>
<p><strong>superclass mismatch for class BankTransfer</strong></p>
<p>I have created an MVC called “payment_metho... | <p>If you're going to have a <code>'Stripe'</code> value in your <code>payment_methods.type</code> column then you'll need to have a <code>Stripe</code> class that looks like this:</p>
<pre><code>class Stripe < PaymentMethod
# ...
end
</code></pre>
<p>Similarly for other <code>payment_methods.type</code> values.</... | Rails How to create a Model, Controller and View using Inheritance? | ruby-on-rails|ruby|rails-activerecord|single-table-inheritance | 0 | 39 | 1 | 73,001,105 | 73,001,105 | 1 | true | 2022-07-15T17:34:35.800Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails How to create a Model, Controller and View using Inheritance?<p>I am working on this application that uses inheritance on models, but it is getting thi... |
73,001,086 | How to horizontally orient a bar plot in plotly using python?<p>I have a bar plot that resembles this something like this-</p>
<pre><code>import plotly.graph_objects as go
months = ["ABC","XYZ"]
fig = go.Figure()
fig.add_trace(go.Bar(
x=months,
y=[3.95,4.04],
name='SMD',
marker_colo... | <p>A horizontal bar graph can be created by reversing the x- and y-axes of a normal bar graph and specifying the graph direction. In addition, the y-axis is reversed. Refer to this in <a href="https://plotly.com/python/horizontal-bar-charts/#horizontal-bar-chart-with-gobar" rel="nofollow noreferrer">the official refere... | How to horizontally orient a bar plot in plotly using python? | python|plotly|plotly-python | 0 | 39 | 1 | 73,001,264 | 73,001,264 | 1 | true | 2022-07-16T02:11:18.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to horizontally orient a bar plot in plotly using python?<p>I have a bar plot that resembles this something like this-</p>
<pre><code>import plotly.graph... |
73,002,541 | Verification system in discord.js<p>Basically when I do console.log(message.author.roles) it just says its undefined and from there im lost please help me</p>
<pre class="lang-js prettyprint-override"><code>const roleId = config.verify.roleId // 997167483473629324
const channelId = config.verify.channelId // 9971674500... | <p>When using <a href="https://discord.js.org/#/docs/discord.js/stable/class/Message?scrollTo=author" rel="nofollow noreferrer"><code>message.author</code></a>, you get a <a href="https://discord.js.org/#/docs/discord.js/stable/class/User" rel="nofollow noreferrer"><code>User</code></a> object which represents the glob... | Verification system in discord.js | discord|discord.js|roles | -1 | 39 | 1 | 73,002,588 | 73,002,588 | 1 | true | 2022-07-16T07:57:32.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Verification system in discord.js<p>Basically when I do console.log(message.author.roles) it just says its undefined and from there im lost please help me</p... |
73,005,336 | Code to Extract Data Based on Criteria in CSV<p>I have a comma delimited text file containing 2M+ records with multiple columns. I would like a way to extract only the columns and rows I need based on values in other columns.</p>
<p>Criteria: <br>
ODBIC = YES <br>
NAM = 1 OR 2</p>
<p>Keep columns:<br> ACC | NUM | NAM ... | <p>Install <code>pandas</code> module</p>
<pre><code>pip install pandas
</code></pre>
<p><strong>CODE</strong></p>
<pre><code>import pandas as pd
file_path = "path_to_csv_file"
data = pd.read_csv(file_path)
data = data[(data["ODBIC"] == "YES") & ((data["NAM"] == 1) | (data[... | Code to Extract Data Based on Criteria in CSV | python|csv | 0 | 39 | 2 | 73,005,461 | 73,005,461 | 1 | true | 2022-07-16T15:14:18.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Code to Extract Data Based on Criteria in CSV<p>I have a comma delimited text file containing 2M+ records with multiple columns. I would like a way to extrac... |
73,000,992 | GTK4 ApplicationWindow that is also a ScrolledWindow?<p>Here is a minimal GTK 4 app written using the Python bindings, based on <a href="https://github.com/Taiko2k/GTK4PythonTutorial" rel="nofollow noreferrer">this tutorial</a>. It displays a window with a very long block of text:</p>
<pre class="lang-py prettyprint-ov... | <p>A <code>Gtk.ScrolledWindow</code> isn't really a "window" per se as most people know it (it used to map to the very specific concept of a X11 Window). It's a widget that allows you to scroll through its child widget.</p>
<p>In other words, if you want an application window where you can scroll through the ... | GTK4 ApplicationWindow that is also a ScrolledWindow? | gtk|pygobject | 0 | 39 | 1 | 73,006,754 | 73,006,754 | 1 | true | 2022-07-16T01:42:59.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GTK4 ApplicationWindow that is also a ScrolledWindow?<p>Here is a minimal GTK 4 app written using the Python bindings, based on <a href="https://github.com/T... |
73,010,343 | Why flatlist is not sorted after sorting the array?<p>I'm creating a flatlist that outputs array of object from an API. Before outputting the array, It will be sorted alphabetically and another data will be added at the top of the array. The problem is that the data is not sorted when rendered in the flatlist and the n... | <p>In your first call to <code>setListTab</code> you're setting the state to <code>result.data.categoriesData</code>.</p>
<p>Then you're trying to sort <code>listTab</code>, but in this moment, the state still empty <code>[]</code>, because react have not rendered it yet.</p>
<p>Sort the results of your request before,... | Why flatlist is not sorted after sorting the array? | javascript|react-native|sorting | 0 | 39 | 2 | 73,010,741 | 73,010,741 | 1 | true | 2022-07-17T08:37:52.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why flatlist is not sorted after sorting the array?<p>I'm creating a flatlist that outputs array of object from an API. Before outputting the array, It will ... |
73,009,289 | When I hot encode a categorical variable using OneHotEncoder, do I need to remove the original column before I train a machine learning model?<p>I used OneHotEncoder to convert a zipcode before feeding into a Random Forest Model:</p>
<pre><code>from sklearn.preprocessing import OneHotEncoder
one_hot = OneHotEncoder()
e... | <p>Short answer: Yes, you need to exclude it.</p>
<p>sklearn has no way of knowing what features are important or which ones are not or even if there is a connection between some of them (that's why you should also try to not use correlated features too much). The OneHotEncoder merely adds features that encode your cat... | When I hot encode a categorical variable using OneHotEncoder, do I need to remove the original column before I train a machine learning model? | python|scikit-learn|random-forest|one-hot-encoding | 0 | 39 | 1 | 73,011,013 | 73,011,013 | 1 | true | 2022-07-17T04:39:08.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When I hot encode a categorical variable using OneHotEncoder, do I need to remove the original column before I train a machine learning model?<p>I used OneHo... |
73,011,474 | How can I show second header when scroll down 60px?<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.nav-header2{
background: purple;
display: flex;
jus... | <p>Please check the code below when you scroll 60px and more the header 1 disappear and header 2 appear</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>window.addEventListener(... | How can I show second header when scroll down 60px? | javascript|html|css | 0 | 39 | 1 | 73,011,594 | 73,011,594 | 1 | true | 2022-07-17T11:43:55.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I show second header when scroll down 60px?<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div clas... |
73,012,219 | Django: How to save javascript auto-increment to django database?<p>I am incrementing a value from my database evey 3.5 sec using javascript, but the value that i am incremeting is coming dynamically from the database, now i want to save the newly incremented value to the database as the increment keeps going, i don't ... | <p>The total points and the increment you can save in the javascript value until there is a submit of the form. Then send the result in the request to safe it to the database. If you refresh the page you indeed loose the increment. It might also be interesting for you to safe stuff in localstorage because if the user t... | Django: How to save javascript auto-increment to django database? | javascript|python|django|django-rest-framework|django-views | 0 | 39 | 1 | 73,013,310 | 73,013,310 | 1 | true | 2022-07-17T13:34:21.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django: How to save javascript auto-increment to django database?<p>I am incrementing a value from my database evey 3.5 sec using javascript, but the value t... |
73,012,729 | tox build artifact location<p>I just started using tox for testing my python project. I was able to configure build and test automation with tox, and I've been able to integrate that automation with a GitHub action to build and test my package when I push commits or a tag. In addition to having this GitHub action build... | <blockquote>
<p>can I get the full path to the built artifact from tox?</p>
</blockquote>
<p>I am pretty sure you can't, at least not easily, but you usually do not need that path.</p>
<p>Both for uploading a package to e.g. PyPI or using the mentioned GitHub action you usually do not use the full path, but either a pa... | tox build artifact location | python|automation|tox | 0 | 39 | 1 | 73,013,761 | 73,013,761 | 1 | true | 2022-07-17T14:42:00.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
tox build artifact location<p>I just started using tox for testing my python project. I was able to configure build and test automation with tox, and I've be... |
73,015,126 | Django Database not retrieving username/password<p>IMage can't be posted some reason but it returns both errors:</p>
<p>User does not exist</p>
<p>Username OR Password not Valid</p>
<p>It seems Django is unable to access the database of users as well as passwords.
The password consists of numbers, letters, upper/lowerc... | <p>You have to add name in the form input fields:</p>
<pre class="lang-html prettyprint-override"><code><form method="POST" action="">
{% csrf_token %}
<label>Username:</label>
<input type="text" name="username" placeholder='Enter Username..' /&g... | Django Database not retrieving username/password | python|django | 0 | 39 | 1 | 73,015,191 | 73,015,191 | 1 | true | 2022-07-17T20:26:13.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django Database not retrieving username/password<p>IMage can't be posted some reason but it returns both errors:</p>
<p>User does not exist</p>
<p>Username O... |
73,013,061 | Unable to locate element inside a table using xpath with selenium<p>I want to click on a button inside my table each row has a update button I want to click on a specfic button inside my table.</p>
<p>Here is a what my table looks like:</p>
<pre><code><table _ngcontent-vhp-c82="" datatable="" id=... | <p>You were almost there. While considering a xpath the <em><code>attribute_name</code></em> should be always preceded by a <code>@</code> sign.</p>
<p>Additionally to make the xpath more canonical as the element is a <code><span></code> element you can mention <code>//span</code> to start the xpath.</p>
<p>Effec... | Unable to locate element inside a table using xpath with selenium | c#|html|selenium|selenium-webdriver|xpath | 1 | 39 | 1 | 73,015,892 | 73,015,892 | 1 | true | 2022-07-17T15:31:22.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to locate element inside a table using xpath with selenium<p>I want to click on a button inside my table each row has a update button I want to click ... |
73,015,814 | Angular observable is not working in callback funtion but Subject is working<p>I have a callback method in a service which have code like below:</p>
<pre><code>@Injectable({
providedIn: 'root'
})
export class AService {
counter: number = 0;
anObject = new anObject();
dataObservable = {} as Observable<anObject>... | <p>I don't think you can use <code>Observable</code> in this way</p>
<pre><code>this.dataObservable = new Observable((observer) => observer.next(this.anObject));
</code></pre>
<p>because at this line you are recreating an observable instance each time and assigning it to the same property, and so if you have any sub... | Angular observable is not working in callback funtion but Subject is working | angular|service|callback|observable|subject | -1 | 39 | 1 | 73,016,943 | 73,016,943 | 1 | true | 2022-07-17T22:36:26.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular observable is not working in callback funtion but Subject is working<p>I have a callback method in a service which have code like below:</p>
<pre><co... |
73,017,497 | Pytest in a nested directory<p>This example works if <code>tool_1/</code> is the top folder.
However, I must make room in the repo for other tools, as so:</p>
<pre><code>tool_repo/tool_1/src/main.py
tool_repo/tool_1/test/test_main.py
</code></pre>
<p>I also have:</p>
<pre><code>tool_repo/tool_1/__init__.py
tool_repo/to... | <p>You need to run the module from outside.</p>
<p>If your module <code>tool_1</code> located in <code>tool_repo\tool_1\</code>, you should run it from:</p>
<pre><code>cd C:\pycharmProjects\tool_repo
python -m pytest
</code></pre>
<p>note that your <code>imports</code> looks for it: <code>import tool_1...</code></p> | Pytest in a nested directory | python|pytest | 1 | 39 | 1 | 73,017,696 | 73,017,696 | 1 | true | 2022-07-18T04:59:24.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pytest in a nested directory<p>This example works if <code>tool_1/</code> is the top folder.
However, I must make room in the repo for other tools, as so:</p... |
73,015,186 | Errors while Creating and Exporting DataFrame to Excel<blockquote>
<p>I have an excel file with 5 columns and 4500 rows of data. The image is a sample of 5 rows from the file that will be iterated through in this code.
<a href="https://i.stack.imgur.com/D4gWI.png" rel="nofollow noreferrer"><img src="https://i.stack.img... | <p>You need to append <code>allData</code> to the <code>data</code> list. For testing purpose you can try my code for first 10 rows, I have edited accordingly.</p>
<pre><code>import pandas as pd
import json
import requests
file = pd.read_excel('allstockdata.xlsx')
file = file.iloc[:10] # For testing purpose try with f... | Errors while Creating and Exporting DataFrame to Excel | python-3.x|excel|dataframe|loops | 0 | 39 | 1 | 73,021,121 | 73,021,121 | 1 | true | 2022-07-17T20:37:30.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Errors while Creating and Exporting DataFrame to Excel<blockquote>
<p>I have an excel file with 5 columns and 4500 rows of data. The image is a sample of 5 r... |
73,027,468 | How to append nested key-value to json array in postgresql?<p>My <code>json</code> values in jsonb column are below:</p>
<pre><code>{"Id": "7324326", "UserName":"Henry", "Details": {"Email":"henry@test.com", "Phone":"03722", "... | <p>You can use <code>jsonb_set</code>:</p>
<pre><code>update tbl set js = jsonb_set(js, '{Details,Images}'::text[],
coalesce((select jsonb_agg(jsonb_build_object('Link', v.value, 'UploadedBy', null, 'Size', null))
from jsonb_array_elements(js -> 'Details' -> 'Images') v), '[]'::jsonb))
</code></pre>
<p... | How to append nested key-value to json array in postgresql? | sql|postgresql|jsonb | 0 | 39 | 1 | 73,028,106 | 73,028,106 | 1 | true | 2022-07-18T19:12:09.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to append nested key-value to json array in postgresql?<p>My <code>json</code> values in jsonb column are below:</p>
<pre><code>{"Id": "73... |
73,023,525 | Can I make [subsidy halving] in solidity?<p>I want to make new coin in solidity.
I found the code how to make subsidy halving in Bitcoin clone coding.
Can I make subsidy halving in solidity?(ERC-20, 721, 1155 whatever)
I can't find any subsidy halving in ERC coin.</p>
<p>Sorry for my poor English.</p> | <p>I want to assume that you mean: "Bitcoin Halving." Given that is the case, in Solidity, what is available is: "<strong>Token burning</strong>".</p>
<p>To ensure that you understand: Bitcoin Halving is an event that occurs where the block reward given to Bitcoin miners for processing transactions ... | Can I make [subsidy halving] in solidity? | ethereum|solidity|ethers.js | -1 | 39 | 1 | 73,028,919 | 73,028,919 | 1 | true | 2022-07-18T13:56:37.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I make [subsidy halving] in solidity?<p>I want to make new coin in solidity.
I found the code how to make subsidy halving in Bitcoin clone coding.
Can I ... |
72,774,453 | Is there a big performance difference with Cassandra LWTs?<p>I have a similar question, but it's not clear, so I'm asking myself. Simple. I want to update only when there is a target row, and if it doesn't, it shouldn't be done. (No new rows should be added.)</p>
<ol>
<li>After Select, check the value and Update</li>
<... | <p>The first option where you select-then-update is invalid because there is no guarantee that the data wouldn't change between the time that you've read it until the time that you update it -- the data isn't locked.</p>
<p>Lightweight transactions (LWTs), also known as compare-and-set (CAS) statements, are expensive b... | Is there a big performance difference with Cassandra LWTs? | spring|cassandra|cql | 0 | 39 | 1 | 73,032,214 | 73,032,214 | 1 | true | 2022-06-27T15:12:50.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a big performance difference with Cassandra LWTs?<p>I have a similar question, but it's not clear, so I'm asking myself. Simple. I want to update on... |
73,019,583 | Tosca not edifying field in FIORI test automation<p>I'm currently using Tosca to automate a specific SAP process in FIORI. At the end of the process, I need to click a specific field to finish the process.</p>
<p>What happens is that the program doesn't recognize the field. I tried multiple scans and rescans and nothin... | <p>Try to find RadioButton inside the DIV in XScan.
It is better to use set value True/False (if possible) than to click on the element.</p> | Tosca not edifying field in FIORI test automation | automation|automated-tests|tosca | 1 | 39 | 1 | 73,077,448 | 73,077,448 | 1 | true | 2022-07-18T08:46:47.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tosca not edifying field in FIORI test automation<p>I'm currently using Tosca to automate a specific SAP process in FIORI. At the end of the process, I need ... |
72,942,699 | error is imported here, but it is a function-like macro<p>I have created a macro to handle all the errors, which will then be implemented individually in the code. But I am getting some errors.</p>
<pre><code>#[error]
pub enum ErrorCode {
#[msg("SOMETHING 1")]
Unauthorized,
}
</code></pre>
<p>and impl... | <p>You need use <code>[error_code]</code> macro instead of <code>[error]</code> I think this a change that was made during the updates .</p> | error is imported here, but it is a function-like macro | blockchain|smartcontracts|solana|anchor-solana | 0 | 39 | 1 | 73,164,755 | 73,164,755 | 1 | true | 2022-07-11T17:50:07.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
error is imported here, but it is a function-like macro<p>I have created a macro to handle all the errors, which will then be implemented individually in the... |
72,838,338 | How to change background using conditions and save it in Flutter/Dart?<p>I have a code that changes text when the button is clicked:</p>
<pre><code>// New Game route
class NewGameRoute extends StatelessWidget {
const NewGameRoute({key});
@override
Widget build(BuildContext context) {
return const MaterialApp... | <p>Hope this helps.</p>
<pre><code>class ListFromCSV extends StatefulWidget {
const ListFromCSV({Key? key}) : super(key: key);
@override
_ListFromCSVState createState() => _ListFromCSVState();
}
class _ListFromCSVState extends State<ListFromCSV> {
List<List<dynamic>> _listData = [
[&q... | How to change background using conditions and save it in Flutter/Dart? | flutter|dart|flutter-layout | 0 | 39 | 2 | 72,838,616 | 72,838,616 | 1 | true | 2022-07-02T10:27:59.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change background using conditions and save it in Flutter/Dart?<p>I have a code that changes text when the button is clicked:</p>
<pre><code>// New Ga... |
72,796,634 | append ids when specific column is the same<p>For example I have this table</p>
<pre><code>| ID | VALUE |
| -------- | -------------- |
| 1 | row24 |
| 2 | row24 |
| 3 | row1 |
| 4 | row15 |
| 5 | row16 |
| 6 | row17 |
| 8 | ... | <p>If need combination lists and scalars use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.agg.html" rel="nofollow noreferrer"><code>GroupBy.agg</code></a> with lambda function:</p>
<pre><code>df = (df.groupby('VALUE', sort=False)['ID']
.agg(lambda x: list(x) if... | append ids when specific column is the same | python|pandas | 3 | 39 | 1 | 72,796,654 | 72,796,654 | 1 | true | 2022-06-29T06:21:12.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
append ids when specific column is the same<p>For example I have this table</p>
<pre><code>| ID | VALUE |
| -------- | -------------- |
| 1 ... |
72,812,106 | Merging dataframes (with different date time --monthly vs daily) at the same time applying lagged values to one of the dataframes<p>I have 2 dataframes I wish to merge:</p>
<p>df1 looks like this:</p>
<pre><code>Date Col1 Col 2 Col 3 Col 4
2016-03 27.57 0.93 28.7 1.57
2016-04 2... | <p>For merge use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.merge_asof.html" rel="nofollow noreferrer"><code>merge_asof</code></a>:</p>
<pre><code>print (df1)
Date Col1 Col 2 Col 3 Col 4
0 2016-03 27.57 0.93 28.70 1.57
1 2016-04 25.83 0.23 28.34 0.84
2 2016-05 2... | Merging dataframes (with different date time --monthly vs daily) at the same time applying lagged values to one of the dataframes | python|pandas|merge|concatenation|lag | 1 | 39 | 2 | 72,812,243 | 72,812,243 | 1 | true | 2022-06-30T07:51:10.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merging dataframes (with different date time --monthly vs daily) at the same time applying lagged values to one of the dataframes<p>I have 2 dataframes I wis... |
73,021,336 | is there a way, to count all rows which contain at least one '1' in a dataframe checking multiple named columns?<p>I have a dataset filled with Medicare beneficiaries. The question is: 'What proportion of patients have at least one of the chronic conditions described in the independent variables alzheimers, arthritis, ... | <p>If need filter only some columns names use subset for filter columns names, compare by <code>1</code> by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.eq.html" rel="nofollow noreferrer"><code>DataFrame.eq</code></a> and last test at least one <code>True</code> by <a href="http:/... | is there a way, to count all rows which contain at least one '1' in a dataframe checking multiple named columns? | python|pandas|dataframe|data-preprocessing | 2 | 39 | 1 | 73,021,422 | 73,021,422 | 1 | true | 2022-07-18T11:05:53.077Z | 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 count all rows which contain at least one '1' in a dataframe checking multiple named columns?<p>I have a dataset filled with Medicare bene... |
72,913,671 | How can I get attribute valus of a JSON using JMESPath<p>I need to get the value of <code>_ISSUE_CURRENCY</code>.</p>
<p>I have a JSON which is as below:</p>
<pre class="lang-json prettyprint-override"><code>{
'#value': 'VR-GROUP PLC',
'_ISSUE_CURRENCY': 'EUR',
'_PRICING_MULTIPLIER': 1,
'_TYPE': 'Debt',... | <p>You are stating:</p>
<blockquote>
<p>I have a JSON which is as below</p>
</blockquote>
<p>This is not a JSON, as described in the <a href="https://www.rfc-editor.org/rfc/rfc7159" rel="nofollow noreferrer">RFC 7159</a>, describing what is a valid JavaScript Object Notation (JSON), the quotation mark that delimits str... | How can I get attribute valus of a JSON using JMESPath | python|json|jmespath | 1 | 39 | 1 | 72,931,118 | 72,931,118 | 1 | true | 2022-07-08T15:25:52.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get attribute valus of a JSON using JMESPath<p>I need to get the value of <code>_ISSUE_CURRENCY</code>.</p>
<p>I have a JSON which is as below:</p>... |
72,945,907 | C# Copy Columns with values within the same DataTable while convert from Int32 into Int64<p>I have a DataTable (i.e. DT) that has a few columns of Type of String (i.e. colStr1, colStr2), and a few of the Type of Int32 (i.e. colInt1, colInt2). This is set in the DB as well as in the DataTable created in the code.</p>
<p... | <p>Your first approach is, indeed, not possible. Given you have two Int32 columns, you could have an Int64, then split that bit-wise across the two Int32s, but that seems like a lot of hassle if you don't need to store the sum. (If you do need to store the sum, a better approach would be to use another table, or someth... | C# Copy Columns with values within the same DataTable while convert from Int32 into Int64 | c#|datatable|copy|datacolumn | 0 | 39 | 1 | 72,946,117 | 72,946,117 | 1 | true | 2022-07-12T00:31:56.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Copy Columns with values within the same DataTable while convert from Int32 into Int64<p>I have a DataTable (i.e. DT) that has a few columns of Type of St... |
72,791,622 | Plot multiple dataframes with a loop/function<p>I have 18 dataframes named chr1, chr2 ... chr18.</p>
<p>And the following (simplified) code to produce a plot:</p>
<pre><code>p1 <- ggplot(chr1, aes(V4, colour = factor(V6)))+
geom_freqpoly(binwidth=1, size=0.8) +
labs(x="score", y="Number of Mutati... | <p>This is not a function, but creates the individual plot objects:</p>
<pre><code>library(ggplot2)
chr.list <- list(
chr1 = data.frame(V4 = sample(1:100, 20), V6 = sample(1:3, 20, replace = T)),
chr2 = data.frame(V4 = sample(1:100, 20), V6 = sample(1:3, 20, replace = T)),
chr3 = data.frame(V4 = sample(1:100,... | Plot multiple dataframes with a loop/function | r|ggplot2 | 0 | 39 | 1 | 72,792,437 | 72,792,437 | 1 | true | 2022-06-28T18:39:31.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plot multiple dataframes with a loop/function<p>I have 18 dataframes named chr1, chr2 ... chr18.</p>
<p>And the following (simplified) code to produce a plot... |
72,891,358 | Looping through two sets of data to conditionally append to CSV file<p>I'm writing a script that should: 1) open a CSV file 2) loop through some eBay results data 3) write details from this data to the same file if it matches a search term and if it's not already present, but it has a few issues:</p>
<ol>
<li>The heade... | <p>There's a few issues with your code:</p>
<ul>
<li>you create a file handle to read a file and then another file handle to append to the same file; that's dodgy at best, do you expect the reader to read lines you've appended? What's the purpose?</li>
<li>you exhaust the reader with <code>for line in csv_reader:</code... | Looping through two sets of data to conditionally append to CSV file | python|python-3.x|csv | 0 | 39 | 1 | 72,891,487 | 72,891,487 | 1 | true | 2022-07-07T01:24:19.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Looping through two sets of data to conditionally append to CSV file<p>I'm writing a script that should: 1) open a CSV file 2) loop through some eBay results... |
73,030,387 | Switching windows using Watir is timing out<p>I want to automate work between two browser windows within the same Watir session. However, the code below times out before I'm able to see a new browser tab open.</p>
<pre class="lang-rb prettyprint-override"><code>b = = Watir::Browser.new :chrome
b.goto 'www.google.com'
b... | <p>When you open <code>b.goto 'www.google.com'</code> control is already in that window so you don't have to switch, you should open another window to make your switch. I have used <code>b.execute_script("window.open('https://spiritualgab.freeforums.net')")</code> to open another window in the given below pro... | Switching windows using Watir is timing out | ruby|watir | 0 | 39 | 1 | 73,031,684 | 73,031,684 | 1 | true | 2022-07-19T02:11:19.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Switching windows using Watir is timing out<p>I want to automate work between two browser windows within the same Watir session. However, the code below time... |
72,785,274 | Creating a structure using an aggregation query that groups by multiple ids<p>I have a collection named <code>Vote</code> that looks like the following:</p>
<pre><code>{
postId: "1",
comment:{
text_sentiment: "positive",
topic: "A"
}
}, // DOC-1
{
postId: "2",
... | <p>2nd stage (<code>$group</code>) - Add <code>postId</code> into <code>postIds</code> array via <code>$push</code>.</p>
<p>3rd stage (<code>$group</code>) - Add <code>postIds</code> array into <code>postIds</code> array via <code>$push</code>. This will leads <code>postIds</code> become nested array.</p>
<pre><code>[[... | Creating a structure using an aggregation query that groups by multiple ids | javascript|mongodb|mongodb-query|aggregation-framework|aggregate-functions | 0 | 39 | 1 | 72,786,456 | 72,786,456 | 1 | true | 2022-06-28T11:02:06.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating a structure using an aggregation query that groups by multiple ids<p>I have a collection named <code>Vote</code> that looks like the following:</p>
... |
73,025,738 | Angular: How to drop a line by the number of characters in the message?<p>This is an illustration image:
<a href="https://i.stack.imgur.com/Ajk8V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ajk8V.png" alt="enter image description here" /></a></p>
<p>I want after a certain amount of characters to ... | <p>You can do this with CSS using <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/word-break" rel="nofollow noreferrer"><code>word-break: break-all;</code></a> if actual character count doesn't matter and you just want to break words up based on the container size. This requires that you have a width on the c... | Angular: How to drop a line by the number of characters in the message? | angular | -1 | 39 | 2 | 73,026,066 | 73,026,066 | 1 | true | 2022-07-18T16:37:45.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular: How to drop a line by the number of characters in the message?<p>This is an illustration image:
<a href="https://i.stack.imgur.com/Ajk8V.png" rel="n... |
72,915,594 | Uncaught SyntaxError: expected expression, got ';'<pre><code>var popupContent = '<a href="#tableofresults" class="modal-trigger" onClick="stopno='+feature.properties.busstopcode+'; nuscode="'+feature.properties.nuscode+'";">Click me!</a>';
</code></pre>
<p>I'm current... | <p>As of ES2015, you could use backticks to create what is known as template literals (template strings).</p>
<p>You can encapsulate text in backticks and interpolate JavaScript so that your code is much neater. It also helps avoid any conflicting use of single/double quotation marks, and avoids having to escape (<code... | Uncaught SyntaxError: expected expression, got ';' | javascript|html|leaflet | 0 | 39 | 1 | 72,916,726 | 72,916,726 | 1 | true | 2022-07-08T18:29:49.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Uncaught SyntaxError: expected expression, got ';'<pre><code>var popupContent = '<a href="#tableofresults" class="modal-trigger" onCli... |
72,891,068 | javascript regex how to match only parts in a list with mandatory prefix<p>I want to match ": red", ": 10", ": [special]" only if category present before (I want to use replace function to get rid of them afterwards)</p>
<pre><code>category fruit(color: red, size: 10, others: [special])
</... | <p>If we take the the following input <strong>verbatim</strong><sup></sup>:</p>
<p><strong>Figure I - Input String</strong></p>
<pre><code>category fruit(color: red, size: 10, others: [special])
</code></pre>
<p>Using a positive lookbehind to match literal <code>: red</code>, <code>: 10</code>, and <code>: [special]</c... | javascript regex how to match only parts in a list with mandatory prefix | javascript|regex | 2 | 39 | 2 | 72,891,274 | 72,891,274 | 1 | true | 2022-07-07T00:18:20.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
javascript regex how to match only parts in a list with mandatory prefix<p>I want to match ": red", ": 10", ": [special]" only ... |
72,978,692 | How to use scroll snap over a number of items per scroll<p>So i'm trying to do this without any javascript. I want make it so that when i scroll, it scrolls over 4 (or multiple) items in a container. is that possible?</p>
<p>To make it easier to understand, here's</p>
<pre><code>.scrollers {
width: 100%;
max-width:... | <p>Alright so i've figured it out. The trick is to target the child elements you want the snapping to happen on and apply the snap css stylings. In my case, i needed it to be over 4 elements so i'll target <code>:nth-of-type(4n + 1)</code>. +1 is because it's zero based.</p>
<p>when we apply <code>scroll-snap-align: st... | How to use scroll snap over a number of items per scroll | css|user-interface|sass|frontend | 0 | 39 | 1 | 72,980,094 | 72,980,094 | 1 | true | 2022-07-14T10:00:54.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use scroll snap over a number of items per scroll<p>So i'm trying to do this without any javascript. I want make it so that when i scroll, it scrolls ... |
72,961,358 | Avoiding null referencing in recursive datastructure in C#<p>I am working with a <code>Binary</code> tree in C# and want to refactor the code, so none of the leafs in the tree is set to the <code>null</code> value.</p>
<p>Assuming we have the following class:</p>
<pre class="lang-c# prettyprint-override"><code>class No... | <p>Your default constructor should be private and assign <code>this</code> to your nodes:</p>
<pre><code>private Node()
{
this.Data = int.MinValue;
Left = this;
Right = this;
}
</code></pre>
<p>its only purpose is to create instance for the Empty property:</p>
<pre><code>public static readonly Node Empty {get;} =... | Avoiding null referencing in recursive datastructure in C# | c#|recursion|null | 1 | 39 | 1 | 72,961,701 | 72,961,701 | 1 | true | 2022-07-13T05:33:27.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Avoiding null referencing in recursive datastructure in C#<p>I am working with a <code>Binary</code> tree in C# and want to refactor the code, so none of the... |
72,895,147 | Create an SVG path (w/ arrow) connecting to a circle element<p>I've got a graph where source and target elements ('nodes') are circular and the connection between these two (an 'edge') must be an arrow, starting in the center of the source node and pointing to the <strong>edge</strong> of the target circle. I do have e... | <p>You will need to calculate the angle of the arrow:</p>
<p><code>let angle = Math.atan2(source.y - target.y, source.x - target.x);</code></p>
<p>Next you calculate the position of the tip of the arrow as a point on a circle with the center in the target center and the radius R = radius of the target + width of the ma... | Create an SVG path (w/ arrow) connecting to a circle element | svg|react-flow | 1 | 39 | 1 | 72,896,498 | 72,896,498 | 1 | true | 2022-07-07T09:10:40.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create an SVG path (w/ arrow) connecting to a circle element<p>I've got a graph where source and target elements ('nodes') are circular and the connection be... |
72,838,038 | (C++) Using multiple operator overloads with const reference parameters<p>I have been working on a matrix class and I have recently learnt about passing const references to operator overloads so that I can have multiple of them on the same line. The problem I encountered is when defining a function for an operator over... | <p>For starters <code>matrix1</code> is a pointer but you need to apply the subscript operator for an object of the type <code>Matrix</code>.</p>
<p><code>matrix2</code> is a constant object but the subscript operator is not a constant member function.</p>
<p>You need to overload the operator [] as a constant member fu... | (C++) Using multiple operator overloads with const reference parameters | c++|class|operator-overloading|const-reference|pass-by-const-reference | 1 | 39 | 1 | 72,838,111 | 72,838,111 | 1 | true | 2022-07-02T09:39:06.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(C++) Using multiple operator overloads with const reference parameters<p>I have been working on a matrix class and I have recently learnt about passing cons... |
72,957,648 | Calling model method and passing params Rails 6<p>I am using Graphql mutation to save a <code>User</code> that looks kinda like this:</p>
<pre><code>class CreateUser < Mutations::BaseMutation
argument :email, String, required: true
argument :password, String, required: true
argument :password_confirmatio... | <p>The error was generated from <code>contact.rb</code> you have a type its <code>belongs_to</code> but you have <code>belongs to</code>.</p>
<p><code>contact.rb</code></p>
<pre><code>class Contact < ApplicationRecord
belongs to :user, optional: true
end
</code></pre>
<p><strong>Preferred Solutions</strong></p>
<p... | Calling model method and passing params Rails 6 | ruby-on-rails|ruby | 0 | 39 | 1 | 72,957,925 | 72,957,925 | 1 | true | 2022-07-12T19:47:21.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calling model method and passing params Rails 6<p>I am using Graphql mutation to save a <code>User</code> that looks kinda like this:</p>
<pre><code>class Cr... |
72,813,687 | Convert binary/hex encoded string to an integer<p><em>Hi sorry if this is a duplicate. Have done my best to look for an answer</em><br>
BACKGROUND:<br>
I am using dpkt to try and read the src and destination ip of packets in a PCAP file.
The raw data in the file is stored simply as bytes: c0 a8 00 28 => 192 168 0 40... | <p>You can use <code>bytearray()</code> and <code>hex()</code> to get the hexadecimal value from an array of byte values:</p>
<pre><code>s = b'\xc0\xa8\x00('
print(bytearray(s).hex())
</code></pre>
<p><strong>Output:</strong></p>
<pre><code>c0a80028
</code></pre>
<p>Also, using a list comprehension can be much more cle... | Convert binary/hex encoded string to an integer | python|python-3.x|dpkt | 1 | 39 | 3 | 72,813,781 | 72,813,781 | 1 | true | 2022-06-30T09:49:36.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert binary/hex encoded string to an integer<p><em>Hi sorry if this is a duplicate. Have done my best to look for an answer</em><br>
BACKGROUND:<br>
I am ... |
72,925,644 | file input null check erroring Object is possibly 'null' in typescript<p>I am trying to check against input file being null in typescript.
the problem is that (if condition is erroring out) telling me Object is possibly 'null'.
how to check against null for this particular case ?</p>
<p><div class="snippet" data-lang="... | <p>You can add a condition to check if the input element is <em>null</em> (or <em>undefined</em>) :</p>
<pre class="lang-js prettyprint-override"><code>if (input && input.files[0]['type']) {
const fileType = input.files![0]['type'];
}
</code></pre> | file input null check erroring Object is possibly 'null' in typescript | typescript | 0 | 39 | 2 | 72,925,692 | 72,925,692 | 1 | true | 2022-07-10T01:38:55.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
file input null check erroring Object is possibly 'null' in typescript<p>I am trying to check against input file being null in typescript.
the problem is tha... |
72,970,478 | How to get 'get' method working in vue 3 modal<p>I have a table of entries and trying to created a modal to view the details of the entry.
However, the modal is unable to get the info and I believe that it cannot access the method within the modal as the cause, but I am not sure how to resolve this.</p>
<p>my code is a... | <p>First of all, there is a typo error here.</p>
<pre><code>$this.detailID
</code></pre>
<p>It should be</p>
<pre><code>this.detailID
</code></pre>
<p>Also, after you send the HTTP request, you didn't get the response value and assign it to <code>data</code> variable to show it in the modal</p>
<pre><code>export defaul... | How to get 'get' method working in vue 3 modal | javascript|api|vue.js|axios|modal-dialog | 0 | 39 | 1 | 72,970,590 | 72,970,590 | 1 | true | 2022-07-13T17:39:59.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get 'get' method working in vue 3 modal<p>I have a table of entries and trying to created a modal to view the details of the entry.
However, the modal... |
72,910,805 | Docker delete all images script not working on Ubuntu<p>I need your help with a command I was using on Windows but on Ubuntu it won't work for me.</p>
<pre class="lang-bash prettyprint-override"><code>docker images | grep none | awk ' { print $3; } ' | xargs docker rmi -f & cls & docker images
</code></pre>
<p>... | <p>Okay so I got it working with:</p>
<pre class="lang-bash prettyprint-override"><code>docker images | grep none | awk " { print $3; } " | xargs docker rmi -f ; clear ; docker images
</code></pre>
<p>Thanks for your efforts tho, it helped me with other problems :)</p> | Docker delete all images script not working on Ubuntu | linux|docker|ubuntu | -1 | 39 | 2 | 72,948,303 | 72,948,303 | 1 | true | 2022-07-08T11:35:51.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Docker delete all images script not working on Ubuntu<p>I need your help with a command I was using on Windows but on Ubuntu it won't work for me.</p>
<pre c... |
72,849,136 | Why does my parallel projection appear inverted?<p>I have the following parallel projection (Row major):</p>
<p><a href="https://i.stack.imgur.com/vsgf8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vsgf8.png" alt="enter image description here" /></a></p>
<p>Before I apply the projection I use the ... | <p>I remembered that I was having a hard time with matrix multiplication before and that probably I might had screwed a sign or a trigonometric function. I double checked everything and but all was ok. Still the result was flipped on the y axis so what I did was this:</p>
<p><a href="https://www.wolframalpha.com/input?... | Why does my parallel projection appear inverted? | c|math|matrix|projection | 1 | 39 | 1 | 72,850,140 | 72,850,140 | 1 | true | 2022-07-03T18:55:37.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my parallel projection appear inverted?<p>I have the following parallel projection (Row major):</p>
<p><a href="https://i.stack.imgur.com/vsgf8.png"... |
72,906,821 | Create bargraph based purely on user input<p>I am creating a very simple app to show census questions to test my understanding of <code>shiny</code>.
I can create an app using a datatable but I want to learn to create an app where plots of graphs are created based on purely user inputs. In the following app, the only p... | <p>You need to give <code>input$children</code> inside a plotting function. For example,</p>
<pre class="lang-r prettyprint-override"><code>library(shiny)
library(ggplot2)
# define ui ----------------------------
ui <- fluidPage(
numericInput(
inputId = "children",
label = "How many childre... | Create bargraph based purely on user input | r|shiny | 0 | 39 | 1 | 72,907,002 | 72,907,002 | 1 | true | 2022-07-08T04:58:52.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create bargraph based purely on user input<p>I am creating a very simple app to show census questions to test my understanding of <code>shiny</code>.
I can c... |
72,907,198 | Logfile game from array to file text is not writing anything c++<p>I developed a game and everything went well except I want to make a logfile (means data from array to text file) but nothing is coming out for the array. My code:</p>
<pre><code>void writeToFile(ofstream &outputfile, string name, string s2, string s... | <p>Look at what your code actually does</p>
<ol>
<li><p>Allocate arrays of <strong>empty</strong> strings</p>
<pre><code>string *name; name= new string[count];
string *s2; s2= new string[count];
string *s3; s3= new string[count];
string *s4 ; s4 = new string[count];
string *s5 ; s5 = new string[count];
string *s... | Logfile game from array to file text is not writing anything c++ | c++ | 0 | 39 | 1 | 72,907,522 | 72,907,522 | 1 | true | 2022-07-08T05:56:44.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Logfile game from array to file text is not writing anything c++<p>I developed a game and everything went well except I want to make a logfile (means data fr... |
72,990,975 | Ensure regex test fails even if string matches an earlier portion of the pattern<p>Apologies if the title is too vague, I don't know the terminology for this issue so any suggestions would be much appreciated!</p>
<p>Current pattern: <code>^(?:\/[^\/]*){2}(?:\/tree|)</code></p>
<p>Target language/platform: JS</p>
<p>In... | <p>You could optionally match <code>/tree</code> followed by optional repetitions or <code>/</code> and other chars than <code>/</code> and assert the end of the string <code>$</code> to prevent partial matches.</p>
<pre><code>^(?:\/[^\/]*){2}(?:\/tree(?:\/[^\/]*)*)?$
</code></pre>
<p><strong>Explanation</strong></p>
<... | Ensure regex test fails even if string matches an earlier portion of the pattern | javascript|regex | 0 | 39 | 1 | 72,991,076 | 72,991,076 | 1 | true | 2022-07-15T08:13:15.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ensure regex test fails even if string matches an earlier portion of the pattern<p>Apologies if the title is too vague, I don't know the terminology for this... |
72,916,579 | Assign values to different columns of the same row in a dataframe in python<p>I have the following dictionary:</p>
<pre><code> test = {'AAGUFU 60 (MDE).jpg': 0.2825904813711154,
'AAGUFU 60 (MCE).jpg': 0.27073007232248,
'AAGUFU 60 (MCA).jpg': 0.3736480594737323,
'AAGUFU 60 (MCP).jpg': 0.451558773072469... | <p>What you could do is:</p>
<pre><code>test = {'AAGUFU 60 (MDE).jpg': 0.2825904813711154,
'AAGUFU 60 (MCE).jpg': 0.27073007232248,
'AAGUFU 60 (MCA).jpg': 0.3736480594737323,
'AAGUFU 60 (MCP).jpg': 0.45155877307246917}
test = [(key, value) for key, value in test.items()]
# turn dictionary into DataFrame... | Assign values to different columns of the same row in a dataframe in python | python|pandas|dataframe | 0 | 39 | 1 | 72,916,752 | 72,916,752 | 1 | true | 2022-07-08T20:17:53.003Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assign values to different columns of the same row in a dataframe in python<p>I have the following dictionary:</p>
<pre><code> test = {'AAGUFU 60 (MDE).jp... |
72,997,531 | select points over land area in R<p>I have a point vector for the entire globe at 0.25 degree resolution.</p>
<pre><code>library(terra)
library(rnaturalearth)
# create point data
ref_grid <- terra::ext(-180, 180, -90, 90)
ref_grid <- terra::rast(ref_grid)
res(ref_grid)<- 0.25
values(ref_grid)<-1 #dummy va... | <p>You should not transform raster data to vector data if you want efficiency. In this case, you can do the following in a second or so:</p>
<pre><code>library(terra)
library(rnaturalearth)
ref_grid <- terra::rast(res=0.25)
world_shp <- rnaturalearth::ne_countries(returnclass="sf") |> vect()
ref_gri... | select points over land area in R | r|raster|sp|terra | 1 | 39 | 1 | 72,998,180 | 72,998,180 | 1 | true | 2022-07-15T17:10:21.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
select points over land area in R<p>I have a point vector for the entire globe at 0.25 degree resolution.</p>
<pre><code>library(terra)
library(rnaturalearth... |
72,788,401 | PyQt5 POO Call instance of Class in another class<p>I would like when I click on a buttom from a toolbar created with PyQt get the selected items in a QListWidget created in other class (LisWorkDirectory class).</p>
<p>In the <em><strong>ToolBar.py</strong></em> in the compilation_ function, I would like to get all sel... | <p>When you add widget to window (or to other widget) then this window (or widget) is its parent and you can use <code>self.parent()</code> to access element in window (or widget). When widgets are nested then you may even use <code>self.parent().parent()</code></p>
<pre><code>def compilation_(self):
""&q... | PyQt5 POO Call instance of Class in another class | python|pyqt5 | 0 | 39 | 1 | 72,789,840 | 72,789,840 | 1 | true | 2022-06-28T14:33:52.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PyQt5 POO Call instance of Class in another class<p>I would like when I click on a buttom from a toolbar created with PyQt get the selected items in a QListW... |
72,942,585 | awk to compare files<p>I'm trying to use awk to find the common lines between two files and save it as a .txt as follows:</p>
<pre><code>>CL1 1
lcu_1 lcu_2 lcu_3
>CL2 1
lcu_6 lcu_4 lcu_8
</code></pre>
<pre><code>>CL1 1
ler_1 lcu_2 ler_3
>CL2 1
lcu_1 lcu_2 lcu_3
>CL3 1
lcu_6 lcu_4 lcu_8
</code></pre>
<p>E... | <p>With awk, can use <code>></code> as the <em>record</em> separator. The output is a bit messed up though:</p>
<pre class="lang-bash prettyprint-override"><code>$ awk 'BEGIN {RS = ORS = ">"} NR == FNR {clu[$1]; next} $1 in clu' file2.cls file1.cls
>CL1 1
lcu_1 lcu_2 lcu_3
>CL2 1
lcu_6 lcu_4 lcu_8... | awk to compare files | linux|awk | -1 | 39 | 2 | 72,943,047 | 72,943,047 | 1 | true | 2022-07-11T17:39:22.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
awk to compare files<p>I'm trying to use awk to find the common lines between two files and save it as a .txt as follows:</p>
<pre><code>>CL1 1
lcu_1 lcu_... |
72,944,879 | Update variable within JavaScript object<p>Here's a simplified example of something I'm trying to do.</p>
<p>I've got an <code>input</code> field which I need to get the value from when the user types in his name and click the "Save changes" <code>button</code>.</p>
<p>What I then need is for the <code>userna... | <p>As suggested in the comments, the variable is substituted when the literal is read, therefore we postpone the reading until it's actually needed. This is done using a function.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="... | Update variable within JavaScript object | javascript|object|parsing|variables|localization | 0 | 39 | 1 | 72,944,966 | 72,944,966 | 1 | true | 2022-07-11T21:31:55.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update variable within JavaScript object<p>Here's a simplified example of something I'm trying to do.</p>
<p>I've got an <code>input</code> field which I nee... |
72,842,481 | conditional sapply to change levels of DF factors<p>I have a very messy dataset where researchers did not match levels of data across sessions. In one session, a '[digit]: ' or '[digit] : ' was added.</p>
<p>I created a dataframe of session 3, 6, and 10 visits from the SWAN dataset. You can download what I'm working w... | <p>You can use your original logic of updating the levels of the factor, rather than the value of the variable, which requires factoring again.</p>
<pre><code>new_levels <- function(vec) {
if (is.factor(vec)) {
lvls <- gsub('\\d: |\\d : ', '', tolower(levels(vec)))
dups <- which(duplicated(substr(lvl... | conditional sapply to change levels of DF factors | r|regex|apply | 1 | 39 | 2 | 72,842,960 | 72,842,960 | 1 | true | 2022-07-02T21:19:16.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
conditional sapply to change levels of DF factors<p>I have a very messy dataset where researchers did not match levels of data across sessions. In one sessi... |
72,851,564 | How to shift column one only with a particular number and keep all the column as such in a text file<p>I have a text file with 30 colums. I want to shift column number one by a small amount, let's say by 0.01, and want to keep all the other columns unchanged. An example of a three-row and thirtee column file is shown b... | <p>Something like that?</p>
<pre class="lang-bash prettyprint-override"><code>awk '{$1 -= 0.01; print}' data.txt
</code></pre>
<p>If you want to save first column formatting:</p>
<pre class="lang-bash prettyprint-override"><code>awk '{$1 = sprintf("%0.4f", $1 - 0.01); print}' data.txt
</code></pre>
<p>And for... | How to shift column one only with a particular number and keep all the column as such in a text file | awk|sed | -1 | 39 | 2 | 72,854,349 | 72,854,349 | 1 | true | 2022-07-04T03:46:17.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to shift column one only with a particular number and keep all the column as such in a text file<p>I have a text file with 30 colums. I want to shift col... |
73,014,719 | How do I do this particular alignment between a group of inputs and their labels, and a single button?<p><a href="https://i.stack.imgur.com/xSwSH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xSwSH.png" alt="enter image description here" /></a></p>
<p>This is the specific kind of alignment that I a... | <p>You can simple use flexbox for vertical-aligning:</p>
<p>Edited:</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-html lang-html prettyprint-override"><code><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.... | How do I do this particular alignment between a group of inputs and their labels, and a single button? | css|bootstrap-5 | 0 | 39 | 3 | 73,014,923 | 73,014,923 | 1 | true | 2022-07-17T19:24:13.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I do this particular alignment between a group of inputs and their labels, and a single button?<p><a href="https://i.stack.imgur.com/xSwSH.png" rel="n... |
72,799,726 | Succinct way to join between XML queries?<p><em>Oracle 18c:</em></p>
<p><a href="https://dbfiddle.uk/?rdbms=oracle_18&fiddle=a1c7e04d943c21708c8e16cf9940890a" rel="nofollow noreferrer">db<>fiddle</a> with sample data.</p>
<p><strong>(1)</strong> I have a query that extracts <code>domain</code> data from an XM... | <p>There are multiple solutions including:</p>
<ol>
<li><p>Using sub-query factoring clauses:</p>
<pre><code>WITH domain AS (<domain_query>),
subtype AS (<subtype_query>)
SELECT ...
FROM domain LEFT OUTER JOIN subtype ON (...);
</code></pre>
</li>
<li><p>Using subqueries:</p>
<pre><code>SELECT ...
FROM ... | Succinct way to join between XML queries? | sql|xml|oracle|join|oracle18c | 0 | 39 | 2 | 72,800,540 | 72,800,540 | 1 | true | 2022-06-29T10:20:22.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Succinct way to join between XML queries?<p><em>Oracle 18c:</em></p>
<p><a href="https://dbfiddle.uk/?rdbms=oracle_18&fiddle=a1c7e04d943c21708c8e16cf9940... |
73,007,195 | Why quoted printable encoding operation in javascript and in Oracle returns different results?<p>Javascript:</p>
<pre><code>//https://www.npmjs.com/package/utf8
//https://github.com/mathiasbynens/quoted-printable
par_comment_qoted = quotedPrintable.encode(utf8.encode('test ąčęė'));
console.log('par_comment_qoted='+par_... | <p>You can try using <code>CONVERT</code> to change the string from the database character set to UTF-8 before generating the quoted printable:</p>
<pre class="lang-sql prettyprint-override"><code>select utl_raw.cast_to_varchar2(
utl_encode.quoted_printable_encode(
utl_raw.cast_to_raw(
... | Why quoted printable encoding operation in javascript and in Oracle returns different results? | javascript|oracle|quoted-printable | 0 | 39 | 1 | 73,007,563 | 73,007,563 | 1 | true | 2022-07-16T19:46:28.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why quoted printable encoding operation in javascript and in Oracle returns different results?<p>Javascript:</p>
<pre><code>//https://www.npmjs.com/package/u... |
72,960,429 | Context not updating value when change routes<p>So I have my context set like this:</p>
<pre><code>import { createContext, ReactNode, useState } from "react";
type props = {
children: ReactNode;
};
type GlobalContextType = {
name: string;
setName: (value: string) => void;
};
export const GlobalCon... | <p>Does the page reload during the redirection? If yes, the state of name should be reverted back to the default value. Apparently data cannot be persisted this way.</p>
<p>You can refer to this post for more details: <a href="https://stackoverflow.com/questions/53453861/react-context-api-persist-data-on-page-refresh">... | Context not updating value when change routes | javascript|reactjs|typescript | 0 | 39 | 1 | 72,960,895 | 72,960,895 | 1 | true | 2022-07-13T02:58:43.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Context not updating value when change routes<p>So I have my context set like this:</p>
<pre><code>import { createContext, ReactNode, useState } from "r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.