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,356,839 | calling a script before the managed bootstrapper application is loaded<p>I am new to wxs and I want to run a script which sets certain registries,right before my managed bootstrapper application is loaded. I haven't found any article which talks about the same.I thought by using custom actions it would solve my require... | <p><code>CustomAction</code> can only be used in an MSI. v3 was silently ignoring it when it was used in a bundle, but v4 will give a warning.</p>
<p>In v3, it's not possible to run anything before the BootstrapperApplication. The only way to run your code is through the BA.</p>
<p>In v4, there is a new concept of Bund... | calling a script before the managed bootstrapper application is loaded | windows|wix|wix3.5|bootstrapper|burn | 0 | 42 | 1 | 72,547,396 | 72,547,396 | 0 | true | 2022-05-24T03:16:41.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
calling a script before the managed bootstrapper application is loaded<p>I am new to wxs and I want to run a script which sets certain registries,right befor... |
72,372,490 | Need Lumen render() method to return HTTP '200' status code<p>Building a simple Lumen API that takes webhook payloads from WooCommerce. When my API returns a 500 'internal error response', WooCommerce automatically switches off the webhook, as a matter of reliability. I find this a bit problematic in my case.</p>
<p>I ... | <p>The render() method actually returns a response object, that has the response HTML as a property. Therefore, my effort above was already close to the solution. I just needed to retrieve the HTML-content from the response object. The following was therefore the solution:</p>
<pre><code>$response = parent::render($req... | Need Lumen render() method to return HTTP '200' status code | exception|lumen | 0 | 42 | 1 | 72,372,803 | 72,372,803 | 0 | true | 2022-05-25T05:45:22.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need Lumen render() method to return HTTP '200' status code<p>Building a simple Lumen API that takes webhook payloads from WooCommerce. When my API returns a... |
72,395,415 | Trying to create a red-translucent , flashing gui with tkinter<pre><code>from tkinter import *
parent = Tk()
parent.geometry('500x500')
parent.title('Test in progress...')
parent.attributes('-alpha',0.5)
#parent.attributes('-fullscreen', True)
button1 = Button(parent, text = 'FOUND!',fg='red', command=parent.destroy)
... | <p>Using some help from <a href="https://stackoverflow.com/questions/27533244/how-to-make-a-flashing-text-box-in-tkinter">this answer</a> I think I have something to help you. You need to have a function that will control the changes to color utilizing <code>.after</code>. It shifts from white transparent to red in a ... | Trying to create a red-translucent , flashing gui with tkinter | python|tkinter | 0 | 42 | 1 | 72,397,311 | 72,397,311 | 0 | true | 2022-05-26T16:56:53.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to create a red-translucent , flashing gui with tkinter<pre><code>from tkinter import *
parent = Tk()
parent.geometry('500x500')
parent.title('Test i... |
72,294,910 | how can I introduce SqlLogger on my project with jdbi?<p>Im using jdbi v3 and I recently wanted to add a logger to check my query statements.</p>
<p>Checking the documentation I found this <a href="https://jdbi.org/#_sqllogger" rel="nofollow noreferrer">https://jdbi.org/#_sqllogger</a></p>
<p>Which refers to this class... | <p>Make sure you are using the latest version of the Jdbi 3 core JAR (currently that is v3.28.0).</p>
<p>As a Maven dependency:</p>
<pre><code><dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi3-core</artifactId>
<version>3.28.0</version>
</dependency>
... | how can I introduce SqlLogger on my project with jdbi? | java|jdbi | 1 | 42 | 1 | 72,295,400 | 72,295,400 | 0 | true | 2022-05-18T19:25:23.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can I introduce SqlLogger on my project with jdbi?<p>Im using jdbi v3 and I recently wanted to add a logger to check my query statements.</p>
<p>Checking... |
72,257,694 | EOS. Unexpected amount descreasing after generate raw (unsigned) transaction, sign it and broadcast<p><a href="https://local.bloks.io/account/needhelp1111?nodeUrl=http%3A%2F%2Fjungle3.cryptolions.io&systemDomain=eosio&hyperionUrl=https%3A%2F%2Fjungle3history.cryptolions.io" rel="nofollow noreferrer">Account</a>... | <p>Problem was in serialization/deserialization part.
Used library creates in DTOs separated field with getter naming pattern (for example, there is field 'account' and also there is field 'getAccount' near).</p>
<p>When raw (unsigned) transaction was serialized, it had created json field also for "getter" fi... | EOS. Unexpected amount descreasing after generate raw (unsigned) transaction, sign it and broadcast | eos | 0 | 42 | 1 | 72,343,384 | 72,343,384 | 0 | true | 2022-05-16T10:23:25.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EOS. Unexpected amount descreasing after generate raw (unsigned) transaction, sign it and broadcast<p><a href="https://local.bloks.io/account/needhelp1111?no... |
72,381,882 | Modification of XML data with namespaces using Python f-string and Xpath<p>My program is giving errors while I take input using namespaces and XPATH with f-string in for modification in XML File</p>
<p>This works fine and it show all the attributes of the XML file</p>
<pre><code>for x in root.findall(".//{http://... | <p>Since the namespace URI is <a href="https://docs.python.org/3/library/xml.etree.elementtree.html#parsing-xml-with-namespaces" rel="nofollow noreferrer">delimited by curly braces</a>, you need to use double curly braces for that part of the f-string. You also need quotes around the attribute value in the predicate.</... | Modification of XML data with namespaces using Python f-string and Xpath | python|xml|xpath|xml-namespaces|f-string | 0 | 42 | 1 | 72,382,415 | 72,382,415 | 0 | true | 2022-05-25T17:22:09.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Modification of XML data with namespaces using Python f-string and Xpath<p>My program is giving errors while I take input using namespaces and XPATH with f-... |
72,388,425 | (Python) Basic way on how to end code if incorrect user input?<p>this is my first time trying code. I viewed a basics on the foundations of python and I decided to start with something simple. I'm making a Fahrenheit to Celsius calculator and vise versa. As you can see in the code below, I want the program to stop runn... | <p>You need input validation. I've gone with the <code>try except</code> method of doing this but you can also capture the input first and then check if its a numbers instead of relying on the exception. I've also added validation to <code>option</code> so that users don't have to input a number if the option is wrong ... | (Python) Basic way on how to end code if incorrect user input? | python | 0 | 42 | 2 | 72,388,500 | 72,388,500 | 0 | true | 2022-05-26T07:44:24.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(Python) Basic way on how to end code if incorrect user input?<p>this is my first time trying code. I viewed a basics on the foundations of python and I deci... |
72,346,600 | Set score in local sotrage only if a higher number<p>Hi im trying to find a way to use local storage to save a high score, i have a simple script that sets the score each time the user plays.</p>
<pre><code> localStorage.score = $(".score").text();
$(".highscore").text(localStorage.score)... | <p>You need to know where you want to have your storage, in a separate storage item, or change it to an object and add values that will hold both the score and date.</p>
<p>Then when using localStorage, to insert a JS <strong>object</strong> correctly it has to be converted into JSON: <code>JSON.stringify()</code>, the... | Set score in local sotrage only if a higher number | html|jquery|local-storage | 0 | 42 | 1 | 72,347,213 | 72,347,213 | 0 | true | 2022-05-23T09:56:33.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set score in local sotrage only if a higher number<p>Hi im trying to find a way to use local storage to save a high score, i have a simple script that sets t... |
72,291,819 | Loop through an array if it finds a key, skip the index for that key, but eventually want to go back and add that index skipping the other keys<p>So this is kind of hard to explain, but basically trying to make a more efficient way of doing the below code...</p>
<pre><code>products.forEach(function(item, index){
if... | <p>You're already doing one loop through all the products, which is a) necessary, and b) about as efficient as it gets.</p>
<p>The best you can do is make your code less verbose. In this case I'm using a ternary to decide which whether to use <code>saleItems</code> or <code>nonSaleItems</code> as the lvalue for <code>+... | Loop through an array if it finds a key, skip the index for that key, but eventually want to go back and add that index skipping the other keys | javascript|html|arrays|object|innerhtml | 0 | 42 | 1 | 72,291,990 | 72,291,990 | 0 | true | 2022-05-18T15:17:17.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loop through an array if it finds a key, skip the index for that key, but eventually want to go back and add that index skipping the other keys<p>So this is ... |
72,355,207 | Cant center my Widgets in Container using Column() flutter<p>On this pic is my
<a href="https://i.stack.imgur.com/LCEuZ.png" rel="nofollow noreferrer">step1</a></p>
<p>And when I use Column(), my design isn't a center :( Watch it -> <a href="https://i.stack.imgur.com/fMJDo.png" rel="nofollow noreferrer">step2</a></p... | <p>Add <code>iconSize: 80</code> in your <code>IconButton</code>. And full code will be</p>
<pre><code> Expanded(
child: Padding(
padding: const EdgeInsets.all(10),
child: Container(
decoration: BoxDecoration(
borderRadius: Bo... | Cant center my Widgets in Container using Column() flutter | flutter|flutter-layout|containers|center|flutter-column | 0 | 42 | 1 | 72,356,521 | 72,356,521 | 0 | true | 2022-05-23T21:59:03.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cant center my Widgets in Container using Column() flutter<p>On this pic is my
<a href="https://i.stack.imgur.com/LCEuZ.png" rel="nofollow noreferrer">step1<... |
72,306,802 | A2019: how to get a context menu in a form for an unbound date control like for bound date controls<p>I'm not sure how it is possible to get the same contextmenu for an unbound form's control like for bound controls, both with a date value.</p>
<p>There are two unbound controls which get their control value via:</p>
<p... | <p>the goal was:</p>
<ul>
<li>make the form updatable</li>
<li>display the date contextmenu for the two textboxes</li>
</ul>
<p>After trying around with subforms which wasn't practable because the form is displayed in data sheet view I found this solution:</p>
<p>qry110:</p>
<pre><code>SELECT tblSpender.spID, tblSpende... | A2019: how to get a context menu in a form for an unbound date control like for bound date controls | controls|contextmenu|ms-access-2016|unbound | 0 | 42 | 1 | 72,346,992 | 72,346,992 | 0 | true | 2022-05-19T14:55:35.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A2019: how to get a context menu in a form for an unbound date control like for bound date controls<p>I'm not sure how it is possible to get the same context... |
72,308,199 | I am getting Name Error in else statement<p>So! I made a simple program that gets a file name as input and open it and read it.
and there is a special file name "mbox.txt", to open it user must insert the pin code, after that user can access the content of the file.</p>
<p>for this I made a if else condition,... | <p>Here are some control flow suggestions. I am making some guesses:</p>
<pre class="lang-py prettyprint-override"><code>#!/usr/bin/env python
MAX_ATTEMPTS = 3
attempts = 0
while True:
fname = input("Enter the file name: ")
try:
open_file = open(fname)
break
except FileNotFoundE... | I am getting Name Error in else statement | python | 0 | 42 | 1 | 72,308,493 | 72,308,493 | 0 | true | 2022-05-19T16:38:57.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I am getting Name Error in else statement<p>So! I made a simple program that gets a file name as input and open it and read it.
and there is a special file n... |
72,251,745 | Python function doesn't return any values<p>It works with certain values (e.g "100 12 2"), but fails at "102 12 2" for some reason.
Checked both on Windows and MacOS with different python versions, results are the same and are not affected by setup.</p>
<pre class="lang-py prettyprint-override"><cod... | <p>Try replacing the zero in the condition with a small number, such as <code>1e-16</code>:</p>
<pre class="lang-py prettyprint-override"><code>from math import floor
s, x, y = 102, 12, 2
def calc(s, x, y):
q = 0
if x > y:
while s - (s / x) > 1e-16:
q += s / x
q1 = s / x
... | Python function doesn't return any values | python|function | -2 | 42 | 1 | 72,251,781 | 72,251,781 | 0 | true | 2022-05-15T19:54:44.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python function doesn't return any values<p>It works with certain values (e.g "100 12 2"), but fails at "102 12 2" for some reason.
Check... |
72,291,102 | MYSQL Query to copy all data in a column from one database to another<p>I accidentally used the "Generate Description" function on my SEO Tool in Opencart and it overwrote all my product descriptions with the Product Title.</p>
<p>I have over 600+ products and it will be a pain to re-do them all again.</p>
<p... | <p>Use <code>REPLACE INTO</code> statement (make backup before operation) if both schema are in the same MySQL instance</p>
<p><strong>old</strong> means: recovered database
<strong>database</strong> means: current database</p>
<pre><code>REPLACE INTO database.oc_product_description
SELECT * FROM old.oc_product_descr... | MYSQL Query to copy all data in a column from one database to another | mysql|phpmyadmin|opencart | 0 | 42 | 1 | 72,318,516 | 72,318,516 | 0 | true | 2022-05-18T14:29:56.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MYSQL Query to copy all data in a column from one database to another<p>I accidentally used the "Generate Description" function on my SEO Tool in O... |
72,240,999 | How do i use chartjs in react project properly?<p>Im trying to use chartjs in my react project but it doesnt work. What am i doing wrong?</p>
<p>You can see console logs here:</p>
<p><a href="https://i.stack.imgur.com/xtSRL.png" rel="nofollow noreferrer">logs</a></p>
<p><div class="snippet" data-lang="js" data-hide="fa... | <p>The attributes you're passing to <code>Bar</code> are incorrect. Specifically, your <code>data</code> attribute is missing its own <code>datasets</code> attribute, as can be seen in the error log when <code>Chart.js</code> is attempting to call <code>setDatasets</code>.</p>
<p>Suppose you're charting the temperature... | How do i use chartjs in react project properly? | javascript|reactjs|chart.js | -1 | 42 | 1 | 72,241,259 | 72,241,259 | 0 | true | 2022-05-14T14:10:18.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i use chartjs in react project properly?<p>Im trying to use chartjs in my react project but it doesnt work. What am i doing wrong?</p>
<p>You can see ... |
72,330,792 | Footer is floating in middle of page despite CSS<p>I am fairly new to HTMl and CSS. I had my footer stuck to the bottom of the page no problem and then something changed and I cannot figure it out. When I go to a page without a lot of content the footer sits in the middle of the page. On pages with content, it works as... | <p>Seeing as you have declared the <code>body</code> to be <code>100vh</code>, you can utilize this empty space with <code>margin-top: auto</code>.</p>
<p>On <code>main-footer</code>, remove <code>margin: auto</code> and replace it with <code>margin-top: auto</code>. This way, it will convert the remaining space on the... | Footer is floating in middle of page despite CSS | html|css | 0 | 42 | 3 | 72,330,880 | 72,330,880 | 0 | true | 2022-05-21T15:11:46.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Footer is floating in middle of page despite CSS<p>I am fairly new to HTMl and CSS. I had my footer stuck to the bottom of the page no problem and then somet... |
72,312,217 | I only get one word as output using dictionaries while it should be two<p>I made a function which converts morse code to text using dictionaries. The slash '/' is the equivalent of a whitespace and splits two words. I therefore made a list using the strip function. I also used a loop to convert each element of that lis... | <p>You return in the middle of the loop and exit the function. Fixed:</p>
<pre><code>def morse_to_text(morse):
l = morse.split("/")
results = []
for element in l:
new_element = element.split()
result = "".join(decode[symbol] for symbol in new_element)
results.appe... | I only get one word as output using dictionaries while it should be two | python|list|dictionary | 3 | 42 | 3 | 72,312,236 | 72,312,236 | 0 | true | 2022-05-20T00:01:44.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I only get one word as output using dictionaries while it should be two<p>I made a function which converts morse code to text using dictionaries. The slash '... |
72,238,297 | React difference of using value in state vs value in object in state<p>I am getting different behaviour depending on whether I am using a boolvalue on with useState, or whether I am using a bool value inside an object with useState.</p>
<p>This first bit of code will show the hidden text when the button is pressed. It ... | <p>React checks objects for equality by checking their reference.</p>
<p>Simply, look at the below example.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const x = { a : 1, b... | React difference of using value in state vs value in object in state | javascript|reactjs|state|use-state | 1 | 42 | 4 | 72,238,380 | 72,238,380 | 1 | true | 2022-05-14T07:49:31.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React difference of using value in state vs value in object in state<p>I am getting different behaviour depending on whether I am using a boolvalue on with u... |
72,241,437 | How to use recursion to sum up a list of numbers up until a certain index<p>I have to write a code that makes use of recursion to sum numbers in a list up until the index is equal to a pre-determined integer value. i.e.</p>
<pre><code> list = [1,4,8,9]
int = 2
sum = 1 + 4 (index 0 and 1)
</code></pre>
<p>below... | <p>You are making it more complex that you need to. You just need a base case — the current index is too big, and the recursion — the value at the current index plus the rest:</p>
<pre><code>def sum_rec(l,max_index, i=0):
if i >= max_index or i >= len(l): # base case
return 0
return l[i] ... | How to use recursion to sum up a list of numbers up until a certain index | python|function|recursion|sum | -1 | 42 | 1 | 72,241,516 | 72,241,516 | 1 | true | 2022-05-14T15:05:15.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use recursion to sum up a list of numbers up until a certain index<p>I have to write a code that makes use of recursion to sum numbers in a list up un... |
72,241,600 | How to make Plotly animated chart display all the categories (not only ones present in first frame)<p>To illustrate my problem, I use sample Plotly animated chart included on their website:</p>
<p><a href="https://plotly.com/python/animations/" rel="nofollow noreferrer">https://plotly.com/python/animations/</a></p>
<p>... | <p>There are limitations with <strong>plotly</strong> animations in that it is expected dimensions are consistent. This can be achieved by doing an appropriate <em>outer join</em> to ensure all combinations are present. Taking your sample code as starting point, then use <strong>pandas</strong> to ensure there is di... | How to make Plotly animated chart display all the categories (not only ones present in first frame) | python|plotly | 0 | 42 | 1 | 72,242,150 | 72,242,150 | 1 | true | 2022-05-14T15:22:33.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make Plotly animated chart display all the categories (not only ones present in first frame)<p>To illustrate my problem, I use sample Plotly animated ... |
72,244,556 | Pause or Getchar with push button<p>I'm new to programming and I'm trying to put a pause in my code before my while(1) loop in in my main(). The pause will be broken after the state of a push button is change. I'm not sure how this is achieved using the pause or getchar, I've seen it done with a key press but not sure ... | <p>not having the hardware i cannot test but taking your comment as gold</p>
<p>you need</p>
<pre><code> while(UI_Set==1);
</code></pre>
<p>this will loop waiting for the button to be pressed</p>
<p>or maybe</p>
<pre><code> while(UI_Set==0);
</code></pre>
<p>not sure which way round the logic is</p> | Pause or Getchar with push button | c|getchar|mplab|pause | 0 | 42 | 2 | 72,244,840 | 72,244,840 | 1 | true | 2022-05-14T23:39:14.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pause or Getchar with push button<p>I'm new to programming and I'm trying to put a pause in my code before my while(1) loop in in my main(). The pause will b... |
72,246,205 | Find difference in two different data-frames<p>I have two data frame df1 is 26000 rows, df2 is 25000 rows.
Im trying to find data points that are in d1 but not in d2, vice versa.
This is what I wrote (below code) but when I cross check it shows me shared data point</p>
<pre><code>import pandas as pd
df1 = pd.read_csv(... | <p>With two dfs:</p>
<pre><code>import pandas as pd
df1 = pd.DataFrame({'a': [1, 2, 3, 4, 5], 'b': [1, 1, 1, 1, 1]})
df2 = pd.DataFrame({'a': [2, 3, 4, 5, 6], 'b': [1, 1, 1, 1, 1]})
print(df1)
print(df2)
</code></pre>
<pre><code> a b
0 1 1
1 2 1
2 3 1
3 4 1
4 5 1
</code></pre>
<pre><code> a b
0 2 1
1... | Find difference in two different data-frames | python|pandas|dataframe | 0 | 42 | 1 | 72,246,289 | 72,246,289 | 1 | true | 2022-05-15T07:07:57.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find difference in two different data-frames<p>I have two data frame df1 is 26000 rows, df2 is 25000 rows.
Im trying to find data points that are in d1 but n... |
72,245,332 | Kotlin Cannot Inflate Layout<p>I am building an application that has a <code>GridView</code> that contains a dynamic amount of <code>CardView</code>s. I am having issues accessing the <code>TextView</code> elements in the individual items layout from the custom adapter that I am creating.</p>
<p><code>tvCastleName</co... | <p>You must be getting <code>Unresolved Reference</code> as the method (<code>Kotlin Synthetics</code>) you are using to access <code>view</code> is now <code>deprecated</code>. You can use <code>ViewBinding</code> to access your <code>views</code>.</p>
<p>You've to make a few changes to your <code>getItem</code> metho... | Kotlin Cannot Inflate Layout | android-studio|kotlin | 1 | 42 | 1 | 72,246,662 | 72,246,662 | 1 | true | 2022-05-15T03:27:15.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kotlin Cannot Inflate Layout<p>I am building an application that has a <code>GridView</code> that contains a dynamic amount of <code>CardView</code>s. I am ... |
72,247,716 | Debug Assertion Failed: Expression vector subscript out of range<p>I dont understand why it says subscript out of range when I have reserved the space in the vector. I have created a short form of my code to explain what the problem is better:</p>
<pre><code>#include <vector>
#include <string>
#include <... | <pre><code>foo.reserve(10)
</code></pre>
<p>Reserves space for elements in foo, but it does not populate any of the elements with an empty std::vector.</p>
<p>You can change it to:</p>
<pre><code>foo.resize(10);
</code></pre>
<p>Which will reserve the space and create the empty vector< string > elements, so that ... | Debug Assertion Failed: Expression vector subscript out of range | c++|arrays|debugging|vector | 1 | 42 | 1 | 72,248,109 | 72,248,109 | 1 | true | 2022-05-15T11:11:28.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Debug Assertion Failed: Expression vector subscript out of range<p>I dont understand why it says subscript out of range when I have reserved the space in the... |
72,250,220 | How to split date strings in JavaScript array<p>For the following Month/Day/Year datestring array...</p>
<pre><code>const array1 = ["05/31/2022", "06/01/2022", "06/02/2022"]
</code></pre>
<p>...I am attempting to configure the array to slice and remove all datestring array items (starting... | <p>You can loop over the <code>dates</code> array and grab the <code>currDay</code> and <code>prevDay</code> and if the condition is satisfied, slice the <code>dates</code> array and return it.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code"... | How to split date strings in JavaScript array | javascript|arrays|loops|for-loop|slice | 0 | 42 | 2 | 72,250,341 | 72,250,341 | 1 | true | 2022-05-15T16:35:50.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to split date strings in JavaScript array<p>For the following Month/Day/Year datestring array...</p>
<pre><code>const array1 = ["05/31/2022", &... |
72,251,613 | Filter last slash of URL and return the last character<p>I can get the last character of the last part of the URL by using the split method and pop method such as
<code>.split("/").pop()</code> .</p>
<p>But usually, there is a slash at the end of the URL like so: <a href="https://exmaple.com/123/456/" rel="no... | <p>One option would be to just remove the slashes, and return the last character no matter what it is.</p>
<p>Here's a quick example:</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">... | Filter last slash of URL and return the last character | javascript | 0 | 42 | 2 | 72,251,651 | 72,251,651 | 1 | true | 2022-05-15T19:35:25.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter last slash of URL and return the last character<p>I can get the last character of the last part of the URL by using the split method and pop method su... |
72,253,901 | Member initialization syntax in C++ constructors<p>Why does the following not compile?</p>
<pre><code>class A {
public:
A(int a) : a_{a} {}
private:
int a_;
};
</code></pre> | <blockquote>
<p>Why does the following not compile?</p>
</blockquote>
<p>Because you're most probably compiling the shown code, with <strong>Pre-C++11</strong> standard version.</p>
<p>The curly braces around <code>a</code> in your example, is a C++11 feature.</p>
<p>To <strong>solve</strong> this you can either compil... | Member initialization syntax in C++ constructors | c++|member-initialization | 0 | 42 | 1 | 72,253,947 | 72,253,947 | 1 | true | 2022-05-16T03:29:38.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Member initialization syntax in C++ constructors<p>Why does the following not compile?</p>
<pre><code>class A {
public:
A(int a) : a_{a} {}
p... |
72,257,925 | using a class n times with a for loop c++<p>I'm trying to learn classes, so here I want to create n-number Triangle and Rectangle types, input a,b,c, also input from user and then cout them.. im trying to get n-number of Triangle and Rectangle with for loop but at the end I get print only the biggest S() and P() which ... | <p>You are overwriting the same variable every time you call <code>Input()</code>. Instead, create a <a href="https://en.cppreference.com/w/cpp/container/vector" rel="nofollow noreferrer"><code>vector</code></a> of rectangles.</p>
<pre><code>#include <vector>
class Rectangle {
// ...
};
int main()
{
// ... | using a class n times with a for loop c++ | c++|class|for-loop | 0 | 42 | 1 | 72,258,036 | 72,258,036 | 1 | true | 2022-05-16T10:40:52.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
using a class n times with a for loop c++<p>I'm trying to learn classes, so here I want to create n-number Triangle and Rectangle types, input a,b,c, also in... |
72,268,360 | Javasript Changing values by selecting only true values from among array values<p>I want to change the value of AdditionalShipping when button onChange occurs only to the values in which select is true among the array values in additionalShippingArray.</p>
<pre><code>console.log(additionalShippingArray)
0: {sele... | <p>I think this might work</p>
<pre><code> const onClickBatchApplication = () => {
setAdditionalShippingArray(prev => prev.map((i)=> {
if(i.select) {
return {...i, AdditionalShipping :additionalShippingCost }
}else{
return i
}
})
};
</code></pre> | Javasript Changing values by selecting only true values from among array values | javascript|reactjs|ecmascript-6|frontend | 3 | 42 | 1 | 72,268,441 | 72,268,441 | 1 | true | 2022-05-17T04:51:35.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javasript Changing values by selecting only true values from among array values<p>I want to change the value of AdditionalShipping when button onChange occ... |
72,258,398 | T-SQL Trigger Update with conditions<p>is it possible to block an update of a field based on a condition?</p>
<p>I have a table: sizes</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>article</th>
<th>shoe_type</th>
<th>size</th>
</tr>
</thead>
<tbody>
<tr>
<td>shoes</td>
<td>0</td>
<td>0</t... | <p>One way:</p>
<pre><code>create trigger sizes__shoe_stuff
after update
as begin
if exists
(
select
from
inserted i
inner join deleted d on i.article=d.article -- I assume article is the PK. If not, join i and d on all PK columns
where
(
(d.article='shoes' and d.shoe_... | T-SQL Trigger Update with conditions | tsql|triggers | -1 | 42 | 1 | 72,268,820 | 72,268,820 | 1 | true | 2022-05-16T11:22:38.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
T-SQL Trigger Update with conditions<p>is it possible to block an update of a field based on a condition?</p>
<p>I have a table: sizes</p>
<div class="s-tabl... |
72,276,125 | Pandas: shift one column until other column value = True<p>I have a dataframe like this one:</p>
<pre><code>df = pd.DataFrame(data={
'date': ['2021-01-01', '2021-01-02','2021-01-03','2021-01-04'],
'order': [False, False, True, True]
})
</code></pre>
<p>And I want to have a new column with the shifted date from ... | <p>You can keep the True values with <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.shere.html" rel="nofollow noreferrer"><code>where</code></a>, fill backwards with <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.bfill.html" rel="nofollow noreferrer"><code>bfill</code></a>, and... | Pandas: shift one column until other column value = True | pandas|dataframe|shift | 1 | 42 | 1 | 72,276,211 | 72,276,211 | 1 | true | 2022-05-17T14:46:37.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas: shift one column until other column value = True<p>I have a dataframe like this one:</p>
<pre><code>df = pd.DataFrame(data={
'date': ['2021-01-01... |
72,273,231 | How to forward specific event to overlapped DOM element<p><a href="https://i.stack.imgur.com/bZ55u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bZ55u.png" alt="enter image description here" /></a></p>
<p>I have two completely overlapped <code>divs</code>; The top layer has a scroll behavior becaus... | <p>To make my explanation easier I'll need to give each of the divs names. Let's call the absolutely positioned div <code>topDiv</code>, and the divs underneath <code>downDivs</code>.</p>
<p>You're also going to need a click handler on <code>topDiv</code> itself. That handler is what we will use to "forward" ... | How to forward specific event to overlapped DOM element | javascript|html|css|dom | 0 | 42 | 1 | 72,277,301 | 72,277,301 | 1 | true | 2022-05-17T11:27:48.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to forward specific event to overlapped DOM element<p><a href="https://i.stack.imgur.com/bZ55u.png" rel="nofollow noreferrer"><img src="https://i.stack.i... |
72,279,087 | opengl won't overlap more than 1 texture<p>I'm trying to create an opengl program that creates a 2d square, and applies 2 textures on it.</p>
<p>I followed this tutorial: <a href="https://learnopengl.com/Getting-started/Textures" rel="nofollow noreferrer">https://learnopengl.com/Getting-started/Textures</a></p>
<p>This... | <p><code>glUniform1i</code> set a value in the default uniform block of the currently installed program. You have to install the program with <code>glUseProgram</code>, before you can set the value of a uniform variable:</p>
<pre class="lang-cpp prettyprint-override"><code>GLint t1_loc = glGetUniformLocation(Program, &... | opengl won't overlap more than 1 texture | c++|windows|opengl | 2 | 42 | 1 | 72,279,200 | 72,279,200 | 1 | true | 2022-05-17T18:34:50.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
opengl won't overlap more than 1 texture<p>I'm trying to create an opengl program that creates a 2d square, and applies 2 textures on it.</p>
<p>I followed t... |
72,280,658 | Firebase RTDB - Get document ID?<p>how can i retrieve document IDs in a <code>useEffect</code> using firebase realtime database?</p>
<p>This works great but however i need every single document id aswell.
<a href="https://i.stack.imgur.com/oPZJe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oPZJe.p... | <p>This is how you can get keys from array in RTDB:</p>
<pre class="lang-js prettyprint-override"><code>onValue(dbRef, (snapshot) => {
snapshot.forEach((childSnapshot) => {
const childKey = childSnapshot.key;
const childData = childSnapshot.val();
// ...
});
}, {
onlyOnce: true
});
</code></pre>... | Firebase RTDB - Get document ID? | javascript|reactjs|firebase|firebase-realtime-database | 0 | 42 | 1 | 72,280,863 | 72,280,863 | 1 | true | 2022-05-17T21:02:32.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firebase RTDB - Get document ID?<p>how can i retrieve document IDs in a <code>useEffect</code> using firebase realtime database?</p>
<p>This works great but ... |
72,279,952 | How to customize Laravel's Collection API resources?<p>I tried the following but it doesn't work:</p>
<p>ArticleController.php:</p>
<pre><code>public function index()
{
$articles = Article::latest()->paginate(10);
return ArticleCollection::collection($articles);
}
</code></pre>
<p>ArticleColl... | <h3>Let your DB query define the final fields</h3>
<p>Check this way, in your <code>ArticleController</code> create a query with a <code>select()</code> method in which you define <strong>which DB fields</strong> are sent to the <code>ArticleCollection</code>.</p>
<p><strong>The collection will only take care of return... | How to customize Laravel's Collection API resources? | laravel | 0 | 42 | 2 | 72,281,870 | 72,281,870 | 1 | true | 2022-05-17T19:54:56.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to customize Laravel's Collection API resources?<p>I tried the following but it doesn't work:</p>
<p>ArticleController.php:</p>
<pre><code>public functio... |
72,282,208 | How can I get an array of all possible combinations of an object's key/values<p>I have an object:</p>
<pre class="lang-js prettyprint-override"><code>{
a: 1,
b: "2",
c: "3",
// ...
}
</code></pre>
<p>I want to get an array with all possible combinations, as objects, of each key/value pair like this:... | <p>You could treat the object's keys like a set, and calculate its <a href="https://en.wikipedia.org/wiki/Power_set" rel="nofollow noreferrer">power set</a> using an algorithm like the one described in <a href="https://stackoverflow.com/questions/24365954/how-to-generate-a-power-set-of-a-given-set">this question</a>:</... | How can I get an array of all possible combinations of an object's key/values | javascript | -2 | 42 | 1 | 72,282,255 | 72,282,255 | 1 | true | 2022-05-18T01:05:27.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get an array of all possible combinations of an object's key/values<p>I have an object:</p>
<pre class="lang-js prettyprint-override"><code>{
a: 1,... |
72,278,758 | XSL apply-templates with sorting does not sort<p>I have an XML document</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="UTF-8"?>
<document>
<timeperiods>
<timeperiod>
<day>1</day>
<period>... | <p>To get a result like the one you expect, change:</p>
<pre><code> <xsl:apply-templates select="/document/timeperiods">
<xsl:sort select="number(period)" data-type="number" order="descending"/>
<xsl:sort select="number(day)" data-type=... | XSL apply-templates with sorting does not sort | xml|sorting|xslt | 0 | 42 | 2 | 72,285,385 | 72,285,385 | 1 | true | 2022-05-17T18:06:28.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XSL apply-templates with sorting does not sort<p>I have an XML document</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0"... |
72,285,265 | Pandas get average from second dataframe of the last N rows within time interval<p>I have 2 DFs:</p>
<p>DF1</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: center;">Name</th>
<th style="text-align: center;">Timestamp</th>
<th style="text-align: center;">Value</th>
</tr>
<... | <p>You need to use <a href="https://pandas.pydata.org/docs/reference/api/pandas.merge_asof.html" rel="nofollow noreferrer"><code>pandas.merge_asof</code></a> to align the timestamps:</p>
<pre><code>df1.join(pd
.merge_asof(df2.sort_values(by='Timestamp'),
df1.sort_values(by='Timestamp')
... | Pandas get average from second dataframe of the last N rows within time interval | python|pandas|dataframe|timestamp | 0 | 42 | 1 | 72,285,659 | 72,285,659 | 1 | true | 2022-05-18T07:58:16.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas get average from second dataframe of the last N rows within time interval<p>I have 2 DFs:</p>
<p>DF1</p>
<div class="s-table-container">
<table class=... |
72,285,632 | Hamburger button on bootstrap wont open<p>I have followed the code from BootStrap as follows:</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.jsd... | <p>You have wrong attributes to make it work by default, just replace <code>data-mdb-toggle="collapse" data-mdb-target="#navbarToggleExternalContent2"</code> with <code>data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent2"</code>, see (in my CodeSnippet I using... | Hamburger button on bootstrap wont open | javascript|html|css|twitter-bootstrap | 0 | 42 | 1 | 72,285,718 | 72,285,718 | 1 | true | 2022-05-18T08:26:17.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hamburger button on bootstrap wont open<p>I have followed the code from BootStrap as follows:</p>
<p><div class="snippet" data-lang="js" data-hide="false" da... |
72,288,659 | use distinct within case statement<p>I have a query that uses multiple left joins and trying to get a SUM of values from one of the joined columns.</p>
<pre><code>SELECT
SUM( case when session.usersessionrun =1 then 1 else 0 end) new_unique_session_user_count
FROM session
LEFT JOIN appuser ON appuser.appid = '6279df3bd... | <p>As you have discovered, JOIN operations can generate combinatorial explosions of data.</p>
<p>You need a subquery to count your sessions by userid. Then you can treat the subquery as a virtual table and JOIN it to the other tables to get the information you need in your result set.</p>
<p>The subquery (nothing in my... | use distinct within case statement | sql|left-join|case|distinct | 0 | 42 | 1 | 72,288,845 | 72,288,845 | 1 | true | 2022-05-18T11:50:25.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
use distinct within case statement<p>I have a query that uses multiple left joins and trying to get a SUM of values from one of the joined columns.</p>
<pre>... |
72,294,337 | Python list clear() strange behaviour<pre><code>numbers = [12,23,34]
sum = []
for number in numbers:
num = []
for n in str(number):
num.append(int(n))
sum.append(num)
print(sum)
</code></pre>
<p>If i add <code>num.clear()</code> AFTER <code>sum.append(num)</code>, it's appending empty array to sum. ... | <p><code>num = []</code> and <code>num.clear()</code> do two different things.</p>
<p><code>num.clear()</code> tells the list pointed to by <code>num</code> to empty itself.
<code>num = []</code> reassigns <code>num</code> to point to an entirely new (empty) list.</p>
<p>When you do <code>sum.append(num)</code>, you're... | Python list clear() strange behaviour | python|list | -3 | 42 | 2 | 72,294,375 | 72,294,375 | 1 | true | 2022-05-18T18:33:03.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python list clear() strange behaviour<pre><code>numbers = [12,23,34]
sum = []
for number in numbers:
num = []
for n in str(number):
num.appen... |
72,294,436 | Day counter program (racket)<p>I need to do a program which can count all days that have been passed since 2000's until the date that the user enter in the input.</p>
<p>Current code.</p>
<pre><code>#lang racket
(define (bisiesto year)
(cond (= (remainder year 4) 0) (void))
)
(define day 0)
(define month 0)
(define... | <p>You will need function <a href="https://docs.racket-lang.org/reference/time.html#%28def._%28%28lib._racket%2Fdate..rkt%29._find-seconds%29%29" rel="nofollow noreferrer"><code>find-seconds</code></a> from <a href="https://docs.racket-lang.org/reference/time.html#%28mod-path._racket%2Fdate%29" rel="nofollow noreferrer... | Day counter program (racket) | racket | 0 | 42 | 1 | 72,295,000 | 72,295,000 | 1 | true | 2022-05-18T18:41:52.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Day counter program (racket)<p>I need to do a program which can count all days that have been passed since 2000's until the date that the user enter in the i... |
72,298,010 | I have a nested list and would like to extract parts of it using list comprehension<p>I have a nested list named list1 of following:</p>
<pre><code> list1 = [['Plane' , 'London' , 'Paris', '1'] , ['Helicopter', 'Budapest' , 'Rome', '2'] , ['Jet', 'Tokio', 'New York' , '3'] , ['Balloons' , 'Belgrade', 'Vienna', '2'... | <p>This works</p>
<pre><code># unpack each sub-list in a dict comprehension and manually construct the keys
{(i,j): v for _,i,j,v in list1}
{('London', 'Paris'): '1',
('Budapest', 'Rome'): '2',
('Tokio', 'New York'): '3',
('Belgrade', 'Vienna'): '2'}
</code></pre> | I have a nested list and would like to extract parts of it using list comprehension | python|list|list-comprehension | -1 | 42 | 1 | 72,298,027 | 72,298,027 | 1 | true | 2022-05-19T02:33:58.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I have a nested list and would like to extract parts of it using list comprehension<p>I have a nested list named list1 of following:</p>
<pre><code> list1 = ... |
72,296,401 | Rails get only array elements from another array<p>I've got result from below query:</p>
<p><code>query</code></p>
<pre><code>class SyncResult
def self.query(products)
Imports::Product
.order(:last_sync_at)
.pluck(:id, :name, :code, :sync_result, :last_sync_at)
.map do |id, name, code, result, l... | <p>You can achieve the expected result in following ways.</p>
<ol>
<li>Updating query to fetch Products for given codes
<pre class="lang-rb prettyprint-override"><code>products = ['SS22CH013', 'FW22WJ021']
Imports::Product
.where(code: products)
.order(:last_sync_at)
.pluck(:id, :name, :code, :sync_result, :last... | Rails get only array elements from another array | ruby-on-rails|ruby | 0 | 42 | 1 | 72,298,963 | 72,298,963 | 1 | true | 2022-05-18T21:51:33Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails get only array elements from another array<p>I've got result from below query:</p>
<p><code>query</code></p>
<pre><code>class SyncResult
def self.que... |
72,298,893 | AWS ElasticBeanstalk LoadBalancer Config Not Linking my aplication to my domain<p>I created an aplication but Its is not linked to my domain
exp: "site.com", "www.site.com", when I access it I get: <a href="https://i.stack.imgur.com/8bmSg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu... | <p>Based on the comments and your updates. I see two issues.</p>
<ol>
<li><p>SSL certificate is setup for <code>jamelaumn.com</code>. This will not work. It must be setup for <code>*.jamelaumn.com</code> or <code>api.jamelaumn.com</code>. So you have to make new SSL certificate and add it to your ALB.</p>
</li>
<li><p>... | AWS ElasticBeanstalk LoadBalancer Config Not Linking my aplication to my domain | python|django|amazon-web-services|amazon-ec2|amazon-elastic-beanstalk | 1 | 42 | 1 | 72,299,412 | 72,299,412 | 1 | true | 2022-05-19T05:07:59.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWS ElasticBeanstalk LoadBalancer Config Not Linking my aplication to my domain<p>I created an aplication but Its is not linked to my domain
exp: "site.... |
72,299,517 | TypeError: in python in custom input function, exception handling<p>While creating a guess_the_number game in python, I wanted to catch the exception if user enters an invalid number, i.e. ValueError when typecasting the entered string to integer, I created a takeInput() function.
It works fine except for the part that... | <p>You need to return the value of the function when an exception occurs. Since you're not returning anything, it returns <code>None</code> by default even when the function gets called.</p>
<pre><code>def takeInput(message):
userInput = input(message)
try:
userInput = int(userInput)
print("... | TypeError: in python in custom input function, exception handling | python|python-3.x|exception|typeerror|valueerror | -1 | 42 | 1 | 72,299,579 | 72,299,579 | 1 | true | 2022-05-19T06:20:51.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: in python in custom input function, exception handling<p>While creating a guess_the_number game in python, I wanted to catch the exception if user... |
72,294,802 | Struggling with Mobile build on phone, looking different on phone and Pc<p>Firstly I'm still fairly new to coding, saw people making games and fell in love with the idea of making your own game. So the past few months I've been learning unity tutorials and practicing basic games. I've come so far to be basically done w... | <p>It doesn´t look the same, due to the different resolutions.</p>
<p>Try to use a <a href="https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/script-CanvasScaler.html" rel="nofollow noreferrer">Canvas Scaler component</a>. Set a reference resolution and the mode how you want to scale it.</p>
<p>If you want yo... | Struggling with Mobile build on phone, looking different on phone and Pc | unity3d|mobile | 0 | 42 | 2 | 72,299,943 | 72,299,943 | 1 | true | 2022-05-18T19:14:51.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Struggling with Mobile build on phone, looking different on phone and Pc<p>Firstly I'm still fairly new to coding, saw people making games and fell in love w... |
72,292,973 | Code completion for constructor parameter types<p>I often have to inject dependencies in some class:</p>
<pre class="lang-js prettyprint-override"><code>class Foo {
constructor(private userService: UserService) {
}
}
</code></pre>
<p>What I'm looking for is a code completion for a <code>UserService</code> type when... | <p>In <strong>Settings | Editor | General | Code Completion</strong>, <strong>JavaScript</strong>, try enabling both <strong>Suggest variable and parameter names</strong> and <strong>Add type annotations for suggested parameter names</strong> - does it help?</p> | Code completion for constructor parameter types | typescript|intellij-idea|webstorm | 1 | 42 | 1 | 72,301,443 | 72,301,443 | 1 | true | 2022-05-18T16:38:20.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Code completion for constructor parameter types<p>I often have to inject dependencies in some class:</p>
<pre class="lang-js prettyprint-override"><code>clas... |
72,303,780 | Removing line breaks between 2 different character sequences<p>I'm editing a csv file which contains hidden line breaks. When I apply the following php script, the line breaks are successfully removed from the entire file.</p>
<pre><code>$csvFileNew = str_replace(array("\r", "\n"), '', $csvFileOld);... | <p>Your can use</p>
<pre class="lang-php prettyprint-override"><code><?php
$csvFileOld = "pre text appears here....,\"\"key\n\n words\r\n appear\r\n here\"\",....post text appears here";
//line break always appears between the final 2 quotation marks
$csvFileNew = preg_replace_callbac... | Removing line breaks between 2 different character sequences | php|regex|csv|delimiter|preg-replace-callback | 1 | 42 | 1 | 72,303,971 | 72,303,971 | 1 | true | 2022-05-19T11:31:44.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing line breaks between 2 different character sequences<p>I'm editing a csv file which contains hidden line breaks. When I apply the following php scrip... |
72,304,210 | BigCommerce NPM - Update Babel<p>I am trying to run an older BigCommerce site locally but none of the JavaScript is working on the local site. Console seems to indicate an issue with Babel.</p>
<p>This is what is in the error log:</p>
<pre><code>Error: Module build failed: TypeError: /Users/liam/Desktop/BigCommerce/KBB... | <p>I think this is the same issue I got when a folder was named with special characters. Try deleting everything in your directory name after KBBC.</p>
<p>Change</p>
<pre><code>KBBC+V1.4+(March+2020)-1.11.0
</code></pre>
<p>To</p>
<pre><code>KBBC
</code></pre>
<p>You may also want to change the "name" value i... | BigCommerce NPM - Update Babel | babeljs|bigcommerce|bigcommerce-stencil-cli | 0 | 42 | 1 | 72,305,005 | 72,305,005 | 1 | true | 2022-05-19T12:03:28.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BigCommerce NPM - Update Babel<p>I am trying to run an older BigCommerce site locally but none of the JavaScript is working on the local site. Console seems ... |
72,306,824 | Is there a way to improve the speed of combining two values as strings?<p>I am currently working with a very large dataset (>70mil rows, 10+ columns), it involves gap fills, forwards fills, reindexing, etc. But the step that takes the most time (over 50% of run time) is the simple code of replacing a column variable... | <p>Take a look at <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.str.cat.html" rel="nofollow noreferrer"><code>Series.str.cat</code></a>:</p>
<pre><code>df['id_date'] = df['id'].str.cat(df["date"], sep='_')
</code></pre>
<p>That being said, as with any redundant information, you are likel... | Is there a way to improve the speed of combining two values as strings? | python|pandas|string|large-data | 1 | 42 | 1 | 72,308,728 | 72,308,728 | 1 | true | 2022-05-19T14:57:20.787Z | 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 improve the speed of combining two values as strings?<p>I am currently working with a very large dataset (>70mil rows, 10+ columns), it ... |
72,312,742 | TypeScript: How to specify the type of an object's value, if the ':' character is already reserved?<p>I have an object with a key <code>item</code> whose value type could be <code>undefined | Box</code>. I have to initiate it as <code>undefined</code>, and at a later time I'll substitute that value with a <code>Box</co... | <p>I would strongly suggest just typing everything:</p>
<pre><code>type Mesh = any;
type ObjectType = {
x: number;
y: number;
z: number;
item?: Mesh; // Mesh or undefined
}
const myObjs: {[key: string]: ObjectType} = {
"obj1" : {x: 0, y: 1, z: 3},
"obj2" : {x: 0, y: 1, z: 3, item: ... | TypeScript: How to specify the type of an object's value, if the ':' character is already reserved? | typescript | 0 | 42 | 3 | 72,312,908 | 72,312,908 | 1 | true | 2022-05-20T01:46:54.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeScript: How to specify the type of an object's value, if the ':' character is already reserved?<p>I have an object with a key <code>item</code> whose val... |
72,314,539 | user info command works only witout a mention<p>i have a problem with my code for the command userinfo it works witout a mantion but not wen a mention somoen</p>
<p>wenn i run the code without a mention it works but wenn i try to test it with a user mentiond the code dosent give me an error it just ignors it</p>
<p>thi... | <p>Instead of <code>message.mentions.users.size</code> you can use <code>message.mentions.members.first()</code>. To get this command works, you can also use <code>if() {} else if() {}</code> statement. For example:</p>
<pre><code>if(!args[0]) {
//This is the part for non-mentioned members.
} else if(args[0]) {
... | user info command works only witout a mention | node.js|discord|discord.js | 0 | 42 | 1 | 72,315,157 | 72,315,157 | 1 | true | 2022-05-20T06:36:11.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
user info command works only witout a mention<p>i have a problem with my code for the command userinfo it works witout a mantion but not wen a mention somoen... |
72,315,752 | Send JavaScript variable as input to python code<p>In JavaScript code declared a variable, that variable should be passed as input to python child process which is called inside JavaScript code, where python code executes its output by taking input from JavaScript variable</p>
<p>JavaScript code</p>
<pre><code> var ... | <p>Made it work by connecting the stream listener to <code>stdout</code> rather than <code>stderr</code>:</p>
<pre class="lang-sh prettyprint-override"><code>python_process.stdout.on('data',function(data) {
console.log(data.toString());
});
</code></pre> | Send JavaScript variable as input to python code | javascript|python | 0 | 42 | 1 | 72,316,145 | 72,316,145 | 1 | true | 2022-05-20T08:25:00.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Send JavaScript variable as input to python code<p>In JavaScript code declared a variable, that variable should be passed as input to python child process wh... |
72,317,669 | how to populate tableview based on button press- swift<p><a href="https://i.stack.imgur.com/DebU4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DebU4.png" alt="enter image description here" /></a></p>
<p>I have two buttons scheduled shoots and completed shoots and a table view under it.I can't use ... | <p>Make two separate arrays of your data one for Scheduled Shoots and the Other for Completed Shoots
Maintain a Boolean Var to switch between them</p>
<pre><code>var scheduledShoots: [YourModel] = [...]
var completedShoots: [YourModel] = [...]
var isScheduledShootSelected = true
</code></pre>
<p>Then in your table view... | how to populate tableview based on button press- swift | ios|swift|uitableview|uibutton | 0 | 42 | 1 | 72,317,868 | 72,317,868 | 1 | true | 2022-05-20T10:49:50.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to populate tableview based on button press- swift<p><a href="https://i.stack.imgur.com/DebU4.png" rel="nofollow noreferrer"><img src="https://i.stack.im... |
72,317,169 | javascript array divide in chunks<p>I am trying to divide the javascript array in chunks of a minimum of 5 using the below function.
the x and z should have only 5 or less than 5 only. and I am also trying it with date condition.
I have tried it with the below function for the inner x and z but it didn't worked so look... | <p>try this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let data = [
{
"date": "01-18-2022",
"x": [
60,
59,
58,
... | javascript array divide in chunks | javascript|arrays | 1 | 42 | 2 | 72,317,904 | 72,317,904 | 1 | true | 2022-05-20T10:11:40.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
javascript array divide in chunks<p>I am trying to divide the javascript array in chunks of a minimum of 5 using the below function.
the x and z should have ... |
72,317,579 | Sync RAM related<p>I am trying to simulate the following code for an synchronous ram in Verilog.</p>
<p>When I am trying to write in a specific address, <strong>dataOut</strong> is not coming the way I was expecting. It is skipping 1 address while reading data in the specified address.</p>
<p><a href="https://i.stack.i... | <p>You have a race condition. You should use nonblocking assignments (<code><=</code>) in your design and testbench for all synchronous signals.</p>
<p>In the design, change:</p>
<pre><code> mem[i] = {DATA_WIDTH{1'b0}};
</code></pre>
<p>to:</p>
<pre><code> mem[i] <= {DATA_WIDTH{1'b0}};
</code></pre>
<p>In ... | Sync RAM related | verilog|iverilog | 0 | 42 | 1 | 72,318,646 | 72,318,646 | 1 | true | 2022-05-20T10:43:51.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sync RAM related<p>I am trying to simulate the following code for an synchronous ram in Verilog.</p>
<p>When I am trying to write in a specific address, <str... |
72,307,156 | How to follow make a dot and text follow a mouse?<p>To get to know how events work in VEGA, I gave myself the simple exercice to render a dot and a text positioned on the cursors coordinates in a given view.</p>
<p>I managed to make a symbol follow the mouse coordinates, yet when I try to make two types of marks ( text... | <p>Your example works as expected if an initial value (using "init" or "value") is included in signal <em>position</em>:</p>
<pre><code>"signals": [
{
"name": "position",
"init": [0, 0],
"on": [
{
"events": {
"t... | How to follow make a dot and text follow a mouse? | vega | 0 | 42 | 1 | 72,319,316 | 72,319,316 | 1 | true | 2022-05-19T15:21:16.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to follow make a dot and text follow a mouse?<p>To get to know how events work in VEGA, I gave myself the simple exercice to render a dot and a text posi... |
72,319,511 | Mapping through an array to produce an object<p>I have an array :</p>
<pre><code>[
"2022-05-20",
"2022- 06-22",
"2022-06-20"
]
</code></pre>
<p>and I want to produce an object like this:</p>
<pre><code>{
'2022-05-20': {disabled:true},
'2022-06-22': {disabled: true},
'2022-06-20': {... | <p>Can do it:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let dates = [
"2022-05-20",
"2022- 06-22",
"2022-06-20"
];
let newObj = Object.assign(...dates.map(key =>... | Mapping through an array to produce an object | javascript|arrays|object|mapping | 0 | 42 | 4 | 72,319,746 | 72,319,746 | 1 | true | 2022-05-20T13:11:47.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mapping through an array to produce an object<p>I have an array :</p>
<pre><code>[
"2022-05-20",
"2022- 06-22",
"2022-06-20"
]
... |
72,319,933 | Is there every a benefit to use localize instead of astimezone in pytz when going from unaware to aware<p>I am converting non-timezone aware datetimes to timezone aware datetimes in Python using pytz.</p>
<p>It seems that <code>astimezone</code> is over 3x faster than <code>localize</code>.</p>
<p>Is there ever a reaso... | <p>To clarify my comment,</p>
<ul>
<li><code>localize</code> sets the time zone for a naive datetime object. It does not change the object's attributes (date/time)</li>
<li><code>astimezone</code> takes a given datetime object, naive or aware, and converts the date/time to the desired time zone. If the datetime object ... | Is there every a benefit to use localize instead of astimezone in pytz when going from unaware to aware | python|datetime|pytz | 0 | 42 | 1 | 72,320,236 | 72,320,236 | 1 | true | 2022-05-20T13:41:49.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there every a benefit to use localize instead of astimezone in pytz when going from unaware to aware<p>I am converting non-timezone aware datetimes to tim... |
72,312,514 | Keras - Is There an way to reduce value gap between categorical_accuracy and val_categorical_accuracy?<p>I'm trying to build and train LSTM Neural Network.</p>
<p>Here is my code (summary version):</p>
<pre><code>X_train, X_test, y_train, y_test = train_test_split(np.array(sequences), to_categorical(labels).astype(int)... | <p>When there is so much difference between your train and validation data this mean your model is overfitting.</p>
<p>So look for how prevent from overfitting. Usually what you have to do <strong>is add more data to your dataset</strong>.</p>
<blockquote>
<p>It won’t work every time, but training with more data can he... | Keras - Is There an way to reduce value gap between categorical_accuracy and val_categorical_accuracy? | python|tensorflow|keras|deep-learning|lstm | 0 | 42 | 1 | 72,320,431 | 72,320,431 | 1 | true | 2022-05-20T01:00:01.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keras - Is There an way to reduce value gap between categorical_accuracy and val_categorical_accuracy?<p>I'm trying to build and train LSTM Neural Network.</... |
72,311,384 | Custom C++ library dependent on ARPACK wrapped in pybind11 segfaults when NumPy is also imported<p>I am creating a custom library (written in C++) that does some numerical stuff with ARPACK-NG. The function is wrapped in pybind11 to provide access to the method from Python in a package. I observe strange behavior.</p>
... | <p>As far as I can tell, what I believed to be the root cause of the issue is correct. I have arrived at a solution that, while not completely satisfactory, nonetheless solves the problem: instantiate the Anaconda environment with the <code>nomkl</code> package (i.e. <code>conda create -n mylib_nomkl nomkl python=3.9 n... | Custom C++ library dependent on ARPACK wrapped in pybind11 segfaults when NumPy is also imported | python|numpy|anaconda|pybind11|arpack | 1 | 42 | 1 | 72,323,088 | 72,323,088 | 1 | true | 2022-05-19T21:44:17.800Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom C++ library dependent on ARPACK wrapped in pybind11 segfaults when NumPy is also imported<p>I am creating a custom library (written in C++) that does ... |
72,322,414 | DateComponentsFormatter - same dates, different results<p>Why is <code>dateRemainingText2</code> giving different result from <code>dateRemainingText</code>?
<br />Obviously <code>dateRemainingText2</code> is wrong.</p>
<p>Here's my code:</p>
<pre><code>import Foundation
let startDate = Calendar.current.date(from: Dat... | <p><code>DateComponentsFormatter.string(from:to:)</code> and <code>DateComponentsFormatter.string(from:)</code> are different methods and so they can do different things.</p>
<p>From some experimentation, we can see that <code>string(from:)</code> outputs a string that describes the <em>sum</em> of all the date compone... | DateComponentsFormatter - same dates, different results | swift|nsdate|nsdateformatter|nsdatecomponents|nsdatecomponentsformatter | 0 | 42 | 1 | 72,323,138 | 72,323,138 | 1 | true | 2022-05-20T16:58:18.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DateComponentsFormatter - same dates, different results<p>Why is <code>dateRemainingText2</code> giving different result from <code>dateRemainingText</code>?... |
72,323,062 | Divide element by sum of groupby in dask without setting index for every column<p>I have code implemented in pandas, but am having trouble converting to dask because I need to use <code>set_index()</code>, what is the best work around? Using dask because I need to scale this to much larger dataframes.</p>
<p>I am looki... | <p>Try with <code>transform</code></p>
<pre><code>df.loc[:,[0,1,2,3]] = df/df.groupby('lab_id').transform('sum')[[0,1,2,3]]
df
Out[767]:
0 1 2 3 lab_id
0 0.111111 1.00 2.0 0.166667 a
1 2.000000 0.80 NaN 0.500000 b
2 0.222222 0.75 1.0 1.000000 a
3 -1.000000 0.20 NaN... | Divide element by sum of groupby in dask without setting index for every column | python|pandas|pandas-groupby|dask|dask-dataframe | 1 | 42 | 1 | 72,323,672 | 72,323,672 | 1 | true | 2022-05-20T17:57:05.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Divide element by sum of groupby in dask without setting index for every column<p>I have code implemented in pandas, but am having trouble converting to dask... |
72,326,623 | I am trying to set data in state everytime on first index for react in array of object<pre><code>state = {
resposne: [{ id: null, sentMessage: "", receviedMessage: "" }],
};
</code></pre>
<p>this is my state object
I am fetching data from an API:</p>
<pre><code>/*CONSIDER ABOVE API CALL IS WOR... | <p>The way you call the setState has not the required format (the piece of the state that is going to update)</p>
<p>Either of the following ways will work</p>
<h4>Directly set the piece of the state object</h4>
<pre><code>this.setState({
response: [
...this.state.response,
{
id: data.id,
received... | I am trying to set data in state everytime on first index for react in array of object | reactjs|api|setstate|react-state | 2 | 42 | 1 | 72,326,771 | 72,326,771 | 1 | true | 2022-05-21T04:19:53.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I am trying to set data in state everytime on first index for react in array of object<pre><code>state = {
resposne: [{ id: null, sentMessage: "&quo... |
72,314,376 | Is there any alternate way to simply the queries<p>Is there any way to combine 2 SQL queries into a single query?</p>
<p>The table names used in both the SQL queries are same. The condition in the WHERE clause changes in both the queries.</p>
<p>Query 1:</p>
<pre><code>SELECT ID
,SUM(time_duration) AS total_time... | <p>Yes, it is possible to combine both of them using conditional aggregation:</p>
<pre><code>WITH A AS (
SELECT *
,LEAD(create_ts) OVER (PARTITION BY ID ORDER BY CAST(pno AS INT)) AS R1
,DATEDIFF('second',create_ts::timestamp ,LEAD::timestamp) AS time_duration
FROM table_name
)
SELECT
ID
,SU... | Is there any alternate way to simply the queries | snowflake-cloud-data-platform | 1 | 42 | 3 | 72,332,348 | 72,332,348 | 1 | true | 2022-05-20T06:20:58.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any alternate way to simply the queries<p>Is there any way to combine 2 SQL queries into a single query?</p>
<p>The table names used in both the SQL... |
72,333,419 | Error on running `predict()` in tidymodels "Error in `dplyr::select()`: Can't subset columns that don't exist."<h1>Problem</h1>
<p>I get an error when running <code>predict</code> in the tidymodels framework.
The error appears to be related to selecting variables in the recipe (see code below).</p>
<h1>What I've tried<... | <p>We may use <code>skip = TRUE</code> in <code>skip_select</code>. According to <code>?skip_select</code></p>
<blockquote>
<p>skip - A logical. Should the step be skipped when the recipe is baked by bake()? While all operations are baked when prep() is run, some operations may not be able to be conducted on new data ... | Error on running `predict()` in tidymodels "Error in `dplyr::select()`: Can't subset columns that don't exist." | r|tidymodels|r-recipes | 1 | 42 | 2 | 72,333,560 | 72,333,560 | 1 | true | 2022-05-21T21:44:52.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error on running `predict()` in tidymodels "Error in `dplyr::select()`: Can't subset columns that don't exist."<h1>Problem</h1>
<p>I get an error when runnin... |
72,336,722 | How to make user input within Range, and repeat loop until the condition is met in Java?<p>So this is my code so far, the user can input values and store them in an array. However what im trying to make is that the user input be between the range 1 and 50, if its outside of this range then i want some error message to ... | <p>There are a few flaws in your code. First of all, you need a loop that makes sure that the n (<code>array.length</code>) elements have been inserted and inside that loop add your controls (inputted a proper number and number included between 1 and 50).</p>
<p>The <code>i</code> variable should be declared outside th... | How to make user input within Range, and repeat loop until the condition is met in Java? | java | 1 | 42 | 1 | 72,336,805 | 72,336,805 | 1 | true | 2022-05-22T10:28:37.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make user input within Range, and repeat loop until the condition is met in Java?<p>So this is my code so far, the user can input values and store the... |
72,338,833 | Why can't I pass operator to a function from an other in C++?<p>In my C++ homework (where I have to short different arrays with different methods), I run into a problem. I can't pass comp() from one function to another.</p>
<p>Here is a simplified version of my code:</p>
<pre><code>template <typename T, typename Com... | <p>I changed two things:</p>
<ol>
<li><p>in your call to <code>fooFunction2(..)</code>, don't pass <code>comp()</code> but <code>comp</code>.
If you add parantheses, you execute the comp-function, which fails because a comparing function needs arguments passed to it. Just passing <code>comp</code> instead will just tel... | Why can't I pass operator to a function from an other in C++? | c++|function|templates|operators | -2 | 42 | 2 | 72,338,919 | 72,338,919 | 1 | true | 2022-05-22T15:15:21.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't I pass operator to a function from an other in C++?<p>In my C++ homework (where I have to short different arrays with different methods), I run int... |
72,339,235 | Surround input text with slash or backslash<p>I am trying to surround input string with either <code>\</code> or <code>/</code>. The input string can only take one of the following forms. The first one is an empty string.</p>
<pre><code>
path
/path
\path
path/
path\
/path/
\path\
</code></pre>
<p>I am trying with <code... | <p>You might write the pattern asserting not <code>/</code> or <code>\</code> before the last slash using a negative lookbehind <code>(?<![\\\/]</code></p>
<pre><code>^[\\\/]?|(?<![\\\/])[\\\/]?$
</code></pre>
<p><a href="https://regex101.com/r/dyZu7T/1" rel="nofollow noreferrer">Regex demo</a></p> | Surround input text with slash or backslash | regex|path|pcre | 0 | 42 | 1 | 72,339,344 | 72,339,344 | 1 | true | 2022-05-22T16:05:46.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Surround input text with slash or backslash<p>I am trying to surround input string with either <code>\</code> or <code>/</code>. The input string can only ta... |
72,341,145 | Setting color of specific row in table if the value inside is >1000<p>So like in the title i want to click the button set row to green if value inside is higher than 1000 i think i figured out the part with setting color im not sure about the button part here is
the specific part of code also the jsfiddle</p>
<pre><cod... | <p>You basically had it, but the inline onclick was throwing it off so I added a jquery click and an id for your button so the function is called when the button is clicked</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet... | Setting color of specific row in table if the value inside is >1000 | javascript|html|jquery | 1 | 42 | 1 | 72,341,471 | 72,341,471 | 1 | true | 2022-05-22T20:40:07.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting color of specific row in table if the value inside is >1000<p>So like in the title i want to click the button set row to green if value inside is hig... |
72,341,400 | pandas - fill in default values for missing records<p>I would like to fill in missing data in my dataset in the following way: <br>
My data can contain one of the following shapes:</p>
<pre><code>['circle', 'square', 'triangle']
</code></pre>
<p>Each shape has width and height attributes, <br>
I would like to fill in m... | <p>You could make another df with the default values, something like</p>
<pre class="lang-py prettyprint-override"><code>defaults = pd.DataFrame({'shape': shapes, 'height': 10, 'width': 5})
# result
shape height width
0 circle 10 5
1 square 10 5
2 triangle 10 5
</code></pre... | pandas - fill in default values for missing records | python|pandas | 0 | 42 | 2 | 72,341,550 | 72,341,550 | 1 | true | 2022-05-22T21:26:58.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas - fill in default values for missing records<p>I would like to fill in missing data in my dataset in the following way: <br>
My data can contain one o... |
72,341,532 | Join starred expressions<p>Probably I have not yet fully understood what starred expression means in python, but I'm having some troubles with this part.</p>
<p>I have some working code that allows me to run multiple async functions in parallel, each feeding a different parameter to a function, by writing this:</p>
<pr... | <p>When you write</p>
<pre><code>( func1(c) for c in mylist )
</code></pre>
<p>You create a generator</p>
<p>When you wrote</p>
<pre><code>*( func1(c) for c in mylist )
</code></pre>
<p>You are getting all the elements from your generator. The same would happen in a list, for instance if you have</p>
<pre><code>[func(c... | Join starred expressions | python|python-3.x|python-asyncio | -1 | 42 | 1 | 72,341,665 | 72,341,665 | 1 | true | 2022-05-22T21:54:26.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Join starred expressions<p>Probably I have not yet fully understood what starred expression means in python, but I'm having some troubles with this part.</p>... |
72,341,632 | If my datastore transaction fails, will code after the transaction run?<p>What happens if my datastore transaction fails and I have some more code that is supposed to run after it finishes? Does the application throw and error and end there? Will my second block of code run or will it never be reached?</p>
<pre><code>o... | <p>If the transaction fails you will get an exception. If you don't handle the exception it will propagate.</p> | If my datastore transaction fails, will code after the transaction run? | java|google-app-engine|objectify | 0 | 42 | 1 | 72,342,041 | 72,342,041 | 1 | true | 2022-05-22T22:13:01.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If my datastore transaction fails, will code after the transaction run?<p>What happens if my datastore transaction fails and I have some more code that is su... |
72,342,800 | Page Model Bool always returns false<p>I'm working on a razor pages project and I'm having an issue changing the value of my page model when clicking a button. It should toggle the value of IsCreatingCompany with each click. Here is my code:</p>
<pre><code> <div class="col-6 text-end">
... | <p>Try to use <code>@Model.IsCreatingCompany.ToString()</code> to replace <code>@Model.IsCreatingCompany</code>,so that the data passed to handler will be correct,here is a demo:</p>
<p>cshtml:</p>
<pre><code><div class="col-6 text-end">
<form asp-page-handler="ToggleCreateCompan... | Page Model Bool always returns false | asp.net-core|razor|razor-pages | 0 | 42 | 1 | 72,343,614 | 72,343,614 | 1 | true | 2022-05-23T02:49:44.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Page Model Bool always returns false<p>I'm working on a razor pages project and I'm having an issue changing the value of my page model when clicking a butto... |
72,344,856 | React routing seems to work but it doesn't render the page<p>when I click on the button the URL changes and it prints 'user exists' in the console, but the page is blank and doesn't show the component. I have been trying to figure out the problem for 2 days now but I can't seem to find a solution and hopefully someone... | <p>You should wrap your <code>Routes</code> with a <code>Switch</code>.
Check the doc <a href="https://v5.reactrouter.com/web/guides/quick-start" rel="nofollow noreferrer">https://v5.reactrouter.com/web/guides/quick-start</a></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="f... | React routing seems to work but it doesn't render the page | javascript|reactjs|react-router|react-router-dom | 1 | 42 | 1 | 72,344,972 | 72,344,972 | 1 | true | 2022-05-23T07:39:56.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React routing seems to work but it doesn't render the page<p>when I click on the button the URL changes and it prints 'user exists' in the console, but the ... |
72,337,917 | I don't see any data in my Realtime Database in Firebase's console<p>I'm trying to figure out how to use Firebase properly, so I made this simple code, saving a "game" object with code and password. I also made it show the game's key on the screen. running the code, it works and shows what looks like a key on... | <p>When you're using the following line of code:</p>
<pre><code>gameRef.setValue(g);
</code></pre>
<p>The data you're trying to write into the database may succeed or fail, but you'll never know that since you aren't attaching a listener to check that. So solve this, you have to attach a listener as in the following li... | I don't see any data in my Realtime Database in Firebase's console | java|android|firebase|google-cloud-platform|firebase-realtime-database | 0 | 42 | 1 | 72,345,146 | 72,345,146 | 1 | true | 2022-05-22T13:19:15.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I don't see any data in my Realtime Database in Firebase's console<p>I'm trying to figure out how to use Firebase properly, so I made this simple code, savin... |
72,345,532 | How to return correct sum from s subselect?<p>I have a subselect which is part of a bigger select. I want to SUM all weights for one order and display that sum, but constantly get errors or multiple returned values:</p>
<pre><code>SELECT "Invoice Date", "Invoice Number", "Invoice Currency Code&... | <p>As you said that you don't know what a correlated subquery is, then (read comments within code):</p>
<pre><code>SELECT "Invoice Date",
"Invoice Number",
"Invoice Currency Code",
--
-- this is a correlated subquery; it puts ITEMS table to relation with ...
... | How to return correct sum from s subselect? | sql|oracle|select|sum|subquery | 0 | 42 | 2 | 72,346,154 | 72,346,154 | 1 | true | 2022-05-23T08:36:22.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to return correct sum from s subselect?<p>I have a subselect which is part of a bigger select. I want to SUM all weights for one order and display that s... |
72,340,823 | GLib.Variant new empty array<p><a href="https://lazka.github.io/pgi-docs/GLib-2.0/classes/Variant.html#GLib.Variant.new_array" rel="nofollow noreferrer">Documentation</a> says that <code>child_type must be non-None if n_children is zero</code>. So I can't get it. Where is the logic here? What type should I use for an e... | <blockquote>
<p>What type should I use for an empty array?</p>
</blockquote>
<p>The same type you’d use for a non-empty array. GVariant arrays are strongly typed, so an empty array of type <code>as</code> is semantically different from an empty array of type <code>au</code>. You need to specify the type of the elements... | GLib.Variant new empty array | python|glib | 0 | 42 | 1 | 72,347,059 | 72,347,059 | 1 | true | 2022-05-22T19:46:19.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GLib.Variant new empty array<p><a href="https://lazka.github.io/pgi-docs/GLib-2.0/classes/Variant.html#GLib.Variant.new_array" rel="nofollow noreferrer">Docu... |
72,355,359 | Google Web App google.script.run not working<p>I have the following .gs:</p>
<pre><code>function doGet(e) {
return HtmlService.createHtmlOutputFromFile('index')
}
function goToMaster() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const sheet = ss.getSheetByName('Master Projects')
sheet.activate()
}
</cod... | <h3>Try it like this</h3>
<p>html:</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<base target="_top">
<link rel="icon" href="/images/favicon.svg" />
<script src="https://kit.fontawesome.com/abd2f5db30.js" crossorigin="anonymous">... | Google Web App google.script.run not working | javascript|html|google-apps-script|google-sheets | 0 | 42 | 1 | 72,355,632 | 72,355,632 | 1 | true | 2022-05-23T22:18:04.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Web App google.script.run not working<p>I have the following .gs:</p>
<pre><code>function doGet(e) {
return HtmlService.createHtmlOutputFromFile('in... |
72,362,919 | How to redirect to new page using javascript<p>How can I redirect the whatsapp api link in new page? When I press ok the whatsapp api is open in same page.</p>
<p>The code I have tried so far.</p>
<pre><code> setTimeout(function () {
applause.play();
swal(
"Congratulations",
&quo... | <pre><code>window.open("https://api.whatsapp.com/send?phone=+91123456789", '_blank');
</code></pre> | How to redirect to new page using javascript | javascript|jquery | -1 | 42 | 1 | 72,362,946 | 72,362,946 | 1 | true | 2022-05-24T12:30:10.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to redirect to new page using javascript<p>How can I redirect the whatsapp api link in new page? When I press ok the whatsapp api is open in same page.</... |
72,364,114 | React Native how to pass a function with a parameter inside a for-loop<p>I have the code below for a React Native app using Javascript and Im creating an array of objects that are data for a context menu.</p>
<p>When the user selects a project from the menu it should call handleSelectedProject
which it does and pass th... | <p>The problem is with your <code>for</code> loop. The <code>onPress</code> callback will reference the loop variable when the loop is already finished, at which time <code>i</code> is out of range, so <code>projects[i]</code> will evaluate to <code>undefined</code>.</p>
<p>The easy solution is to use a block scoped va... | React Native how to pass a function with a parameter inside a for-loop | javascript|react-native | 0 | 42 | 1 | 72,364,172 | 72,364,172 | 1 | true | 2022-05-24T13:48:42.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Native how to pass a function with a parameter inside a for-loop<p>I have the code below for a React Native app using Javascript and Im creating an arr... |
72,364,004 | Sampling from two different normal distributions at specified probabilities<p>I'm trying to create a simulation that samples from two different normal distributions at specified probabilities. I want the simulation to choose a new value from the distribution during each simulation. I created the code below, but it pick... | <p>You could generate all 50 samples per <code>P</code> using <code>size</code>. Then use random to choose either index 0 of <code>elements</code> (P1) or index 1 of <code>elements</code> (P2) and then call random on the resulting distribution. You can use list comprehension to generate your 50 simulations.</p>
<pre>... | Sampling from two different normal distributions at specified probabilities | python | 1 | 42 | 2 | 72,364,260 | 72,364,260 | 1 | true | 2022-05-24T13:42:28.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sampling from two different normal distributions at specified probabilities<p>I'm trying to create a simulation that samples from two different normal distri... |
72,367,998 | Critcl : args in procedure<p>I would like to replace a Tcl procedure by C procedure with Critcl.<br>
Tcl procedure :</p>
<pre><code>proc myProc {args} {...}
</code></pre>
<p>Critcl procedure :</p>
<pre><code>critcl::cproc myProc {Tcl_Interp* interp Tcl_Obj* data} ok {...}
</code></pre>
<p>And this is how I use it :</p>... | <p>You could try using a <code>ccommand</code> instead of a <code>cproc</code>, as that let's you get the direct array of values (provided you skip the first word, which will be the command name). There is an example of this on the wiki at <a href="https://wiki.tcl-lang.org/page/Critcl+Examples" rel="nofollow noreferre... | Critcl : args in procedure | tcl | 0 | 42 | 1 | 72,369,174 | 72,369,174 | 1 | true | 2022-05-24T18:45:52.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Critcl : args in procedure<p>I would like to replace a Tcl procedure by C procedure with Critcl.<br>
Tcl procedure :</p>
<pre><code>proc myProc {args} {...}
... |
72,376,647 | How to use object key from string value in javascript<p>I have sample object, need to reassign the value dynamically.</p>
<p>here is sample object, i have stored the object in dynamodb with inarray data type. i have formed the object by using loop. i couldn't use the payload.offer value. kindly suggest the better solut... | <p>As I understand, you want a way to convert from dot-notation to deeply-nested objects. You can try the following then:</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>functi... | How to use object key from string value in javascript | javascript | 0 | 42 | 2 | 72,376,974 | 72,376,974 | 1 | true | 2022-05-25T11:18:32.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use object key from string value in javascript<p>I have sample object, need to reassign the value dynamically.</p>
<p>here is sample object, i have st... |
72,380,382 | Check if true or false on json parse into html<p>Currently have all data displaying perfectly except the boolean ones.
I have some data that if <code>true</code> or <code>false</code> they should display different html/css</p>
<p>So, how can I have a class or html that shows the data if returns true?</p>
<p>I'm a bit s... | <p>You can use a ternary expression in the template literal.</p>
<pre><code> out += `
<div class="supporter">
<h4 class="supporter__name">
<span class="supporter__thumbnail"></span>
${supporter.name}
... | Check if true or false on json parse into html | javascript|json | 1 | 42 | 1 | 72,380,555 | 72,380,555 | 1 | true | 2022-05-25T15:24:11.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check if true or false on json parse into html<p>Currently have all data displaying perfectly except the boolean ones.
I have some data that if <code>true</c... |
72,384,240 | Keeping track of cumulative travel using dplyr<p>I'm attempting to keep track of a team's cumulative travel throughout a season, but having trouble trying to figure out the best way to do that since teams change who is home/away throughout the season.</p>
<p>Here is my dataframe:</p>
<pre><code>df <- data.frame(game... | <p>I think you could try using both <code>pivot_longer</code> and <code>pivot_wider</code> from <code>tidyverse</code>. The former will give you long format data making it easier to obtain a cumulative sum of <code>Travel</code> for each team. The latter puts back to original wide form.</p>
<pre><code>library(tidyverse... | Keeping track of cumulative travel using dplyr | r|dplyr | 1 | 42 | 2 | 72,385,810 | 72,385,810 | 1 | true | 2022-05-25T21:11:50.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keeping track of cumulative travel using dplyr<p>I'm attempting to keep track of a team's cumulative travel throughout a season, but having trouble trying to... |
72,386,456 | How can I change the navbar height in bootstrap?<p>I'm recreating the mac OS navbar and would like to resize the navbar height, and the text size (to around 12px). It's the very first time I'm using bootstrap so any help would be amazing, please. Also, let me know about where I could find information about how to use b... | <p>Basically you need to add css height to navbar class.</p>
<pre><code> <style>
.navbar{ height: 48px;}
.navbar a{font-size:12px;}
</style>
</code></pre>
<p>Please check this codepane <a href="https://codepen.io/thewizardjs/pen/jONqmya" rel="nofollow noreferrer">Demo</a></p> | How can I change the navbar height in bootstrap? | html|css|macos|bootstrap-4|navbar | 0 | 42 | 1 | 72,386,569 | 72,386,569 | 1 | true | 2022-05-26T03:44:40.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I change the navbar height in bootstrap?<p>I'm recreating the mac OS navbar and would like to resize the navbar height, and the text size (to around ... |
72,388,657 | Compare multiple value in a dictionary and get bigger value key<p>How can I compare that 2 keys with the highest length of the value?
I wanna found the highest key name which has a bigger length.</p>
<pre class="lang-py prettyprint-override"><code>{
'UFTBUSD': ['Hammer', 'Belthold', 'Doji', 'Three Outside', 'Hanging Ma... | <pre><code>thisdict = {
'UFTBUSD': ['Hammer', 'Belthold', 'Doji', 'Three Outside', 'Hanging Man', 'Closing Marubozu', 'Dragonfly Doji', 'Engulfing Pattern', 'Gravestone Doji', 'Harami Pattern'],
'ANCBUSD': ['Belthold', 'Doji', 'Three Outside', 'Shooting Star', 'Closing Marubozu', 'Engulfing Pattern', 'Harami P... | Compare multiple value in a dictionary and get bigger value key | python|dictionary | 0 | 42 | 2 | 72,389,594 | 72,389,594 | 1 | true | 2022-05-26T08:03:20.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compare multiple value in a dictionary and get bigger value key<p>How can I compare that 2 keys with the highest length of the value?
I wanna found the highe... |
72,390,646 | Express Async Method in Method<p>I´m quite new to ExpressJS, so i have a question about my Code.</p>
<pre><code> router.post("/create", (req: Request, res: Response) => {
pruefungController.create(req, res);
});
public async create(req: Request, res: Response): Promise<void> {
const ... | <p>The only time you need to declare a function as <code>async</code> is if you use the <code>await</code> keyword inside it.</p>
<p>The only time you need to use the <code>await</code> keyword is if you need a function to wait for a promise to resolve before continuing.</p>
<p>The function you pass to <code>post</code... | Express Async Method in Method | javascript|node.js|typescript|express|async-await | 3 | 42 | 1 | 72,390,660 | 72,390,660 | 1 | true | 2022-05-26T10:52:44.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Express Async Method in Method<p>I´m quite new to ExpressJS, so i have a question about my Code.</p>
<pre><code> router.post("/create", (req: Re... |
72,793,891 | Insert new column into dataframe as a VARIABLE<p>I used the following to obtain state using zipcode</p>
<pre><code>from uszipcode import SearchEngine
engine = SearchEngine()
zipcode = engine.by_zipcode(ZIPCODE)
**st** = print(zipcode.state)
</code></pre>
<p>Now I am trying to insert state into data frame df2:</p>
<ul>... | <p>Show your code please but it seems that you only have to add it to the dataframe.</p>
<pre><code>zipcode = zipcode.state # Florida in this case
df2['STATE']= zipcode
</code></pre> | Insert new column into dataframe as a VARIABLE | python|pandas|dataframe | 2 | 42 | 2 | 72,794,016 | 72,794,016 | 1 | true | 2022-06-28T22:41:21.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Insert new column into dataframe as a VARIABLE<p>I used the following to obtain state using zipcode</p>
<pre><code>from uszipcode import SearchEngine
engine ... |
72,794,377 | Pandas KeyError: Predictions not in index<p>I have the following code,</p>
<pre><code>train = data[:training_data_len]
valid = data[training_data_len:]
valid ['Prediction'] = predictions
plt.figure(figsize = (16,8))
plt.title('Model')
plt.xlabel('Date', fontsize=18)
plt.ylabel('Close Price USD ($)', fontsize=18)
plt.pl... | <p>This question is a little vague so if you could tell us which line is throwing the error you might get better responses. But based on what you wrote here, I noticed that you named the field in the <code>valid</code> dataframe 'Prediction' (singular) and later in the code you start referring to 'Predictions' (plural)... | Pandas KeyError: Predictions not in index | python|pandas|dataframe|indexing|jupyter-notebook | 0 | 42 | 1 | 72,794,408 | 72,794,408 | 1 | true | 2022-06-29T00:04:31.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas KeyError: Predictions not in index<p>I have the following code,</p>
<pre><code>train = data[:training_data_len]
valid = data[training_data_len:]
valid... |
72,796,785 | How to get mimeType from HTMLImageElement?<p>I checked <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement" rel="nofollow noreferrer">MDN docs</a> about <code>HTMLImageElement</code>.</p>
<p>But i couldn't find any information about <code>mimeType</code>.</p>
<p>I was able to find few docs about ... | <p>Convert image to base64. The base64 string has mime type in the start. Extract mime type from that string. Check the below links.</p>
<p>Convert image to base64</p>
<p><a href="https://www.codegrepper.com/code-examples/javascript/how+to+convert+image+to+base64+in+javascript" rel="nofollow noreferrer">https://www.cod... | How to get mimeType from HTMLImageElement? | javascript|html|image | 0 | 42 | 1 | 72,797,082 | 72,797,082 | 1 | true | 2022-06-29T06:36:51.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get mimeType from HTMLImageElement?<p>I checked <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement" rel="nofollow noreferrer">... |
72,797,833 | How can I access the next step data using DataLoader in PyTorch?<p>I am using a code that trains neural networks. The code uses the DataLoader of PyTorch to load the data for every iteration. The code looks as follows</p>
<pre><code>for step, data in enumerate(dataloader, 0):
........................................ | <p>It seems to be handier to perform such manipulation at the iteration level rather than having to change the data loaders implementation. Looking at <a href="https://stackoverflow.com/a/38151585/6331369"><em>Iterate over <code>n</code> successive elements with overlap</em></a> you can achieve this using <a href="http... | How can I access the next step data using DataLoader in PyTorch? | pytorch|dataloader | 1 | 42 | 1 | 72,798,498 | 72,798,498 | 1 | true | 2022-06-29T08:03:25.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I access the next step data using DataLoader in PyTorch?<p>I am using a code that trains neural networks. The code uses the DataLoader of PyTorch to ... |
72,802,802 | Scraping reviews from product page using python<p>'''I'm writing this code but it is only giving me top 4 reviews. I want all the review's of a product from product page.
Please help me out with my code..'''</p>
<pre><code>url = 'https://mamaearth.in/product/glow-serum-foundation-almond-glow'
r = requests.get(url)
soup... | <p>You can access the data in the json and return a list of dictionaries, each containing the review information:</p>
<pre><code>import requests
from bs4 import BeautifulSoup
import json
url = 'https://mamaearth.in/product/glow-serum-foundation-almond-glow'
r = requests.get(url)
soup=BeautifulSoup(r.content,'lxml')
d... | Scraping reviews from product page using python | python|web-scraping|product|review | 0 | 42 | 1 | 72,804,819 | 72,804,819 | 1 | true | 2022-06-29T14:08:09.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scraping reviews from product page using python<p>'''I'm writing this code but it is only giving me top 4 reviews. I want all the review's of a product from ... |
72,806,099 | Css responsive not working when deployed on server<p>I made a responsive home design with only html and css. When I deploy it locally the responsive part works perfectly, so I sended the files to the owner of the page, but he told me that the page wasn't responsive. He deployed it locally and in fileZila but it's like ... | <p>You Should Probably Check the file permissions and owner of the file</p>
<h1>EX:</h1>
<p><a href="https://i.stack.imgur.com/4jbxR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4jbxR.png" alt="enter image description here" /></a></p> | Css responsive not working when deployed on server | html|css|responsive-design|responsive | 0 | 42 | 3 | 72,806,298 | 72,806,298 | 1 | true | 2022-06-29T18:16:40.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Css responsive not working when deployed on server<p>I made a responsive home design with only html and css. When I deploy it locally the responsive part wor... |
72,808,925 | Bash, compare the a result awk '{print $1} with something and return awk '{print$2} if true<p>My File Looks like this:</p>
<pre><code> 790 45.61.188.53
494 45.61.188.95
</code></pre>
<p>I need to compare the first one for example 790 with something else and then print the second one.</p>
<p>So my code actually... | <p>You can do this entirely in <code>awk</code></p>
<pre><code>awk '$1 > 100 { print $2 }' "$CFILE"
</code></pre> | Bash, compare the a result awk '{print $1} with something and return awk '{print$2} if true | bash|for-loop|awk|printing | -2 | 42 | 2 | 72,808,958 | 72,808,958 | 1 | true | 2022-06-29T23:43:53.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bash, compare the a result awk '{print $1} with something and return awk '{print$2} if true<p>My File Looks like this:</p>
<pre><code> 790 45.61.188.53
... |
72,808,127 | Logging every exception within custom Python package<p>I'm working on implementing logging into a custom Python package. Throughout the package, exceptions can be raised if inputs are unacceptable, or if tests fail, etc. I'd like to log <em>any</em> exceptions that are raised within the package using the built-in <code... | <p>Your exception hook can test to see if the exception is being raised in your package by seeing if it's one of your exceptions (use <code>issubclass()</code> to see whether the passed-in exception type is derived from your package's exception base class) or comes from one of your modules (check the passed-in tracebac... | Logging every exception within custom Python package | python|logging|python-3.8|python-logging | 0 | 42 | 1 | 72,809,163 | 72,809,163 | 1 | true | 2022-06-29T21:34:43.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Logging every exception within custom Python package<p>I'm working on implementing logging into a custom Python package. Throughout the package, exceptions c... |
72,805,180 | How to return from scratch and config gitlab and github account on the same pc?<p>With my University, I have a GitLab account, but later I created my own account on GitHub for my personal use, and both are "linked" on my laptop. But in my mind, it's quite a mess : both are linked differently, and I kinda lose... | <p>To effectively 'start from scratch' you will need to:</p>
<ol>
<li>Remove your local configurations<br />
a. Remove your SSH configurations/key<br />
b. Remove your (global) git configuration</li>
<li>(optionally) Revoke your SSH keys from your GitHub and GitLab accounts online</li>
</ol>
<h2>Removing your local con... | How to return from scratch and config gitlab and github account on the same pc? | github|ssh|gitlab | 3 | 42 | 1 | 72,809,291 | 72,809,291 | 1 | true | 2022-06-29T16:56:06.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to return from scratch and config gitlab and github account on the same pc?<p>With my University, I have a GitLab account, but later I created my own acc... |
72,792,548 | Getting emails with specyfic text in them scrapy<p>i'm creating a script that lists all bussiness from one website,
it need's to scrape (Name,address,website,email,telephone number).
And i got to part that i kinda can scrape email, but i have small problem, i can't just tell my script to take all of them, they are spec... | <p>In your <code>parseEmail</code> method, after extracting the email address, just check the extracted string like you would with any string.</p>
<p>For Example</p>
<pre><code>from urllib.parse import urlsplit
def parseEmail(self,response, params=None):
email = response.xpath('//a[contains(@href, "@")]/... | Getting emails with specyfic text in them scrapy | python|python-3.x|web-scraping|scrapy | 0 | 42 | 1 | 72,810,435 | 72,810,435 | 1 | true | 2022-06-28T20:06:32.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting emails with specyfic text in them scrapy<p>i'm creating a script that lists all bussiness from one website,
it need's to scrape (Name,address,website... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.