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,953,060
getValues is not a function : How to add multiple ranges in google app script? How to implement it to the code?<p>I am trying to sum data from different sheets to one that will make the total of this. When I run it, that make a sum of numbers and a sum of string :</p> <pre><code>function myFunction() { var sheet_ori...
<p><strong>Description</strong></p> <p>I've taken the liberty of modifying your script using a single spreadsheet multiple sheets and the <code>getRangeList()</code> method. You will need to examine and learn from this script and implement in your code.</p> <p><code>getRangeList()</code> returns a RangeList object fro...
getValues is not a function : How to add multiple ranges in google app script? How to implement it to the code?
google-apps-script|google-sheets
0
59
1
72,958,057
72,958,057
2
true
2022-07-12T13:23:45.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: getValues is not a function : How to add multiple ranges in google app script? How to implement it to the code?<p>I am trying to sum data from different shee...
72,967,166
How to migrate from WebSecurityConfigurerAdapter?<p>As <code>WebSecurityConfigurerAdapter</code> is <code>@Deprecated</code>, how can I correctly move to <code>org.springframework.security.web.SecurityFilterChain</code>?</p> <p>I mean, what is the equivalent of the following deprecated configuration?</p> <pre><code>@Co...
<p>As documented in <a href="https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter" rel="nofollow noreferrer">this blog</a> remove the <code>extends</code> and expose the <code>SecurityFilterChain</code>.</p> <pre class="lang-java prettyprint-override"><code>@EnableWebSecurity stati...
How to migrate from WebSecurityConfigurerAdapter?
java|spring|spring-boot|spring-security
-1
59
1
72,967,524
72,967,524
2
true
2022-07-13T13:30:15.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to migrate from WebSecurityConfigurerAdapter?<p>As <code>WebSecurityConfigurerAdapter</code> is <code>@Deprecated</code>, how can I correctly move to <co...
72,939,218
Git, tracking wrong remote branch after moving commits between branches<p>I needed to move some commits to another, new branch, and I followed the instructions in <a href="https://stackoverflow.com/a/36463546/4537160">this answer</a>.<br /> So, as mentioned in the linked question, I went from:</p> <pre><code>old_branch...
<p>From the information you display : your local <code>new_branch</code> branch is not tracking the branch you expect.</p> <p>Set the correct remote tracking branch for your local <code>new_branch</code> branch :</p> <pre><code>git branch -u origin/new_branch new_branch </code></pre> <hr /> <p>note that this upstream b...
Git, tracking wrong remote branch after moving commits between branches
git|version-control
0
59
1
72,939,559
72,939,559
2
true
2022-07-11T13:17:49.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git, tracking wrong remote branch after moving commits between branches<p>I needed to move some commits to another, new branch, and I followed the instructio...
72,927,080
How Could I Register Types With A Deleted Copy Constructor To QMetaType?<h3>The Problem:</h3> <p>I want to create an object instance at runtime using QMetaType by the type name. But I couldn't register the type because it's a <code>QObject</code> and I don't have access to the implementation to change it.</p> <h3>Dupli...
<h2>A Non-portable And Non-documented Solution:</h2> <p>Specialize the <code>QtMetaTypePrivate::QMetaTypeFunctionHelper</code> for your type:</p> <pre class="lang-cpp prettyprint-override"><code>namespace QtMetaTypePrivate { template &lt;&gt; struct QMetaTypeFunctionHelper&lt;MyObject, true&gt; { static void Destruct...
How Could I Register Types With A Deleted Copy Constructor To QMetaType?
c++|qt|qmetatype
1
59
1
72,927,806
72,927,806
2
true
2022-07-10T08:17:09.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Could I Register Types With A Deleted Copy Constructor To QMetaType?<h3>The Problem:</h3> <p>I want to create an object instance at runtime using QMetaTy...
72,895,740
Vue, vuetify: How to validate input immediately after creating, adding it<p>I'm trying to figure out how to validate inputs immediately after adding them:</p> <p>template:</p> <pre><code>&lt;div id=&quot;app&quot;&gt; &lt;div v-for=&quot;(message, index) in messages&quot; :key=&quot;index&quot; ...
<p>You can put your template's code, where you use v-for directive, between <em>v-form</em> tags:</p> <pre><code>&lt;v-form ref=&quot;form&quot;&gt; &lt;div v-for=&quot;(message, index) in messages&quot; :key=&quot;index&quot;&gt; &lt;v-text-field v-model=&quot;messages[index]&quot; :rules=&quot;[v =&gt; !!...
Vue, vuetify: How to validate input immediately after creating, adding it
vue.js|vuetify.js
0
59
2
72,896,058
72,896,058
2
true
2022-07-07T09:51:39.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue, vuetify: How to validate input immediately after creating, adding it<p>I'm trying to figure out how to validate inputs immediately after adding them:</p...
72,950,348
Java ParseException: Unparseable date When Date Should be Parseable<p>I am getting an Unparseable date exception for a date I would expect to be parseable.</p> <blockquote> <p>java.text.ParseException: Unparseable date: &quot;03 Sep 18&quot; at java.base/java.text.DateFormat.parse(DateFormat.java:399)</p> </blockquote>...
<p>Your default Locale is presumably non-English. You can verify with this what your Locale is.</p> <pre><code>System.out.println(Locale.getDefault()); </code></pre> <p>For me, in the UK, this prints <code>en_GB</code>.</p> <p>Because Java is presumably using non-English, your native name for the 9th month is not &quot...
Java ParseException: Unparseable date When Date Should be Parseable
java|simpledateformat
0
59
1
72,950,541
72,950,541
2
true
2022-07-12T09:51:34.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java ParseException: Unparseable date When Date Should be Parseable<p>I am getting an Unparseable date exception for a date I would expect to be parseable.</...
72,932,297
python cdk to create lambda trigger on s3 bucket<p>Hi I want to create a trigger on lambda function when a new json file is uploaded on s3 bucket. rule for trigger are</p> <p>Trigger Rules for Lambda invocation using s3</p> <pre><code>**folder name** on which it will trigger is : input-files **file name** ending with...
<p>S3 doesn't allow you to define multiple suffix rules in a filter.</p> <p>To work around this, you would need to define two separate event sources:</p> <pre><code>my_lambda.add_event_source( lambda_event_sources.S3EventSource( bucket, events=[s3.EventType.OBJECT_CREATED], filters=[ ...
python cdk to create lambda trigger on s3 bucket
python|amazon-web-services|amazon-s3|aws-cdk
-1
59
1
72,938,971
72,938,971
2
true
2022-07-10T22:33:16.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python cdk to create lambda trigger on s3 bucket<p>Hi I want to create a trigger on lambda function when a new json file is uploaded on s3 bucket. rule for t...
72,802,203
Rounding two similar numbers and getting different results Python<p>I am trying to compare two different values in Python: <strong>59.725</strong> and <strong>59.72497</strong>.</p> <p>I am rounding them both using the Python round function as doing <code>df.round(2)</code> doesn't work how I need it to:</p> <pre><code...
<p>Simple solution is using <code>math.ceil</code>.</p> <p>Try</p> <pre><code>import math x = math.ceil(100 * 59.72497) / 100 print(x) y = math.ceil(100 * 59.725) / 100 print(y) </code></pre> <p>Ouput</p> <pre><code>59.73 59.73 </code></pre>
Rounding two similar numbers and getting different results Python
python|rounding
0
59
2
72,802,328
72,802,328
2
true
2022-06-29T13:24:22.160Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rounding two similar numbers and getting different results Python<p>I am trying to compare two different values in Python: <strong>59.725</strong> and <stron...
72,830,867
Pandas: Find ratio of values for a column and then groupby on another column<p>I am working with the <a href="http://archive.ics.uci.edu/ml/datasets/Adult" rel="nofollow noreferrer">Census Income dataset</a>. You can find the dataset file adult.data in the &quot;Data Folder&quot;.</p> <p>To quickly reproduce the proble...
<h2>Pandas solution</h2> <p>Create a frequency table with <code>crosstab</code>, then mask the values where count is zero, then use eval to divide <code>&lt;=50K</code> by <code>&gt;50K</code> column to calculate ratio</p> <pre><code>s = pd.crosstab(df['native-country'], df['income']) result = s[s != 0].eval('`&lt;=50K...
Pandas: Find ratio of values for a column and then groupby on another column
python|pandas|numpy|pandas-groupby|data-manipulation
1
59
1
72,831,173
72,831,173
2
true
2022-07-01T14:36:37.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: Find ratio of values for a column and then groupby on another column<p>I am working with the <a href="http://archive.ics.uci.edu/ml/datasets/Adult" r...
72,875,335
Java : JTree and BasicTreeUI reference doesn't show scrollbars<p>Working with the JTreeWithScrollbar example, but scaled it back significantly to focus on the issue.</p> <p>The original code would have the vertical scrollbars appear as needed.</p> <p>Here, there is plenty of space and no scrollbars are needed.</p> <p><...
<blockquote> <ol> <li>When utilizing the <code>BasicTreeUI</code> object, what is required to ensure the scrollbars still function?</li> </ol> </blockquote> <p>As shown in the minimal example below, <code>BasicTreeUI</code> correctly shows each scroll bar when needed; resize the frame to see the effect.</p> <blockquote...
Java : JTree and BasicTreeUI reference doesn't show scrollbars
java|swing|scrollbar|jtree
1
59
1
72,876,285
72,876,285
2
true
2022-07-05T20:47:52.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java : JTree and BasicTreeUI reference doesn't show scrollbars<p>Working with the JTreeWithScrollbar example, but scaled it back significantly to focus on th...
72,809,946
Add subtitle to VideoJS via String<p>I have a string like this</p> <pre><code>var subtitle = `WEBVTT 00:01.000 --&gt; 00:04.000 - Never drink liquid nitrogen. 00:05.000 --&gt; 00:09.000 - It will perforate your stomach. - You could die.` </code></pre> <p>Now i want to dynamically load it to VideoJS from that variable...
<p>You can add it as a data uri:</p> <pre class="lang-js prettyprint-override"><code>player.addRemoteTextTrack({ src: `data:text/vtt;base64,${btoa(subtitle)}`, kind: 'subtitles', srclang: 'en' }); </code></pre> <p>Or parse the string and add each cue:</p> <pre class="lang-js prettyprint-override"><code>const trac...
Add subtitle to VideoJS via String
javascript|video.js|subtitle
0
59
1
72,811,161
72,811,161
2
true
2022-06-30T03:17:11.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add subtitle to VideoJS via String<p>I have a string like this</p> <pre><code>var subtitle = `WEBVTT 00:01.000 --&gt; 00:04.000 - Never drink liquid nitroge...
72,778,525
Find problem XML values by catching XMLTABLE() errors in custom function<p>I'm using an Oracle 18c view called <a href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/overview-geodatabase-system-tables.htm#:%7E:text=data%20type.%20The-,GDB_Items_vw,-shows%20the%20contents" rel="nofollow nor...
<p>If your XML will return a single row, you can use:</p> <pre class="lang-sql prettyprint-override"><code>with function test_xmltable(v_xml clob) return number is v_code VARCHAR2(255); v_desc VARCHAR2(255); begin SELECT code, description INTO v_code, v_desc FROM xmltable( '/GPCodedValueDomain2...
Find problem XML values by catching XMLTABLE() errors in custom function
sql|xml|oracle|oracle18c|xmltable
0
59
1
72,778,553
72,778,553
2
true
2022-06-27T21:33:04.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find problem XML values by catching XMLTABLE() errors in custom function<p>I'm using an Oracle 18c view called <a href="https://desktop.arcgis.com/en/arcmap/...
72,791,346
How to get the "difference" between two objects in another object with the same structure using powershell?<p>TL;DR: <a href="https://stackoverflow.com/questions/1187518/how-to-get-the-difference-between-two-arrays-in-javascript">This but in powershell</a><br /> I'm trying to get the &quot;difference&quot; between a li...
<p>You can use the <code>-notin</code> or <code>-notcontains</code> operators to perform the check.</p> <pre><code>#List of all the IDs $list1='2','5','6','11' $CustObject1=foreach($i in $list){ [pscustomobject]@{ id=$i } } #Another list, where invalid IDs are not listed $list2='2','5' $CustObject2=fore...
How to get the "difference" between two objects in another object with the same structure using powershell?
arrays|powershell|data-structures
1
59
3
72,791,494
72,791,494
2
true
2022-06-28T18:15:53.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the "difference" between two objects in another object with the same structure using powershell?<p>TL;DR: <a href="https://stackoverflow.com/quest...
72,850,925
Python lambda and eval scoping within function<p>I have the following code</p> <pre><code>def foo(q, s): a = 1 f = lambda x : eval(s) return f(1) foo(1, &quot;x+a+q&quot;) </code></pre> <p>I would expect the function call to return <code>3</code>, however I get a <code>NameError</code> instead. I assume th...
<p>So, this is clearly documented:</p> <blockquote> <p>Note, <code>eval()</code> does not have access to the <a href="https://docs.python.org/3/glossary.html#term-nested-scope" rel="nofollow noreferrer">nested scopes</a> (non-locals) in the enclosing environment.</p> </blockquote> <p>So, you have the local scope of <co...
Python lambda and eval scoping within function
python|python-3.x|lambda|eval
0
59
1
72,852,467
72,852,467
2
true
2022-07-04T01:14:24.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python lambda and eval scoping within function<p>I have the following code</p> <pre><code>def foo(q, s): a = 1 f = lambda x : eval(s) return f(1)...
72,937,017
Laravel Eloquent where statement returns no attributes<p>So from my previous post, I was advised to start using Eloquent models, which I did.</p> <p>My end goal, is to print out specific gifts, that belongs to that specific box.</p> <p><strong>Migrations:</strong></p> <p>gift_items:</p> <pre><code>public function up() ...
<p>First of all as I sense the <code>campaigns_gifts</code> is a pivot table for <code>campaigns</code> and <code>gifts</code> having a Many-to-Many relation. You are doing it completely against the conventions of Laravel.</p> <ul> <li>You generally do not use a Model for pivot table.</li> <li>You generally do not fetc...
Laravel Eloquent where statement returns no attributes
php|mysql|sql|laravel|where-clause
1
59
1
72,937,353
72,937,353
2
true
2022-07-11T10:20:11.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Eloquent where statement returns no attributes<p>So from my previous post, I was advised to start using Eloquent models, which I did.</p> <p>My end g...
72,928,188
How can I generate a chart getting data from a JSON file<p>I have a json file in which I have different data, I need to generate a graph whose legend is &quot;Dates&quot; and whose data is all the viewers of each user. I've been trying to do it all morning, but I have no idea, can someone help me?</p> <pre class="lang-...
<p>Assume that you have put the json data in a faile named input.json</p> <pre class="lang-py prettyprint-override"><code>import json import matplotlib.pyplot as plt with open('input.json') as fp: json_data = json.load(fp) for v in json_data['Viewers']: plt.plot(json_data['Dates'], v['Viewers'], label=v['Name...
How can I generate a chart getting data from a JSON file
python|json|python-3.x|charts
0
59
2
72,928,316
72,928,316
2
true
2022-07-10T11:37:21.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I generate a chart getting data from a JSON file<p>I have a json file in which I have different data, I need to generate a graph whose legend is &quo...
72,975,959
How do I generate random strings in a column based on some parameters from other columns of a dataframe?<p>I am trying to create a simulated dataset of emails. For that, I want to generate recipients based on 2 parameters:</p> <ul> <li>how many recipients</li> <li>how many domains those recipients will be from</li> </u...
<p>You can pre-generate a list of names and domains and just combine them to create the number of combinations you need. The main trick is to use <code>random.sample</code> to get samples without replacement, so you are assured to have unique names.</p> <p>Note that, in production code, the asserts should be changed fo...
How do I generate random strings in a column based on some parameters from other columns of a dataframe?
pandas|string|email|random|generator
1
59
2
72,976,476
72,976,476
2
true
2022-07-14T06:11:43.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I generate random strings in a column based on some parameters from other columns of a dataframe?<p>I am trying to create a simulated dataset of email...
72,898,633
How to encode 3 integers into 2 integers?<p>I have three integers <code>(x1,x2,x3)</code> all in <code>[0,255]</code>. I need to encode them into two integers (<code>a</code>, and <code>b</code>) such that I can deterministically decode them back. The constraint is that the size of the new integers needs to be small. S...
<p>Welcome to information theory / the pigeonhole principle. If you wish to encode <code>x</code> different values, you need to have enough bits to distinguish between <code>x</code> different things. In your case there are <code>256 = 2**8</code> possibilities (using <code>**</code> for exponentiation) for each of <...
How to encode 3 integers into 2 integers?
algorithm|math|integer|mapping
0
59
2
72,899,309
72,899,309
2
true
2022-07-07T13:22:43.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to encode 3 integers into 2 integers?<p>I have three integers <code>(x1,x2,x3)</code> all in <code>[0,255]</code>. I need to encode them into two integer...
72,877,721
I have a <p> element that is empty, how do I give it height and not push elements down when I fill the element with text during execution?<p>When the user does things with the app, I want to have an annoying <code>&lt;p&gt;</code> element telling what they just did. So I devised a simple code to show my problem. Every...
<p>Add a linebreak to your empty <code>&lt;p&gt;</code> tag with <code>&lt;br&gt;</code></p> <pre class="lang-html prettyprint-override"><code>&lt;p id=&quot;popupText&quot;&gt;&lt;br&gt;&lt;/p&gt; </code></pre> <p>Also while unflashing, set the <code>innerHTML</code> (replace <code>.textContent</code> with <code>inner...
I have a <p> element that is empty, how do I give it height and not push elements down when I fill the element with text during execution?
javascript|html|css|height|element
0
59
1
72,877,771
72,877,771
2
true
2022-07-06T03:42:42.383Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I have a <p> element that is empty, how do I give it height and not push elements down when I fill the element with text during execution?<p>When the user do...
72,920,036
Call Google Apps Script API with GmailApp function from Postman [without using AuthO2]<p>I am trying to access the <strong>Google Apps Script Gmail service</strong> with <strong>Postman</strong>. Here is my Google Apps Script Code, with a straightforward sendMail function:</p> <pre><code>function sendMail() { GmailAp...
<p>You need a <a href="https://developers.google.com/apps-script/guides/web" rel="nofollow noreferrer"><code>doGet()</code></a> function to return data:</p> <pre><code>function doGet(){ sendMail();// call send email function return ContentService.createTextOutput('Email Sent!') } </code></pre> <p>You should publish...
Call Google Apps Script API with GmailApp function from Postman [without using AuthO2]
google-apps-script|gmail
0
59
1
72,922,248
72,922,248
2
true
2022-07-09T08:37:01.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call Google Apps Script API with GmailApp function from Postman [without using AuthO2]<p>I am trying to access the <strong>Google Apps Script Gmail service</...
72,780,603
Format pandas dataframe output into a text file as a table (formatted and aligned to the max length of the data or header (which ever is longer))<pre><code>pd.DataFrame({ 'ID': { 0: 11404371006, 1: 11404371007, 2: 11404371008, 3: 11404371009, 4: 114043...
<p>Use <code>to_markdown</code>:</p> <pre><code>out = df.to_markdown(index=False, tablefmt='pipe', colalign=['center']*len(df.columns)) print(out) # Output: | ID | TABLE.F1 | O | |:-----------:|:----------:|:-----:| | 11404371006 | Y | False | | 11404371007 | NULL | False | | 11404371008 ...
Format pandas dataframe output into a text file as a table (formatted and aligned to the max length of the data or header (which ever is longer))
python|pandas|dataframe
1
59
1
72,780,739
72,780,739
3
true
2022-06-28T04:00:31.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Format pandas dataframe output into a text file as a table (formatted and aligned to the max length of the data or header (which ever is longer))<pre><code>p...
72,789,387
Getting exact data from xml to array [PHP]<p>i m trying to get some data from the xml out of prestashop api To be exact, i want to create an array which will have as key the id (ex. 2) and value the name-&gt;language. I am using simplexml_load_string to convert the xml to arrays</p> <pre><code> &lt;?xml version=&quo...
<p>Please have a look at the code below. I suppose you have multiple <code>&lt;category&gt;</code> elements:</p> <h2>Code</h2> <pre class="lang-php prettyprint-override"><code>$xml = '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;prestashop xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;...
Getting exact data from xml to array [PHP]
php|xml
0
59
1
72,789,567
72,789,567
3
true
2022-06-28T15:34:38.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting exact data from xml to array [PHP]<p>i m trying to get some data from the xml out of prestashop api To be exact, i want to create an array which will...
72,832,380
No atomicity with Thread.join()<p>Consider the following code:</p> <pre><code>Thread t1 = new Thread(() -&gt; { System.out.println(&quot;t1 running&quot;); System.err.println(&quot;foo 1&quot;); }); Thread t2 = new Thread(() -&gt; { System.out.println(&quot;t2 running&quot;); System.out.println(&quot;foo 2&quot...
<p>of course the code executes sequentially, you can check this(not by checking logs order in different streams!):</p> <pre><code> AtomicInteger counter = new AtomicInteger(0); Thread t1 = new Thread(() -&gt; { System.out.println(&quot;t1 running [&quot; + counter.incrementAndGet() + &quot;]&quot;); ...
No atomicity with Thread.join()
java|multithreading|concurrency
1
59
1
72,832,911
72,832,911
3
true
2022-07-01T16:45:02.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No atomicity with Thread.join()<p>Consider the following code:</p> <pre><code>Thread t1 = new Thread(() -&gt; { System.out.println(&quot;t1 running&quot;);...
72,855,387
Does IN (NULL) consistently return no rows?<p>We have a system which builds T-SQL queries from objects. This system deliberately throws exception if trying to use empty lists for <code>IN()</code> condition.</p> <p>I am thinking of replacing this behaviour with <code>IN (NULL)</code> operation. From what I tried, this ...
<p><code>[Column] IN (NULL)</code> is equivalent to <code>[Column] = NULL</code></p> <p>In the default setting of <code>SET ANSI_NULLS ON</code>, <code>[Column] = NULL</code> always returns an empty result set.</p> <p>So, as long as you are interested in</p> <blockquote> <p>it returns no records even for values which a...
Does IN (NULL) consistently return no rows?
sql-server|tsql
2
59
2
72,855,548
72,855,548
3
true
2022-07-04T10:35:01.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does IN (NULL) consistently return no rows?<p>We have a system which builds T-SQL queries from objects. This system deliberately throws exception if trying t...
72,836,830
Data structure to find the nearest untaken element<p>I have an array A[0..N-1] containing N elements and a list containing M indexes. Each index in the list corresponds to an element in the array. For example, an index of 0 corresponds to A[0], an index of 1 corresponds to A[1]</p> <p>I want to process the list sequen...
<p>Here is a suggestion for an O(M*logM) algorithm.</p> <p>At the start, insert all M i-indexes of the list into a sorted tree allowing doubles. The steps become,</p> <ol> <li>If A[i] is not taken, then take A[i]. Remove the i from the tree.</li> <li>If A[i] is taken, then the smallest j &gt; i where A[j] is not taken ...
Data structure to find the nearest untaken element
algorithm|data-structures
0
59
1
72,864,607
72,864,607
3
true
2022-07-02T06:01:48.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data structure to find the nearest untaken element<p>I have an array A[0..N-1] containing N elements and a list containing M indexes. Each index in the list...
72,900,810
Socket IO in Kubernetes keeps disconnecting<p>I'd like to launch a clustered Socket IO application in Kubernetes. When I create a service (whether NodePort or LoadBalancer) the client application keeps getting disconnected and it reconnects again with the following logs:</p> <pre><code>undefined oah4g28zZCw36g1MAAAm un...
<p>You can use the <code>sessionAffinity: ClientIP</code>, which will manage the session from K8s service.</p> <pre><code>kind: Service apiVersion: v1 metadata: name: example spec: selector: app: example ports: - name: http protocol: TCP port: 80 targetPort: 80 sessionAffinity: ClientIP sess...
Socket IO in Kubernetes keeps disconnecting
kubernetes|socket.io
1
59
1
72,902,717
72,902,717
3
true
2022-07-07T15:49:28.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Socket IO in Kubernetes keeps disconnecting<p>I'd like to launch a clustered Socket IO application in Kubernetes. When I create a service (whether NodePort o...
72,896,482
How do I create a scheduled user-defined action that trims rows in TimescaleDB?<p>I'm monitoring, collecting and storing event data for different organizations in my TimescaleDB.</p> <p>I have a TimescaleDB with one database. Each organization has its own schema in that database. Each schema has two tables: A <strong>d...
<p>Is your device sending the data every X seconds? Because you could also create a retention policy if you have such a case. Let's say you have it receiving a new event every 5 seconds for each device, so you have 12 per minute and (12 * 60 * 24) = 17280 per day. So, 10k of 17280 is around 58% of the day.</p> <p>You c...
How do I create a scheduled user-defined action that trims rows in TimescaleDB?
postgresql|stored-procedures|user-defined-functions|timescaledb|retention
2
59
1
72,903,697
72,903,697
3
true
2022-07-07T10:49:26.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I create a scheduled user-defined action that trims rows in TimescaleDB?<p>I'm monitoring, collecting and storing event data for different organizatio...
72,954,113
if else return in kotlin<p><a href="https://i.stack.imgur.com/IhZcC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IhZcC.png" alt="enter image description here" /></a></p> <h2>Error :</h2> <h3>Kotlin: Type mismatch: inferred type is String but Unit was expected</h3> <blockquote> <h2>code :</h2> </bl...
<p>Your code should be like this</p> <pre><code>var data: String = if (a != 2) { &quot;Hello&quot; } else { &quot;World&quot; } </code></pre> <p>By using <code>return</code> you are returning from the <code>main</code> function which has the return type set to &quot;Unit&quot;. If you want to di...
if else return in kotlin
kotlin|intellij-idea
0
59
1
72,954,263
72,954,263
3
true
2022-07-12T14:38:11.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: if else return in kotlin<p><a href="https://i.stack.imgur.com/IhZcC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IhZcC.png" alt="enter ...
72,962,857
In a Pandas Id column, how can I insert an incremented value (max + 1) for each missing Id value<p>In a large data set (300K rows) with an Id column (primary key), I append new rows of data. New rows do not have an Id, which I am having difficulty adding. Each new Id should be an incremented value for each row - adding...
<p>Try:</p> <ul> <li>add <code>max()</code> to <code>cumsum</code> on <code>isna</code></li> <li><code>fillna</code> with the above</li> </ul> <p>Code:</p> <pre><code>df['Id'] = df['Id'].fillna(df['Id'].isna().cumsum()+df['Id'].max()) </code></pre> <p>Output:</p> <pre><code> Id Col1 Col2 0 0 1 7 1 1 ...
In a Pandas Id column, how can I insert an incremented value (max + 1) for each missing Id value
python|pandas|indexing|identity
1
59
1
72,962,926
72,962,926
3
true
2022-07-13T08:05:30.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In a Pandas Id column, how can I insert an incremented value (max + 1) for each missing Id value<p>In a large data set (300K rows) with an Id column (primary...
72,985,704
SQL: NOT IN vs NOT EXISTS strange behavior<p>In my searching for answers, I seem to only be finding explanations that cover the existence of <code>NULL</code> which is why the <code>NOT IN</code> returns 0 results. However, my scenario is exactly the opposite. I'm getting my expected results with the <code>NOT IN</code...
<p>The query shape...</p> <pre class="lang-sql prettyprint-override"><code>and o.ClinicLocationId not in (SELECT o.ClinicLocationId ...) </code></pre> <p>...correlates <code>o.ClinicLocationId</code> to <code>o.ClinicLocationId</code> in the subquery.</p> <p>When using <code>exists</code> you have to write a correlated...
SQL: NOT IN vs NOT EXISTS strange behavior
sql-server|exists|not-exists
1
59
1
72,985,914
72,985,914
3
true
2022-07-14T19:26:26.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: NOT IN vs NOT EXISTS strange behavior<p>In my searching for answers, I seem to only be finding explanations that cover the existence of <code>NULL</code...
72,994,633
OOP fortran : Must I keep the abstract interface in this program?<p>Following the second option suggested by Federico Perini in <a href="https://stackoverflow.com/q/72935168/7462275">Fortran : Is it possible to overload a procedure in a abstract interface?</a>, I wrote this code.</p> <pre><code>module myModule impl...
<p>The reason <code>abstract interface</code>s exist is to define a common template that all extended types need to comply to. In your example, you could have such interfaces to mandate properties that are shared across all them. For example (to name a couple):</p> <pre><code>abstract interface elemental real(real64...
OOP fortran : Must I keep the abstract interface in this program?
oop|module|fortran
1
59
1
72,998,466
72,998,466
3
true
2022-07-15T13:18:16.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OOP fortran : Must I keep the abstract interface in this program?<p>Following the second option suggested by Federico Perini in <a href="https://stackoverflo...
73,001,018
Is it possible to insert a variable in Scala string like python format string?<p>I'm trying to create a Scala code that is similar to python where I read a text file such as:</p> <p>test.sql</p> <pre><code> select * from {name} </code></pre> <p>and insert name variable from the main program itself.</p> <p>I'm new to Sc...
<p>I strongly advise against using a string interpolation / replacement to build SQL queries, as it's an easy way to leave your program vulnerable to SQL Injection (regardless of what programming language you're using). If interacting with SQL is your goal, I'd recommend looking into a database helper library like Doob...
Is it possible to insert a variable in Scala string like python format string?
scala
-2
59
1
73,001,444
73,001,444
3
true
2022-07-16T01:48:03.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to insert a variable in Scala string like python format string?<p>I'm trying to create a Scala code that is similar to python where I read a t...
73,008,579
Assigning value to variable when IF statement is false causes error in Python<p>I'm writing a function in Python that should search a string for a substring, then assign the index of the substring to a variable. And if the substring isn't found, I'd like to assign -1 to the variable to be used as a stop code elsewhere....
<p>I think, in using ternary operator, value should be returned.</p> <pre><code>test = &quot;azbc&quot; search_str = &quot;z&quot; index_search_str = test.index(search_str) if search_str in test else -1 print(index_search_str) # print value maybe &quot;1&quot; </code></pre>
Assigning value to variable when IF statement is false causes error in Python
python
2
59
5
73,008,609
73,008,609
3
true
2022-07-17T00:53:49.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assigning value to variable when IF statement is false causes error in Python<p>I'm writing a function in Python that should search a string for a substring,...
73,014,636
How to filter in R only if a certain condition is valid?<p>I have a dataset with groups--&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, and &quot;A &amp; B&quot;--at two time points--&quot;before&quot; and &quot;after&quot;. I only want to include &quot;A &amp; B&quot; if the any of the sample sizes for A or B at either ...
<p>Maybe the condition in <code>filter</code> would be - subset the <code>group</code> where the <code>sample_size</code> is less than 10, check if there are <code>any</code> values of 'A', 'B' in that group, negate (<code>!</code>), then create the second expression where <code>group</code> is &quot;A &amp; B&quot;, j...
How to filter in R only if a certain condition is valid?
r|dplyr
3
59
2
73,014,701
73,014,701
3
true
2022-07-17T19:11:56.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter in R only if a certain condition is valid?<p>I have a dataset with groups--&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, and &quot;A &amp; B&quo...
72,806,505
What is the difference between event, channels, topics?<p>With refernce to Kafka, what is the difference between all these?</p> <p>Lets say I have a component &quot;Order&quot; which must emit events into a kafka-channel when I create/cancel/modify orders.</p> <p>And I create a channel. As &quot;Order-out&quot;. Is top...
<p>An event is a single record. In Spring, you might work with a <code>Message</code> class to wrap an event.</p> <p>Channel is a <a href="https://docs.spring.io/spring-integration/reference/html/channel.html" rel="nofollow noreferrer">Spring Integration</a> term used via Spring-Kafka or <a href="https://docs.spring.io...
What is the difference between event, channels, topics?
spring-boot|apache-kafka|spring-integration|spring-kafka
2
59
1
72,806,711
72,806,711
3
true
2022-06-29T18:57:55.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the difference between event, channels, topics?<p>With refernce to Kafka, what is the difference between all these?</p> <p>Lets say I have a componen...
72,949,868
How to create a column that is dependent on several events over time with a certain threshold?<p>In the data below we observe an indexed GDP rate of a certain country over time. My aim is to create a binary variable: 0= no crisis, 1= crisis. If the index is below the past 5 year average, then the variable is coded as 1...
<p>You could use slider's <code>slide_dbl</code> to get the <code>mean</code> of the prior 5 years per below:</p> <p>A few notes:</p> <ol> <li>Without <code>.complete = TRUE</code>, it would calculate a mean for partial windows.</li> <li>If your real dataset has multiple countries, then don't forget to <code>group_by(c...
How to create a column that is dependent on several events over time with a certain threshold?
r|dplyr
0
59
2
72,950,094
72,950,094
3
true
2022-07-12T09:16:03.260Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a column that is dependent on several events over time with a certain threshold?<p>In the data below we observe an indexed GDP rate of a certai...
72,870,683
Running CPU bound task as a separate process within asyncio application causes significant slowdown<p>I have some HTML pages that I am trying to extract the text from using asynchronous web requests through <code>aiohttp</code> and <code>asyncio</code>, after extracting them I save the files locally. I am using <code>B...
<p>Here is roughly what your asynchronous program does:</p> <ol> <li>Launch <code>num_files</code> <code>parse()</code> tasks concurrently</li> <li>Each <code>parse()</code> task creates its own <code>ProcessPoolExecutor</code> and asynchronously awaits for <code>extract_text</code> (which is executed in the previously...
Running CPU bound task as a separate process within asyncio application causes significant slowdown
python|asynchronous|python-asyncio
1
59
1
72,880,885
72,880,885
3
true
2022-07-05T13:56:59.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running CPU bound task as a separate process within asyncio application causes significant slowdown<p>I have some HTML pages that I am trying to extract the ...
72,957,686
Extract multiple substring patterns from a vector<p>Let's say I have a vector as follows:</p> <pre><code>patient_condition &lt;- c(&quot;Pre_P1&quot;,&quot;Post_P1&quot;,&quot;Enriched_Post_P1&quot;,&quot;Post_P1_2&quot;,&quot;Pre_P2&quot;,&quot;Post_P2&quot;, &quot;P3_Pre&quot;) to_match &lt;- c(&quot;P1&quot;,&quot;P...
<p>We can use</p> <pre><code>stringr::str_extract(patient_condition, &quot;P[0-9]+&quot;) #[1] &quot;P1&quot; &quot;P1&quot; &quot;P1&quot; &quot;P1&quot; &quot;P2&quot; &quot;P2&quot; &quot;P3&quot; </code></pre> <hr /> <p><strong>Misc Replies</strong></p> <blockquote> <p>In my case, this answer works. but I guess the...
Extract multiple substring patterns from a vector
r|regex
2
59
4
72,957,694
72,957,694
3
true
2022-07-12T19:51:26.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract multiple substring patterns from a vector<p>Let's say I have a vector as follows:</p> <pre><code>patient_condition &lt;- c(&quot;Pre_P1&quot;,&quot;P...
72,906,463
how to analysis String contain multiple list in python<p>I have a string as follows</p> <pre class="lang-py prettyprint-override"><code>str = &quot;['A', 'B', 'C'] ['D', 'E', 'F']&quot; </code></pre> <p>I use <code>json.load</code> with <code>ast.literal_eval</code> neither works</p> <p>Is there any function that can q...
<p>The string does not represent a valid Python construct. Therefore, neither eval nor ast.literal_eval will be able to parse it. However, it appears that all you need to do is insert a comma in the appropriate position. You could do it like this:</p> <pre><code>import re import ast s = &quot;['A', 'B', 'C'] ['D', 'E'...
how to analysis String contain multiple list in python
python|string|list
0
59
1
72,907,051
72,907,051
3
true
2022-07-08T03:55:42.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to analysis String contain multiple list in python<p>I have a string as follows</p> <pre class="lang-py prettyprint-override"><code>str = &quot;['A', 'B'...
72,924,091
Using purrr's possibly over a list to convert empty tibble columns to NA values<p>I have a function which uses <code>rvest</code> to extract data from a webpage. The function is the following (which is not so important):</p> <pre><code>processCardPackMinimalRealtorInfo = function(rowPosition){ # collect realtor infor...
<p>The function <code>processCardPackMinimalRealtorInfo</code> should throw an error when no rows are output, so that this can be handled by <code>possibly</code>:</p> <pre class="lang-r prettyprint-override"><code>library(tibble) library(purrr) data0 &lt;- tibble(realEstateCompanyName = character(0), ...
Using purrr's possibly over a list to convert empty tibble columns to NA values
r|purrr|rvest
0
59
1
72,924,479
72,924,479
3
true
2022-07-09T19:31:59.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using purrr's possibly over a list to convert empty tibble columns to NA values<p>I have a function which uses <code>rvest</code> to extract data from a webp...
72,871,247
Regex: Look for a specific word after the first backslash occurrence<p>I'm wanting to use regex to look for the word &quot;bacon&quot; after the first &quot;/&quot; occurrence.</p> <p>For example:</p> <p>Should return true:</p> <pre><code>console.log('1 - ', myRegexFunction('www.bacondelivery.com/weekly-bacon-delivery/...
<p>You may use this regex for this:</p> <pre class="lang-bash prettyprint-override"><code>^[^\/]+\/[^\/]*\bbacon\b.* </code></pre> <p><a href="https://regex101.com/r/WiARoM/1" rel="nofollow noreferrer">RegEx Demo</a></p> <p><strong>RegEx Details:</strong></p> <ul> <li><code>^</code>: Start</li> <li><code>[^\/]+</code>:...
Regex: Look for a specific word after the first backslash occurrence
javascript|regex|match
1
59
4
72,871,309
72,871,309
3
true
2022-07-05T14:37:29.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex: Look for a specific word after the first backslash occurrence<p>I'm wanting to use regex to look for the word &quot;bacon&quot; after the first &quot;...
72,953,273
If the variable is null or not assigned, putting value in function does not work<p>I have this function that sometimes does not assign the variable <code>$infolasterroredu</code></p> <p>In these cases I want to tell the function to assign the value <code>&quot;Hello&quot;</code> if the variable is <code>not assigned</c...
<p>By not having a type at all on the second argument, you're saying anything can be passed, but if <em>nothing</em> is passed (not even <code>null</code>), it's <code>Hello</code>. First, I would restrict the type if possible:</p> <pre><code>function stockstatus(Product $product, string $infolasterroredu = 'Hello') {}...
If the variable is null or not assigned, putting value in function does not work
php
2
59
3
72,954,332
72,954,332
3
true
2022-07-12T13:39:34.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If the variable is null or not assigned, putting value in function does not work<p>I have this function that sometimes does not assign the variable <code>$in...
72,825,445
javafx TabPane setSelection doesn't switch the tab<p>I want to control the TabPane and switch tabs with a Canvas, basically hide the tab headers and use canvas instead, the canvas displays different &quot;Devices&quot; and when user click on the device, the TabPane switch to show the content of that device.</p> <pre><c...
<p>Note: this is plain javafx and might not be the exact solution in your case (hard to tell without example) - but actually I can reproduce the described behavior.</p> <p>The problem seems to be calling clearSelection: TabPane with tabs should have exactly one selected tab - which is not specified. <strike> But every ...
javafx TabPane setSelection doesn't switch the tab
kotlin|javafx
0
59
1
72,830,008
72,830,008
3
true
2022-07-01T06:59:12.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javafx TabPane setSelection doesn't switch the tab<p>I want to control the TabPane and switch tabs with a Canvas, basically hide the tab headers and use canv...
72,833,833
How do I separate this 1 item list into multiple lists?<pre><code>from urllib.request import urlopen from bs4 import BeautifulSoup import numpy as np table_body = soup.findAll('tbody', class_ = lambda table_rows: table_rows != &quot;thead&quot;) table_data = [[td.getText() for td in table_body[i].findAll('td')] ...
<p>Iterate the rows of the table and for each one over its <code>&lt;td&gt;</code> to get its text:</p> <pre><code>[[e.text for e in r.select('td')] for row in soup.select('tbody tr')] </code></pre> <p>Output:</p> <pre><code>[['Tom Brady*', 'TAM', '44', 'QB', '17', '17', '13-4-0', '485', '719', '67.5', '5316', '43', '6...
How do I separate this 1 item list into multiple lists?
python|list|web-scraping|beautifulsoup|split
1
59
1
72,833,992
72,833,992
3
true
2022-07-01T19:26:23.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I separate this 1 item list into multiple lists?<pre><code>from urllib.request import urlopen from bs4 import BeautifulSoup import numpy as np table_b...
72,792,490
c++ Thread handling in class<p>I would like to create a object in which I can start a thread and have a function to join withe the created thread. Everything insight the object, so that the thread is a private component of the object.</p> <p>I have tried a bit and got those Results. Could some of you explain me what I ...
<pre><code>std::thread A::startThread() { std::thread a((*threadFunction)); return a; } </code></pre> <p>Does not interact with the member variable <code>a</code>, but it creates a new local variable <code>std::thread</code> object and then moves it to the result (unless the move is optimized out). The thread <...
c++ Thread handling in class
c++|multithreading
0
59
1
72,792,600
72,792,600
3
true
2022-06-28T19:59:57.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++ Thread handling in class<p>I would like to create a object in which I can start a thread and have a function to join withe the created thread. Everything...
72,909,528
How to set a css property depending on desktop or mobile view?<p>I would like to have 2 different margin for the same div depend on mobile and desktop view.</p> <p>The code below can perform a <code>margin-left: 70px;</code> on desktop. The problem arises on mobile view, it doesn't reset to <code>margin-left: 0px;</cod...
<p>You're not resetting margin in <code>.content</code></p> <p>You need to use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries" rel="nofollow noreferrer">media queries</a></p> <p>The solution below uses <strong>non-mobile approach</strong></p> <p><div class="snippet" data-lan...
How to set a css property depending on desktop or mobile view?
html|css
0
59
4
72,909,582
72,909,582
3
true
2022-07-08T09:43:19.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set a css property depending on desktop or mobile view?<p>I would like to have 2 different margin for the same div depend on mobile and desktop view.<...
72,904,943
Cuda Async MemCpy behavior when 'lapping' itself<p>Say you have a fairly typical sequence of async compute:</p> <ol> <li>Generate data on host, do other CPU stuff</li> <li>Put data in async stream to device (via pinned memory)</li> <li>compute data in (same) async stream</li> </ol> <p>Now if you're running in a loop, t...
<blockquote> <p>Does the host MemCpyAsync block until the previous copy is complete?</p> </blockquote> <p>No, generally not, assuming by &quot;block&quot; you mean block the CPU thread. Asynchronous work items issued to the GPU go into a queue, and control is immediately returned to the CPU thread, before the work has...
Cuda Async MemCpy behavior when 'lapping' itself
cuda
1
59
1
72,905,103
72,905,103
3
true
2022-07-07T22:39:28.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cuda Async MemCpy behavior when 'lapping' itself<p>Say you have a fairly typical sequence of async compute:</p> <ol> <li>Generate data on host, do other CPU ...
72,992,075
How to remove an element from LinkedList in stable Rust?<p>I have a linked list of values and I want to remove elements from there either by value or by index. I tried to use the remove function, but the compiler says that this function is not stable. Is it possible to remove elements from an arbitrary location in a li...
<p>You can split the array using <a href="https://doc.rust-lang.org/std/collections/struct.LinkedList.html#method.split_off" rel="nofollow noreferrer"><code>split_off</code></a> then join them back together without the element. See <a href="https://github.com/rust-lang/rust/issues/69210#issuecomment-647864685" rel="nof...
How to remove an element from LinkedList in stable Rust?
rust|linked-list
0
59
1
72,992,169
72,992,169
3
true
2022-07-15T09:44:29.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove an element from LinkedList in stable Rust?<p>I have a linked list of values and I want to remove elements from there either by value or by inde...
72,991,388
Is list comprehension implemented via map and lambda function?<p>According to the <a href="https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions" rel="nofollow noreferrer">list comprehension doc</a> and <a href="https://stackoverflow.com/q/34835951/9758790">this question</a>: <code>squares = [x**2 ...
<p>No, list comprehensions are not implemented by map and lambda under the hood, not in CPython and not in Pypy3 either.</p> <p><a href="https://github.com/python/cpython/blob/c22f134211743cd5ad14cec1dd4f527bee542b4c/Python/compile.c#L5103-L5122" rel="nofollow noreferrer">CPython (3.9.13 here) compiles the list compreh...
Is list comprehension implemented via map and lambda function?
python|list-comprehension|python-internals
2
59
1
72,991,438
72,991,438
3
true
2022-07-15T08:46:55.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is list comprehension implemented via map and lambda function?<p>According to the <a href="https://docs.python.org/3/tutorial/datastructures.html#list-compre...
72,822,464
Python - init argument not used in self<p>I came by a code and wanted to get more understanding on when to use such arrangement. What would be a good scenario of not using <code>__init__</code>'s argument (<code>name</code>) in <code>self</code>?</p> <pre><code>class ArgumentNotUsedInSelf: def __init__(self, name: ...
<p>Some of the reasons for this can be:</p> <ul> <li>Historical. The class used to use the argument, but it was changed so it's no longer meaningful. The argument was kept for backward compatibility.</li> <li>Class hierarchy. This may be a child class of a class that uses the argument, but the child overrides the need ...
Python - init argument not used in self
python|python-class
0
59
3
72,822,486
72,822,486
4
true
2022-06-30T21:57:50.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - init argument not used in self<p>I came by a code and wanted to get more understanding on when to use such arrangement. What would be a good scenari...
72,867,001
js: fill object with array elements using reduce()<p>trying to learn reduce() but can't understand it well yet. Maybe someone from you could help me with my problem.</p> <p>I have an object with defined keys and an array. I would like to fill up the objects keys with the arrays values using reduce().</p> <p>My sandbox ...
<p>You need to change <code>index</code> into &quot;an object key at <code>index</code>&quot;:</p> <pre><code>const newObj = myArr.reduce((result, value, index) =&gt; { result[Object.keys(myObj)[index]] = value return result }, myObj) </code></pre> <p>That said, <code>zip</code> + <code>Object.fromEntries</code...
js: fill object with array elements using reduce()
javascript|arrays|object
1
59
3
72,867,349
72,867,349
4
true
2022-07-05T09:25:57.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: js: fill object with array elements using reduce()<p>trying to learn reduce() but can't understand it well yet. Maybe someone from you could help me with my ...
72,965,902
Recursion with dplyr<p>I have data</p> <pre class="lang-r prettyprint-override"><code>library(dplyr, warn.conflicts = FALSE) mtcars %&gt;% as_tibble() %&gt;% select(mpg, qsec) %&gt;% head(5) %&gt;% mutate(new_col = c(10, rep(NA, times = nrow(.)-1))) #&gt; # A tibble: 5 × 3 #&gt; mpg qsec new_col #&gt;...
<p>You can use <code>purrr::accumulate()</code> (or <code>base::Reduce()</code> if you prefer):</p> <pre><code>library(dplyr) library(purrr) mtcars %&gt;% as_tibble() %&gt;% select(mpg, qsec) %&gt;% head(5) %&gt;% mutate(new_col = accumulate(tail(mpg + qsec, -1), .f = ~ .y - .x, .init = 10)) # A tibble: 5...
Recursion with dplyr
r|dplyr
3
59
2
72,966,053
72,966,053
4
true
2022-07-13T11:58:12.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Recursion with dplyr<p>I have data</p> <pre class="lang-r prettyprint-override"><code>library(dplyr, warn.conflicts = FALSE) mtcars %&gt;% as_tibble() %&g...
72,983,277
Why do conditions with %in% ignore missing values?<p>I encountered an unexpected output when I used <code>%in%</code> in a condition whilst recoding a categorical variable.</p> <p>When an element of a vector on the left is <code>NA</code>, the condition evaluates as <code>FALSE</code>, whilst I expected it to be <code>...
<p><code>%in%</code> checks to see if <code>NA</code> is in the list. Consider these two scenarios</p> <pre><code>NA %in% 1:3 # [1] FALSE NA %in% c(1:3, NA) # [1] TRUE </code></pre> <p>This allows you to check of NA is in the vector or not.</p> <p>If you want to preserve NA values, you could write your own alternative<...
Why do conditions with %in% ignore missing values?
r|conditional-statements|recode
2
59
3
72,983,362
72,983,362
4
true
2022-07-14T15:45:16.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do conditions with %in% ignore missing values?<p>I encountered an unexpected output when I used <code>%in%</code> in a condition whilst recoding a catego...
73,024,048
R efficient way to translate string pattern in all tibble cells with col and row number<p>let's say I have a dataframe like this:</p> <pre><code>first &lt;- tibble( a = c(&quot;XXX&quot;,&quot;YYY&quot;,&quot;BBB&quot;,&quot;CCC&quot;,&quot;AAA&quot;,&quot;EEE&quot;), b = c(&quot;RRR&quot;,&quot;AAA&quot;,&quot;GGG...
<pre><code> a b c d &lt;chr&gt; &lt;chr&gt; &lt;chr&gt; &lt;chr&gt; 1 XXX RRR AAA VVV 2 YYY AAA ZZZ YYY 3 BBB GGG NNN AAA 4 CCC BBB MMM CCC 5 AAA LLL AAA AAA 6 EEE BBB QQQ EEE library(data.table) setDT(first) str= &quot;AAA&quot; first[first == str] &l...
R efficient way to translate string pattern in all tibble cells with col and row number
r|function
1
59
3
73,024,228
73,024,228
4
true
2022-07-18T14:32:29.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R efficient way to translate string pattern in all tibble cells with col and row number<p>let's say I have a dataframe like this:</p> <pre><code>first &lt;- ...
72,857,421
ClickOnce - Installation folder Setup on the server side<p>I am traying to publish an application via ftp, using visual studio 2015 and Net Framework 4.5.2</p> <p>I have a local ftp in a lan web.</p> <p>But do i need to create a iis website for the <strong>Installation folder Setup</strong>? if i neeed to do that how t...
<p>That's possible.</p> <p>When you publish an application by using ClickOnce, the <code>Publish Location</code> property specifies the location where the application files and manifest are put. This can be a file path or the path to an FTP server.</p> <p>You can specify the <code>Publish Location</code> property on th...
ClickOnce - Installation folder Setup on the server side
c#|visual-studio
1
59
1
73,160,869
73,160,869
4
true
2022-07-04T13:19:00.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ClickOnce - Installation folder Setup on the server side<p>I am traying to publish an application via ftp, using visual studio 2015 and Net Framework 4.5.2</...
72,963,501
why is the following code not returning sum of all the array elements?<p>Below is the code, I want to return the sum of all the array elements, why is it not working. I know we don't need the Promise to achieve that but I would like to know how it can be done with a Promise.</p> <pre><code>const arr = [1, 5, 7, 8]; ...
<p>I hope this will help</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 arr = [1, 5, 7, 8]; function sumPromise(a, b) { return new Promise((res) =&gt; { setTimeou...
why is the following code not returning sum of all the array elements?
javascript|arrays|promise|javascript-objects|es6-promise
2
59
2
72,963,674
72,963,674
4
true
2022-07-13T08:56:14.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why is the following code not returning sum of all the array elements?<p>Below is the code, I want to return the sum of all the array elements, why is it not...
72,909,105
How to have a separate color for each face on my object in OpenGL?<p>Total OpenGL noob here... I am trying to color each face of a pyramid in a different color like so:</p> <pre><code> glBegin(GL_POLYGON) f1 = ((1,-1,-1),(1,-1,1),(0,1,0)) f2 = ((1,-1,1),(-1,-1,1),(0,1,0)) f3 = ((-1,-1,-1),(-1,-1,1),(0,1,...
<p>The primitive type <code>GL_POLYGON</code> makes 1 large polygon out of all vertices in the <code>glBegin</code>/<code>glEnd</code> sequence. Note that OpenGL cannot guess how many points make up a single polygon. You need to draw the polygons in separated <code>glBegin</code>/<code>glEnd</code> sequences:</p> <pre ...
How to have a separate color for each face on my object in OpenGL?
python|opengl|colors
2
59
1
72,909,185
72,909,185
4
true
2022-07-08T09:05:18.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to have a separate color for each face on my object in OpenGL?<p>Total OpenGL noob here... I am trying to color each face of a pyramid in a different col...
72,903,466
result of isequal(0.6, 0.5 + 0.1) differs from isequal(0.6, 0.4 + 0.2) in julia<p>I'm learning <a href="https://julialang.org/" rel="nofollow noreferrer">Julia</a> currently and have encountered a strange result (which I don't think to be Julia's specific behavior!), and I'm eager to find out why. In Julia, one can che...
<p>The numbers such as <code>0.1</code> or <code>0.2</code> are not rational numbers in the binary system so you end up having rounding errors. This behaviour is according to the <a href="https://en.wikipedia.org/wiki/IEEE_754" rel="nofollow noreferrer">IEEE floating point standard</a>, and is present in all mainstrea...
result of isequal(0.6, 0.5 + 0.1) differs from isequal(0.6, 0.4 + 0.2) in julia
julia
2
59
1
72,905,838
72,905,838
4
true
2022-07-07T19:47:57.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: result of isequal(0.6, 0.5 + 0.1) differs from isequal(0.6, 0.4 + 0.2) in julia<p>I'm learning <a href="https://julialang.org/" rel="nofollow noreferrer">Jul...
72,936,306
Select key:value with jq and output as array<p>When using jq it is easy to select a key:value that you want to output, but by default the array dissapears. How do I keep the output as an array?</p> <h1>Example</h1> <pre><code># My JSON my_json='{&quot;count&quot;:2,&quot;values&quot;:[{&quot;name&quot;: &quot;Hans&quot...
<p>You can add <em>square brackets</em> (<em>preferably</em> along with <em><strong>c</strong></em>(<em>ompact output</em>) option in order to return the array on a single line as in the question) such as</p> <pre class="lang-bash prettyprint-override"><code>echo $my_json | jq -c '[.values[].name]' </code></pre> <p><kb...
Select key:value with jq and output as array
json|bash|csv|output|jq
2
59
2
72,936,373
72,936,373
4
true
2022-07-11T09:25:13.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select key:value with jq and output as array<p>When using jq it is easy to select a key:value that you want to output, but by default the array dissapears. H...
72,875,281
What does the parenthesis after an expression function in javascript do?<p>I have this module on NodeJS:</p> <pre><code>const { cloneDeep, mapValues } = require('lodash'); module.exports = function(Sequelize) { return new ( function(Sequelize) { /* Preserve this pointer into forEach callbacks scope */ var se...
<p>This is an <a href="https://developer.mozilla.org/en-US/docs/Glossary/IIFE" rel="noreferrer">IIFE</a>. It's a function created and run inline.</p> <p>Sequelize is just an argument</p> <p>That could be written like that</p> <pre><code>return new init(Sequelize); function init(Sequelize) { /* Preserve this pointe...
What does the parenthesis after an expression function in javascript do?
javascript|node.js|function|sequelize.js|parentheses
1
59
1
72,875,311
72,875,311
5
true
2022-07-05T20:39:28.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does the parenthesis after an expression function in javascript do?<p>I have this module on NodeJS:</p> <pre><code>const { cloneDeep, mapValues } = requ...
72,910,875
What is the real advantage of using activation group in rpg<p>Can someone kindly tell me what is the real advantage of using an activation group. I mean other than the fact that we can deactivate a bunch of programs together what real advantage does activation group provide us over not using it.</p>
<p>Prior to ILE Activation groups, every program ran in a given job shared certain resources, with activation groups these are shared only within an activation group.</p> <p>I'll point you toward the <a href="https://www.ibm.com/docs/en/i/7.4?topic=concepts-activation-group" rel="noreferrer">ILE Concepts manual</a></p>...
What is the real advantage of using activation group in rpg
ibm-midrange|rpgle|rpg
2
59
2
72,913,084
72,913,084
5
true
2022-07-08T11:42:49.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the real advantage of using activation group in rpg<p>Can someone kindly tell me what is the real advantage of using an activation group. I mean othe...
73,024,623
Why don't Scanner methods return void?<p>I've noticed that when using scanners, if I want to set attributes such as delimiter or locale, the methods to do so return the <code>Scanner</code> object itself:</p> <pre><code>public Scanner useDelimiter(String pattern) { modCount++; delimPattern = patternCache.forNam...
<p>This is more for convenience than anything else. The return value can be ignored; it just allows you to chain methods for readability.</p> <p>E.g.</p> <pre><code>lineScanner.useDelimiter(&quot;,&quot;).useLocale(Locale.US).useRadix(10); </code></pre> <p>This is more readable and shorter than</p> <pre><code>lineScann...
Why don't Scanner methods return void?
java|java.util.scanner
2
59
1
73,024,684
73,024,684
5
true
2022-07-18T15:11:36.263Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why don't Scanner methods return void?<p>I've noticed that when using scanners, if I want to set attributes such as delimiter or locale, the methods to do so...
72,820,324
Ping script not exporting results<p>Can someone tell me what I am doing wrong? Trying to have a ping script run a bunch of IPs that are in a text file. The write Alive or Dead and write it to a txt file with results. I get it to run put does not input anything into the txt fil.</p> <p>End goal is I Would like this to o...
<ul> <li><p>In your first, attempt, <strong>your <a href="https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/out-file" rel="nofollow noreferrer"><code>Out-File</code></a> call receives <em>no input</em></strong>, so the resulting file is empty.</p> <ul> <li><p>To put it differently: the <a href="...
Ping script not exporting results
excel|powershell
1
59
2
72,820,881
72,820,881
5
true
2022-06-30T18:14:12.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ping script not exporting results<p>Can someone tell me what I am doing wrong? Trying to have a ping script run a bunch of IPs that are in a text file. The w...
72,950,419
What does "polling" mean in the context of watching for file changes?<p>I'm currently trying to get a FileSystemWatcher to work, as outlined in <a href="https://stackoverflow.com/questions/72909655/why-does-my-filesystemwatcher-stop-working-after-the-first-change-in-a-subdirect">this question</a>. During my research, I...
<p>Polling means here that you regularly read for instance the last write-time of the files you want to watch and test if there is a difference. you could even read the file contents and compare it with a previous verison. Polling just means that you actively do the comparison instead of being notified.</p> <p>Polling ...
What does "polling" mean in the context of watching for file changes?
c#|.net-6.0|filesystemwatcher
3
59
1
72,950,469
72,950,469
5
true
2022-07-12T09:57:02.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does "polling" mean in the context of watching for file changes?<p>I'm currently trying to get a FileSystemWatcher to work, as outlined in <a href="http...
73,011,573
How to retrieve SCOPE_IDENTITY of all inserts done in INSERT INTO [table] SELECT [col1, ...]<p>Suppose I have a temp table with some cols one of which I have dedicated to identity column of the inserted Invoice and the others for inserting Invoice data itself. Like the following table :</p> <pre><code>CREATE TABLE #Inv...
<p>To grab multiple <code>IDENTITY</code> values from <code>INSERT INTO SELECT FROM</code> <code>OUTPUT</code> clause could be used:</p> <pre><code>-- temp table CREATE TABLE #temp(col VARCHAR(100)); INSERT INTO #temp(col) VALUES ('A'), ('B'), ('C'); --target table CREATE TABLE tab( id INT IDENTITY, col VARCHAR(1...
How to retrieve SCOPE_IDENTITY of all inserts done in INSERT INTO [table] SELECT [col1, ...]
sql|sql-server|database
1
59
2
73,011,656
73,011,656
6
true
2022-07-17T12:00:20.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to retrieve SCOPE_IDENTITY of all inserts done in INSERT INTO [table] SELECT [col1, ...]<p>Suppose I have a temp table with some cols one of which I have...
72,769,984
How to evaluate two enum members with same value as not equal in C#?<p>I have this enum instance</p> <pre><code>public enum MyEnum {A1 = 0, A2 = 0} </code></pre> <p>where I want the members <code>A1</code> <code>A2</code> to yield the same value when evaluated but should not be considered equal when compared.</p> <p>He...
<p>I found an easy work around that is most suffiecient for my problem.</p> <p>That is to simply use modulo to allow all members in <code>MyEnum</code> to have different values while still evaluate to the same value.</p> <p>This method also made it very easy to add enum members to <code>MyEnum</code> and without taking...
How to evaluate two enum members with same value as not equal in C#?
c#|enums
1
60
3
72,770,998
72,770,998
0
true
2022-06-27T09:41:36.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to evaluate two enum members with same value as not equal in C#?<p>I have this enum instance</p> <pre><code>public enum MyEnum {A1 = 0, A2 = 0} </code></...
72,788,941
res.redirect is not a function - express.js<p>I am new to Express.js and am trying to create a URL shortener.</p> <p>When the user naviagtes to domain.com/r/ I query the DB for the param and get the actual URL.</p> <p>I use res.redirect to try to redirect to their stored URL but it fails with 'res.redirect is not a fun...
<p>datdabaseRes and res should be different variable name. Otherwise res has the respose object of database connection in the scope you are trying to use 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-j...
res.redirect is not a function - express.js
javascript|node.js|express
0
60
2
72,789,032
72,789,032
0
true
2022-06-28T15:06:59.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: res.redirect is not a function - express.js<p>I am new to Express.js and am trying to create a URL shortener.</p> <p>When the user naviagtes to domain.com/r/...
72,801,865
How do we list all SSH keys against an Azure subscription from Python SDK?<p>Not sure how do we create NewEnvironmentCredential from client_id, client_secret and tenant_id.</p> <p>I have done same thing for GO, but not able to do it in python:</p> <pre><code>func GetAzureKeyPairsAgainstRegion(ctx context.Context, resou...
<p>I was able to get keys in the following way:</p> <pre><code>def get_key_pairs(azure_account_details, resource_group): try: logger.debug(f&quot;getting azure key pairs for resource group : {resource_group}&quot;) # Authenticates as a service principal using a client secret credential = ClientSecretCred...
How do we list all SSH keys against an Azure subscription from Python SDK?
python|azure|azure-devops|ssh-keys
0
60
1
72,816,946
72,816,946
0
true
2022-06-29T13:00:57.557Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do we list all SSH keys against an Azure subscription from Python SDK?<p>Not sure how do we create NewEnvironmentCredential from client_id, client_secret...
72,810,879
Blacklisting fields from elasticsearch query<p>Hi friends am new on elasticsearch. I want to know if I can exclude certain fields from search from elastic search. To eloborate I want to ignore it from my search. It should not search that field when we specify but should be searchable on all the fields other then thats ...
<p>Try this</p> <pre><code>GET {YOUR_INDEX_NAME}/_search { &quot;query&quot;: { &quot;bool&quot;: { &quot;must&quot;: [ { &quot;simple_query_string&quot;: { &quot;query&quot;: &quot;Product ABC&quot; } } ], &quot;must_not&quot;: [ { ...
Blacklisting fields from elasticsearch query
elasticsearch|elasticsearch-7
0
60
2
72,818,867
72,818,867
0
true
2022-06-30T05:52:25.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Blacklisting fields from elasticsearch query<p>Hi friends am new on elasticsearch. I want to know if I can exclude certain fields from search from elastic se...
72,298,281
way to always call a function without repeating code inside a function with guard clauses<p>I have a function which looks like 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"><...
<p>Using <code>try/catch[optional]/finally</code> solved my problem.</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>try { (function myFunc(){ if (!condition1){ ...
way to always call a function without repeating code inside a function with guard clauses
javascript|guard-clause
0
60
1
72,819,958
72,819,958
0
true
2022-05-19T03:24:46.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: way to always call a function without repeating code inside a function with guard clauses<p>I have a function which looks like this:</p> <p><div class="snipp...
72,823,207
How to enable button when row is selected in MUI DataGrid?<p>How do I make my button state enabled when I click a checkbox in mui DataGrid? <a href="https://i.stack.imgur.com/rVeAw.png" rel="nofollow noreferrer">Sample Image</a> I want to enable the approve button once the user has clicked checkbox.</p> <pre><code>cons...
<p>The second way to use the <code>onSelectionModelChange</code> prop of the DataGrid you can find out an example here <a href="https://codesandbox.io/s/beautiful-grass-o3h30g" rel="nofollow noreferrer">link</a>:</p> <pre><code>import * as React from &quot;react&quot;; import { DataGrid } from &quot;@material-ui/data-g...
How to enable button when row is selected in MUI DataGrid?
reactjs|material-ui
0
60
2
72,825,841
72,825,841
0
true
2022-07-01T00:14:10.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enable button when row is selected in MUI DataGrid?<p>How do I make my button state enabled when I click a checkbox in mui DataGrid? <a href="https://...
72,827,721
ASP.NET Core API Docker: Failed to load resource: the server responded with a status of 404 (Not Found)<p>I cloned this <a href="https://github.com/Azure-Samples/dotnet-core-api" rel="nofollow noreferrer">git repo</a> and while it works locally, I receive a 404 error when I Dockerize the API:</p> <p><a href="https://i....
<p>open your app.js from wwwroot/app/scripts/app.js</p> <p>it is problem case sensitive in linux environment.</p> <p>and modify like this.</p> <pre><code> $routeProvider.when(&quot;/Home&quot;, { controller: &quot;todoListCtrl&quot;, templateUrl: &quot;/app/views/TodoList.html&quot;, }).otherwise({ redirectTo:...
ASP.NET Core API Docker: Failed to load resource: the server responded with a status of 404 (Not Found)
docker|api|asp.net-core
0
60
1
72,828,823
72,828,823
0
true
2022-07-01T10:12:53.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET Core API Docker: Failed to load resource: the server responded with a status of 404 (Not Found)<p>I cloned this <a href="https://github.com/Azure-Sam...
72,829,037
Embedding sqlite.c into Go code: ld complains about libdl while it should not<p>I'm absolutely new to CGo. I don't want to use mattn's go-sqlite package and would like to build my own minimal interface to SQLite.</p> <p>I'm trying to get compiled the simplest program on my linux machine with <code>go build</code>, and ...
<p>To embed some C code inside a Go file, you write the C statements as something called <em>preambles</em>. There are certain strict rules regarding the formatting:</p> <ul> <li><code>import &quot;C&quot;</code> is a standalone statement, and cannot be included in an <code>import ()</code> group</li> <li>The C include...
Embedding sqlite.c into Go code: ld complains about libdl while it should not
sqlite|go|cgo
1
60
1
72,830,944
72,830,944
0
true
2022-07-01T12:07:00.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Embedding sqlite.c into Go code: ld complains about libdl while it should not<p>I'm absolutely new to CGo. I don't want to use mattn's go-sqlite package and ...
72,830,830
Generate and Sign Certificate using .NET, verifiable with OpenSSL<p>Taking the code from <a href="https://stackoverflow.com/a/48210587/509369">this answer</a>, saving the <code>parentCert</code> and the <code>cert</code> to .crt files, and trying to verify the certificate with OpenSSL as follows:</p> <pre class="lang-b...
<p>The problem is you've created your files as DER, but that OpenSSL command only reads PEM.</p> <p>You can either convert them with something like <code>openssl x509 -in parentCert.cer -inform der -out parentCert.pem</code>, or just change your export code to something like</p> <pre><code>File.WriteAllText( Path.C...
Generate and Sign Certificate using .NET, verifiable with OpenSSL
c#|.net|cryptography|certificate|x509
0
60
1
72,831,559
72,831,559
0
true
2022-07-01T14:32:46.177Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate and Sign Certificate using .NET, verifiable with OpenSSL<p>Taking the code from <a href="https://stackoverflow.com/a/48210587/509369">this answer</a...
72,774,843
How to hide or NOT SHOW items in a Room Database based on a Boolean<p>I have a Todo Application and I want to hide (which basically means not showing)the tasks based on its completed status(strikeThrough over the text). However, the hideCompleted tasks implementation I followed isn't working but the sort and search is ...
<p>I was able to find a solution. It turns out there was no logic to actually change the boolean value of the todoCheckBox(was changed to completed), it was just adding a strikeThrough. So I followed a better method to Implement the strikeThrough and refactored some of the code. So here's my code.</p> <p>My Adapter</p>...
How to hide or NOT SHOW items in a Room Database based on a Boolean
android|kotlin|android-room|kotlin-stateflow
0
60
1
72,834,826
72,834,826
0
true
2022-06-27T15:43:25.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to hide or NOT SHOW items in a Room Database based on a Boolean<p>I have a Todo Application and I want to hide (which basically means not showing)the tas...
72,842,111
Unable to use primeng in second Angular module<p>I've just started a new Angualr project. I've been trying to use a shared module in Angular to import and then export primeng modules to both the app.module.ts as well as a consumer-site.module.ts. Primeng is working in the component declared in the app.module.ts but n...
<p>have a good time</p> <p>One thing I noticed was that you didn't include the ConsumerSite.module in the AppModule</p> <pre><code>You need to import the ConsumerSite Module itself into the AppModule </code></pre> <p>I hope I could help you</p>
Unable to use primeng in second Angular module
angular|primeng
-1
60
1
72,842,241
72,842,241
0
true
2022-07-02T20:05:03.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to use primeng in second Angular module<p>I've just started a new Angualr project. I've been trying to use a shared module in Angular to import and t...
72,844,785
ReactJS - Uncaught TypeError: Cannot set property default of #<Object> which has only a getter<p><a href="https://i.stack.imgur.com/D6IA2.png" rel="nofollow noreferrer">Image of Error</a></p> <p>Facing an error while coding using React.js. I have know idea about it. Hence i don't know how to ask this question. Besides,...
<p>Try to change the <code>className</code> of the <code>img</code> container to:</p> <pre><code>&lt;div className={classes['main-image']}&gt; </code></pre>
ReactJS - Uncaught TypeError: Cannot set property default of #<Object> which has only a getter
reactjs
-1
60
2
72,844,917
72,844,917
0
true
2022-07-03T07:53:56.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReactJS - Uncaught TypeError: Cannot set property default of #<Object> which has only a getter<p><a href="https://i.stack.imgur.com/D6IA2.png" rel="nofollow ...
72,846,011
Display List of Iterated Data into two Columns in ReactJS<p>I have an array contains 6 objects, Now I need to render first 3 objects in 1st Column and Next 3 Objects in 2nd Column, Here I am Iterating the array with Map and Displaying the Data. So How Can I break the Array into 2 Columns? As Of Now 6 objects are Displa...
<p>Solution is here :</p> <pre><code>const secondColumnStart = Math.ceil(dataservices.length / 2); &lt;div className='wholecontainer'&gt; &lt;div className='col1'&gt; {dataservices.slice(0, secondColumnStart).map((services, index) =&gt; { ...
Display List of Iterated Data into two Columns in ReactJS
css|reactjs|flexbox
0
60
1
72,847,481
72,847,481
0
true
2022-07-03T11:13:26.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display List of Iterated Data into two Columns in ReactJS<p>I have an array contains 6 objects, Now I need to render first 3 objects in 1st Column and Next 3...
72,852,383
Converting JSON into Seq<String> in Scala<p>I'm new in Scala and trying to achieve the following using Scala's foldLeft() method or any other functional solution:</p> <p>I have the following JSON:</p> <pre><code> { &quot;aspects&quot;: [ { &quot;name&quot;: &quot;Name&quot;, &quot;values&quot;: [ ...
<p>It depends on the JSON library you are using, but once you have the <code>aspects</code> data in a suitable format the output can be generated is like this:</p> <pre><code>case class Aspect(name: String, values: Seq[String]) val aspects: Seq[Aspect] = ??? aspects.flatMap(a =&gt; a.values.map(a.name + &quot;:::&quo...
Converting JSON into Seq<String> in Scala
scala
0
60
2
72,852,584
72,852,584
0
true
2022-07-04T06:09:04.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting JSON into Seq<String> in Scala<p>I'm new in Scala and trying to achieve the following using Scala's foldLeft() method or any other functional solu...
72,856,334
Symfony6 - add iput field after submitting form<p>i have an ChoiceType::class input field in my form with, now just as an example, two choices: 'choices' =&gt; ['type1' =&gt; '1', 'type2' =&gt; '2']</p> <p>now when the user select type2 i want to add an exta TextType::class inputfield to the form. But i dont want to sh...
<p>You were on the right way, you have to do it in Javascript. You just need to manage the attr required in Javascript so that the form does not block you with something like this:</p> <ul> <li>Remove the required attribute from a field: <code>document.getElementById(&quot;id&quot;).required = false;</code></li> <li>Ma...
Symfony6 - add iput field after submitting form
php|symfony|symfony-forms|symfony6
-1
60
2
72,856,450
72,856,450
0
true
2022-07-04T11:58:06.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Symfony6 - add iput field after submitting form<p>i have an ChoiceType::class input field in my form with, now just as an example, two choices: 'choices' =&g...
72,828,296
Change column order in SheetsJS<p>I generate an Excel file using <code>xlsx</code> (based on <code>SheetJS</code>). In my excel file, I need an specific order in the generated columns, as well as custom headers. I generate my excel with custom headers like this:</p> <pre class="lang-js prettyprint-override"><code> cons...
<p>Finally, I get it done. With the combination of the two ways, I can do it:</p> <pre class="lang-js prettyprint-override"><code> const sortedHeader = ['clientName', 'projectName', 'sourceLanguageName', 'targetLanguageName', 'numItemsTarget', 'numItemsWithoutImages', 'numWordsCreative', 'numWordsNonCreative']; ...
Change column order in SheetsJS
angular|excel|typescript|sheetjs
0
60
1
72,866,374
72,866,374
0
true
2022-07-01T11:04:59.953Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change column order in SheetsJS<p>I generate an Excel file using <code>xlsx</code> (based on <code>SheetJS</code>). In my excel file, I need an specific orde...
72,870,982
Plotting mean and standard deviation for every numeric value in data frame in R<p>I want to plot every numeric column with the mean as a bar and the standard deviation is a line through the bar. How can I do this for the <code>iris</code> dataset?</p> <p>I'm trying to transform my dataset to make it easy to plot in ggp...
<p>To achieve your desired result you could first simplify your code using <code>dplyr::across</code>. Afterwards you could convert to long via <code>pivot_longer</code> whereby using the <code>.value</code> allows to put the <code>mean</code>s and the <code>sd</code>s in their own columns. Finally you could make your ...
Plotting mean and standard deviation for every numeric value in data frame in R
r|ggplot2|dplyr
0
60
4
72,871,221
72,871,221
0
true
2022-07-05T14:18:26.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plotting mean and standard deviation for every numeric value in data frame in R<p>I want to plot every numeric column with the mean as a bar and the standard...
72,771,442
How can I supply different data based on the route?<p>I am working on a large Angular-based project with many (let's say, &gt; 200) lazy-loaded modules. Each module has the same UI, so each module can be represented by the same component. (The difference between modules is that they offer different dynamically instanti...
<p>It seems that the <a href="https://angular.io/api/router/Route#data" rel="nofollow noreferrer"><code>Route.data</code> attribute</a> is the right place to store this kind of data. This is where arbitrary route-specific data can be supplied.</p> <p>The component (even if it is the same component for many routes) can ...
How can I supply different data based on the route?
angular|routes|angular-components
0
60
2
72,872,625
72,872,625
0
true
2022-06-27T11:36:32.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I supply different data based on the route?<p>I am working on a large Angular-based project with many (let's say, &gt; 200) lazy-loaded modules. Each...
72,868,620
Unable to render a SVG graph from a dot when adding multi-edges using graphviz<p>Im trying to render my dot file using: grv.render('neato', 'svg', 'graph.dot').</p> <p>The dot file is at the bottom of the question.(quite large, 1500+ lines).</p> <p>Web apps like Magjac's <a href="http://magjac.com/graphviz-visual-edito...
<p>2.43.0 is rather old (several years). If you install a new version of Graphviz (4.0) it works fine. Unfortunately, &quot;installing a newer version&quot; can take some real work.</p>
Unable to render a SVG graph from a dot when adding multi-edges using graphviz
graphviz|dot
0
60
1
72,874,241
72,874,241
0
true
2022-07-05T11:24:58.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to render a SVG graph from a dot when adding multi-edges using graphviz<p>Im trying to render my dot file using: grv.render('neato', 'svg', 'graph.dot...
72,876,341
Create an async generator "from scratch"<p>Most of the time I am using asyncio API. But how would I create an async generator &quot;from scratch&quot;?</p> <p>Say I have a classic generator, and I want to make it async. How can I do that?</p> <p>I naively thought that I could do something like below, but it does not ru...
<p>I'm glad the fixing the call to <code>asyncio.sleep()</code> got things running.</p> <p>I'm concerned partly about your <code>run()</code> function, because you're only <code>await</code>-ing on the first task, which means your code could exit before the other tasks are complete. I would suggest this:</p> <pre><code...
Create an async generator "from scratch"
python-asyncio
1
60
1
72,876,783
72,876,783
0
true
2022-07-05T22:59:00.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create an async generator "from scratch"<p>Most of the time I am using asyncio API. But how would I create an async generator &quot;from scratch&quot;?</p> <...
72,876,809
Eureka service not reading its config file in Git repository using ConfigServer<p>I'm trying trying to write some basic microservices examples. Firstly, I'm using a ConfigServer application using Spring, with this resources/application.yaml file:</p> <pre><code>server: port: 8081 spring: cloud: config: se...
<p>Looks like your eureka-server is not picking up the bootstrapping config.</p> <p>First cause might be that this config file should be named <code>bootstrap.yml</code>, not <code>bootstrap.yaml</code>.</p> <p>Also, since Spring Boot 2.4 bootstrapping via <code>bootstrap.yml</code> is disabled by default and the usual...
Eureka service not reading its config file in Git repository using ConfigServer
java|spring|netflix-eureka|spring-cloud-config-server
0
60
1
72,880,771
72,880,771
0
true
2022-07-06T00:33:17.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Eureka service not reading its config file in Git repository using ConfigServer<p>I'm trying trying to write some basic microservices examples. Firstly, I'm ...
72,876,587
static shared_ptr not keeping value across function calls<p>I have an input.hpp (which I won't post for the sake of brevity) and an input.cpp file that looks like this (some things removed):</p> <pre><code>#include &quot;details/macros.hpp&quot; #if defined(PLATFORM_WINDOWS) #include &quot;details/win32/input.inl&q...
<p>I found out the answer to this problem. I mistakingly (don't code while tired people!) had a call to the Win32 API <code>GetKeyboardState</code> that was using the wrong static variable as the output buffer and caused static memory corruption.</p> <p>Thank you for everyone's help and I apologize for not giving much ...
static shared_ptr not keeping value across function calls
c++|exception|static|shared-ptr
-1
60
1
72,890,798
72,890,798
0
true
2022-07-05T23:50:13.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: static shared_ptr not keeping value across function calls<p>I have an input.hpp (which I won't post for the sake of brevity) and an input.cpp file that looks...
72,894,452
An error has occurred. Websocket error: undefined in Linkerd Dashboard<p>I have minikube running in AWS EC2 Instance, Meshed the application with linkerd, when i try to monitor the Live Calls throws <strong>An error has occurred. Websocket error: undefined</strong> in the linkerd dashboard.</p> <p>Note: I have exposed ...
<p>It looks like my ingress by default doesn't support websockets. Want to get that configured or just use port forwarding. used port forwarding it worked as expected</p> <p>Refer this <a href="https://github.com/linkerd/linkerd2/discussions/5264" rel="nofollow noreferrer">https://github.com/linkerd/linkerd2/discussion...
An error has occurred. Websocket error: undefined in Linkerd Dashboard
kubernetes|amazon-ec2|devops|linkerd
0
60
1
72,895,049
72,895,049
0
true
2022-07-07T08:17:03.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: An error has occurred. Websocket error: undefined in Linkerd Dashboard<p>I have minikube running in AWS EC2 Instance, Meshed the application with linkerd, wh...
72,898,219
Quarkus NPE Persistence.createEntityManagerFactory<p>Im trying to migrate my projects to Quarkus. Unfortunately I'm using libs which initialize EntityManagerFactory not via Injection. My Problem is that Persistence.createEntityManagerFactory results in a NPE. As i looked a little deeper into the implementation of modul...
<p>So unfortunately yes.</p> <p>The Hibernate ORM initialization in Quarkus is very carefully crafted to fully support our optimized bootstrap and also support compiling to a native executable.</p> <p>Note that you can access the CDI container statically if you cannot inject things via <code>@Inject</code>:</p> <pre cl...
Quarkus NPE Persistence.createEntityManagerFactory
quarkus|quarkus-jpa
0
60
1
72,898,585
72,898,585
0
true
2022-07-07T12:56:32.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Quarkus NPE Persistence.createEntityManagerFactory<p>Im trying to migrate my projects to Quarkus. Unfortunately I'm using libs which initialize EntityManager...
72,891,213
Tailwind CSS divs disappear without content. Advice no how make divs fit to screen better?<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code> function App() { return ( &lt;div&g...
<p>You can use <code>h-full</code>. This will allow you take the space that the content have. You can see below example for that.</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">...
Tailwind CSS divs disappear without content. Advice no how make divs fit to screen better?
html|css|tailwind-css
0
60
1
72,900,096
72,900,096
0
true
2022-07-07T00:52:02Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tailwind CSS divs disappear without content. Advice no how make divs fit to screen better?<p><div class="snippet" data-lang="js" data-hide="false" data-conso...
72,898,525
Loop error on <fieldset> tags - inserting closing tag before it should<p>As part of a web app I'm building in Google Apps Script, I'm trying to create a checkbox field that shows one checkbox for each learner/student, arranged in rows of 3. The learner data is being taken from a spreadsheet (this bit is working fine)....
<p>Thanks <a href="https://stackoverflow.com/users/3656739/thewized">TheWizEd</a> for the idea to dynamically name the fieldset tags - this is what lead to the solution. By dynamically creating the fieldset ID, I can use the inner loop to append the checkboxes BETWEEN the fieldset tags. Here's the code:</p> <p><div c...
Loop error on <fieldset> tags - inserting closing tag before it should
javascript|jquery|forms|google-apps-script
0
60
2
72,909,475
72,909,475
0
true
2022-07-07T13:16:25.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop error on <fieldset> tags - inserting closing tag before it should<p>As part of a web app I'm building in Google Apps Script, I'm trying to create a chec...
72,920,832
I cannot install requests module on my computer<p>I get this error when I run my python project(I'm using python 3.10.5 on Windows 10):</p> <pre><code>ModuleNotFoundError: No module named 'requests' </code></pre> <p>Despite the fact that I do infact have the <a href="https://i.stack.imgur.com/8ckj8.png" rel="nofollow n...
<p>In Command Prompt Type: py -3 -m pip install requests If it doesn't install, go to the given address and delete all the folders that say requests and upload again.</p>
I cannot install requests module on my computer
python|python-requests|discord|request|discord.py
0
60
1
72,920,847
72,920,847
0
true
2022-07-09T11:04:28.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I cannot install requests module on my computer<p>I get this error when I run my python project(I'm using python 3.10.5 on Windows 10):</p> <pre><code>Module...
72,866,696
Stack Overflow on Lua metatable<p>I used to have a construct that worked with luajit:</p> <pre class="lang-lua prettyprint-override"><code>mytbl = setmetatable({1}, {__index = function(tbl,idx) return tbl[idx - 1] + 1 end}) </code></pre> <p>Now with plain Lua 5.4 this gives me a stack overflow:</p> <pre><code>&gt; mytb...
<p>This is what I came up with now:</p> <pre><code>__index=function(tbl, idx) local max = 0 for k, v in next, tbl do if k &lt;= idx then max = v - k end end return idx + max end </code></pre> <p>I only have very few entries in <code>tbl</code> so this should be reasonable fast for my purposes.<...
Stack Overflow on Lua metatable
lua
4
60
2
72,921,702
72,921,702
0
true
2022-07-05T09:01:59.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stack Overflow on Lua metatable<p>I used to have a construct that worked with luajit:</p> <pre class="lang-lua prettyprint-override"><code>mytbl = setmetatab...
72,934,976
How to find radio group checked property<p>Here, I've three radio group in a single page. But in the entire page I want to select only one radio option. Like if I'm selecting Monday then Tuesday selection should be unchecked automatically. How can I proceed with the logic, below logic is not working as expected.</p> <p...
<p>If you're able to create radio buttons in SurveyJS, you should be able to give the button group a name, so there would be no need for any additional JavaScript. Check out <a href="https://surveyjs.io/Examples/Library/?id=questiontype-radiogroup&amp;platform=jQuery#content-js" rel="nofollow noreferrer">their document...
How to find radio group checked property
javascript|surveyjs
0
60
2
72,936,982
72,936,982
0
true
2022-07-11T07:20:13.793Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find radio group checked property<p>Here, I've three radio group in a single page. But in the entire page I want to select only one radio option. Like...
72,937,063
Changing the state of a context within an if-else in JavaScript<p>I tried making a global state by using a Context and have the following for my AuthProvider.js file</p> <pre><code>import { createContext, useState } from &quot;react&quot;; const AuthContext = createContext({}); export const AuthProvider = ({ children...
<p>You probably want to check the <a href="https://reactjs.org/docs/context.html" rel="nofollow noreferrer">context docs</a> again, and try to understand how and why you set them up, and how to access them. You tried accessing the context by passing the provider as a param to the useContext hook. This is wrong, you nee...
Changing the state of a context within an if-else in JavaScript
javascript|reactjs|boolean|react-context
-1
60
1
72,938,199
72,938,199
0
true
2022-07-11T10:23:10.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing the state of a context within an if-else in JavaScript<p>I tried making a global state by using a Context and have the following for my AuthProvider...
72,947,927
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: not able to locate the element inside table tag<p>I was trying to locate the element which is present inside the table tag But iam getting the error</p> <p>&quot;org.openqa.selenium.NoSuchElementException: no such element: Unable to ...
<p>We can see there is one frame before the element so first switch to frame and then Use below xpath for table value input</p> <pre><code>driver.switchTo().frame(&quot;iframeDefineSequence&quot;); WebElement prefix= driver.findElement(By.xpath(&quot;//input[@name='prefixtxt']&quot;)); </code></pre>
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: not able to locate the element inside table tag
java|html|selenium|selenium-webdriver
0
60
1
72,949,784
72,949,784
0
true
2022-07-12T06:31:20.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: not able to locate the element inside table tag<p>I was trying to loca...
72,901,581
Host identification in Docker container<p><strong>PROBLEM:</strong></p> <p>My application consists of one server and two clients which can be run on Windows, Linux, MAC operating systems. My goal is for the server to be able to determine if the clients are running on the same physical host or different ones. When clien...
<p><strong>SOLUTION:</strong></p> <p>I used the host boot time to identify the host. Windows, Linux and MAC provide ways to get this information. These methods return the boot time of the host when called from a container. This is not a completely accurate solution to my problem, since there is some possibility that th...
Host identification in Docker container
docker
2
60
1
72,954,175
72,954,175
0
true
2022-07-07T16:48:36.927Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Host identification in Docker container<p><strong>PROBLEM:</strong></p> <p>My application consists of one server and two clients which can be run on Windows,...
72,951,450
Where can I get the Session ID to send a request to Fielo API?<p>I am trying to get user transactions from the Fielo API. I have been following the <a href="https://docs.fielo.com/reference/membersmember_idtransactions-1" rel="nofollow noreferrer">documentation</a>, however, I see that they require <code>SESSION_ID</co...
<p>This seems to be &quot;normal&quot; Salesforce REST API, piece of custom Apex code exposed as a webservice.</p> <p>Just for getting familiar with it you could try connecting via <a href="https://workbench.developerforce.com/login.php" rel="nofollow noreferrer">https://workbench.developerforce.com/login.php</a>. Once...
Where can I get the Session ID to send a request to Fielo API?
salesforce
0
60
1
72,958,796
72,958,796
0
true
2022-07-12T11:18:02.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where can I get the Session ID to send a request to Fielo API?<p>I am trying to get user transactions from the Fielo API. I have been following the <a href="...
72,973,182
Conditional rendering with useEffect / useState, why is there a delay in the DOM when switching components?<p><strong>Intro / Context</strong></p> <p>I am trying to build an application using React that allows for image or video display based on a chosen menu item. I am currently using Advanced Custom Fields within Wor...
<p>You set your visual option right after you set your <code>appState</code>, this is why <code>appState.activeImage</code> in <code>changeVisualOption</code> is not updated because state updates in React is asynchronous. You can either use <code>useEffect</code> to update visual option when the <code>appState</code> ...
Conditional rendering with useEffect / useState, why is there a delay in the DOM when switching components?
reactjs|object|use-effect|use-state|conditional-rendering
0
60
1
72,973,677
72,973,677
0
true
2022-07-13T22:12:44.930Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditional rendering with useEffect / useState, why is there a delay in the DOM when switching components?<p><strong>Intro / Context</strong></p> <p>I am tr...
72,785,037
AWS braket python sdk: user is not authorized to perform on quantum device<p>I have installed boto3, aws cli, and python-braket-sdk. I have run <code>aws configure</code>, and config with my IAM user. My IAM user isn't root user, but it has <code>AdministratorAccess</code>, <code>AmazonBraketFullAccess</code>, <code>Am...
<p>I have found the answer. I have activated MFA authorization on my account, but in my <code>aws cli</code>, I don't setup it. So I need to setup my <code>aws cli</code> by a new account without MFA, or set up MFA for my <code>aws cli</code>. Thank you everyone for help</p>
AWS braket python sdk: user is not authorized to perform on quantum device
amazon-web-services|amazon-ami|quantum-computing|qiskit
-1
60
1
72,974,684
72,974,684
0
true
2022-06-28T10:44:08.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS braket python sdk: user is not authorized to perform on quantum device<p>I have installed boto3, aws cli, and python-braket-sdk. I have run <code>aws con...